modern-canvas 0.3.3 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3970 -4472
- package/dist/index.d.cts +382 -429
- package/dist/index.d.mts +382 -429
- package/dist/index.d.ts +382 -429
- package/dist/index.js +46 -37
- package/dist/index.mjs +3968 -4475
- package/package.json +11 -11
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Font } from 'modern-font';
|
|
2
2
|
import { AnimationItem } from 'lottie-web';
|
|
3
3
|
import { AnyColor, Colord } from 'colord';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { TextOptions, Text, MeasureResult } from 'modern-text';
|
|
4
|
+
import { Path2D, LineCap, LineJoin, LineStyle } from 'modern-path2d';
|
|
5
|
+
import { TextStyleDeclaration, ElementStyleDeclaration, ImageRect } from 'modern-idoc';
|
|
7
6
|
import { Node as Node$1, Direction } from 'yoga-layout/load';
|
|
7
|
+
import { TextOptions, Text, MeasureResult } from 'modern-text';
|
|
8
8
|
|
|
9
9
|
declare abstract class Loader {
|
|
10
10
|
abstract install(assets: Assets): this;
|
|
@@ -57,7 +57,69 @@ declare class Ticker {
|
|
|
57
57
|
protected static _performUpdate(): void;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
type Cursor = 'auto' | 'default' | 'none' | 'context-menu' | 'help' | 'pointer' | 'progress' | 'wait' | 'cell' | 'crosshair' | 'text' | 'vertical-text' | 'alias' | 'copy' | 'move' | 'no-drop' | 'not-allowed' | 'e-resize' | 'n-resize' | 'ne-resize' | 'nw-resize' | 's-resize' | 'se-resize' | 'sw-resize' | 'w-resize' | 'ns-resize' | 'ew-resize' | 'nesw-resize' | 'col-resize' | 'nwse-resize' | 'row-resize' | 'all-scroll' | 'zoom-in' | 'zoom-out' | 'grab' | 'grabbing';
|
|
60
|
+
type Cursor = 'auto' | 'default' | 'none' | 'context-menu' | 'help' | 'pointer' | 'progress' | 'wait' | 'cell' | 'crosshair' | 'text' | 'vertical-text' | 'alias' | 'copy' | 'move' | 'no-drop' | 'not-allowed' | 'e-resize' | 'n-resize' | 'ne-resize' | 'nw-resize' | 's-resize' | 'se-resize' | 'sw-resize' | 'w-resize' | 'ns-resize' | 'ew-resize' | 'nesw-resize' | 'col-resize' | 'nwse-resize' | 'row-resize' | 'all-scroll' | 'zoom-in' | 'zoom-out' | 'grab' | 'grabbing' | string;
|
|
61
|
+
|
|
62
|
+
type EventListenerValue = (...args: any[]) => void;
|
|
63
|
+
type EventListenerOptions = boolean | AddEventListenerOptions;
|
|
64
|
+
interface EventListener {
|
|
65
|
+
value: EventListenerValue;
|
|
66
|
+
options?: EventListenerOptions;
|
|
67
|
+
}
|
|
68
|
+
declare class EventEmitter {
|
|
69
|
+
eventListeners: Map<string, EventListener | EventListener[]>;
|
|
70
|
+
removeAllListeners(): this;
|
|
71
|
+
hasEventListener(event: string): boolean;
|
|
72
|
+
on(type: string, listener: EventListenerValue, options?: EventListenerOptions): any;
|
|
73
|
+
once(type: string, listener: EventListenerValue): this;
|
|
74
|
+
off(type: string, listener?: EventListenerValue, options?: EventListenerOptions): this;
|
|
75
|
+
emit(type: string, ...args: any[]): boolean;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
interface CoreObjectEventMap {
|
|
79
|
+
updateProperty: (key: PropertyKey, newValue: any, oldValue: any, declaration?: PropertyDeclaration) => void;
|
|
80
|
+
}
|
|
81
|
+
interface CoreObject {
|
|
82
|
+
on: (<K extends keyof CoreObjectEventMap>(type: K, listener: CoreObjectEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
83
|
+
once: (<K extends keyof CoreObjectEventMap>(type: K, listener: CoreObjectEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
84
|
+
off: (<K extends keyof CoreObjectEventMap>(type: K, listener?: CoreObjectEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
85
|
+
emit: (<K extends keyof CoreObjectEventMap>(type: K, ...args: Parameters<CoreObjectEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
|
|
86
|
+
}
|
|
87
|
+
declare class CoreObject extends EventEmitter {
|
|
88
|
+
readonly instanceId: number;
|
|
89
|
+
protected _defaultProperties?: Record<PropertyKey, any>;
|
|
90
|
+
protected _updatedProperties: Map<PropertyKey, any>;
|
|
91
|
+
protected _changedProperties: Set<PropertyKey>;
|
|
92
|
+
protected _updatingPromise: Promise<void>;
|
|
93
|
+
protected _updating: boolean;
|
|
94
|
+
is(target: CoreObject | undefined | null): boolean;
|
|
95
|
+
protected _enqueueUpdate(): Promise<void>;
|
|
96
|
+
update(): void;
|
|
97
|
+
protected _update(changed: Map<PropertyKey, any>): void;
|
|
98
|
+
protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
99
|
+
isDirty(key: string): boolean;
|
|
100
|
+
getPropertyDeclarations(): Map<PropertyKey, PropertyDeclaration>;
|
|
101
|
+
getPropertyDeclaration(key: PropertyKey): PropertyDeclaration | undefined;
|
|
102
|
+
getDefaultProperties(): Record<PropertyKey, any>;
|
|
103
|
+
getProperty(key: PropertyKey): any | undefined;
|
|
104
|
+
setProperty(key: PropertyKey, value: any): this;
|
|
105
|
+
getProperties(keys?: PropertyKey[]): Record<PropertyKey, any>;
|
|
106
|
+
setProperties(properties?: Record<PropertyKey, any>): this;
|
|
107
|
+
requestUpdate(key?: PropertyKey, oldValue?: unknown, declaration?: PropertyDeclaration): void;
|
|
108
|
+
toJSON(): Record<string, any>;
|
|
109
|
+
clone(): this;
|
|
110
|
+
free(): void;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
interface RefCountedEventMap extends CoreObjectEventMap {
|
|
114
|
+
}
|
|
115
|
+
interface RefCounted {
|
|
116
|
+
on: (<K extends keyof RefCountedEventMap>(type: K, listener: RefCountedEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
117
|
+
once: (<K extends keyof RefCountedEventMap>(type: K, listener: RefCountedEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
118
|
+
off: (<K extends keyof RefCountedEventMap>(type: K, listener?: RefCountedEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
119
|
+
emit: (<K extends keyof RefCountedEventMap>(type: K, ...args: Parameters<RefCountedEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
|
|
120
|
+
}
|
|
121
|
+
declare class RefCounted extends CoreObject {
|
|
122
|
+
}
|
|
61
123
|
|
|
62
124
|
declare class InputEvent<N extends UIEvent = UIEvent> implements UIEvent {
|
|
63
125
|
bubbles: boolean;
|
|
@@ -150,68 +212,6 @@ declare class MouseInputEvent extends InputEvent implements MouseEvent {
|
|
|
150
212
|
initMouseEvent(..._args: any[]): void;
|
|
151
213
|
}
|
|
152
214
|
|
|
153
|
-
type EventListenerValue = (...args: any[]) => void;
|
|
154
|
-
type EventListenerOptions = boolean | AddEventListenerOptions;
|
|
155
|
-
interface EventListener {
|
|
156
|
-
value: EventListenerValue;
|
|
157
|
-
options?: EventListenerOptions;
|
|
158
|
-
}
|
|
159
|
-
declare class EventEmitter {
|
|
160
|
-
eventListeners: Map<string, EventListener | EventListener[]>;
|
|
161
|
-
removeAllListeners(): this;
|
|
162
|
-
hasEventListener(event: string): boolean;
|
|
163
|
-
on(type: string, listener: EventListenerValue, options?: EventListenerOptions): any;
|
|
164
|
-
once(type: string, listener: EventListenerValue): this;
|
|
165
|
-
off(type: string, listener?: EventListenerValue, options?: EventListenerOptions): this;
|
|
166
|
-
emit(type: string, ...args: any[]): boolean;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
interface CoreObjectEventMap {
|
|
170
|
-
updateProperty: (key: PropertyKey, newValue: any, oldValue: any, declaration?: PropertyDeclaration) => void;
|
|
171
|
-
}
|
|
172
|
-
interface CoreObject {
|
|
173
|
-
on: (<K extends keyof CoreObjectEventMap>(type: K, listener: CoreObjectEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
174
|
-
once: (<K extends keyof CoreObjectEventMap>(type: K, listener: CoreObjectEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
175
|
-
off: (<K extends keyof CoreObjectEventMap>(type: K, listener?: CoreObjectEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
176
|
-
emit: (<K extends keyof CoreObjectEventMap>(type: K, ...args: Parameters<CoreObjectEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
|
|
177
|
-
}
|
|
178
|
-
declare class CoreObject extends EventEmitter {
|
|
179
|
-
readonly instanceId: number;
|
|
180
|
-
protected _defaultProperties?: Record<PropertyKey, any>;
|
|
181
|
-
protected _updatedProperties: Map<PropertyKey, any>;
|
|
182
|
-
protected _changedProperties: Set<PropertyKey>;
|
|
183
|
-
protected _updatingPromise: Promise<void>;
|
|
184
|
-
protected _updating: boolean;
|
|
185
|
-
is(target: CoreObject | undefined | null): boolean;
|
|
186
|
-
protected _enqueueUpdate(): Promise<void>;
|
|
187
|
-
protected _performUpdate(): void;
|
|
188
|
-
protected _update(changed: Map<PropertyKey, any>): void;
|
|
189
|
-
protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
190
|
-
isDirty(key: string): boolean;
|
|
191
|
-
getPropertyDeclarations(): Map<PropertyKey, PropertyDeclaration>;
|
|
192
|
-
getPropertyDeclaration(key: PropertyKey): PropertyDeclaration | undefined;
|
|
193
|
-
getDefaultProperties(): Record<PropertyKey, any>;
|
|
194
|
-
getProperty(key: PropertyKey): any | undefined;
|
|
195
|
-
setProperty(key: PropertyKey, value: any): this;
|
|
196
|
-
getProperties(keys?: PropertyKey[]): Record<PropertyKey, any>;
|
|
197
|
-
setProperties(properties?: Record<PropertyKey, any>): this;
|
|
198
|
-
requestUpdate(key?: PropertyKey, oldValue?: unknown, declaration?: PropertyDeclaration): void;
|
|
199
|
-
toJSON(): Record<string, any>;
|
|
200
|
-
clone(): this;
|
|
201
|
-
destroy(): void;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
interface RefCountedEventMap extends CoreObjectEventMap {
|
|
205
|
-
}
|
|
206
|
-
interface RefCounted {
|
|
207
|
-
on: (<K extends keyof RefCountedEventMap>(type: K, listener: RefCountedEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
208
|
-
once: (<K extends keyof RefCountedEventMap>(type: K, listener: RefCountedEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
209
|
-
off: (<K extends keyof RefCountedEventMap>(type: K, listener?: RefCountedEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
210
|
-
emit: (<K extends keyof RefCountedEventMap>(type: K, ...args: Parameters<RefCountedEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
|
|
211
|
-
}
|
|
212
|
-
declare class RefCounted extends CoreObject {
|
|
213
|
-
}
|
|
214
|
-
|
|
215
215
|
declare class PointerInputEvent extends MouseInputEvent implements PointerEvent {
|
|
216
216
|
altitudeAngle: number;
|
|
217
217
|
azimuthAngle: number;
|
|
@@ -277,11 +277,7 @@ declare class Input extends EventEmitter {
|
|
|
277
277
|
protected cloneWheelEvent(nativeEvent: WheelEvent): WheelInputEvent;
|
|
278
278
|
protected clonePointerEvent(nativeEvent: PointerEvent): PointerInputEvent;
|
|
279
279
|
protected copyMouseEvent(event: MouseInputEvent, nativeEvent: MouseEvent): void;
|
|
280
|
-
|
|
281
|
-
* Sets the current cursor mode, handling any callbacks or CSS style changes.
|
|
282
|
-
* @param mode - cursor mode, a key from the cursorStyles dictionary
|
|
283
|
-
*/
|
|
284
|
-
setCursor(mode: string): void;
|
|
280
|
+
setCursor(mode?: Cursor): void;
|
|
285
281
|
mapPositionToPoint(point: {
|
|
286
282
|
x: number;
|
|
287
283
|
y: number;
|
|
@@ -347,8 +343,8 @@ declare abstract class Vector extends EventEmitter {
|
|
|
347
343
|
rotate<T extends VectorOperateOutput>(angle: number, output: T): T;
|
|
348
344
|
set(value: VectorLike, ...args: number[]): this;
|
|
349
345
|
equals(value: VectorLike): boolean;
|
|
346
|
+
copy(value: VectorLike): this;
|
|
350
347
|
clone(): this;
|
|
351
|
-
protected _emitUpdate(array: number[]): void;
|
|
352
348
|
protected _onUpdate(_array: number[]): void;
|
|
353
349
|
toArray(): number[];
|
|
354
350
|
toName(): string;
|
|
@@ -364,14 +360,12 @@ declare abstract class Matrix extends EventEmitter {
|
|
|
364
360
|
constructor(rows: number, cols: number, array?: number[]);
|
|
365
361
|
protected _operate(operator: string, target: MatrixLike | Vector, output?: MatrixOperateOutput): any;
|
|
366
362
|
identity(): this;
|
|
367
|
-
clone(): this;
|
|
368
363
|
set(value: MatrixLike): this;
|
|
364
|
+
copy(value: MatrixLike): this;
|
|
365
|
+
clone(): this;
|
|
369
366
|
multiply<T extends Vector>(value: T): T;
|
|
370
367
|
multiply(value: MatrixLike): this;
|
|
371
368
|
multiply<T extends MatrixOperateOutput>(value: MatrixLike, output: T): T;
|
|
372
|
-
onUpdate(callback: (array: number[]) => void): this;
|
|
373
|
-
offUpdate(callback: (array: number[]) => void): this;
|
|
374
|
-
protected _emitUpdate(array: number[]): void;
|
|
375
369
|
protected _onUpdate(_array: number[]): void;
|
|
376
370
|
toArray(transpose?: boolean): number[];
|
|
377
371
|
toName(): string;
|
|
@@ -466,6 +460,10 @@ declare class Vector2 extends Vector {
|
|
|
466
460
|
set width(val: number);
|
|
467
461
|
get height(): number;
|
|
468
462
|
set height(val: number);
|
|
463
|
+
get left(): number;
|
|
464
|
+
set left(val: number);
|
|
465
|
+
get top(): number;
|
|
466
|
+
set top(val: number);
|
|
469
467
|
constructor(x?: VectorLike, y?: number);
|
|
470
468
|
update(x: number, y: number): this;
|
|
471
469
|
getLength(): number;
|
|
@@ -600,6 +598,7 @@ declare class MainLoop extends CoreObject {
|
|
|
600
598
|
start(process: (delta: number) => void): this;
|
|
601
599
|
stop(): this;
|
|
602
600
|
protected _onNextTick(): void;
|
|
601
|
+
free(): void;
|
|
603
602
|
}
|
|
604
603
|
|
|
605
604
|
interface CssFunctionArg {
|
|
@@ -862,7 +861,7 @@ declare class WebGLRenderer extends Renderer {
|
|
|
862
861
|
draw(options?: WebGLDrawOptions): void;
|
|
863
862
|
reset(): void;
|
|
864
863
|
flush(): void;
|
|
865
|
-
|
|
864
|
+
free(): void;
|
|
866
865
|
toPixels(): Uint8ClampedArray;
|
|
867
866
|
}
|
|
868
867
|
|
|
@@ -898,7 +897,7 @@ declare abstract class WebGLModule {
|
|
|
898
897
|
onUpdateContext(): void;
|
|
899
898
|
flush(): void;
|
|
900
899
|
reset(): void;
|
|
901
|
-
|
|
900
|
+
free(): void;
|
|
902
901
|
}
|
|
903
902
|
|
|
904
903
|
interface WebGLState {
|
|
@@ -954,6 +953,7 @@ interface Batchable2D {
|
|
|
954
953
|
colorMatrix?: ArrayLike<number>;
|
|
955
954
|
colorMatrixOffset?: ArrayLike<number>;
|
|
956
955
|
blendMode?: WebGLBlendMode;
|
|
956
|
+
disableWrapMode?: boolean;
|
|
957
957
|
}
|
|
958
958
|
interface Shader {
|
|
959
959
|
update: (attributeBuffer: ArrayBuffer, indexBuffer: Uint16Array) => void;
|
|
@@ -963,7 +963,6 @@ declare class WebGLBatch2DModule extends WebGLModule {
|
|
|
963
963
|
install(renderer: WebGLRenderer): void;
|
|
964
964
|
protected _state: WebGLState;
|
|
965
965
|
protected _batchSize: number;
|
|
966
|
-
protected _vertexSize: number;
|
|
967
966
|
protected _drawCallUid: number;
|
|
968
967
|
protected _defaultModulate: number;
|
|
969
968
|
protected _defaultBackgroundColor: number;
|
|
@@ -976,6 +975,7 @@ declare class WebGLBatch2DModule extends WebGLModule {
|
|
|
976
975
|
protected _indexBuffers: Uint16Array[];
|
|
977
976
|
protected _shaders: Map<number, Shader>;
|
|
978
977
|
protected _attributes: Record<string, Partial<WebGLVertexAttrib>>;
|
|
978
|
+
protected _vertexSize: number;
|
|
979
979
|
protected _getShader(maxTextureUnits: number): Shader;
|
|
980
980
|
protected _createShader(maxTextureUnits: number): Shader;
|
|
981
981
|
render(batchable: Batchable2D): void;
|
|
@@ -1086,7 +1086,7 @@ declare class WebGLProgramModule extends WebGLModule {
|
|
|
1086
1086
|
updateUniforms(program: WebGLProgram, uniforms: Record<string, any>): void;
|
|
1087
1087
|
updateUniforms(uniforms: Record<string, any>): void;
|
|
1088
1088
|
reset(): void;
|
|
1089
|
-
|
|
1089
|
+
free(): void;
|
|
1090
1090
|
}
|
|
1091
1091
|
|
|
1092
1092
|
declare class WebGLScissorModule extends WebGLModule {
|
|
@@ -1286,7 +1286,6 @@ declare class UvGeometry extends Geometry {
|
|
|
1286
1286
|
positionBuffer: VertexBuffer;
|
|
1287
1287
|
uvBuffer: VertexBuffer;
|
|
1288
1288
|
constructor();
|
|
1289
|
-
update(vertices: Float32Array, uvs: Float32Array, indices: Uint16Array): this;
|
|
1290
1289
|
}
|
|
1291
1290
|
|
|
1292
1291
|
type Texture2DFilterMode = WebGLTextureFilterMode;
|
|
@@ -1327,7 +1326,7 @@ declare class Texture2D<T extends Texture2DSource = Texture2DSource> extends Res
|
|
|
1327
1326
|
upload(renderer: WebGLRenderer, options?: Partial<WebGLTextureOptions>): boolean;
|
|
1328
1327
|
activate(renderer: WebGLRenderer, location?: number): boolean;
|
|
1329
1328
|
inactivate(renderer: WebGLRenderer): void;
|
|
1330
|
-
|
|
1329
|
+
free(): void;
|
|
1331
1330
|
}
|
|
1332
1331
|
|
|
1333
1332
|
interface ImageFrame {
|
|
@@ -1339,7 +1338,7 @@ declare class AnimatedTexture extends Resource {
|
|
|
1339
1338
|
duration: number;
|
|
1340
1339
|
constructor(source: Texture2D | ImageFrame[]);
|
|
1341
1340
|
updateDuration(): this;
|
|
1342
|
-
|
|
1341
|
+
free(): void;
|
|
1343
1342
|
}
|
|
1344
1343
|
|
|
1345
1344
|
declare class CanvasTexture extends Texture2D<HTMLCanvasElement> {
|
|
@@ -1419,80 +1418,25 @@ declare class VideoTexture extends Texture2D<HTMLVideoElement> {
|
|
|
1419
1418
|
protected _videoFrameRequestCallback: () => void;
|
|
1420
1419
|
requestUpload: () => void;
|
|
1421
1420
|
load(): Promise<this>;
|
|
1422
|
-
|
|
1421
|
+
free(): void;
|
|
1423
1422
|
}
|
|
1424
1423
|
|
|
1425
1424
|
declare class ViewportTexture extends PixelsTexture {
|
|
1426
1425
|
}
|
|
1427
1426
|
|
|
1428
|
-
type CanvasItemStyleFilterKey = 'hue-rotate' | 'saturate' | 'brightness' | 'contrast' | 'invert' | 'sepia' | 'opacity' | 'grayscale';
|
|
1429
|
-
type CanvasItemStyleFilter = Record<CanvasItemStyleFilterKey, number>;
|
|
1430
|
-
interface CanvasItemStyleProperties extends IDOCTextStyleDeclaration, IDOCTransformStyleDeclaration {
|
|
1431
|
-
direction: 'inherit' | 'ltr' | 'rtl';
|
|
1432
|
-
backgroundColor?: 'none' | ColorValue;
|
|
1433
|
-
backgroundImage?: string;
|
|
1434
|
-
filter: string;
|
|
1435
|
-
boxShadow: 'none' | string;
|
|
1436
|
-
maskImage: 'none' | string;
|
|
1437
|
-
opacity: number;
|
|
1438
|
-
borderWidth: number;
|
|
1439
|
-
borderRadius: number;
|
|
1440
|
-
borderColor: 'none' | ColorValue;
|
|
1441
|
-
borderStyle: string;
|
|
1442
|
-
outlineWidth: number;
|
|
1443
|
-
outlineOffset: number;
|
|
1444
|
-
outlineColor: 'none' | ColorValue;
|
|
1445
|
-
outlineStyle: string;
|
|
1446
|
-
visibility: Visibility;
|
|
1447
|
-
overflow: Overflow;
|
|
1448
|
-
pointerEvents: PointerEvents$1;
|
|
1449
|
-
}
|
|
1450
|
-
type PointerEvents$1 = 'auto' | 'none';
|
|
1451
|
-
interface CanvasItemStyle extends CanvasItemStyleProperties {
|
|
1452
|
-
}
|
|
1453
|
-
declare class CanvasItemStyle extends Resource {
|
|
1454
|
-
backgroundColor: 'none' | ColorValue;
|
|
1455
|
-
backgroundImage: 'none' | string;
|
|
1456
|
-
filter: 'none' | string;
|
|
1457
|
-
direction: 'inherit' | 'ltr' | 'rtl';
|
|
1458
|
-
boxShadow: 'none' | string;
|
|
1459
|
-
maskImage: 'none' | string;
|
|
1460
|
-
opacity: number;
|
|
1461
|
-
borderWidth: number;
|
|
1462
|
-
borderRadius: number;
|
|
1463
|
-
borderColor: 'none' | ColorValue;
|
|
1464
|
-
borderStyle: 'none' | string;
|
|
1465
|
-
outlineWidth: number;
|
|
1466
|
-
outlineOffset: number;
|
|
1467
|
-
outlineColor: 'none' | ColorValue;
|
|
1468
|
-
outlineStyle: 'none' | string;
|
|
1469
|
-
visibility: Visibility;
|
|
1470
|
-
overflow: Overflow;
|
|
1471
|
-
pointerEvents: PointerEvents$1;
|
|
1472
|
-
protected _backgroundColor: Color;
|
|
1473
|
-
constructor(properties?: Partial<CanvasItemStyleProperties>);
|
|
1474
|
-
protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
1475
|
-
canPointeEvents(): boolean;
|
|
1476
|
-
getComputedOpacity(): number;
|
|
1477
|
-
getComputedBackgroundColor(): Color;
|
|
1478
|
-
loadBackgroundImage(): Promise<Texture2D<ImageBitmap> | undefined>;
|
|
1479
|
-
getComputedTransform(): Transform2D;
|
|
1480
|
-
getComputedTransformOrigin(): number[];
|
|
1481
|
-
getComputedFilter(): CanvasItemStyleFilter;
|
|
1482
|
-
getComputedFilterColorMatrix(): ColorMatrix;
|
|
1483
|
-
}
|
|
1484
|
-
|
|
1485
1427
|
interface CanvasBatchable extends Batchable2D {
|
|
1486
1428
|
type: 'stroke' | 'fill';
|
|
1487
1429
|
texture?: Texture2D;
|
|
1488
1430
|
}
|
|
1489
|
-
interface
|
|
1431
|
+
interface StrokeDraw {
|
|
1432
|
+
type: 'stroke';
|
|
1490
1433
|
path: Path2D;
|
|
1491
1434
|
texture?: Texture2D;
|
|
1492
1435
|
textureTransform?: Transform2D;
|
|
1493
1436
|
style: LineStyle;
|
|
1494
1437
|
}
|
|
1495
|
-
interface
|
|
1438
|
+
interface FillDraw {
|
|
1439
|
+
type: 'fill';
|
|
1496
1440
|
path: Path2D;
|
|
1497
1441
|
texture?: Texture2D;
|
|
1498
1442
|
textureTransform?: Transform2D;
|
|
@@ -1506,8 +1450,7 @@ declare class CanvasContext extends Path2D {
|
|
|
1506
1450
|
lineWidth?: number;
|
|
1507
1451
|
miterLimit?: number;
|
|
1508
1452
|
_defaultStyle: Texture2D<Texture2DSource>;
|
|
1509
|
-
|
|
1510
|
-
_fills: FilledGraphics[];
|
|
1453
|
+
_draws: (StrokeDraw | FillDraw)[];
|
|
1511
1454
|
stroke(): void;
|
|
1512
1455
|
fillRect(x: number, y: number, width: number, height: number): void;
|
|
1513
1456
|
strokeRect(x: number, y: number, width: number, height: number): void;
|
|
@@ -1628,6 +1571,7 @@ interface SceneTree {
|
|
|
1628
1571
|
declare class SceneTree extends MainLoop {
|
|
1629
1572
|
paused: boolean;
|
|
1630
1573
|
backgroundColor?: ColorValue;
|
|
1574
|
+
readonly input: Input;
|
|
1631
1575
|
readonly renderStack: RenderStack;
|
|
1632
1576
|
readonly root: Viewport;
|
|
1633
1577
|
readonly timeline: Timeline;
|
|
@@ -1639,6 +1583,7 @@ declare class SceneTree extends MainLoop {
|
|
|
1639
1583
|
protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
1640
1584
|
protected _render(renderer: WebGLRenderer, delta?: number): this;
|
|
1641
1585
|
protected _renderScreen(renderer: WebGLRenderer): void;
|
|
1586
|
+
free(): void;
|
|
1642
1587
|
}
|
|
1643
1588
|
|
|
1644
1589
|
interface NodeEventMap extends CoreObjectEventMap, InputEventMap {
|
|
@@ -1684,7 +1629,7 @@ declare class Node extends CoreObject {
|
|
|
1684
1629
|
renderMode: RenderMode;
|
|
1685
1630
|
internalMode: InternalMode;
|
|
1686
1631
|
protected _readyed: boolean;
|
|
1687
|
-
constructor(properties?: Partial<NodeProperties>,
|
|
1632
|
+
constructor(properties?: Partial<NodeProperties>, nodes?: Node[]);
|
|
1688
1633
|
/** Name */
|
|
1689
1634
|
getName(): string;
|
|
1690
1635
|
setName(value: string): this;
|
|
@@ -1754,6 +1699,7 @@ declare class Node extends CoreObject {
|
|
|
1754
1699
|
protected _process(delta: number): void;
|
|
1755
1700
|
protected _input(event: InputEvent, key: InputEventKey): void;
|
|
1756
1701
|
protected _render(renderer: WebGLRenderer): void;
|
|
1702
|
+
clone(): this;
|
|
1757
1703
|
toJSON(): Record<string, any>;
|
|
1758
1704
|
static parse(JSON: Record<string, any>[]): Node[];
|
|
1759
1705
|
static parse(JSON: Record<string, any>): Node;
|
|
@@ -1777,7 +1723,7 @@ declare class TimelineNode extends Node {
|
|
|
1777
1723
|
delay: number;
|
|
1778
1724
|
duration: number;
|
|
1779
1725
|
paused: boolean;
|
|
1780
|
-
constructor(properties?: Partial<TimelineNodeProperties>,
|
|
1726
|
+
constructor(properties?: Partial<TimelineNodeProperties>, nodes?: Node[]);
|
|
1781
1727
|
/** Timeline */
|
|
1782
1728
|
computedDuration: number;
|
|
1783
1729
|
protected _currentTime: number;
|
|
@@ -1796,12 +1742,10 @@ declare class TimelineNode extends Node {
|
|
|
1796
1742
|
}
|
|
1797
1743
|
|
|
1798
1744
|
interface CanvasItemProperties extends TimelineNodeProperties {
|
|
1799
|
-
style: Partial<CanvasItemStyleProperties>;
|
|
1800
1745
|
modulate: ColorValue;
|
|
1801
1746
|
blendMode: WebGLBlendMode;
|
|
1802
1747
|
}
|
|
1803
1748
|
interface CanvasItemEventMap extends TimelineNodeEventMap {
|
|
1804
|
-
updateStyleProperty: (key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration) => void;
|
|
1805
1749
|
draw: () => void;
|
|
1806
1750
|
}
|
|
1807
1751
|
interface CanvasItem {
|
|
@@ -1813,56 +1757,40 @@ interface CanvasItem {
|
|
|
1813
1757
|
declare class CanvasItem extends TimelineNode {
|
|
1814
1758
|
modulate?: ColorValue;
|
|
1815
1759
|
blendMode?: WebGLBlendMode;
|
|
1816
|
-
protected _style: CanvasItemStyle;
|
|
1817
|
-
get style(): CanvasItemStyle;
|
|
1818
|
-
set style(style: CanvasItemStyle);
|
|
1819
|
-
/** @internal */
|
|
1820
|
-
opacity: number;
|
|
1821
1760
|
visible: boolean;
|
|
1822
|
-
|
|
1823
|
-
protected
|
|
1761
|
+
opacity: number;
|
|
1762
|
+
protected _parentGlobalVisible?: boolean;
|
|
1763
|
+
protected _globalVisible?: boolean;
|
|
1764
|
+
get globalVisible(): boolean;
|
|
1765
|
+
protected _parentGlobalOpacity?: number;
|
|
1766
|
+
protected _globalOpacity?: number;
|
|
1767
|
+
get globalOpacity(): number;
|
|
1824
1768
|
protected _modulate: Color;
|
|
1825
1769
|
protected _backgroundImage?: Texture2D;
|
|
1826
1770
|
context: CanvasContext;
|
|
1827
1771
|
protected _resetContext: boolean;
|
|
1828
1772
|
protected _redrawing: boolean;
|
|
1829
|
-
protected
|
|
1773
|
+
protected _relayouting: boolean;
|
|
1830
1774
|
protected _repainting: boolean;
|
|
1831
1775
|
protected _originalBatchables: CanvasBatchable[];
|
|
1832
1776
|
protected _layoutedBatchables: CanvasBatchable[];
|
|
1833
1777
|
protected _batchables: CanvasBatchable[];
|
|
1834
|
-
constructor(properties?: Partial<CanvasItemProperties>,
|
|
1835
|
-
setProperties(properties?: Record<PropertyKey, any>): this;
|
|
1778
|
+
constructor(properties?: Partial<CanvasItemProperties>, nodes?: Node[]);
|
|
1836
1779
|
protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
1837
|
-
protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
1838
|
-
protected _updateBoxShadow(): void;
|
|
1839
|
-
protected _updateMaskImage(): void;
|
|
1840
|
-
protected _updateBackgroundColor(): void;
|
|
1841
|
-
protected _updateBackgroundImage(): Promise<void>;
|
|
1842
|
-
protected _updateOpacity(): void;
|
|
1843
|
-
protected _updateCurrentTime(force?: boolean): void;
|
|
1844
|
-
protected _updateVisible(): void;
|
|
1845
1780
|
show(): void;
|
|
1846
1781
|
hide(): void;
|
|
1847
1782
|
isVisibleInTree(): boolean;
|
|
1848
1783
|
canRender(): boolean;
|
|
1849
1784
|
requestRedraw(): void;
|
|
1850
|
-
|
|
1785
|
+
requestRelayout(): void;
|
|
1851
1786
|
requestRepaint(): void;
|
|
1852
|
-
protected
|
|
1853
|
-
protected
|
|
1854
|
-
protected _drawBackground(): void;
|
|
1855
|
-
protected _drawContent(): void;
|
|
1856
|
-
protected _drawBorder(): void;
|
|
1857
|
-
protected _drawOutline(): void;
|
|
1858
|
-
protected _drawBoundingRect(): void;
|
|
1859
|
-
protected _fillBoundingRect(): void;
|
|
1860
|
-
protected _strokeBoundingRect(): void;
|
|
1787
|
+
protected _updateGlobalVisible(): void;
|
|
1788
|
+
protected _updateGlobalOpacity(): void;
|
|
1861
1789
|
protected _relayout(batchables: CanvasBatchable[]): CanvasBatchable[];
|
|
1862
|
-
protected _reflow(batchables: CanvasBatchable[]): CanvasBatchable[];
|
|
1863
1790
|
protected _repaint(batchables: CanvasBatchable[]): CanvasBatchable[];
|
|
1791
|
+
protected _draw(): void;
|
|
1792
|
+
protected _update(): void;
|
|
1864
1793
|
protected _render(renderer: WebGLRenderer): void;
|
|
1865
|
-
toJSON(): Record<string, any>;
|
|
1866
1794
|
}
|
|
1867
1795
|
|
|
1868
1796
|
type EffectMode = 'before' | 'parent' | 'children' | 'transition';
|
|
@@ -1919,21 +1847,238 @@ declare class Transition extends Effect {
|
|
|
1919
1847
|
constructor(properties?: Partial<TransitionProperties>, children?: Node[]);
|
|
1920
1848
|
}
|
|
1921
1849
|
|
|
1850
|
+
interface BaseElement2DStyleProperties extends TextStyleDeclaration, Omit<ElementStyleDeclaration, 'left' | 'top' | 'width' | 'height' | 'backgroundColor' | 'borderColor'> {
|
|
1851
|
+
backgroundColor: 'none' | ColorValue;
|
|
1852
|
+
maskImage: 'none' | string;
|
|
1853
|
+
borderColor: 'none' | ColorValue;
|
|
1854
|
+
outlineWidth: number;
|
|
1855
|
+
outlineOffset: number;
|
|
1856
|
+
outlineColor: 'none' | ColorValue;
|
|
1857
|
+
outlineStyle: string;
|
|
1858
|
+
}
|
|
1859
|
+
interface BaseElement2DStyle extends BaseElement2DStyleProperties {
|
|
1860
|
+
}
|
|
1861
|
+
declare class BaseElement2DStyle extends Resource {
|
|
1862
|
+
protected _backgroundColor: Color;
|
|
1863
|
+
constructor(properties?: Partial<BaseElement2DStyleProperties>);
|
|
1864
|
+
protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
1865
|
+
getComputedBackgroundColor(): Color;
|
|
1866
|
+
loadBackgroundImage(): Promise<Texture2D<ImageBitmap> | undefined>;
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1922
1869
|
interface Node2DProperties extends CanvasItemProperties {
|
|
1923
1870
|
}
|
|
1924
1871
|
declare class Node2D extends CanvasItem {
|
|
1872
|
+
position: Vector2;
|
|
1873
|
+
rotation: number;
|
|
1874
|
+
scale: Vector2;
|
|
1875
|
+
skew: Vector2;
|
|
1925
1876
|
transform: Transform2D;
|
|
1877
|
+
globalPosition: Vector2;
|
|
1878
|
+
globalRotation: number;
|
|
1879
|
+
globalScale: Vector2;
|
|
1880
|
+
globalSkew: Vector2;
|
|
1881
|
+
globalTransform: Transform2D;
|
|
1926
1882
|
protected _parentTransformDirtyId?: number;
|
|
1927
|
-
constructor(properties?: Partial<Node2DProperties>,
|
|
1883
|
+
constructor(properties?: Partial<Node2DProperties>, nodes?: Node[]);
|
|
1884
|
+
protected _updateTransform(): void;
|
|
1885
|
+
protected _updateGlobalTransform(): void;
|
|
1886
|
+
protected _transformVertices(vertices: number[]): number[];
|
|
1887
|
+
protected _relayout(batchables: CanvasBatchable[]): CanvasBatchable[];
|
|
1888
|
+
protected _process(delta: number): void;
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
interface BaseElement2DEventMap extends CanvasItemEventMap {
|
|
1892
|
+
updateStyleProperty: (key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration) => void;
|
|
1893
|
+
}
|
|
1894
|
+
interface BaseElement2DProperties extends Node2DProperties {
|
|
1895
|
+
style: Partial<BaseElement2DStyleProperties>;
|
|
1896
|
+
modulate: ColorValue;
|
|
1897
|
+
blendMode: WebGLBlendMode;
|
|
1898
|
+
}
|
|
1899
|
+
interface BaseElement2D {
|
|
1900
|
+
on: (<K extends keyof BaseElement2DEventMap>(type: K, listener: BaseElement2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
1901
|
+
once: (<K extends keyof BaseElement2DEventMap>(type: K, listener: BaseElement2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
1902
|
+
off: (<K extends keyof BaseElement2DEventMap>(type: K, listener?: BaseElement2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
1903
|
+
emit: (<K extends keyof BaseElement2DEventMap>(type: K, ...args: Parameters<BaseElement2DEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
|
|
1904
|
+
}
|
|
1905
|
+
declare class BaseElement2D extends Node2D implements Rectangulable {
|
|
1906
|
+
size: Vector2;
|
|
1907
|
+
protected _style: BaseElement2DStyle;
|
|
1908
|
+
get style(): BaseElement2DStyle;
|
|
1909
|
+
set style(style: BaseElement2DStyle);
|
|
1910
|
+
constructor(properties?: Partial<BaseElement2DProperties>, nodes?: Node[]);
|
|
1911
|
+
setProperties(properties?: Record<PropertyKey, any>): this;
|
|
1928
1912
|
protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
1913
|
+
protected _updateBoxShadow(): void;
|
|
1914
|
+
protected _updateMaskImage(): void;
|
|
1915
|
+
protected _updateBackgroundColor(): void;
|
|
1916
|
+
protected _updateBackgroundImage(): Promise<void>;
|
|
1929
1917
|
protected _updateTransform(): void;
|
|
1918
|
+
protected _updateGlobalTransform(): void;
|
|
1930
1919
|
getRect(): Rect2;
|
|
1931
1920
|
protected _updateOverflow(): void;
|
|
1932
|
-
protected
|
|
1933
|
-
protected
|
|
1934
|
-
protected
|
|
1921
|
+
protected _draw(): void;
|
|
1922
|
+
protected _drawBackground(): void;
|
|
1923
|
+
protected _drawContent(): void;
|
|
1924
|
+
protected _drawBorder(): void;
|
|
1925
|
+
protected _drawOutline(): void;
|
|
1926
|
+
protected _drawBoundingRect(): void;
|
|
1927
|
+
protected _fillBoundingRect(): void;
|
|
1928
|
+
protected _strokeBoundingRect(): void;
|
|
1929
|
+
protected _repaint(batchables: CanvasBatchable[]): CanvasBatchable[];
|
|
1930
|
+
canPointerEvents(): boolean;
|
|
1931
|
+
input(event: InputEvent, key: InputEventKey): void;
|
|
1932
|
+
protected _pointerEntering: boolean;
|
|
1933
|
+
protected _pointerEntered(): void;
|
|
1934
|
+
protected _pointerExited(): void;
|
|
1935
|
+
protected _pointerInput(point: {
|
|
1936
|
+
x: number;
|
|
1937
|
+
y: number;
|
|
1938
|
+
}, key: InputEventKey): boolean;
|
|
1935
1939
|
protected _input(event: InputEvent, key: InputEventKey): void;
|
|
1936
|
-
|
|
1940
|
+
toJSON(): Record<string, any>;
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1943
|
+
interface Element2DStyleProperties extends BaseElement2DStyleProperties {
|
|
1944
|
+
width: number;
|
|
1945
|
+
height: number;
|
|
1946
|
+
left: number;
|
|
1947
|
+
top: number;
|
|
1948
|
+
}
|
|
1949
|
+
interface Element2DStyle extends Element2DStyleProperties {
|
|
1950
|
+
}
|
|
1951
|
+
declare class Element2DStyle extends BaseElement2DStyle {
|
|
1952
|
+
constructor(properties?: Partial<Element2DStyleProperties>);
|
|
1953
|
+
}
|
|
1954
|
+
|
|
1955
|
+
interface Element2DEventMap extends BaseElement2DEventMap {
|
|
1956
|
+
}
|
|
1957
|
+
interface Element2DProperties extends BaseElement2DProperties {
|
|
1958
|
+
style: Partial<Element2DStyleProperties>;
|
|
1959
|
+
}
|
|
1960
|
+
interface Element2D {
|
|
1961
|
+
on: (<K extends keyof Element2DEventMap>(type: K, listener: Element2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
1962
|
+
once: (<K extends keyof Element2DEventMap>(type: K, listener: Element2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
1963
|
+
off: (<K extends keyof Element2DEventMap>(type: K, listener?: Element2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
1964
|
+
emit: (<K extends keyof Element2DEventMap>(type: K, ...args: Parameters<Element2DEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
|
|
1965
|
+
}
|
|
1966
|
+
declare class Element2D extends BaseElement2D {
|
|
1967
|
+
protected _style: Element2DStyle;
|
|
1968
|
+
get style(): Element2DStyle;
|
|
1969
|
+
set style(style: Element2DStyle);
|
|
1970
|
+
constructor(properties?: Partial<Element2DProperties>, nodes?: Node[]);
|
|
1971
|
+
protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1974
|
+
type Align = 'auto' | 'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline' | 'space-between' | 'space-around' | 'space-evenly';
|
|
1975
|
+
type FlexDirection = 'column' | 'column-reverse' | 'row' | 'row-reverse';
|
|
1976
|
+
type FlexWrap = 'nowrap' | 'wrap' | 'Wrap-reverse';
|
|
1977
|
+
type Justify = 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
|
|
1978
|
+
type Position = 'static' | 'relative' | 'absolute';
|
|
1979
|
+
type BoxSizing = 'border-box' | 'content-box';
|
|
1980
|
+
interface LayoutStyleDeclaration {
|
|
1981
|
+
alignContent: Align;
|
|
1982
|
+
alignItems: Align;
|
|
1983
|
+
alignSelf: Align;
|
|
1984
|
+
borderTop: string;
|
|
1985
|
+
borderLeft: string;
|
|
1986
|
+
borderRight: string;
|
|
1987
|
+
borderBottom: string;
|
|
1988
|
+
borderWidth: number;
|
|
1989
|
+
border: string;
|
|
1990
|
+
direction: 'inherit' | 'ltr' | 'rtl';
|
|
1991
|
+
display: 'none' | 'flex' | 'contents';
|
|
1992
|
+
flex: number;
|
|
1993
|
+
flexBasis: number | 'auto' | `${number}%`;
|
|
1994
|
+
flexDirection: FlexDirection;
|
|
1995
|
+
flexGrow: number;
|
|
1996
|
+
flexShrink: number;
|
|
1997
|
+
flexWrap: FlexWrap;
|
|
1998
|
+
height: number | 'auto' | `${number}%`;
|
|
1999
|
+
justifyContent: Justify;
|
|
2000
|
+
gap: number | `${number}%`;
|
|
2001
|
+
marginTop: number | 'auto' | `${number}%`;
|
|
2002
|
+
marginLeft: number | 'auto' | `${number}%`;
|
|
2003
|
+
marginRight: number | 'auto' | `${number}%`;
|
|
2004
|
+
marginBottom: number | 'auto' | `${number}%`;
|
|
2005
|
+
margin: number | 'auto' | `${number}%`;
|
|
2006
|
+
maxHeight: number | `${number}%`;
|
|
2007
|
+
maxWidth: number | `${number}%`;
|
|
2008
|
+
minHeight: number | `${number}%`;
|
|
2009
|
+
minWidth: number | `${number}%`;
|
|
2010
|
+
paddingTop: number | `${number}%`;
|
|
2011
|
+
paddingLeft: number | `${number}%`;
|
|
2012
|
+
paddingRight: number | `${number}%`;
|
|
2013
|
+
paddingBottom: number | `${number}%`;
|
|
2014
|
+
padding: number | `${number}%`;
|
|
2015
|
+
top: number | `${number}%`;
|
|
2016
|
+
bottom: number | `${number}%`;
|
|
2017
|
+
left: number | `${number}%`;
|
|
2018
|
+
right: number | `${number}%`;
|
|
2019
|
+
position: Position;
|
|
2020
|
+
boxSizing: BoxSizing;
|
|
2021
|
+
width: number | 'auto' | `${number}%`;
|
|
2022
|
+
}
|
|
2023
|
+
interface FlexElement2DStyleProperties extends BaseElement2DStyleProperties, LayoutStyleDeclaration {
|
|
2024
|
+
}
|
|
2025
|
+
interface FlexElement2DStyle extends FlexElement2DStyleProperties {
|
|
2026
|
+
}
|
|
2027
|
+
declare class FlexElement2DStyle extends BaseElement2DStyle {
|
|
2028
|
+
constructor(properties?: Partial<FlexElement2DStyleProperties>);
|
|
2029
|
+
}
|
|
2030
|
+
|
|
2031
|
+
interface ComputedLayout {
|
|
2032
|
+
left: number;
|
|
2033
|
+
right: number;
|
|
2034
|
+
top: number;
|
|
2035
|
+
bottom: number;
|
|
2036
|
+
width: number;
|
|
2037
|
+
height: number;
|
|
2038
|
+
}
|
|
2039
|
+
declare class FlexLayout {
|
|
2040
|
+
protected _element: FlexElement2D;
|
|
2041
|
+
static _yoga?: any;
|
|
2042
|
+
static load(): Promise<void>;
|
|
2043
|
+
_node: Node$1;
|
|
2044
|
+
protected get _style(): FlexElement2DStyle;
|
|
2045
|
+
get offsetLeft(): number;
|
|
2046
|
+
get offsetTop(): number;
|
|
2047
|
+
get offsetWidth(): number;
|
|
2048
|
+
get offsetHeight(): number;
|
|
2049
|
+
constructor(_element: FlexElement2D);
|
|
2050
|
+
calculateLayout(width?: number | 'auto', height?: number | 'auto', direction?: Direction): void;
|
|
2051
|
+
getComputedLayout(): ComputedLayout;
|
|
2052
|
+
updateStyleProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
2053
|
+
}
|
|
2054
|
+
|
|
2055
|
+
interface FlexBaseElement2DEventMap extends BaseElement2DEventMap {
|
|
2056
|
+
updateStyleProperty: (key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration) => void;
|
|
2057
|
+
}
|
|
2058
|
+
interface FlexElement2DProperties extends BaseElement2DProperties {
|
|
2059
|
+
style: Partial<FlexElement2DStyleProperties>;
|
|
2060
|
+
}
|
|
2061
|
+
interface FlexElement2D {
|
|
2062
|
+
on: (<K extends keyof FlexBaseElement2DEventMap>(type: K, listener: FlexBaseElement2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
2063
|
+
once: (<K extends keyof FlexBaseElement2DEventMap>(type: K, listener: FlexBaseElement2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
2064
|
+
off: (<K extends keyof FlexBaseElement2DEventMap>(type: K, listener?: FlexBaseElement2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
2065
|
+
emit: (<K extends keyof FlexBaseElement2DEventMap>(type: K, ...args: Parameters<FlexBaseElement2DEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
|
|
2066
|
+
}
|
|
2067
|
+
declare class FlexElement2D extends BaseElement2D implements Rectangulable {
|
|
2068
|
+
protected _style: FlexElement2DStyle;
|
|
2069
|
+
get style(): FlexElement2DStyle;
|
|
2070
|
+
set style(style: FlexElement2DStyle);
|
|
2071
|
+
_layout: FlexLayout;
|
|
2072
|
+
get offsetLeft(): number;
|
|
2073
|
+
get offsetTop(): number;
|
|
2074
|
+
get offsetWidth(): number;
|
|
2075
|
+
get offsetHeight(): number;
|
|
2076
|
+
constructor(properties?: Partial<FlexElement2DProperties>, nodes?: Node[]);
|
|
2077
|
+
protected _parented(parent: Node): void;
|
|
2078
|
+
protected _unparented(oldParent: Node): void;
|
|
2079
|
+
protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
2080
|
+
protected _updateTransform(): void;
|
|
2081
|
+
calculateLayout(width?: number | 'auto', height?: number | 'auto', direction?: Direction): void;
|
|
1937
2082
|
}
|
|
1938
2083
|
|
|
1939
2084
|
declare class Graphics2D extends Node2D {
|
|
@@ -1960,16 +2105,18 @@ declare class Graphics2D extends Node2D {
|
|
|
1960
2105
|
drawEllipse(x: number, y: number, width: number, height: number): this;
|
|
1961
2106
|
}
|
|
1962
2107
|
|
|
1963
|
-
interface Image2DProperties extends
|
|
2108
|
+
interface Image2DProperties extends Element2DProperties {
|
|
1964
2109
|
src: string;
|
|
2110
|
+
srcRect: ImageRect;
|
|
1965
2111
|
gif: boolean;
|
|
1966
2112
|
}
|
|
1967
|
-
declare class Image2D extends
|
|
1968
|
-
|
|
1969
|
-
|
|
2113
|
+
declare class Image2D extends Element2D {
|
|
2114
|
+
texture?: AnimatedTexture;
|
|
2115
|
+
srcRect: ImageRect;
|
|
1970
2116
|
src: string;
|
|
1971
|
-
|
|
1972
|
-
get
|
|
2117
|
+
gif: boolean;
|
|
2118
|
+
get currentFrameTexture(): Texture2D | undefined;
|
|
2119
|
+
get textureDuration(): number;
|
|
1973
2120
|
get naturalWidth(): number;
|
|
1974
2121
|
get naturalHeight(): number;
|
|
1975
2122
|
get complete(): boolean;
|
|
@@ -1985,12 +2132,14 @@ declare class Image2D extends Node2D {
|
|
|
1985
2132
|
protected _updateFrameIndex(): this;
|
|
1986
2133
|
protected _process(delta: number): void;
|
|
1987
2134
|
protected _drawContent(): void;
|
|
2135
|
+
protected _repaint(batchables: CanvasBatchable[]): CanvasBatchable[];
|
|
1988
2136
|
}
|
|
1989
2137
|
|
|
1990
|
-
interface TextureRect2DProperties extends
|
|
2138
|
+
interface TextureRect2DProperties extends Element2DProperties {
|
|
1991
2139
|
}
|
|
1992
|
-
declare class TextureRect2D<T extends Texture2D = Texture2D> extends
|
|
2140
|
+
declare class TextureRect2D<T extends Texture2D = Texture2D> extends Element2D {
|
|
1993
2141
|
texture?: T;
|
|
2142
|
+
constructor(properties?: Partial<TextureRect2DProperties>, children?: Node[]);
|
|
1994
2143
|
protected _drawContent(): void;
|
|
1995
2144
|
}
|
|
1996
2145
|
|
|
@@ -2041,10 +2190,11 @@ declare class Text2D extends TextureRect2D<CanvasTexture> {
|
|
|
2041
2190
|
protected _drawContent(): void;
|
|
2042
2191
|
}
|
|
2043
2192
|
|
|
2044
|
-
interface TransformRect2DProperties extends
|
|
2193
|
+
interface TransformRect2DProperties extends BaseElement2DProperties {
|
|
2045
2194
|
}
|
|
2046
|
-
declare class TransformRect2D extends
|
|
2047
|
-
|
|
2195
|
+
declare class TransformRect2D extends Element2D {
|
|
2196
|
+
handleSize: number;
|
|
2197
|
+
constructor(properties?: Partial<TransformRect2DProperties>, nodes?: Node[]);
|
|
2048
2198
|
protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
2049
2199
|
protected _drawCircle(x: number, y: number): void;
|
|
2050
2200
|
protected _drawEllipse(x: number, y: number): void;
|
|
@@ -2186,7 +2336,7 @@ declare class HTMLAudioContext extends EventEmitter implements IAudioContext {
|
|
|
2186
2336
|
get audioContext(): AudioContext;
|
|
2187
2337
|
toggleMute(): boolean;
|
|
2188
2338
|
togglePause(): boolean;
|
|
2189
|
-
|
|
2339
|
+
free(): void;
|
|
2190
2340
|
}
|
|
2191
2341
|
|
|
2192
2342
|
declare class HTMLSound extends EventEmitter {
|
|
@@ -2232,7 +2382,7 @@ declare class HTMLSound extends EventEmitter {
|
|
|
2232
2382
|
play(options?: IPlayOptions): void;
|
|
2233
2383
|
protected _onUpdate: () => void;
|
|
2234
2384
|
protected _onComplete(): void;
|
|
2235
|
-
|
|
2385
|
+
free(): void;
|
|
2236
2386
|
}
|
|
2237
2387
|
|
|
2238
2388
|
declare class HTMLAudio {
|
|
@@ -2334,7 +2484,7 @@ declare class WebSound extends EventEmitter {
|
|
|
2334
2484
|
protected _onComplete: () => void;
|
|
2335
2485
|
protected _updateListener: () => void;
|
|
2336
2486
|
protected _enableTicker(enabled: boolean): void;
|
|
2337
|
-
|
|
2487
|
+
free(): void;
|
|
2338
2488
|
}
|
|
2339
2489
|
|
|
2340
2490
|
declare class WebAudio extends AudioPipeline {
|
|
@@ -2422,12 +2572,12 @@ declare class Audio extends TimelineNode {
|
|
|
2422
2572
|
declare class AudioSpectrum extends Node2D {
|
|
2423
2573
|
}
|
|
2424
2574
|
|
|
2425
|
-
interface AudioWaveformProperties extends
|
|
2575
|
+
interface AudioWaveformProperties extends Element2DProperties {
|
|
2426
2576
|
src: string;
|
|
2427
2577
|
gap: number;
|
|
2428
2578
|
color: string;
|
|
2429
2579
|
}
|
|
2430
|
-
declare class AudioWaveform extends
|
|
2580
|
+
declare class AudioWaveform extends Element2D {
|
|
2431
2581
|
src?: string;
|
|
2432
2582
|
gap: number;
|
|
2433
2583
|
color: string;
|
|
@@ -2575,7 +2725,7 @@ declare class ZoomBlurEffect extends Effect {
|
|
|
2575
2725
|
|
|
2576
2726
|
interface ControlEventMap extends CanvasItemEventMap, RectangulableEventMap {
|
|
2577
2727
|
}
|
|
2578
|
-
interface ControlProperties extends
|
|
2728
|
+
interface ControlProperties extends BaseElement2DProperties {
|
|
2579
2729
|
}
|
|
2580
2730
|
interface Control {
|
|
2581
2731
|
on: (<K extends keyof ControlEventMap>(type: K, listener: ControlEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
@@ -2583,7 +2733,7 @@ interface Control {
|
|
|
2583
2733
|
off: (<K extends keyof ControlEventMap>(type: K, listener?: ControlEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
2584
2734
|
emit: (<K extends keyof ControlEventMap>(type: K, ...args: Parameters<ControlEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
|
|
2585
2735
|
}
|
|
2586
|
-
declare class Control extends
|
|
2736
|
+
declare class Control extends Element2D implements Rectangulable {
|
|
2587
2737
|
constructor(properties?: Partial<ControlProperties>, children?: Node[]);
|
|
2588
2738
|
protected _parented(parent: any): void;
|
|
2589
2739
|
protected _unparented(oldParent: any): void;
|
|
@@ -2591,7 +2741,6 @@ declare class Control extends CanvasItem implements Rectangulable {
|
|
|
2591
2741
|
protected _input(event: InputEvent, key: InputEventKey): void;
|
|
2592
2742
|
protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
2593
2743
|
protected _guiInput(event: InputEvent, key: InputEventKey): void;
|
|
2594
|
-
getRect(): Rect2;
|
|
2595
2744
|
}
|
|
2596
2745
|
|
|
2597
2746
|
interface RangeProperties extends ControlProperties {
|
|
@@ -2635,7 +2784,7 @@ declare class Ruler extends Control {
|
|
|
2635
2784
|
markBackgroundColor: string;
|
|
2636
2785
|
markColor: string;
|
|
2637
2786
|
gap: number;
|
|
2638
|
-
|
|
2787
|
+
gapScale: number;
|
|
2639
2788
|
texture: CanvasTexture;
|
|
2640
2789
|
constructor(properties?: Partial<RulerProperties>, children?: Node[]);
|
|
2641
2790
|
protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
@@ -2651,8 +2800,18 @@ declare class ScrollBar extends Range {
|
|
|
2651
2800
|
direction: 'vertical' | 'horizontal';
|
|
2652
2801
|
constructor(properties?: Partial<ScrollBarProperties>, children?: Node[]);
|
|
2653
2802
|
protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
2654
|
-
protected
|
|
2803
|
+
protected _rect(): {
|
|
2804
|
+
left: number;
|
|
2805
|
+
top: number;
|
|
2806
|
+
width: number;
|
|
2807
|
+
height: number;
|
|
2808
|
+
radii: number;
|
|
2809
|
+
};
|
|
2655
2810
|
protected _draw(): void;
|
|
2811
|
+
protected _pointerInput(point: {
|
|
2812
|
+
x: number;
|
|
2813
|
+
y: number;
|
|
2814
|
+
}, key: InputEventKey): boolean;
|
|
2656
2815
|
}
|
|
2657
2816
|
|
|
2658
2817
|
interface XScrollBarProperties extends Omit<ScrollBarProperties, 'direction'> {
|
|
@@ -2667,220 +2826,6 @@ declare class YScrollBar extends ScrollBar {
|
|
|
2667
2826
|
constructor(properties?: Partial<YScrollBarProperties>, children?: Node[]);
|
|
2668
2827
|
}
|
|
2669
2828
|
|
|
2670
|
-
type Align = 'auto' | 'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline' | 'space-between' | 'space-around' | 'space-evenly';
|
|
2671
|
-
type FlexDirection = 'column' | 'column-reverse' | 'row' | 'row-reverse';
|
|
2672
|
-
type FlexWrap = 'no-wrap' | 'wrap' | 'Wrap-reverse';
|
|
2673
|
-
type Justify = 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
|
|
2674
|
-
type Position = 'static' | 'relative' | 'absolute';
|
|
2675
|
-
type BoxSizing = 'border-box' | 'content-box';
|
|
2676
|
-
interface IDOCLayoutStyleDeclaration {
|
|
2677
|
-
alignContent: Align;
|
|
2678
|
-
alignItems: Align;
|
|
2679
|
-
alignSelf: Align;
|
|
2680
|
-
borderTop: string;
|
|
2681
|
-
borderLeft: string;
|
|
2682
|
-
borderRight: string;
|
|
2683
|
-
borderBottom: string;
|
|
2684
|
-
borderWidth: number;
|
|
2685
|
-
border: string;
|
|
2686
|
-
direction: 'inherit' | 'ltr' | 'rtl';
|
|
2687
|
-
display: 'none' | 'flex' | 'contents';
|
|
2688
|
-
flex: number;
|
|
2689
|
-
flexBasis: number | 'auto' | `${number}%`;
|
|
2690
|
-
flexDirection: FlexDirection;
|
|
2691
|
-
flexGrow: number;
|
|
2692
|
-
flexShrink: number;
|
|
2693
|
-
flexWrap: FlexWrap;
|
|
2694
|
-
height: number | 'auto' | `${number}%`;
|
|
2695
|
-
justifyContent: Justify;
|
|
2696
|
-
gap: number | `${number}%`;
|
|
2697
|
-
marginTop: number | 'auto' | `${number}%`;
|
|
2698
|
-
marginLeft: number | 'auto' | `${number}%`;
|
|
2699
|
-
marginRight: number | 'auto' | `${number}%`;
|
|
2700
|
-
marginBottom: number | 'auto' | `${number}%`;
|
|
2701
|
-
margin: number | 'auto' | `${number}%`;
|
|
2702
|
-
maxHeight: number | `${number}%`;
|
|
2703
|
-
maxWidth: number | `${number}%`;
|
|
2704
|
-
minHeight: number | `${number}%`;
|
|
2705
|
-
minWidth: number | `${number}%`;
|
|
2706
|
-
paddingTop: number | `${number}%`;
|
|
2707
|
-
paddingLeft: number | `${number}%`;
|
|
2708
|
-
paddingRight: number | `${number}%`;
|
|
2709
|
-
paddingBottom: number | `${number}%`;
|
|
2710
|
-
padding: number | `${number}%`;
|
|
2711
|
-
top: number | `${number}%`;
|
|
2712
|
-
bottom: number | `${number}%`;
|
|
2713
|
-
left: number | `${number}%`;
|
|
2714
|
-
right: number | `${number}%`;
|
|
2715
|
-
position: Position;
|
|
2716
|
-
boxSizing: BoxSizing;
|
|
2717
|
-
width: number | 'auto' | `${number}%`;
|
|
2718
|
-
}
|
|
2719
|
-
type ElementStyleFilterKey = 'hue-rotate' | 'saturate' | 'brightness' | 'contrast' | 'invert' | 'sepia' | 'opacity' | 'grayscale';
|
|
2720
|
-
type ElementStyleFilter = Record<ElementStyleFilterKey, number>;
|
|
2721
|
-
interface ElementStyleProperties extends IDOCTextStyleDeclaration, Omit<IDOCTransformStyleDeclaration, 'left' | 'top' | 'width' | 'height'>, IDOCLayoutStyleDeclaration {
|
|
2722
|
-
backgroundColor?: 'none' | ColorValue;
|
|
2723
|
-
backgroundImage?: string;
|
|
2724
|
-
filter: string;
|
|
2725
|
-
boxShadow: 'none' | string;
|
|
2726
|
-
maskImage: 'none' | string;
|
|
2727
|
-
opacity: number;
|
|
2728
|
-
borderWidth: number;
|
|
2729
|
-
borderRadius: number;
|
|
2730
|
-
borderColor: 'none' | ColorValue;
|
|
2731
|
-
borderStyle: string;
|
|
2732
|
-
outlineWidth: number;
|
|
2733
|
-
outlineOffset: number;
|
|
2734
|
-
outlineColor: 'none' | ColorValue;
|
|
2735
|
-
outlineStyle: string;
|
|
2736
|
-
visibility: Visibility;
|
|
2737
|
-
overflow: Overflow;
|
|
2738
|
-
pointerEvents: PointerEvents;
|
|
2739
|
-
}
|
|
2740
|
-
type PointerEvents = 'auto' | 'none';
|
|
2741
|
-
interface ElementStyle extends ElementStyleProperties {
|
|
2742
|
-
}
|
|
2743
|
-
declare class ElementStyle extends Resource {
|
|
2744
|
-
backgroundColor: 'none' | ColorValue;
|
|
2745
|
-
backgroundImage: 'none' | string;
|
|
2746
|
-
filter: 'none' | string;
|
|
2747
|
-
boxShadow: 'none' | string;
|
|
2748
|
-
maskImage: 'none' | string;
|
|
2749
|
-
opacity: number;
|
|
2750
|
-
borderRadius: number;
|
|
2751
|
-
borderColor: 'none' | ColorValue;
|
|
2752
|
-
borderStyle: 'none' | string;
|
|
2753
|
-
outlineWidth: number;
|
|
2754
|
-
outlineOffset: number;
|
|
2755
|
-
outlineColor: 'none' | ColorValue;
|
|
2756
|
-
outlineStyle: 'none' | string;
|
|
2757
|
-
visibility: Visibility;
|
|
2758
|
-
overflow: Overflow;
|
|
2759
|
-
pointerEvents: PointerEvents;
|
|
2760
|
-
alignContent: Align;
|
|
2761
|
-
alignItems: Align;
|
|
2762
|
-
alignSelf: Align;
|
|
2763
|
-
borderTop: string;
|
|
2764
|
-
borderLeft: string;
|
|
2765
|
-
borderRight: string;
|
|
2766
|
-
borderBottom: string;
|
|
2767
|
-
borderWidth: number;
|
|
2768
|
-
border: string;
|
|
2769
|
-
direction: 'inherit' | 'ltr' | 'rtl';
|
|
2770
|
-
display: 'none' | 'flex' | 'contents';
|
|
2771
|
-
flex: number;
|
|
2772
|
-
flexBasis: number | 'auto' | `${number}%`;
|
|
2773
|
-
flexDirection: FlexDirection;
|
|
2774
|
-
flexGrow: number;
|
|
2775
|
-
flexShrink: number;
|
|
2776
|
-
flexWrap: FlexWrap;
|
|
2777
|
-
height: number | 'auto' | `${number}%`;
|
|
2778
|
-
justifyContent: Justify;
|
|
2779
|
-
gap: number | `${number}%`;
|
|
2780
|
-
marginTop: number | 'auto' | `${number}%`;
|
|
2781
|
-
marginLeft: number | 'auto' | `${number}%`;
|
|
2782
|
-
marginRight: number | 'auto' | `${number}%`;
|
|
2783
|
-
marginBottom: number | 'auto' | `${number}%`;
|
|
2784
|
-
margin: number | 'auto' | `${number}%`;
|
|
2785
|
-
maxHeight: number | `${number}%`;
|
|
2786
|
-
maxWidth: number | `${number}%`;
|
|
2787
|
-
minHeight: number | `${number}%`;
|
|
2788
|
-
minWidth: number | `${number}%`;
|
|
2789
|
-
paddingTop: number | `${number}%`;
|
|
2790
|
-
paddingLeft: number | `${number}%`;
|
|
2791
|
-
paddingRight: number | `${number}%`;
|
|
2792
|
-
paddingBottom: number | `${number}%`;
|
|
2793
|
-
padding: number | `${number}%`;
|
|
2794
|
-
top: number | `${number}%`;
|
|
2795
|
-
bottom: number | `${number}%`;
|
|
2796
|
-
left: number | `${number}%`;
|
|
2797
|
-
right: number | `${number}%`;
|
|
2798
|
-
position: Position;
|
|
2799
|
-
boxSizing: BoxSizing;
|
|
2800
|
-
width: number | 'auto' | `${number}%`;
|
|
2801
|
-
protected _backgroundColor: Color;
|
|
2802
|
-
constructor(properties?: Partial<ElementStyleProperties>);
|
|
2803
|
-
protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
2804
|
-
canPointeEvents(): boolean;
|
|
2805
|
-
getComputedOpacity(): number;
|
|
2806
|
-
getComputedBackgroundColor(): Color;
|
|
2807
|
-
loadBackgroundImage(): Promise<Texture2D<ImageBitmap> | undefined>;
|
|
2808
|
-
getComputedTransformOrigin(): number[];
|
|
2809
|
-
protected _defaultFilter: ElementStyleFilter;
|
|
2810
|
-
getComputedFilter(): ElementStyleFilter;
|
|
2811
|
-
getComputedFilterColorMatrix(): ColorMatrix;
|
|
2812
|
-
}
|
|
2813
|
-
|
|
2814
|
-
interface ElementProperties extends NodeProperties {
|
|
2815
|
-
style: Partial<ElementStyleProperties>;
|
|
2816
|
-
modulate: ColorValue;
|
|
2817
|
-
blendMode: WebGLBlendMode;
|
|
2818
|
-
}
|
|
2819
|
-
declare class Element$1 extends Node {
|
|
2820
|
-
modulate?: ColorValue;
|
|
2821
|
-
blendMode?: WebGLBlendMode;
|
|
2822
|
-
static layoutEngine?: any;
|
|
2823
|
-
static loadLayoutEngine(): Promise<void>;
|
|
2824
|
-
protected _style: ElementStyle;
|
|
2825
|
-
get style(): ElementStyle;
|
|
2826
|
-
set style(style: ElementStyle);
|
|
2827
|
-
_layout: Node$1;
|
|
2828
|
-
transform: Transform2D;
|
|
2829
|
-
protected _parentTransformDirtyId?: number;
|
|
2830
|
-
opacity: number;
|
|
2831
|
-
visible: boolean;
|
|
2832
|
-
protected _parentOpacity?: number;
|
|
2833
|
-
protected _parentVisible?: boolean;
|
|
2834
|
-
protected _modulate: Color;
|
|
2835
|
-
protected _backgroundImage?: Texture2D;
|
|
2836
|
-
context: CanvasContext;
|
|
2837
|
-
protected _resetContext: boolean;
|
|
2838
|
-
protected _redrawing: boolean;
|
|
2839
|
-
protected _reflowing: boolean;
|
|
2840
|
-
protected _repainting: boolean;
|
|
2841
|
-
protected _originalBatchables: CanvasBatchable[];
|
|
2842
|
-
protected _layoutedBatchables: CanvasBatchable[];
|
|
2843
|
-
protected _batchables: CanvasBatchable[];
|
|
2844
|
-
constructor(properties?: Partial<ElementProperties>, children?: Node[]);
|
|
2845
|
-
setProperties(properties?: Record<PropertyKey, any>): this;
|
|
2846
|
-
protected _parented(parent: Node): void;
|
|
2847
|
-
protected _unparented(oldParent: Node): void;
|
|
2848
|
-
protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
2849
|
-
protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
2850
|
-
protected _updateBoxShadow(): void;
|
|
2851
|
-
protected _updateMaskImage(): void;
|
|
2852
|
-
protected _updateBackgroundColor(): void;
|
|
2853
|
-
protected _updateBackgroundImage(): Promise<void>;
|
|
2854
|
-
protected _updateOpacity(): void;
|
|
2855
|
-
protected _updateVisible(): void;
|
|
2856
|
-
protected _updateTransform(): void;
|
|
2857
|
-
getRect(): Rect2;
|
|
2858
|
-
protected _updateOverflow(): void;
|
|
2859
|
-
show(): void;
|
|
2860
|
-
hide(): void;
|
|
2861
|
-
isVisibleInTree(): boolean;
|
|
2862
|
-
canRender(): boolean;
|
|
2863
|
-
requestRedraw(): void;
|
|
2864
|
-
requestReflow(): void;
|
|
2865
|
-
requestRepaint(): void;
|
|
2866
|
-
protected _process(delta: number): void;
|
|
2867
|
-
protected _transformVertices(vertices: number[]): number[];
|
|
2868
|
-
protected _draw(): void;
|
|
2869
|
-
protected _drawBackground(): void;
|
|
2870
|
-
protected _drawContent(): void;
|
|
2871
|
-
protected _drawBorder(): void;
|
|
2872
|
-
protected _drawOutline(): void;
|
|
2873
|
-
protected _drawBoundingRect(): void;
|
|
2874
|
-
protected _fillBoundingRect(): void;
|
|
2875
|
-
protected _strokeBoundingRect(): void;
|
|
2876
|
-
protected _relayout(batchables: CanvasBatchable[]): CanvasBatchable[];
|
|
2877
|
-
protected _reflow(batchables: CanvasBatchable[]): CanvasBatchable[];
|
|
2878
|
-
protected _repaint(batchables: CanvasBatchable[]): CanvasBatchable[];
|
|
2879
|
-
calculateLayout(width?: number | 'auto', height?: number | 'auto', direction?: Direction): void;
|
|
2880
|
-
protected _render(renderer: WebGLRenderer): void;
|
|
2881
|
-
toJSON(): Record<string, any>;
|
|
2882
|
-
}
|
|
2883
|
-
|
|
2884
2829
|
interface ScalerEventMap extends NodeEventMap {
|
|
2885
2830
|
updateScale: (scale: number) => void;
|
|
2886
2831
|
}
|
|
@@ -2899,7 +2844,7 @@ declare class Scaler extends Node {
|
|
|
2899
2844
|
value: number;
|
|
2900
2845
|
minValue: number;
|
|
2901
2846
|
maxValue: number;
|
|
2902
|
-
get target():
|
|
2847
|
+
get target(): Element2D | undefined;
|
|
2903
2848
|
constructor(properties?: Partial<ScalerProperties>, children?: Node[]);
|
|
2904
2849
|
protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
2905
2850
|
protected _updateScale(): void;
|
|
@@ -2996,21 +2941,29 @@ declare class Assets {
|
|
|
2996
2941
|
}
|
|
2997
2942
|
declare const assets: Assets;
|
|
2998
2943
|
|
|
2944
|
+
type CSSFilterKey = 'hue-rotate' | 'saturate' | 'brightness' | 'contrast' | 'invert' | 'sepia' | 'opacity' | 'grayscale';
|
|
2945
|
+
type CSSFilters = Record<CSSFilterKey, number>;
|
|
2946
|
+
declare function parseCSSFilter(filter: string): ColorMatrix;
|
|
2947
|
+
|
|
2948
|
+
declare function parseCSSTransform(transform: string, width: number, height: number): Transform2D;
|
|
2949
|
+
|
|
2950
|
+
declare function parseCSSTransformOrigin(transformOrigin: string): number[];
|
|
2951
|
+
|
|
2999
2952
|
declare class CanvasItemEditor extends Control {
|
|
3000
|
-
protected _pointerStart?:
|
|
2953
|
+
protected _pointerStart?: Element2DStyle;
|
|
3001
2954
|
protected _pointerOffset?: {
|
|
3002
2955
|
x: number;
|
|
3003
2956
|
y: number;
|
|
3004
2957
|
};
|
|
3005
|
-
selected?:
|
|
3006
|
-
dragging?:
|
|
3007
|
-
hovered?:
|
|
3008
|
-
hover:
|
|
2958
|
+
selected?: Element2D;
|
|
2959
|
+
dragging?: Element2D;
|
|
2960
|
+
hovered?: Element2D;
|
|
2961
|
+
hover: Element2D;
|
|
3009
2962
|
transformRect: TransformRect2D;
|
|
3010
2963
|
scaler: Scaler;
|
|
3011
2964
|
xScrollBar: XScrollBar;
|
|
3012
2965
|
yScrollBar: YScrollBar;
|
|
3013
|
-
drawboard:
|
|
2966
|
+
drawboard: Element2D;
|
|
3014
2967
|
ruler: Ruler;
|
|
3015
2968
|
constructor();
|
|
3016
2969
|
protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
@@ -3018,6 +2971,7 @@ declare class CanvasItemEditor extends Control {
|
|
|
3018
2971
|
protected _onPointerdown(e: PointerInputEvent): void;
|
|
3019
2972
|
protected _onPointermove(e: PointerInputEvent): void;
|
|
3020
2973
|
protected _onPointerup(): void;
|
|
2974
|
+
protected _copyGlobalTransform(a: Element2D, b: Element2D): void;
|
|
3021
2975
|
protected _updateHover(): void;
|
|
3022
2976
|
protected _updateSelectionRect(): void;
|
|
3023
2977
|
protected _updateScrollbars(): void;
|
|
@@ -3055,7 +3009,6 @@ interface Engine {
|
|
|
3055
3009
|
emit: (<K extends keyof EngineEventMap>(type: K, ...args: Parameters<EngineEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
|
|
3056
3010
|
}
|
|
3057
3011
|
declare class Engine extends SceneTree {
|
|
3058
|
-
readonly input: Input;
|
|
3059
3012
|
readonly renderer: WebGLRenderer;
|
|
3060
3013
|
get view(): HTMLCanvasElement | undefined;
|
|
3061
3014
|
get gl(): WebGLRenderingContext | WebGL2RenderingContext;
|
|
@@ -3078,7 +3031,7 @@ declare class Engine extends SceneTree {
|
|
|
3078
3031
|
waitUntilLoad(): Promise<void>;
|
|
3079
3032
|
render(delta?: number): this;
|
|
3080
3033
|
start(): this;
|
|
3081
|
-
|
|
3034
|
+
free(): void;
|
|
3082
3035
|
toPixels(): Uint8ClampedArray;
|
|
3083
3036
|
toImageData(): ImageData;
|
|
3084
3037
|
toCanvas2D(): HTMLCanvasElement;
|
|
@@ -3091,4 +3044,4 @@ interface RenderOptions {
|
|
|
3091
3044
|
}
|
|
3092
3045
|
declare function render(options: RenderOptions): Promise<HTMLCanvasElement>;
|
|
3093
3046
|
|
|
3094
|
-
export { AnimatedTexture, Animation, type AnimationEffectMode, type AnimationProperties, type AssetHandler, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, type AudioWaveformProperties, type
|
|
3047
|
+
export { type Align, AnimatedTexture, Animation, type AnimationEffectMode, type AnimationProperties, type AssetHandler, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, type AudioWaveformProperties, BaseElement2D, type BaseElement2DEventMap, type BaseElement2DProperties, BaseElement2DStyle, type BaseElement2DStyleProperties, type Batchable2D, BlurEffect, type BoxSizing, type CSSFilterKey, type CSSFilters, type CanvasBatchable, CanvasContext, CanvasItem, CanvasItemEditor, type CanvasItemEventMap, type CanvasItemProperties, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, type ColorFilterEffectProperties, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, type ColorValue, type ComputedLayout, Control, type ControlEventMap, type ControlProperties, CoreObject, type CoreObjectEventMap, type CssFunction, type CssFunctionArg, type Cursor, DEG_TO_RAD, DEVICE_PIXEL_RATIO, type Easing, Effect, type EffectContext, EffectMaterial, type EffectMode, type EffectProperties, Element2D, type Element2DEventMap, type Element2DProperties, Element2DStyle, type Element2DStyleProperties, EmbossEffect, Engine, type EngineOptions, EventEmitter, type EventListener, type EventListenerOptions, type EventListenerValue, type FillDraw, type FlexBaseElement2DEventMap, type FlexDirection, FlexElement2D, type FlexElement2DProperties, FlexElement2DStyle, type FlexElement2DStyleProperties, FlexLayout, type FlexWrap, FontLoader, GIFLoader, Geometry, type GeometryOptions, GlitchEffect, GodrayEffect, Graphics2D, HTMLAudio, HTMLAudioContext, HTMLSound, type IAudioContext, type IAudioNode, IN_BROWSER, type IPlayOptions, Image2D, type Image2DProperties, type ImageFrame, ImageTexture, type ImageTextureOptions, IndexBuffer, type IndexBufferOptions, Input, InputEvent, type InputEventKey, type InputEventMap, type InternalMode, JSONLoader, type Justify, KawaseTransition, type Keyframe, type LayoutStyleDeclaration, LeftEraseTransition, Loader, Lottie2D, type Lottie2DProperties, LottieLoader, MainLoop, type MainLoopEventMap, type MaskColor, type MaskData, MaskEffect, type MaskEffectProperties, type MaskObject, type MaskRect, type Maskable, Material, type MaterialOptions, Matrix, Matrix2, Matrix3, Matrix4, type MatrixLike, type MatrixOperateOutput, MouseInputEvent, Node, Node2D, type Node2DProperties, type NodeEventMap, type NodeProperties, type NormalizedKeyframe, PI, PI_2, PixelateEffect, PixelsTexture, type PlatformAudio, type PlatformSound, PointerInputEvent, type Position, type ProcessMode, Projection2D, type PropertyDeclaration, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, Range, type RangeProperties, RawWeakMap, Rect2, type Rectangulable, type RectangulableEventMap, RefCounted, type RefCountedEventMap, type RenderMode, type RenderOptions, type Renderable, Renderer, Resource, type ResourceEventMap, Ruler, type RulerProperties, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, Scaler, type ScalerEventMap, type ScalerProperties, SceneTree, type SceneTreeEventMap, ScrollBar, type ScrollBarProperties, ShadowEffect, type StrokeDraw, Text2D, type Text2DProperties, TextLoader, Texture2D, type Texture2DFilterMode, type Texture2DPixelsSource, type Texture2DSource, type Texture2DWrapMode, TextureLoader, TextureRect2D, type TextureRect2DProperties, Ticker, TiltShiftTransition, Timeline, type TimelineEventMap, TimelineNode, type TimelineNodeEventMap, type TimelineNodeProperties, type TimelineProperties, type TimingFunctions, Transform2D, type Transform2DObject, TransformRect2D, type TransformRect2DProperties, Transition, type TransitionProperties, TwistTransition, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, type VectorLike, type VectorOperateOutput, VertexAttribute, type VertexAttributeOptions, VertexBuffer, type VertexBufferOptions, Video2D, type Video2DProperties, VideoLoader, VideoTexture, type VideoTextureOptions, type VideoTextureSource, Viewport, type ViewportEventMap, type ViewportFramebuffer, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, type WebGLBufferMeta, WebGLBufferModule, type WebGLBufferOptions, type WebGLBufferTarget, type WebGLBufferUsage, type WebGLDrawMode, type WebGLDrawOptions, type WebGLExtensions, type WebGLFramebufferMeta, WebGLFramebufferModule, type WebGLFramebufferOptions, WebGLMaskModule, WebGLModule, type WebGLProgramMeta, WebGLProgramModule, type WebGLProgramOptions, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, type WebGLTarget, type WebGLTextureFilterMode, type WebGLTextureLocation, type WebGLTextureMeta, WebGLTextureModule, type WebGLTextureOptions, type WebGLTextureSource, type WebGLTextureTarget, type WebGLTextureWrapMode, WebGLVertexArrayModule, type WebGLVertexArrayObjectMeta, type WebGLVertexArrayObjectOptions, type WebGLVertexAttrib, type WebGLVertexAttribType, type WebGLViewport, WebGLViewportModule, WebSound, WheelInputEvent, XScrollBar, type XScrollBarProperties, YScrollBar, type YScrollBarProperties, ZoomBlurEffect, assets, clamp, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, defineProperty, determineCrossOrigin, ease, easeIn, easeInOut, easeOut, getDeclarations, getDefaultCssPropertyValue, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, parseCSSFilter, parseCSSTransform, parseCSSTransformOrigin, parseCssFunctions, parseCssProperty, property, protectedProperty, render, timingFunctions, uid };
|