@visactor/vrender-core
Version:
## Description
73 lines (72 loc) • 3.12 kB
TypeScript
import type { AABBBounds, IAABBBounds, IPointLike } from '@visactor/vutils';
import { Graphic } from './graphic';
import type { GraphicType, IGraphic, IGlyph, IGlyphGraphicAttribute, IGraphicAttribute, ISetAttributeContext } from '../interface';
export declare class Glyph extends Graphic<IGlyphGraphicAttribute> implements IGlyph {
type: GraphicType;
_onInit: (g: IGlyph) => void;
_onUpdate: (g: IGlyph) => void;
glyphStates?: Record<string, {
attributes: Partial<IGlyphGraphicAttribute>;
subAttributes: Partial<IGraphicAttribute>[];
}>;
glyphStateProxy?: (stateName: string, targetStates?: string[]) => {
attributes: Partial<IGlyphGraphicAttribute>;
subAttributes: Partial<IGraphicAttribute>[];
};
protected subGraphic: IGraphic[];
static NOWORK_ANIMATE_ATTR: {
strokeSeg: number;
boundsPadding: number;
pickMode: number;
boundsMode: number;
customPickShape: number;
pickable: number;
childrenPickable: number;
visible: number;
zIndex: number;
layout: number;
keepDirIn3d: number;
globalZIndex: number;
outerBorder: number;
innerBorder: number;
lineDash: number;
lineCap: number;
lineJoin: number;
miterLimit: number;
strokeBoundsBuffer: number;
scaleCenter: number;
anchor: number;
anchor3d: number;
postMatrix: number;
backgroundMode: number;
background: number;
texture: number;
cursor: number;
html: number;
};
constructor(params: Partial<IGlyphGraphicAttribute>);
setSubGraphic(subGraphic: IGraphic[]): void;
protected detachSubGraphic(): void;
getSubGraphic(): IGraphic<Partial<IGraphicAttribute>>[];
onInit(cb: (g: this) => void): void;
onUpdate(cb: (g: this) => void): void;
isValid(): boolean;
setAttribute(key: string, value: any, forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
setAttributes(params: Partial<IGlyphGraphicAttribute>, forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
translate(x: number, y: number): this;
translateTo(x: number, y: number): this;
scale(scaleX: number, scaleY: number, scaleCenter?: IPointLike): this;
scaleTo(scaleX: number, scaleY: number): this;
rotate(angle: number): this;
rotateTo(angle: number): this;
getGraphicTheme(): Required<IGlyphGraphicAttribute>;
protected updateAABBBounds(attribute: IGlyphGraphicAttribute, theme: Required<IGlyphGraphicAttribute>, aabbBounds: IAABBBounds): import("@visactor/vutils").IBounds;
protected doUpdateAABBBounds(): AABBBounds;
protected needUpdateTags(keys: string[]): boolean;
protected needUpdateTag(key: string): boolean;
useStates(states: string[], hasAnimation?: boolean): void;
clearStates(hasAnimation?: boolean): void;
clone(): IGraphic<Partial<IGlyphGraphicAttribute>>;
getNoWorkAnimateAttr(): Record<string, number>;
}
export declare function createGlyph(attributes: IGlyphGraphicAttribute): IGlyph;