(
ext: EChartsExtensionInstaller | EChartsExtension | (EChartsExtensionInstaller | EChartsExtension)[]
)
| 99 | } |
| 100 | |
| 101 | export function use( |
| 102 | ext: EChartsExtensionInstaller | EChartsExtension | (EChartsExtensionInstaller | EChartsExtension)[] |
| 103 | ) { |
| 104 | if (isArray(ext)) { |
| 105 | // use([ChartLine, ChartBar]); |
| 106 | each(ext, (singleExt) => { |
| 107 | use(singleExt); |
| 108 | }); |
| 109 | return; |
| 110 | } |
| 111 | |
| 112 | if (indexOf(extensions, ext) >= 0) { |
| 113 | return; |
| 114 | } |
| 115 | extensions.push(ext); |
| 116 | |
| 117 | if (isFunction(ext)) { |
| 118 | ext = { |
| 119 | install: ext |
| 120 | }; |
| 121 | } |
| 122 | ext.install(extensionRegisters); |
| 123 | } |
| 124 | |
| 125 | // A simpler use type for exporting to reduce exported inner modules. |
| 126 | export type EChartsExtensionInstallerSimple = (registers: any) => void; |
no test coverage detected