canvasengine 2.0.0-beta.56 → 2.0.0-beta.58
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/DebugRenderer-DkjTAc48.js +1384 -0
- package/dist/DebugRenderer-DkjTAc48.js.map +1 -0
- package/dist/directives/Controls.d.ts +1 -1
- package/dist/dist-BOOc43Qm.js +778 -0
- package/dist/dist-BOOc43Qm.js.map +1 -0
- package/dist/index.global.js +5 -5
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +9712 -12139
- package/dist/index.js.map +1 -1
- package/dist/utils/RadialGradient.d.ts +1 -1
- package/package.json +6 -6
- package/dist/components/Container.d.ts +0 -86
- package/dist/components/Container.d.ts.map +0 -1
- package/dist/components/DOMContainer.d.ts +0 -98
- package/dist/components/DOMContainer.d.ts.map +0 -1
- package/dist/components/DisplayObject.d.ts +0 -94
- package/dist/components/DisplayObject.d.ts.map +0 -1
- package/dist/components/Mesh.d.ts +0 -208
- package/dist/components/Mesh.d.ts.map +0 -1
- package/dist/components/Sprite.d.ts +0 -249
- package/dist/components/Sprite.d.ts.map +0 -1
- package/dist/components/Viewport.d.ts +0 -122
- package/dist/components/Viewport.d.ts.map +0 -1
- package/dist/index-DaGekQUW.js +0 -2218
- package/dist/index-DaGekQUW.js.map +0 -1
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
import { Signal } from '@signe/reactive';
|
|
2
|
-
import { Sprite as PixiSprite, Texture } from 'pixi.js';
|
|
3
|
-
import { Element } from '../engine/reactive';
|
|
4
|
-
import { AnimationFrames, FrameOptions, SpritesheetOptions, TextureOptions, TransformOptions } from './types/Spritesheet';
|
|
5
|
-
import { ComponentFunction } from '../engine/signal';
|
|
6
|
-
import { DisplayObjectProps } from './types/DisplayObject';
|
|
7
|
-
import { Layout } from '@pixi/layout';
|
|
8
|
-
type Image = {
|
|
9
|
-
image: string;
|
|
10
|
-
};
|
|
11
|
-
type TextureOptionsMerging = TextureOptions & {
|
|
12
|
-
spriteWidth: number;
|
|
13
|
-
spriteHeight: number;
|
|
14
|
-
sound?: string;
|
|
15
|
-
} & Image & TransformOptions;
|
|
16
|
-
type FrameOptionsMerging = TextureOptionsMerging & FrameOptions;
|
|
17
|
-
type SpritesheetOptionsMerging = TextureOptionsMerging & SpritesheetOptions;
|
|
18
|
-
type AnimationDataFrames = {
|
|
19
|
-
sprites: FrameOptionsMerging[];
|
|
20
|
-
frames: Texture[][];
|
|
21
|
-
name: string;
|
|
22
|
-
animations: AnimationFrames;
|
|
23
|
-
params: any[];
|
|
24
|
-
data: TextureOptionsMerging;
|
|
25
|
-
};
|
|
26
|
-
export type HitboxAnchorMode = "top-left" | "center" | "foot";
|
|
27
|
-
export type Hitbox = {
|
|
28
|
-
w: number;
|
|
29
|
-
h: number;
|
|
30
|
-
anchorMode?: HitboxAnchorMode;
|
|
31
|
-
};
|
|
32
|
-
export declare enum StandardAnimation {
|
|
33
|
-
Stand = "stand",
|
|
34
|
-
Walk = "walk"
|
|
35
|
-
}
|
|
36
|
-
declare const CanvasSprite_base: {
|
|
37
|
-
new (): {
|
|
38
|
-
[x: string]: any;
|
|
39
|
-
"__#private@#canvasContext": {
|
|
40
|
-
[key: string]: any;
|
|
41
|
-
} | null;
|
|
42
|
-
isFlex: boolean;
|
|
43
|
-
fullProps: import('..').Props;
|
|
44
|
-
isMounted: boolean;
|
|
45
|
-
_anchorPoints: import('pixi.js').ObservablePoint;
|
|
46
|
-
isCustomAnchor: boolean;
|
|
47
|
-
displayWidth: import('@signe/reactive').WritableSignal<number>;
|
|
48
|
-
displayHeight: import('@signe/reactive').WritableSignal<number>;
|
|
49
|
-
overrideProps: string[];
|
|
50
|
-
layout: any;
|
|
51
|
-
onBeforeDestroy: import('./DisplayObject').OnHook | null;
|
|
52
|
-
onAfterMount: import('./DisplayObject').OnHook | null;
|
|
53
|
-
subjectInit: import('rxjs').BehaviorSubject<any>;
|
|
54
|
-
disableLayout: boolean;
|
|
55
|
-
"__#private@#registeredEvents": Map<string, Function>;
|
|
56
|
-
"__#private@#computedLayoutBox": {
|
|
57
|
-
width?: number;
|
|
58
|
-
height?: number;
|
|
59
|
-
} | null;
|
|
60
|
-
"__#private@#element": Element<any> | null;
|
|
61
|
-
getElement(): Element<any> | null;
|
|
62
|
-
onLayoutComputed(_event: any): void;
|
|
63
|
-
get deltaRatio(): any;
|
|
64
|
-
get parentIsFlex(): any;
|
|
65
|
-
onInit(props: import('..').Props): void;
|
|
66
|
-
onMount(element: Element<any>, index?: number): Promise<void>;
|
|
67
|
-
onUpdate(props: import('..').Props): void;
|
|
68
|
-
onDestroy(parent: Element, afterDestroy?: () => void): Promise<void>;
|
|
69
|
-
setFlexDirection(direction: import('./types/DisplayObject').FlexDirection): void;
|
|
70
|
-
setFlexWrap(wrap: "wrap" | "nowrap" | "wrap-reverse"): void;
|
|
71
|
-
setAlignContent(align: import('./types/DisplayObject').AlignContent): void;
|
|
72
|
-
setAlignSelf(align: import('./types/DisplayObject').AlignContent): void;
|
|
73
|
-
setAlignItems(align: import('./types/DisplayObject').AlignContent): void;
|
|
74
|
-
setJustifyContent(justifyContent: "flex-start" | "flex-end" | "center" | "space-between" | "space-around"): void;
|
|
75
|
-
setPosition(position: import('./types/DisplayObject').EdgeSize): void;
|
|
76
|
-
setX(x: number): void;
|
|
77
|
-
setY(y: number): void;
|
|
78
|
-
setPadding(padding: import('./types/DisplayObject').EdgeSize): void;
|
|
79
|
-
setMargin(margin: import('./types/DisplayObject').EdgeSize): void;
|
|
80
|
-
setGap(gap: import('./types/DisplayObject').EdgeSize): void;
|
|
81
|
-
setBorder(border: import('./types/DisplayObject').EdgeSize): void;
|
|
82
|
-
setPositionType(positionType: "relative" | "absolute"): void;
|
|
83
|
-
setWidth(width: number): void;
|
|
84
|
-
setHeight(height: number): void;
|
|
85
|
-
getWidth(): number;
|
|
86
|
-
getHeight(): number;
|
|
87
|
-
setMinWidth(minWidth: number | string): void;
|
|
88
|
-
setMinHeight(minHeight: number | string): void;
|
|
89
|
-
setMaxWidth(maxWidth: number | string): void;
|
|
90
|
-
setMaxHeight(maxHeight: number | string): void;
|
|
91
|
-
setAspectRatio(aspectRatio: number): void;
|
|
92
|
-
setFlexGrow(flexGrow: number): void;
|
|
93
|
-
setFlexShrink(flexShrink: number): void;
|
|
94
|
-
setFlexBasis(flexBasis: number | string): void;
|
|
95
|
-
setRowGap(rowGap: number): void;
|
|
96
|
-
setColumnGap(columnGap: number): void;
|
|
97
|
-
setTop(top: number | string): void;
|
|
98
|
-
setLeft(left: number | string): void;
|
|
99
|
-
setRight(right: number | string): void;
|
|
100
|
-
setBottom(bottom: number | string): void;
|
|
101
|
-
setObjectFit(objectFit: import('./types/DisplayObject').ObjectFit): void;
|
|
102
|
-
setObjectPosition(objectPosition: import('./types/DisplayObject').ObjectPosition): void;
|
|
103
|
-
setTransformOrigin(transformOrigin: import('./types/DisplayObject').TransformOrigin): void;
|
|
104
|
-
};
|
|
105
|
-
[x: string]: any;
|
|
106
|
-
};
|
|
107
|
-
export declare class CanvasSprite extends CanvasSprite_base {
|
|
108
|
-
hitbox: Hitbox | null;
|
|
109
|
-
applyTransform: (frame: FrameOptionsMerging, data: TextureOptionsMerging, spritesheet: SpritesheetOptionsMerging) => Partial<FrameOptionsMerging>;
|
|
110
|
-
private spritesheet;
|
|
111
|
-
private currentAnimation;
|
|
112
|
-
private time;
|
|
113
|
-
private frameIndex;
|
|
114
|
-
private animations;
|
|
115
|
-
private subscriptionTick;
|
|
116
|
-
private subscriptionSheet;
|
|
117
|
-
private sheetParams;
|
|
118
|
-
private sheetCurrentAnimation;
|
|
119
|
-
private app;
|
|
120
|
-
onFinish: () => void;
|
|
121
|
-
private globalLoader;
|
|
122
|
-
private trackedAssetIds;
|
|
123
|
-
get renderer(): import('pixi.js').Renderer;
|
|
124
|
-
private currentAnimationContainer;
|
|
125
|
-
/**
|
|
126
|
-
* Auto-detects image dimensions by loading the image and reading its natural size
|
|
127
|
-
* This is used when width/height are not explicitly provided in the spritesheet definition
|
|
128
|
-
*
|
|
129
|
-
* @param imagePath - Path to the image file
|
|
130
|
-
* @returns Object containing the detected width and height of the image
|
|
131
|
-
*
|
|
132
|
-
* @example
|
|
133
|
-
* ```typescript
|
|
134
|
-
* const { width, height } = await sprite.detectImageDimensions('path/to/image.png');
|
|
135
|
-
* // width: 256, height: 128
|
|
136
|
-
* ```
|
|
137
|
-
*/
|
|
138
|
-
private detectImageDimensions;
|
|
139
|
-
/**
|
|
140
|
-
* Creates textures from a spritesheet image by cutting it into frames
|
|
141
|
-
* Automatically detects image dimensions if width/height are not provided
|
|
142
|
-
*
|
|
143
|
-
* @param options - Texture options containing image path, dimensions, and frame configuration
|
|
144
|
-
* @returns A 2D array of textures organized by rows and columns
|
|
145
|
-
*
|
|
146
|
-
* @example
|
|
147
|
-
* ```typescript
|
|
148
|
-
* // With explicit dimensions
|
|
149
|
-
* const textures = await sprite.createTextures({
|
|
150
|
-
* image: 'path/to/image.png',
|
|
151
|
-
* width: 256,
|
|
152
|
-
* height: 128,
|
|
153
|
-
* framesWidth: 4,
|
|
154
|
-
* framesHeight: 2,
|
|
155
|
-
* spriteWidth: 64,
|
|
156
|
-
* spriteHeight: 64
|
|
157
|
-
* });
|
|
158
|
-
*
|
|
159
|
-
* // Without dimensions (automatically detected)
|
|
160
|
-
* const textures = await sprite.createTextures({
|
|
161
|
-
* image: 'path/to/image.png',
|
|
162
|
-
* framesWidth: 4,
|
|
163
|
-
* framesHeight: 2,
|
|
164
|
-
* spriteWidth: 64,
|
|
165
|
-
* spriteHeight: 64
|
|
166
|
-
* });
|
|
167
|
-
* ```
|
|
168
|
-
*/
|
|
169
|
-
private createTextures;
|
|
170
|
-
private createAnimations;
|
|
171
|
-
onMount(params: Element<any>): Promise<void>;
|
|
172
|
-
onUpdate(props: any): Promise<void>;
|
|
173
|
-
onDestroy(parent: Element, afterDestroy: () => void): Promise<void>;
|
|
174
|
-
has(name: string): boolean;
|
|
175
|
-
get(name: string): AnimationDataFrames;
|
|
176
|
-
isPlaying(name?: string): boolean;
|
|
177
|
-
stop(): void;
|
|
178
|
-
play(name: string, params?: any[]): void;
|
|
179
|
-
/**
|
|
180
|
-
* Resets the sprite by destroying and recreating all animations
|
|
181
|
-
* This method clears the current animation state, destroys existing textures,
|
|
182
|
-
* and recreates all animations from the spritesheet
|
|
183
|
-
*
|
|
184
|
-
* @example
|
|
185
|
-
* ```typescript
|
|
186
|
-
* // Reset all animations to their initial state
|
|
187
|
-
* sprite.resetAnimations();
|
|
188
|
-
*
|
|
189
|
-
* // Reset and then play a specific animation
|
|
190
|
-
* await sprite.resetAnimations();
|
|
191
|
-
* sprite.play('walk');
|
|
192
|
-
* ```
|
|
193
|
-
*/
|
|
194
|
-
resetAnimations(): Promise<void>;
|
|
195
|
-
update({ deltaRatio }: {
|
|
196
|
-
deltaRatio: any;
|
|
197
|
-
}): void;
|
|
198
|
-
private applyHitboxAnchor;
|
|
199
|
-
private normalizeHitbox;
|
|
200
|
-
private clamp;
|
|
201
|
-
}
|
|
202
|
-
export interface CanvasSprite extends PixiSprite {
|
|
203
|
-
layout: Layout | null;
|
|
204
|
-
}
|
|
205
|
-
export interface SpriteProps extends DisplayObjectProps {
|
|
206
|
-
sheet?: {
|
|
207
|
-
definition?: SpritesheetOptionsMerging;
|
|
208
|
-
playing?: string;
|
|
209
|
-
params?: any;
|
|
210
|
-
onFinish?: () => void;
|
|
211
|
-
};
|
|
212
|
-
hitbox?: Hitbox;
|
|
213
|
-
scaleMode?: number;
|
|
214
|
-
image?: string;
|
|
215
|
-
rectangle?: {
|
|
216
|
-
x: number;
|
|
217
|
-
y: number;
|
|
218
|
-
width: number;
|
|
219
|
-
height: number;
|
|
220
|
-
};
|
|
221
|
-
context?: {
|
|
222
|
-
tick: Signal;
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
export interface SpritePropsWithImage extends Omit<SpriteProps, "sheet"> {
|
|
226
|
-
image: string;
|
|
227
|
-
rectangle?: {
|
|
228
|
-
x: number;
|
|
229
|
-
y: number;
|
|
230
|
-
width: number;
|
|
231
|
-
height: number;
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
export interface SpritePropsWithSheet extends Omit<SpriteProps, "image" | "rectangle"> {
|
|
235
|
-
sheet: {
|
|
236
|
-
definition: SpritesheetOptionsMerging;
|
|
237
|
-
playing?: string;
|
|
238
|
-
params?: any;
|
|
239
|
-
onFinish?: () => void;
|
|
240
|
-
};
|
|
241
|
-
loader?: {
|
|
242
|
-
onProgress?: (progress: number) => void;
|
|
243
|
-
onComplete?: (texture: Texture) => void;
|
|
244
|
-
};
|
|
245
|
-
}
|
|
246
|
-
export type SpritePropTypes = SpritePropsWithImage | SpritePropsWithSheet;
|
|
247
|
-
export declare const Sprite: ComponentFunction<SpritePropTypes>;
|
|
248
|
-
export {};
|
|
249
|
-
//# sourceMappingURL=Sprite.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Sprite.d.ts","sourceRoot":"","sources":["../../src/components/Sprite.ts"],"names":[],"mappings":"AACA,OAAO,EAA8B,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAIL,MAAM,IAAI,UAAU,EAEpB,OAAO,EACR,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,OAAO,EAKR,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAKtC,KAAK,KAAK,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/B,KAAK,qBAAqB,GAAG,cAAc,GAAG;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY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B,CAAC,eAAe,CAIrD,CAAC"}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { Viewport as PixiViewport } from 'pixi-viewport';
|
|
2
|
-
import { Element, Props } from '../engine/reactive';
|
|
3
|
-
import { ComponentInstance } from './DisplayObject';
|
|
4
|
-
import { ContainerChild, IRenderLayer } from 'pixi.js';
|
|
5
|
-
export interface ViewportProps extends Props {
|
|
6
|
-
screenWidth?: number;
|
|
7
|
-
screenHeight?: number;
|
|
8
|
-
worldWidth?: number;
|
|
9
|
-
worldHeight?: number;
|
|
10
|
-
sortableChildren?: boolean;
|
|
11
|
-
clamp?: boolean | {
|
|
12
|
-
left?: number;
|
|
13
|
-
right?: number;
|
|
14
|
-
top?: number;
|
|
15
|
-
bottom?: number;
|
|
16
|
-
};
|
|
17
|
-
context?: any;
|
|
18
|
-
[key: string]: any;
|
|
19
|
-
}
|
|
20
|
-
declare const CanvasViewport_base: {
|
|
21
|
-
new (): {
|
|
22
|
-
[x: string]: any;
|
|
23
|
-
"__#private@#canvasContext": {
|
|
24
|
-
[key: string]: any;
|
|
25
|
-
} | null;
|
|
26
|
-
isFlex: boolean;
|
|
27
|
-
fullProps: Props;
|
|
28
|
-
isMounted: boolean;
|
|
29
|
-
_anchorPoints: import('pixi.js').ObservablePoint;
|
|
30
|
-
isCustomAnchor: boolean;
|
|
31
|
-
displayWidth: import('@signe/reactive').WritableSignal<number>;
|
|
32
|
-
displayHeight: import('@signe/reactive').WritableSignal<number>;
|
|
33
|
-
overrideProps: string[];
|
|
34
|
-
layout: any;
|
|
35
|
-
onBeforeDestroy: import('./DisplayObject').OnHook | null;
|
|
36
|
-
onAfterMount: import('./DisplayObject').OnHook | null;
|
|
37
|
-
subjectInit: import('rxjs').BehaviorSubject<any>;
|
|
38
|
-
disableLayout: boolean;
|
|
39
|
-
"__#private@#registeredEvents": Map<string, Function>;
|
|
40
|
-
"__#private@#computedLayoutBox": {
|
|
41
|
-
width?: number;
|
|
42
|
-
height?: number;
|
|
43
|
-
} | null;
|
|
44
|
-
"__#private@#element": Element<any> | null;
|
|
45
|
-
getElement(): Element<any> | null;
|
|
46
|
-
onLayoutComputed(_event: any): void;
|
|
47
|
-
get deltaRatio(): any;
|
|
48
|
-
get parentIsFlex(): any;
|
|
49
|
-
onInit(props: Props): void;
|
|
50
|
-
onMount(element: Element<any>, index?: number): Promise<void>;
|
|
51
|
-
onUpdate(props: Props): void;
|
|
52
|
-
onDestroy(parent: Element, afterDestroy?: () => void): Promise<void>;
|
|
53
|
-
setFlexDirection(direction: import('./types/DisplayObject').FlexDirection): void;
|
|
54
|
-
setFlexWrap(wrap: "wrap" | "nowrap" | "wrap-reverse"): void;
|
|
55
|
-
setAlignContent(align: import('./types/DisplayObject').AlignContent): void;
|
|
56
|
-
setAlignSelf(align: import('./types/DisplayObject').AlignContent): void;
|
|
57
|
-
setAlignItems(align: import('./types/DisplayObject').AlignContent): void;
|
|
58
|
-
setJustifyContent(justifyContent: "flex-start" | "flex-end" | "center" | "space-between" | "space-around"): void;
|
|
59
|
-
setPosition(position: import('./types/DisplayObject').EdgeSize): void;
|
|
60
|
-
setX(x: number): void;
|
|
61
|
-
setY(y: number): void;
|
|
62
|
-
setPadding(padding: import('./types/DisplayObject').EdgeSize): void;
|
|
63
|
-
setMargin(margin: import('./types/DisplayObject').EdgeSize): void;
|
|
64
|
-
setGap(gap: import('./types/DisplayObject').EdgeSize): void;
|
|
65
|
-
setBorder(border: import('./types/DisplayObject').EdgeSize): void;
|
|
66
|
-
setPositionType(positionType: "relative" | "absolute"): void;
|
|
67
|
-
setWidth(width: number): void;
|
|
68
|
-
setHeight(height: number): void;
|
|
69
|
-
getWidth(): number;
|
|
70
|
-
getHeight(): number;
|
|
71
|
-
setMinWidth(minWidth: number | string): void;
|
|
72
|
-
setMinHeight(minHeight: number | string): void;
|
|
73
|
-
setMaxWidth(maxWidth: number | string): void;
|
|
74
|
-
setMaxHeight(maxHeight: number | string): void;
|
|
75
|
-
setAspectRatio(aspectRatio: number): void;
|
|
76
|
-
setFlexGrow(flexGrow: number): void;
|
|
77
|
-
setFlexShrink(flexShrink: number): void;
|
|
78
|
-
setFlexBasis(flexBasis: number | string): void;
|
|
79
|
-
setRowGap(rowGap: number): void;
|
|
80
|
-
setColumnGap(columnGap: number): void;
|
|
81
|
-
setTop(top: number | string): void;
|
|
82
|
-
setLeft(left: number | string): void;
|
|
83
|
-
setRight(right: number | string): void;
|
|
84
|
-
setBottom(bottom: number | string): void;
|
|
85
|
-
setObjectFit(objectFit: import('./types/DisplayObject').ObjectFit): void;
|
|
86
|
-
setObjectPosition(objectPosition: import('./types/DisplayObject').ObjectPosition): void;
|
|
87
|
-
setTransformOrigin(transformOrigin: import('./types/DisplayObject').TransformOrigin): void;
|
|
88
|
-
};
|
|
89
|
-
[x: string]: any;
|
|
90
|
-
};
|
|
91
|
-
export declare class CanvasViewport extends CanvasViewport_base {
|
|
92
|
-
#private;
|
|
93
|
-
private tickSubscription;
|
|
94
|
-
overrideProps: string[];
|
|
95
|
-
viewport: PixiViewport;
|
|
96
|
-
constructor();
|
|
97
|
-
addChild<U extends any[]>(...children: U): U[0];
|
|
98
|
-
addChildAt<T extends ContainerChild | IRenderLayer>(child: T, index: number): T;
|
|
99
|
-
onInit(props: any): void;
|
|
100
|
-
/**
|
|
101
|
-
* Called when the component is mounted to the scene graph.
|
|
102
|
-
* Initializes viewport settings and subscriptions.
|
|
103
|
-
* @param {Element<CanvasViewport>} element - The element being mounted. Its `props` property (of type ViewportProps) contains component properties and context.
|
|
104
|
-
* @param {number} [index] - The index of the component among its siblings.
|
|
105
|
-
*/
|
|
106
|
-
onMount(element: Element<any>, index?: number): Promise<void>;
|
|
107
|
-
onUpdate(props: any): void;
|
|
108
|
-
private updateViewportSettings;
|
|
109
|
-
private updateMask;
|
|
110
|
-
/**
|
|
111
|
-
* Called when the component is about to be destroyed.
|
|
112
|
-
* Unsubscribes from the tick observable.
|
|
113
|
-
* @param {Element<any>} parent - The parent element.
|
|
114
|
-
* @param {() => void} [afterDestroy] - An optional callback function to be executed after the component's own destruction logic.
|
|
115
|
-
*/
|
|
116
|
-
onDestroy(parent: Element<any>, afterDestroy?: () => void): Promise<void>;
|
|
117
|
-
follow(...args: any[]): any;
|
|
118
|
-
get plugins(): import('pixi-viewport').PluginManager;
|
|
119
|
-
}
|
|
120
|
-
export declare function Viewport(props: ViewportProps): Element<ComponentInstance>;
|
|
121
|
-
export {};
|
|
122
|
-
//# sourceMappingURL=Viewport.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Viewport.d.ts","sourceRoot":"","sources":["../../src/components/Viewport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,EAAsC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACxF,OAAO,EAAiB,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEnE,OAAO,EAAuB,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AA0B5E,MAAM,WAAW,aAAc,SAAQ,KAAK;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,KAAK,CAAC,EAAE,OAAO,GAAG;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB;;;;;;;;;;;;;;;;;;;;;;iBAgEO,CAAL;kBAAgB,CAAC;;;;;;;;;;;;;;;;;;;;;;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