@visactor/vgrammar-core
Version:
VGrammar is a visual grammar library
56 lines (55 loc) • 4.09 kB
TypeScript
import type { IGraphic, IGraphicAttribute } from '@visactor/vrender-core';
import type { GlyphChannelEncoder, GlyphDefaultEncoder, IComponentConstructor, IElement, IGlyphElement, IGlyphMeta, IGrammarBaseConstructor, IGroupMark, IInteractionConstructor, ILayoutOptions, IMark, IMarkConstructor, IPlotMarkConstructor, ISemanticMark, IStageEventPlugin, ITransform, IView, MarkType, TypeAnimation } from '../types';
import type { ComponentOptions } from '@visactor/vrender-components';
export declare class Factory {
private static _plotMarks;
private static _marks;
private static _components;
private static _graphicComponents;
private static _transforms;
private static _grammars;
private static _glyphs;
private static _animations;
private static _interactions;
private static _graphics;
private static defaultLayout;
private static _stageEventPlugins;
static registerPlotMarks(key: string, mark: IPlotMarkConstructor): void;
static createPlotMark(type: string, id?: string): ISemanticMark<any, any> | null;
static registerMark(key: string, mark: IMarkConstructor): void;
static createMark(type: string, view: IView, group?: IGroupMark): IMark | null;
static hasMark(type: string): boolean;
static getMark(type: string): IMarkConstructor;
static registerComponent(key: string, component: IComponentConstructor): void;
static createComponent(componentType: string, view: IView, group?: IGroupMark, mode?: '2d' | '3d'): import("../types").IComponent;
static hasComponent(componentType: string): boolean;
static registerGraphicComponent(key: string, creator: (attrs: any, options?: ComponentOptions) => IGraphic): void;
static createGraphicComponent(componentType: string, attrs: any, options?: ComponentOptions): IGraphic<Partial<IGraphicAttribute>>;
static registerTransform(type: string, transform: Omit<ITransform, 'type'>, isBuiltIn?: boolean): void;
static getTransform(type: string): ITransform<any, any, any>;
static unregisterRuntimeTransforms(): void;
static registerGrammar(type: string, grammarClass: IGrammarBaseConstructor, specKey?: string): void;
static createGrammar(type: string, view: IView, grammarType: string): import("../types").IGrammarBase;
static getGrammars(): Record<string, {
grammarClass: IGrammarBaseConstructor<any>;
specKey: string;
}>;
static registerGlyph: <EncodeValuesType = any, GlyphConfigType = any>(glyphType: string, marks: {
[markName: string]: string;
}, encoders?: {
[markName: string]: GlyphChannelEncoder<any, EncodeValuesType, GlyphConfigType>;
}, defaultEncoder?: GlyphDefaultEncoder, progressiveChannels?: string | string[]) => IGlyphMeta<EncodeValuesType, GlyphConfigType>;
static getGlyph(glyphType: string): IGlyphMeta;
static registerAnimationType: (animationType: string, animation: TypeAnimation<IGlyphElement> | TypeAnimation<IElement>) => void;
static getAnimationType: (animationType: string) => TypeAnimation<IGlyphElement<any>> | TypeAnimation<IElement>;
static registerInteraction: (interactionType: string, interaction: IInteractionConstructor) => void;
static createInteraction(interactionType: string, view: IView, options?: any): import("../types").IInteraction<any>;
static hasInteraction(interactionType: string): boolean;
static registerGraphic: (graphicType: string, creator: (attributes: IGraphicAttribute) => IGraphic) => void;
static getGraphicType: (graphicType: string) => (attributes: IGraphicAttribute) => IGraphic;
static createGraphic: (graphicType: string, attributes?: IGraphicAttribute) => IGraphic<Partial<IGraphicAttribute>>;
static registerDefaultLayout: (layout: (marks: IMark[], options: ILayoutOptions, view: IView) => void) => void;
static getDefaultLayout: () => (marks: IMark[], options: ILayoutOptions, view: IView) => void;
static registerStageEventPlugin: (type: string, Plugin: IStageEventPlugin<any>) => void;
static getStageEventPlugin: (type: string) => IStageEventPlugin<any>;
}