@visactor/vrender-core
Version:
```typescript import { xxx } from '@visactor/vrender-core'; ```
8 lines (7 loc) • 615 B
TypeScript
import type { IGraphic, IGraphicAttribute } from '../interface/graphic';
import type { IGraphicConstructor, IGraphicFactory } from './types';
export declare class GraphicFactory implements IGraphicFactory {
private readonly registry;
create<TGraphic extends IGraphic = IGraphic, TAttributes extends Partial<IGraphicAttribute> = Partial<IGraphicAttribute>>(type: string, attributes: TAttributes): TGraphic;
register<TGraphic extends IGraphic = IGraphic, TAttributes extends Partial<IGraphicAttribute> = Partial<IGraphicAttribute>>(type: string, ctor: IGraphicConstructor<TGraphic, TAttributes>): void;
}