UNPKG

1.04 kBTypeScriptView Raw
1import { G2Spec } from '../spec';
2import { G2Library } from '../runtime';
3import { Runtime, RuntimeOptions } from './runtime';
4import { MarkOf, CompositionOf as Of } from './types';
5import { MarkNode } from './mark';
6import { CompositionNode } from './composition';
7type BuiltinComposition = {
8 'composition.mark': any;
9 'composition.view': any;
10};
11export type CompositionOf<Library> = Of<Library, (composite?: any) => CompositionAPI<Library>>;
12export type CompositionAPI<Library> = CompositionNode<CompositionOf<Library> & MarkOf<Library, (composite?: any) => MarkNode>> & MarkOf<Library, (composite?: any) => MarkNode> & CompositionOf<Library>;
13export type API<Spec, Library> = Runtime<Spec> & MarkOf<Library, (composite?: any) => MarkNode> & CompositionOf<Library & BuiltinComposition>;
14export declare function extend<Spec extends G2Spec = G2Spec, Library extends G2Library = G2Library>(Runtime: new (options: RuntimeOptions) => Runtime<Spec>, library: Library): new (options?: RuntimeOptions) => API<Spec, Library>;
15export {};