1 | import { Node, NodeConfig } from './Node.js';
|
---|
2 | import { GetSet, IRect } from './types.js';
|
---|
3 | import { Shape } from './Shape.js';
|
---|
4 | import { HitCanvas, SceneCanvas } from './Canvas.js';
|
---|
5 | import { SceneContext } from './Context.js';
|
---|
6 | export type ClipFuncOutput = void | [Path2D | CanvasFillRule] | [Path2D, CanvasFillRule];
|
---|
7 | export interface ContainerConfig extends NodeConfig {
|
---|
8 | clearBeforeDraw?: boolean;
|
---|
9 | clipFunc?: (ctx: SceneContext) => ClipFuncOutput;
|
---|
10 | clipX?: number;
|
---|
11 | clipY?: number;
|
---|
12 | clipWidth?: number;
|
---|
13 | clipHeight?: number;
|
---|
14 | }
|
---|
15 | export declare abstract class Container<ChildType extends Node = Node> extends Node<ContainerConfig> {
|
---|
16 | children: Array<ChildType>;
|
---|
17 | getChildren(filterFunc?: (item: Node) => boolean): ChildType[];
|
---|
18 | hasChildren(): boolean;
|
---|
19 | removeChildren(): this;
|
---|
20 | destroyChildren(): this;
|
---|
21 | abstract _validateAdd(node: Node): void;
|
---|
22 | add(...children: ChildType[]): this;
|
---|
23 | destroy(): this;
|
---|
24 | find<ChildNode extends Node>(selector: any): Array<ChildNode>;
|
---|
25 | findOne<ChildNode extends Node = Node>(selector: string | Function): ChildNode | undefined;
|
---|
26 | _generalFind<ChildNode extends Node>(selector: string | Function, findOne: boolean): ChildNode[];
|
---|
27 | private _descendants;
|
---|
28 | toObject(): {
|
---|
29 | attrs: any;
|
---|
30 | className: string;
|
---|
31 | children?: any[] | undefined;
|
---|
32 | };
|
---|
33 | isAncestorOf(node: Node): boolean;
|
---|
34 | clone(obj?: any): this;
|
---|
35 | getAllIntersections(pos: any): Shape<import("./Shape.js").ShapeConfig>[];
|
---|
36 | _clearSelfAndDescendantCache(attr?: string): void;
|
---|
37 | _setChildrenIndices(): void;
|
---|
38 | drawScene(can?: SceneCanvas, top?: Node, bufferCanvas?: SceneCanvas): this;
|
---|
39 | drawHit(can?: HitCanvas, top?: Node): this;
|
---|
40 | _drawChildren(drawMethod: any, canvas: any, top: any, bufferCanvas?: any): void;
|
---|
41 | getClientRect(config?: {
|
---|
42 | skipTransform?: boolean;
|
---|
43 | skipShadow?: boolean;
|
---|
44 | skipStroke?: boolean;
|
---|
45 | relativeTo?: Container<Node>;
|
---|
46 | }): IRect;
|
---|
47 | clip: GetSet<IRect, this>;
|
---|
48 | clipX: GetSet<number, this>;
|
---|
49 | clipY: GetSet<number, this>;
|
---|
50 | clipWidth: GetSet<number, this>;
|
---|
51 | clipHeight: GetSet<number, this>;
|
---|
52 | clipFunc: GetSet<(ctx: CanvasRenderingContext2D, shape: Container) => ClipFuncOutput, this>;
|
---|
53 | }
|
---|