@woven-canvas/core 0.1.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/LICENSE +21 -0
- package/README.md +34 -0
- package/build/_tsup-dts-rollup.d.cts +1509 -0
- package/build/_tsup-dts-rollup.d.ts +1509 -0
- package/build/index.cjs +4109 -0
- package/build/index.cjs.map +1 -0
- package/build/index.d.cts +133 -0
- package/build/index.d.ts +133 -0
- package/build/index.js +4036 -0
- package/build/index.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,1509 @@
|
|
|
1
|
+
import { Aabb as Aabb_2 } from '@woven-canvas/math';
|
|
2
|
+
import { addComponent } from '@woven-ecs/core';
|
|
3
|
+
import { AnyCanvasComponentDef } from '@woven-ecs/canvas-store';
|
|
4
|
+
import { AnyCanvasSingletonDef } from '@woven-ecs/canvas-store';
|
|
5
|
+
import { AnyStateMachine } from 'xstate';
|
|
6
|
+
import { Arc } from '@woven-canvas/math';
|
|
7
|
+
import { ArrayFieldBuilder } from '@woven-ecs/core';
|
|
8
|
+
import { BooleanFieldBuilder } from '@woven-ecs/core';
|
|
9
|
+
import { BufferFieldBuilder } from '@woven-ecs/core';
|
|
10
|
+
import { CanvasComponentDef } from '@woven-ecs/canvas-store';
|
|
11
|
+
import { CanvasSingletonDef } from '@woven-ecs/canvas-store';
|
|
12
|
+
import { Capsule } from '@woven-canvas/math';
|
|
13
|
+
import { ComponentDef } from '@woven-ecs/core';
|
|
14
|
+
import { ComponentSchema } from '@woven-ecs/core';
|
|
15
|
+
import { Context } from '@woven-ecs/core';
|
|
16
|
+
import { createEntity } from '@woven-ecs/core';
|
|
17
|
+
import { defineCanvasComponent } from '@woven-ecs/canvas-store';
|
|
18
|
+
import { defineCanvasSingleton } from '@woven-ecs/canvas-store';
|
|
19
|
+
import { defineQuery } from '@woven-ecs/core';
|
|
20
|
+
import { defineSystem } from '@woven-ecs/core';
|
|
21
|
+
import { EntityId } from '@woven-ecs/core';
|
|
22
|
+
import { EnumFieldBuilder } from '@woven-ecs/core';
|
|
23
|
+
import type { EnumFieldDef } from '@woven-ecs/core';
|
|
24
|
+
import { EventType } from '@woven-ecs/core';
|
|
25
|
+
import { field } from '@woven-ecs/core';
|
|
26
|
+
import { getBackrefs } from '@woven-ecs/core';
|
|
27
|
+
import { getResources } from '@woven-ecs/core';
|
|
28
|
+
import { hasComponent } from '@woven-ecs/core';
|
|
29
|
+
import { InferCanvasComponentType } from '@woven-ecs/canvas-store';
|
|
30
|
+
import { isAlive } from '@woven-ecs/core';
|
|
31
|
+
import { MainThreadSystem } from '@woven-ecs/core';
|
|
32
|
+
import { Mat2 } from '@woven-canvas/math';
|
|
33
|
+
import { NumberFieldBuilder } from '@woven-ecs/core';
|
|
34
|
+
import { QueryDef } from '@woven-ecs/core';
|
|
35
|
+
import { RefFieldBuilder } from '@woven-ecs/core';
|
|
36
|
+
import { removeComponent } from '@woven-ecs/core';
|
|
37
|
+
import { removeEntity } from '@woven-ecs/core';
|
|
38
|
+
import { SINGLETON_ENTITY_ID } from '@woven-ecs/core';
|
|
39
|
+
import { SingletonSyncBehavior } from '@woven-ecs/canvas-store';
|
|
40
|
+
import { StringFieldBuilder } from '@woven-ecs/core';
|
|
41
|
+
import type { StringFieldDef } from '@woven-ecs/core';
|
|
42
|
+
import { SyncBehavior } from '@woven-ecs/canvas-store';
|
|
43
|
+
import { Synced } from '@woven-ecs/canvas-store';
|
|
44
|
+
import { System } from '@woven-ecs/core';
|
|
45
|
+
import { TupleFieldBuilder } from '@woven-ecs/core';
|
|
46
|
+
import { Vec2 } from '@woven-canvas/math';
|
|
47
|
+
import { z } from 'zod';
|
|
48
|
+
|
|
49
|
+
declare const Aabb: AabbDef;
|
|
50
|
+
export { Aabb }
|
|
51
|
+
export { Aabb as Aabb_alias_1 }
|
|
52
|
+
export { Aabb as Aabb_alias_2 }
|
|
53
|
+
|
|
54
|
+
declare class AabbDef extends CanvasComponentDef<typeof AabbSchema> {
|
|
55
|
+
constructor();
|
|
56
|
+
containsPoint(ctx: Context, entityId: EntityId, point: Vec2, inclusive?: boolean): boolean;
|
|
57
|
+
expandByPoint(ctx: Context, entityId: EntityId, point: Vec2): void;
|
|
58
|
+
expandByBlock(ctx: Context, entityId: EntityId, blockEntityId: EntityId): void;
|
|
59
|
+
expandByAabb(ctx: Context, entityId: EntityId, other: Aabb_2): void;
|
|
60
|
+
copyFrom(ctx: Context, entityId: EntityId, otherEntityId: EntityId): void;
|
|
61
|
+
setByPoints(ctx: Context, entityId: EntityId, points: Vec2[]): void;
|
|
62
|
+
getCenter(ctx: Context, entityId: EntityId): Vec2;
|
|
63
|
+
getWidth(ctx: Context, entityId: EntityId): number;
|
|
64
|
+
getHeight(ctx: Context, entityId: EntityId): number;
|
|
65
|
+
distanceToPoint(ctx: Context, entityId: EntityId, point: Vec2): number;
|
|
66
|
+
intersectsEntity(ctx: Context, entityIdA: EntityId, entityIdB: EntityId): boolean;
|
|
67
|
+
surroundsEntity(ctx: Context, entityIdA: EntityId, entityIdB: EntityId): boolean;
|
|
68
|
+
getCorners(ctx: Context, entityId: EntityId, out?: [Vec2, Vec2, Vec2, Vec2]): [Vec2, Vec2, Vec2, Vec2];
|
|
69
|
+
applyPadding(ctx: Context, entityId: EntityId, padding: number): void;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
declare const AabbSchema: {
|
|
73
|
+
value: TupleFieldBuilder<NumberFieldBuilder<"float32">, 4>;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export { addComponent }
|
|
77
|
+
|
|
78
|
+
declare function addPointerSample(pointer: ReturnType<typeof Pointer.write>, position: Vec2, time: number): void;
|
|
79
|
+
export { addPointerSample }
|
|
80
|
+
export { addPointerSample as addPointerSample_alias_1 }
|
|
81
|
+
|
|
82
|
+
export { AnyCanvasComponentDef }
|
|
83
|
+
|
|
84
|
+
export { AnyCanvasSingletonDef }
|
|
85
|
+
|
|
86
|
+
declare const Asset: CanvasComponentDef< {
|
|
87
|
+
identifier: StringFieldBuilder;
|
|
88
|
+
uploadState: EnumFieldBuilder<"pending" | "uploading" | "complete" | "failed">;
|
|
89
|
+
}, "asset">;
|
|
90
|
+
export { Asset }
|
|
91
|
+
export { Asset as Asset_alias_1 }
|
|
92
|
+
export { Asset as Asset_alias_2 }
|
|
93
|
+
|
|
94
|
+
declare function attachKeyboardListeners(domElement: HTMLElement): void;
|
|
95
|
+
export { attachKeyboardListeners }
|
|
96
|
+
export { attachKeyboardListeners as attachKeyboardListeners_alias_1 }
|
|
97
|
+
|
|
98
|
+
declare function attachMouseListeners(domElement: HTMLElement): void;
|
|
99
|
+
export { attachMouseListeners }
|
|
100
|
+
export { attachMouseListeners as attachMouseListeners_alias_1 }
|
|
101
|
+
|
|
102
|
+
declare function attachPointerListeners(domElement: HTMLElement): void;
|
|
103
|
+
export { attachPointerListeners }
|
|
104
|
+
export { attachPointerListeners as attachPointerListeners_alias_1 }
|
|
105
|
+
|
|
106
|
+
declare function attachScreenObserver(domElement: HTMLElement): void;
|
|
107
|
+
export { attachScreenObserver }
|
|
108
|
+
export { attachScreenObserver as attachScreenObserver_alias_1 }
|
|
109
|
+
|
|
110
|
+
declare const Block: BlockDef_2;
|
|
111
|
+
export { Block }
|
|
112
|
+
export { Block as Block_alias_1 }
|
|
113
|
+
export { Block as Block_alias_2 }
|
|
114
|
+
|
|
115
|
+
declare const BlockDef: z.ZodObject<{
|
|
116
|
+
tag: z.ZodString;
|
|
117
|
+
stratum: z.ZodDefault<z.ZodEnum<{
|
|
118
|
+
background: "background";
|
|
119
|
+
content: "content";
|
|
120
|
+
overlay: "overlay";
|
|
121
|
+
}>>;
|
|
122
|
+
editOptions: z.ZodDefault<z.ZodObject<{
|
|
123
|
+
canEdit: z.ZodDefault<z.ZodBoolean>;
|
|
124
|
+
removeWhenTextEmpty: z.ZodDefault<z.ZodBoolean>;
|
|
125
|
+
}, z.core.$strip>>;
|
|
126
|
+
components: z.ZodDefault<z.ZodArray<z.ZodCustom<AnyCanvasComponentDef, AnyCanvasComponentDef>>>;
|
|
127
|
+
resizeMode: z.ZodDefault<z.ZodEnum<{
|
|
128
|
+
scale: "scale";
|
|
129
|
+
text: "text";
|
|
130
|
+
free: "free";
|
|
131
|
+
groupOnly: "groupOnly";
|
|
132
|
+
}>>;
|
|
133
|
+
canRotate: z.ZodDefault<z.ZodBoolean>;
|
|
134
|
+
canScale: z.ZodDefault<z.ZodBoolean>;
|
|
135
|
+
connectors: z.ZodDefault<z.ZodObject<{
|
|
136
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
137
|
+
terminals: z.ZodDefault<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
|
|
138
|
+
}, z.core.$strip>>;
|
|
139
|
+
}, z.core.$strip>;
|
|
140
|
+
|
|
141
|
+
declare type BlockDef = z.infer<typeof BlockDef>;
|
|
142
|
+
export { BlockDef }
|
|
143
|
+
export { BlockDef as BlockDef_alias_1 }
|
|
144
|
+
|
|
145
|
+
declare class BlockDef_2 extends CanvasComponentDef<typeof BlockSchema> {
|
|
146
|
+
constructor();
|
|
147
|
+
getCenter(ctx: Context, entityId: EntityId, out?: Vec2): Vec2;
|
|
148
|
+
setCenter(ctx: Context, entityId: EntityId, center: Vec2): void;
|
|
149
|
+
getCorners(ctx: Context, entityId: EntityId, out?: [Vec2, Vec2, Vec2, Vec2]): [Vec2, Vec2, Vec2, Vec2];
|
|
150
|
+
containsPoint(ctx: Context, entityId: EntityId, point: Vec2): boolean;
|
|
151
|
+
translate(ctx: Context, entityId: EntityId, delta: Vec2): void;
|
|
152
|
+
setPosition(ctx: Context, entityId: EntityId, position: Vec2): void;
|
|
153
|
+
setSize(ctx: Context, entityId: EntityId, size: Vec2): void;
|
|
154
|
+
rotateBy(ctx: Context, entityId: EntityId, deltaAngle: number): void;
|
|
155
|
+
rotateAround(ctx: Context, entityId: EntityId, pivot: Vec2, angle: number): void;
|
|
156
|
+
scaleBy(ctx: Context, entityId: EntityId, scaleFactor: number): void;
|
|
157
|
+
scaleAround(ctx: Context, entityId: EntityId, pivot: Vec2, scaleFactor: number): void;
|
|
158
|
+
intersectsAabb(ctx: Context, entityId: EntityId, aabb: Aabb_2): boolean;
|
|
159
|
+
worldToUv(ctx: Context, entityId: EntityId, worldPos: Vec2): Vec2;
|
|
160
|
+
uvToWorld(ctx: Context, entityId: EntityId, uv: Vec2): Vec2;
|
|
161
|
+
getUvToWorldMatrix(ctx: Context, entityId: EntityId, out: Mat2): void;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
declare type BlockDefInput = z.input<typeof BlockDef>;
|
|
165
|
+
export { BlockDefInput }
|
|
166
|
+
export { BlockDefInput as BlockDefInput_alias_1 }
|
|
167
|
+
|
|
168
|
+
declare const BlockSchema: {
|
|
169
|
+
tag: StringFieldBuilder;
|
|
170
|
+
position: TupleFieldBuilder<NumberFieldBuilder<"float64">, 2>;
|
|
171
|
+
size: TupleFieldBuilder<NumberFieldBuilder<"float64">, 2>;
|
|
172
|
+
rotateZ: NumberFieldBuilder<"float64">;
|
|
173
|
+
flip: TupleFieldBuilder<BooleanFieldBuilder, 2>;
|
|
174
|
+
rank: StringFieldBuilder;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
declare const Camera: CameraDef;
|
|
178
|
+
export { Camera }
|
|
179
|
+
export { Camera as Camera_alias_1 }
|
|
180
|
+
export { Camera as Camera_alias_2 }
|
|
181
|
+
|
|
182
|
+
declare class CameraDef extends CanvasSingletonDef<typeof CameraSchema> {
|
|
183
|
+
constructor();
|
|
184
|
+
toWorld(ctx: Context, screenPos: Vec2): Vec2;
|
|
185
|
+
toScreen(ctx: Context, worldPos: Vec2): Vec2;
|
|
186
|
+
getWorldCenter(ctx: Context): Vec2;
|
|
187
|
+
getWorldBounds(ctx: Context): {
|
|
188
|
+
left: number;
|
|
189
|
+
top: number;
|
|
190
|
+
right: number;
|
|
191
|
+
bottom: number;
|
|
192
|
+
};
|
|
193
|
+
getAabb(ctx: Context, out?: Aabb_2): Aabb_2;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
declare const CameraSchema: {
|
|
197
|
+
top: NumberFieldBuilder<"float64">;
|
|
198
|
+
left: NumberFieldBuilder<"float64">;
|
|
199
|
+
zoom: NumberFieldBuilder<"float64">;
|
|
200
|
+
canSeeBlocks: BooleanFieldBuilder;
|
|
201
|
+
lastSeenBlock: RefFieldBuilder;
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
declare function canBlockEdit(ctx: Context, tag: string): boolean;
|
|
205
|
+
export { canBlockEdit }
|
|
206
|
+
export { canBlockEdit as canBlockEdit_alias_1 }
|
|
207
|
+
export { canBlockEdit as canBlockEdit_alias_2 }
|
|
208
|
+
|
|
209
|
+
declare function canBlockRotate(ctx: Context, tag: string): boolean;
|
|
210
|
+
export { canBlockRotate }
|
|
211
|
+
export { canBlockRotate as canBlockRotate_alias_1 }
|
|
212
|
+
|
|
213
|
+
declare function canBlockScale(ctx: Context, tag: string): boolean;
|
|
214
|
+
export { canBlockScale }
|
|
215
|
+
export { canBlockScale as canBlockScale_alias_1 }
|
|
216
|
+
|
|
217
|
+
declare const canSeeBlocksSystem: EditorSystem;
|
|
218
|
+
export { canSeeBlocksSystem }
|
|
219
|
+
export { canSeeBlocksSystem as canSeeBlocksSystem_alias_1 }
|
|
220
|
+
|
|
221
|
+
export { CanvasComponentDef }
|
|
222
|
+
|
|
223
|
+
export { CanvasSingletonDef }
|
|
224
|
+
|
|
225
|
+
export declare function cleanupCommands(ctx: Context): void;
|
|
226
|
+
|
|
227
|
+
declare function clearBits(buffer: {
|
|
228
|
+
[index: number]: number;
|
|
229
|
+
length: number;
|
|
230
|
+
}): void;
|
|
231
|
+
export { clearBits }
|
|
232
|
+
export { clearBits as clearBits_alias_1 }
|
|
233
|
+
|
|
234
|
+
declare function clearPointerTrackingState(ctx: Context): void;
|
|
235
|
+
export { clearPointerTrackingState }
|
|
236
|
+
export { clearPointerTrackingState as clearPointerTrackingState_alias_1 }
|
|
237
|
+
export { clearPointerTrackingState as clearPointerTrackingState_alias_2 }
|
|
238
|
+
|
|
239
|
+
declare const codeToIndex: Record<string, number>;
|
|
240
|
+
export { codeToIndex }
|
|
241
|
+
export { codeToIndex as codeToIndex_alias_1 }
|
|
242
|
+
|
|
243
|
+
declare const Color: ColorDef;
|
|
244
|
+
export { Color }
|
|
245
|
+
export { Color as Color_alias_1 }
|
|
246
|
+
export { Color as Color_alias_2 }
|
|
247
|
+
|
|
248
|
+
declare class ColorDef extends CanvasComponentDef<typeof ColorSchema> {
|
|
249
|
+
constructor();
|
|
250
|
+
toHex(ctx: Context, entityId: EntityId): string;
|
|
251
|
+
fromHex(ctx: Context, entityId: EntityId, hex: string): void;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
declare const ColorSchema: {
|
|
255
|
+
red: NumberFieldBuilder<"uint8">;
|
|
256
|
+
green: NumberFieldBuilder<"uint8">;
|
|
257
|
+
blue: NumberFieldBuilder<"uint8">;
|
|
258
|
+
alpha: NumberFieldBuilder<"uint8">;
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
declare interface CommandDef<T> {
|
|
262
|
+
readonly name: string;
|
|
263
|
+
spawn(ctx: Context, payload: T): EntityId;
|
|
264
|
+
iter(ctx: Context): IterableIterator<{
|
|
265
|
+
eid: EntityId;
|
|
266
|
+
payload: T;
|
|
267
|
+
}>;
|
|
268
|
+
didSpawnLastFrame(ctx: Context): boolean;
|
|
269
|
+
}
|
|
270
|
+
export { CommandDef }
|
|
271
|
+
export { CommandDef as CommandDef_alias_1 }
|
|
272
|
+
|
|
273
|
+
declare const CommandMarker: ComponentDef< {
|
|
274
|
+
name: StringFieldBuilder;
|
|
275
|
+
}>;
|
|
276
|
+
export { CommandMarker }
|
|
277
|
+
export { CommandMarker as CommandMarker_alias_1 }
|
|
278
|
+
|
|
279
|
+
export { ComponentDef }
|
|
280
|
+
|
|
281
|
+
export { ComponentSchema }
|
|
282
|
+
|
|
283
|
+
declare function computeAabb(ctx: Context, entityId: EntityId, out: Aabb_2): void;
|
|
284
|
+
export { computeAabb }
|
|
285
|
+
export { computeAabb as computeAabb_alias_1 }
|
|
286
|
+
|
|
287
|
+
declare const Connector: CanvasComponentDef< {
|
|
288
|
+
startBlock: RefFieldBuilder;
|
|
289
|
+
startBlockUv: TupleFieldBuilder<NumberFieldBuilder<"float64">, 2>;
|
|
290
|
+
startUv: TupleFieldBuilder<NumberFieldBuilder<"float64">, 2>;
|
|
291
|
+
endBlock: RefFieldBuilder;
|
|
292
|
+
endBlockUv: TupleFieldBuilder<NumberFieldBuilder<"float64">, 2>;
|
|
293
|
+
endUv: TupleFieldBuilder<NumberFieldBuilder<"float64">, 2>;
|
|
294
|
+
}, "connector">;
|
|
295
|
+
export { Connector }
|
|
296
|
+
export { Connector as Connector_alias_1 }
|
|
297
|
+
export { Connector as Connector_alias_2 }
|
|
298
|
+
|
|
299
|
+
export { Context }
|
|
300
|
+
export { Context as Context_alias_1 }
|
|
301
|
+
|
|
302
|
+
declare const Controls: ControlsDef;
|
|
303
|
+
export { Controls }
|
|
304
|
+
export { Controls as Controls_alias_1 }
|
|
305
|
+
export { Controls as Controls_alias_2 }
|
|
306
|
+
|
|
307
|
+
declare class ControlsDef extends CanvasSingletonDef<typeof ControlsSchema> {
|
|
308
|
+
constructor();
|
|
309
|
+
getButtons(ctx: Context, ...tools: string[]): PointerButton[];
|
|
310
|
+
wheelActive(ctx: Context, tool: string, modDown: boolean): boolean;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
declare const ControlsOptions: z.ZodObject<{
|
|
314
|
+
leftMouseTool: z.ZodDefault<z.ZodString>;
|
|
315
|
+
middleMouseTool: z.ZodDefault<z.ZodString>;
|
|
316
|
+
rightMouseTool: z.ZodDefault<z.ZodString>;
|
|
317
|
+
wheelTool: z.ZodDefault<z.ZodString>;
|
|
318
|
+
modWheelTool: z.ZodDefault<z.ZodString>;
|
|
319
|
+
}, z.core.$strip>;
|
|
320
|
+
|
|
321
|
+
declare type ControlsOptions = z.infer<typeof ControlsOptions>;
|
|
322
|
+
export { ControlsOptions }
|
|
323
|
+
export { ControlsOptions as ControlsOptions_alias_1 }
|
|
324
|
+
|
|
325
|
+
declare type ControlsOptionsInput = z.input<typeof ControlsOptions>;
|
|
326
|
+
export { ControlsOptionsInput }
|
|
327
|
+
export { ControlsOptionsInput as ControlsOptionsInput_alias_1 }
|
|
328
|
+
|
|
329
|
+
declare const ControlsSchema: {
|
|
330
|
+
leftMouseTool: StringFieldBuilder;
|
|
331
|
+
middleMouseTool: StringFieldBuilder;
|
|
332
|
+
rightMouseTool: StringFieldBuilder;
|
|
333
|
+
wheelTool: StringFieldBuilder;
|
|
334
|
+
modWheelTool: StringFieldBuilder;
|
|
335
|
+
heldSnapshot: StringFieldBuilder;
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
declare const CorePlugin: EditorPlugin;
|
|
339
|
+
export { CorePlugin }
|
|
340
|
+
export { CorePlugin as CorePlugin_alias_1 }
|
|
341
|
+
|
|
342
|
+
export { createEntity }
|
|
343
|
+
|
|
344
|
+
declare const Cursor: CursorDef_2;
|
|
345
|
+
export { Cursor }
|
|
346
|
+
export { Cursor as Cursor_alias_1 }
|
|
347
|
+
export { Cursor as Cursor_alias_2 }
|
|
348
|
+
|
|
349
|
+
declare const CursorDef: z.ZodObject<{
|
|
350
|
+
makeSvg: z.ZodFunction<z.ZodTuple<[z.ZodNumber], null>, z.ZodString>;
|
|
351
|
+
hotspot: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
352
|
+
rotationOffset: z.ZodNumber;
|
|
353
|
+
}, z.core.$strip>;
|
|
354
|
+
|
|
355
|
+
declare type CursorDef = z.infer<typeof CursorDef>;
|
|
356
|
+
export { CursorDef }
|
|
357
|
+
export { CursorDef as CursorDef_alias_1 }
|
|
358
|
+
|
|
359
|
+
declare class CursorDef_2 extends CanvasSingletonDef<typeof CursorSchema> {
|
|
360
|
+
constructor();
|
|
361
|
+
getEffective(ctx: Context): {
|
|
362
|
+
cursorKind: string;
|
|
363
|
+
rotation: number;
|
|
364
|
+
};
|
|
365
|
+
setCursor(ctx: Context, cursorKind: string, rotation?: number): void;
|
|
366
|
+
setContextCursor(ctx: Context, cursorKind: string, rotation?: number): void;
|
|
367
|
+
clearContextCursor(ctx: Context): void;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
declare type CursorDefMap = Partial<Record<string, CursorDef>>;
|
|
371
|
+
export { CursorDefMap }
|
|
372
|
+
export { CursorDefMap as CursorDefMap_alias_1 }
|
|
373
|
+
|
|
374
|
+
declare const CursorSchema: {
|
|
375
|
+
cursorKind: StringFieldBuilder;
|
|
376
|
+
rotation: NumberFieldBuilder<"float64">;
|
|
377
|
+
contextCursorKind: StringFieldBuilder;
|
|
378
|
+
contextRotation: NumberFieldBuilder<"float64">;
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
declare const cursorSystem: EditorSystem;
|
|
382
|
+
export { cursorSystem }
|
|
383
|
+
export { cursorSystem as cursorSystem_alias_1 }
|
|
384
|
+
|
|
385
|
+
export declare const DEFAULT_PRIORITY = 0;
|
|
386
|
+
|
|
387
|
+
export { defineCanvasComponent }
|
|
388
|
+
|
|
389
|
+
export { defineCanvasSingleton }
|
|
390
|
+
|
|
391
|
+
declare function defineCommand<T = void>(name: string): CommandDef<T>;
|
|
392
|
+
export { defineCommand }
|
|
393
|
+
export { defineCommand as defineCommand_alias_1 }
|
|
394
|
+
|
|
395
|
+
declare function defineEditorState<T extends StateSchema>(name: string, schema: T): EditorStateDef<T>;
|
|
396
|
+
export { defineEditorState }
|
|
397
|
+
export { defineEditorState as defineEditorState_alias_1 }
|
|
398
|
+
|
|
399
|
+
declare function defineEditorSystem(options: EditorSystemOptions, execute: EditorSystemFunction): EditorSystem;
|
|
400
|
+
export { defineEditorSystem }
|
|
401
|
+
export { defineEditorSystem as defineEditorSystem_alias_1 }
|
|
402
|
+
|
|
403
|
+
export { defineQuery }
|
|
404
|
+
|
|
405
|
+
export { defineSystem }
|
|
406
|
+
|
|
407
|
+
declare function detachKeyboardListeners(domElement: HTMLElement): void;
|
|
408
|
+
export { detachKeyboardListeners }
|
|
409
|
+
export { detachKeyboardListeners as detachKeyboardListeners_alias_1 }
|
|
410
|
+
|
|
411
|
+
declare function detachMouseListeners(domElement: HTMLElement): void;
|
|
412
|
+
export { detachMouseListeners }
|
|
413
|
+
export { detachMouseListeners as detachMouseListeners_alias_1 }
|
|
414
|
+
|
|
415
|
+
declare function detachPointerListeners(domElement: HTMLElement): void;
|
|
416
|
+
export { detachPointerListeners }
|
|
417
|
+
export { detachPointerListeners as detachPointerListeners_alias_1 }
|
|
418
|
+
|
|
419
|
+
declare function detachScreenObserver(domElement: HTMLElement): void;
|
|
420
|
+
export { detachScreenObserver }
|
|
421
|
+
export { detachScreenObserver as detachScreenObserver_alias_1 }
|
|
422
|
+
|
|
423
|
+
declare const Edited: CanvasComponentDef< {}, "edited">;
|
|
424
|
+
export { Edited }
|
|
425
|
+
export { Edited as Edited_alias_1 }
|
|
426
|
+
export { Edited as Edited_alias_2 }
|
|
427
|
+
|
|
428
|
+
declare class Editor {
|
|
429
|
+
cursors: Record<string, CursorDef>;
|
|
430
|
+
keybinds: Keybind[];
|
|
431
|
+
blockDefs: Record<string, BlockDef>;
|
|
432
|
+
fonts: FontFamily[];
|
|
433
|
+
components: AnyCanvasComponentDef[];
|
|
434
|
+
singletons: AnyCanvasSingletonDef[];
|
|
435
|
+
private world;
|
|
436
|
+
private systemBatches;
|
|
437
|
+
private plugins;
|
|
438
|
+
private fontLoader;
|
|
439
|
+
private userData;
|
|
440
|
+
private gridOptions;
|
|
441
|
+
private controlsOptions;
|
|
442
|
+
constructor(domElement: HTMLElement, optionsInput?: EditorOptionsInput);
|
|
443
|
+
private get ctx();
|
|
444
|
+
initialize(): Promise<void>;
|
|
445
|
+
tick(): Promise<void>;
|
|
446
|
+
nextTick(callback: (ctx: Context) => void): () => void;
|
|
447
|
+
command<T>(def: CommandDef<T>, ...args: T extends void ? [] : [T]): void;
|
|
448
|
+
subscribe(query: QueryDef, callback: QueryCallback): () => void;
|
|
449
|
+
_getContext(): Context;
|
|
450
|
+
dispose(): void;
|
|
451
|
+
}
|
|
452
|
+
export { Editor }
|
|
453
|
+
export { Editor as Editor_alias_1 }
|
|
454
|
+
|
|
455
|
+
export declare type EditorOptions = z.infer<typeof EditorOptionsSchema>;
|
|
456
|
+
|
|
457
|
+
declare type EditorOptionsInput = z.input<typeof EditorOptionsSchema>;
|
|
458
|
+
export { EditorOptionsInput }
|
|
459
|
+
export { EditorOptionsInput as EditorOptionsInput_alias_1 }
|
|
460
|
+
|
|
461
|
+
export declare const EditorOptionsSchema: z.ZodObject<{
|
|
462
|
+
plugins: z.ZodDefault<z.ZodArray<z.ZodCustom<EditorPluginInput, EditorPluginInput>>>;
|
|
463
|
+
maxEntities: z.ZodDefault<z.ZodNumber>;
|
|
464
|
+
user: z.ZodDefault<z.ZodCustom<{
|
|
465
|
+
userId?: string | undefined;
|
|
466
|
+
sessionId?: string | undefined;
|
|
467
|
+
color?: string | undefined;
|
|
468
|
+
name?: string | undefined;
|
|
469
|
+
avatar?: string | undefined;
|
|
470
|
+
}, {
|
|
471
|
+
userId?: string | undefined;
|
|
472
|
+
sessionId?: string | undefined;
|
|
473
|
+
color?: string | undefined;
|
|
474
|
+
name?: string | undefined;
|
|
475
|
+
avatar?: string | undefined;
|
|
476
|
+
}>>;
|
|
477
|
+
grid: z.ZodDefault<z.ZodCustom<{
|
|
478
|
+
enabled?: boolean | undefined;
|
|
479
|
+
strict?: boolean | undefined;
|
|
480
|
+
colWidth?: number | undefined;
|
|
481
|
+
rowHeight?: number | undefined;
|
|
482
|
+
snapAngleRad?: number | undefined;
|
|
483
|
+
shiftSnapAngleRad?: number | undefined;
|
|
484
|
+
}, {
|
|
485
|
+
enabled?: boolean | undefined;
|
|
486
|
+
strict?: boolean | undefined;
|
|
487
|
+
colWidth?: number | undefined;
|
|
488
|
+
rowHeight?: number | undefined;
|
|
489
|
+
snapAngleRad?: number | undefined;
|
|
490
|
+
shiftSnapAngleRad?: number | undefined;
|
|
491
|
+
}>>;
|
|
492
|
+
blockDefs: z.ZodDefault<z.ZodArray<z.ZodCustom<{
|
|
493
|
+
tag: string;
|
|
494
|
+
stratum?: "background" | "content" | "overlay" | undefined;
|
|
495
|
+
editOptions?: {
|
|
496
|
+
canEdit?: boolean | undefined;
|
|
497
|
+
removeWhenTextEmpty?: boolean | undefined;
|
|
498
|
+
} | undefined;
|
|
499
|
+
components?: AnyCanvasComponentDef[] | undefined;
|
|
500
|
+
resizeMode?: "scale" | "text" | "free" | "groupOnly" | undefined;
|
|
501
|
+
canRotate?: boolean | undefined;
|
|
502
|
+
canScale?: boolean | undefined;
|
|
503
|
+
connectors?: {
|
|
504
|
+
enabled?: boolean | undefined;
|
|
505
|
+
terminals?: [number, number][] | undefined;
|
|
506
|
+
} | undefined;
|
|
507
|
+
}, {
|
|
508
|
+
tag: string;
|
|
509
|
+
stratum?: "background" | "content" | "overlay" | undefined;
|
|
510
|
+
editOptions?: {
|
|
511
|
+
canEdit?: boolean | undefined;
|
|
512
|
+
removeWhenTextEmpty?: boolean | undefined;
|
|
513
|
+
} | undefined;
|
|
514
|
+
components?: AnyCanvasComponentDef[] | undefined;
|
|
515
|
+
resizeMode?: "scale" | "text" | "free" | "groupOnly" | undefined;
|
|
516
|
+
canRotate?: boolean | undefined;
|
|
517
|
+
canScale?: boolean | undefined;
|
|
518
|
+
connectors?: {
|
|
519
|
+
enabled?: boolean | undefined;
|
|
520
|
+
terminals?: [number, number][] | undefined;
|
|
521
|
+
} | undefined;
|
|
522
|
+
}>>>;
|
|
523
|
+
keybinds: z.ZodDefault<z.ZodArray<z.ZodCustom<{
|
|
524
|
+
command: string;
|
|
525
|
+
key: number;
|
|
526
|
+
mod?: boolean | undefined;
|
|
527
|
+
shift?: boolean | undefined;
|
|
528
|
+
}, {
|
|
529
|
+
command: string;
|
|
530
|
+
key: number;
|
|
531
|
+
mod?: boolean | undefined;
|
|
532
|
+
shift?: boolean | undefined;
|
|
533
|
+
}>>>;
|
|
534
|
+
cursors: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodCustom<{
|
|
535
|
+
makeSvg: z.core.$InferOuterFunctionType<z.ZodTuple<[z.ZodNumber], null>, z.ZodString>;
|
|
536
|
+
hotspot: [number, number];
|
|
537
|
+
rotationOffset: number;
|
|
538
|
+
}, {
|
|
539
|
+
makeSvg: z.core.$InferOuterFunctionType<z.ZodTuple<[z.ZodNumber], null>, z.ZodString>;
|
|
540
|
+
hotspot: [number, number];
|
|
541
|
+
rotationOffset: number;
|
|
542
|
+
}>>>;
|
|
543
|
+
components: z.ZodDefault<z.ZodArray<z.ZodCustom<AnyCanvasComponentDef, AnyCanvasComponentDef>>>;
|
|
544
|
+
singletons: z.ZodDefault<z.ZodArray<z.ZodCustom<AnyCanvasSingletonDef, AnyCanvasSingletonDef>>>;
|
|
545
|
+
systems: z.ZodDefault<z.ZodArray<z.ZodCustom<EditorSystem, EditorSystem>>>;
|
|
546
|
+
fonts: z.ZodDefault<z.ZodArray<z.ZodCustom<{
|
|
547
|
+
name: string;
|
|
548
|
+
displayName: string;
|
|
549
|
+
url: string;
|
|
550
|
+
previewImage?: string | undefined;
|
|
551
|
+
selectable?: boolean | undefined;
|
|
552
|
+
weights?: number[] | undefined;
|
|
553
|
+
italics?: boolean | undefined;
|
|
554
|
+
}, {
|
|
555
|
+
name: string;
|
|
556
|
+
displayName: string;
|
|
557
|
+
url: string;
|
|
558
|
+
previewImage?: string | undefined;
|
|
559
|
+
selectable?: boolean | undefined;
|
|
560
|
+
weights?: number[] | undefined;
|
|
561
|
+
italics?: boolean | undefined;
|
|
562
|
+
}>>>;
|
|
563
|
+
omitPluginKeybinds: z.ZodDefault<z.ZodBoolean>;
|
|
564
|
+
omitPluginCursors: z.ZodDefault<z.ZodBoolean>;
|
|
565
|
+
omitPluginFonts: z.ZodDefault<z.ZodBoolean>;
|
|
566
|
+
controls: z.ZodOptional<z.ZodCustom<{
|
|
567
|
+
leftMouseTool?: string | undefined;
|
|
568
|
+
middleMouseTool?: string | undefined;
|
|
569
|
+
rightMouseTool?: string | undefined;
|
|
570
|
+
wheelTool?: string | undefined;
|
|
571
|
+
modWheelTool?: string | undefined;
|
|
572
|
+
}, {
|
|
573
|
+
leftMouseTool?: string | undefined;
|
|
574
|
+
middleMouseTool?: string | undefined;
|
|
575
|
+
rightMouseTool?: string | undefined;
|
|
576
|
+
wheelTool?: string | undefined;
|
|
577
|
+
modWheelTool?: string | undefined;
|
|
578
|
+
}>>;
|
|
579
|
+
}, z.core.$strip>;
|
|
580
|
+
|
|
581
|
+
declare interface EditorPlugin<TResources = unknown> {
|
|
582
|
+
name: string;
|
|
583
|
+
keybinds?: Keybind[];
|
|
584
|
+
blockDefs?: BlockDefInput[];
|
|
585
|
+
cursors?: Record<string, CursorDef>;
|
|
586
|
+
fonts?: FontFamilyInput[];
|
|
587
|
+
resources?: TResources;
|
|
588
|
+
dependencies?: string[];
|
|
589
|
+
components?: AnyCanvasComponentDef[];
|
|
590
|
+
singletons?: AnyCanvasSingletonDef[];
|
|
591
|
+
systems?: EditorSystem[];
|
|
592
|
+
setup?: (ctx: Context) => void | Promise<void>;
|
|
593
|
+
teardown?: (ctx: Context) => void;
|
|
594
|
+
}
|
|
595
|
+
export { EditorPlugin }
|
|
596
|
+
export { EditorPlugin as EditorPlugin_alias_1 }
|
|
597
|
+
|
|
598
|
+
declare type EditorPluginFactory<TOptions = unknown, TResources = unknown> = (options: TOptions) => EditorPlugin<TResources>;
|
|
599
|
+
export { EditorPluginFactory }
|
|
600
|
+
export { EditorPluginFactory as EditorPluginFactory_alias_1 }
|
|
601
|
+
|
|
602
|
+
declare type EditorPluginInput = EditorPlugin | EditorPluginFactory<any, any>;
|
|
603
|
+
export { EditorPluginInput }
|
|
604
|
+
export { EditorPluginInput as EditorPluginInput_alias_1 }
|
|
605
|
+
|
|
606
|
+
declare interface EditorResources {
|
|
607
|
+
domElement: HTMLElement;
|
|
608
|
+
editor: Editor;
|
|
609
|
+
userId: string;
|
|
610
|
+
sessionId: string;
|
|
611
|
+
pluginResources: Record<string, unknown>;
|
|
612
|
+
componentsByName: Map<string, AnyCanvasComponentDef>;
|
|
613
|
+
singletonsByName: Map<string, AnyCanvasSingletonDef>;
|
|
614
|
+
componentsById: Map<number, AnyCanvasComponentDef>;
|
|
615
|
+
singletonsById: Map<number, AnyCanvasSingletonDef>;
|
|
616
|
+
}
|
|
617
|
+
export { EditorResources }
|
|
618
|
+
export { EditorResources as EditorResources_alias_1 }
|
|
619
|
+
|
|
620
|
+
declare class EditorStateDef<T extends StateSchema> extends CanvasSingletonDef<T> {
|
|
621
|
+
constructor(name: string, schema: T);
|
|
622
|
+
getState(ctx: Context): string;
|
|
623
|
+
getContext<TContext extends object = InferMachineContext<T>>(ctx: Context): TContext;
|
|
624
|
+
run<TState extends string, TContext extends object = InferMachineContext<T>, TEvent extends {
|
|
625
|
+
type: string;
|
|
626
|
+
} = {
|
|
627
|
+
type: string;
|
|
628
|
+
}>(ctx: Context, machine: AnyStateMachine, events: TEvent[]): {
|
|
629
|
+
value: TState;
|
|
630
|
+
context: TContext;
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
export { EditorStateDef }
|
|
634
|
+
export { EditorStateDef as EditorStateDef_alias_1 }
|
|
635
|
+
|
|
636
|
+
declare interface EditorSystem {
|
|
637
|
+
readonly _system: MainThreadSystem;
|
|
638
|
+
readonly phase: SystemPhase;
|
|
639
|
+
readonly priority: number;
|
|
640
|
+
}
|
|
641
|
+
export { EditorSystem }
|
|
642
|
+
export { EditorSystem as EditorSystem_alias_1 }
|
|
643
|
+
|
|
644
|
+
declare type EditorSystemFunction = (ctx: Context) => void;
|
|
645
|
+
export { EditorSystemFunction }
|
|
646
|
+
export { EditorSystemFunction as EditorSystemFunction_alias_1 }
|
|
647
|
+
|
|
648
|
+
declare interface EditorSystemOptions {
|
|
649
|
+
phase: SystemPhase;
|
|
650
|
+
priority?: number;
|
|
651
|
+
}
|
|
652
|
+
export { EditorSystemOptions }
|
|
653
|
+
export { EditorSystemOptions as EditorSystemOptions_alias_1 }
|
|
654
|
+
|
|
655
|
+
export { EntityId }
|
|
656
|
+
export { EntityId as EntityId_alias_1 }
|
|
657
|
+
|
|
658
|
+
export { EventType }
|
|
659
|
+
|
|
660
|
+
export { field }
|
|
661
|
+
|
|
662
|
+
declare const FontFamily: z.ZodObject<{
|
|
663
|
+
name: z.ZodString;
|
|
664
|
+
displayName: z.ZodString;
|
|
665
|
+
url: z.ZodString;
|
|
666
|
+
previewImage: z.ZodOptional<z.ZodString>;
|
|
667
|
+
selectable: z.ZodDefault<z.ZodBoolean>;
|
|
668
|
+
weights: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
|
|
669
|
+
italics: z.ZodDefault<z.ZodBoolean>;
|
|
670
|
+
}, z.core.$strip>;
|
|
671
|
+
|
|
672
|
+
declare type FontFamily = z.infer<typeof FontFamily>;
|
|
673
|
+
export { FontFamily }
|
|
674
|
+
export { FontFamily as FontFamilyType }
|
|
675
|
+
export { FontFamily as FontFamily_alias_1 }
|
|
676
|
+
|
|
677
|
+
declare type FontFamilyInput = z.input<typeof FontFamily>;
|
|
678
|
+
export { FontFamilyInput }
|
|
679
|
+
export { FontFamilyInput as FontFamilyInput_alias_1 }
|
|
680
|
+
|
|
681
|
+
declare class FontLoader {
|
|
682
|
+
private loadedFonts;
|
|
683
|
+
loadFonts(families: FontFamily[]): Promise<void>;
|
|
684
|
+
private buildGoogleFontsUrl;
|
|
685
|
+
private loadSingleFont;
|
|
686
|
+
private getFontLoadPromises;
|
|
687
|
+
isLoaded(fontName: string): boolean;
|
|
688
|
+
getLoadedFonts(): ReadonlySet<string>;
|
|
689
|
+
}
|
|
690
|
+
export { FontLoader }
|
|
691
|
+
export { FontLoader as FontLoader_alias_1 }
|
|
692
|
+
|
|
693
|
+
declare const Frame: CanvasSingletonDef< {
|
|
694
|
+
number: NumberFieldBuilder<"uint32">;
|
|
695
|
+
delta: NumberFieldBuilder<"float64">;
|
|
696
|
+
time: NumberFieldBuilder<"float64">;
|
|
697
|
+
lastTime: NumberFieldBuilder<"float64">;
|
|
698
|
+
}, "frame">;
|
|
699
|
+
export { Frame }
|
|
700
|
+
export { Frame as Frame_alias_1 }
|
|
701
|
+
export { Frame as Frame_alias_2 }
|
|
702
|
+
|
|
703
|
+
declare interface FrameInput {
|
|
704
|
+
type: 'frame';
|
|
705
|
+
ctx: Context;
|
|
706
|
+
delta: number;
|
|
707
|
+
frameNumber: number;
|
|
708
|
+
time: number;
|
|
709
|
+
}
|
|
710
|
+
export { FrameInput }
|
|
711
|
+
export { FrameInput as FrameInput_alias_1 }
|
|
712
|
+
export { FrameInput as FrameInput_alias_2 }
|
|
713
|
+
|
|
714
|
+
declare const frameSystem: EditorSystem;
|
|
715
|
+
export { frameSystem }
|
|
716
|
+
export { frameSystem as frameSystem_alias_1 }
|
|
717
|
+
|
|
718
|
+
export { getBackrefs }
|
|
719
|
+
|
|
720
|
+
declare function getBlockDef(ctx: Context, tag: string): BlockDef;
|
|
721
|
+
export { getBlockDef }
|
|
722
|
+
export { getBlockDef as getBlockDef_alias_1 }
|
|
723
|
+
export { getBlockDef as getBlockDef_alias_2 }
|
|
724
|
+
|
|
725
|
+
declare function getBlockDefs(ctx: Context): Record<string, BlockDef>;
|
|
726
|
+
export { getBlockDefs }
|
|
727
|
+
export { getBlockDefs as getBlockDefs_alias_1 }
|
|
728
|
+
|
|
729
|
+
export declare function getCursorSvg(cursors: Record<string, CursorDef>, kind: string, rotateZ: number): string;
|
|
730
|
+
|
|
731
|
+
declare function getFrameInput(ctx: Context): FrameInput;
|
|
732
|
+
export { getFrameInput }
|
|
733
|
+
export { getFrameInput as getFrameInput_alias_1 }
|
|
734
|
+
export { getFrameInput as getFrameInput_alias_2 }
|
|
735
|
+
|
|
736
|
+
declare function getKeyboardInput(ctx: Context, keys: number[]): KeyboardInput[];
|
|
737
|
+
export { getKeyboardInput }
|
|
738
|
+
export { getKeyboardInput as getKeyboardInput_alias_1 }
|
|
739
|
+
export { getKeyboardInput as getKeyboardInput_alias_2 }
|
|
740
|
+
|
|
741
|
+
declare function getMouseInput(ctx: Context): MouseInput[];
|
|
742
|
+
export { getMouseInput }
|
|
743
|
+
export { getMouseInput as getMouseInput_alias_1 }
|
|
744
|
+
export { getMouseInput as getMouseInput_alias_2 }
|
|
745
|
+
|
|
746
|
+
declare function getMyUserEntityId(ctx: Context): EntityId | null;
|
|
747
|
+
export { getMyUserEntityId }
|
|
748
|
+
export { getMyUserEntityId as getMyUserEntityId_alias_1 }
|
|
749
|
+
|
|
750
|
+
declare function getPluginResources<T>(ctx: Context, pluginName: string): T;
|
|
751
|
+
export { getPluginResources }
|
|
752
|
+
export { getPluginResources as getPluginResources_alias_1 }
|
|
753
|
+
|
|
754
|
+
declare function getPointerInput(ctx: Context, buttons: PointerButton[], options?: PointerInputOptions): PointerInput[];
|
|
755
|
+
export { getPointerInput }
|
|
756
|
+
export { getPointerInput as getPointerInput_alias_1 }
|
|
757
|
+
export { getPointerInput as getPointerInput_alias_2 }
|
|
758
|
+
|
|
759
|
+
export { getResources }
|
|
760
|
+
|
|
761
|
+
declare function getTopmostBlockAtPoint(ctx: Context, point: Vec2): EntityId | undefined;
|
|
762
|
+
export { getTopmostBlockAtPoint }
|
|
763
|
+
export { getTopmostBlockAtPoint as getTopmostBlockAtPoint_alias_1 }
|
|
764
|
+
export { getTopmostBlockAtPoint as getTopmostBlockAtPoint_alias_2 }
|
|
765
|
+
|
|
766
|
+
declare const Grid: GridDef;
|
|
767
|
+
export { Grid }
|
|
768
|
+
export { Grid as Grid_alias_1 }
|
|
769
|
+
export { Grid as Grid_alias_2 }
|
|
770
|
+
|
|
771
|
+
declare class GridDef extends CanvasSingletonDef<typeof GridSchema> {
|
|
772
|
+
constructor();
|
|
773
|
+
snapPosition(ctx: Context, position: Vec2): void;
|
|
774
|
+
snapSize(ctx: Context, size: Vec2): void;
|
|
775
|
+
snapX(ctx: Context, value: number): number;
|
|
776
|
+
snapY(ctx: Context, value: number): number;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
declare const GridOptions: z.ZodObject<{
|
|
780
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
781
|
+
strict: z.ZodDefault<z.ZodBoolean>;
|
|
782
|
+
colWidth: z.ZodDefault<z.ZodNumber>;
|
|
783
|
+
rowHeight: z.ZodDefault<z.ZodNumber>;
|
|
784
|
+
snapAngleRad: z.ZodDefault<z.ZodNumber>;
|
|
785
|
+
shiftSnapAngleRad: z.ZodDefault<z.ZodNumber>;
|
|
786
|
+
}, z.core.$strip>;
|
|
787
|
+
|
|
788
|
+
declare type GridOptions = z.infer<typeof GridOptions>;
|
|
789
|
+
export { GridOptions }
|
|
790
|
+
export { GridOptions as GridOptions_alias_1 }
|
|
791
|
+
|
|
792
|
+
declare type GridOptionsInput = z.input<typeof GridOptions>;
|
|
793
|
+
export { GridOptionsInput }
|
|
794
|
+
export { GridOptionsInput as GridOptionsInput_alias_1 }
|
|
795
|
+
|
|
796
|
+
declare const GridSchema: {
|
|
797
|
+
enabled: BooleanFieldBuilder;
|
|
798
|
+
strict: BooleanFieldBuilder;
|
|
799
|
+
colWidth: NumberFieldBuilder<"float64">;
|
|
800
|
+
rowHeight: NumberFieldBuilder<"float64">;
|
|
801
|
+
snapAngleRad: NumberFieldBuilder<"float64">;
|
|
802
|
+
shiftSnapAngleRad: NumberFieldBuilder<"float64">;
|
|
803
|
+
};
|
|
804
|
+
|
|
805
|
+
export { hasComponent }
|
|
806
|
+
|
|
807
|
+
declare const Held: CanvasComponentDef< {
|
|
808
|
+
sessionId: StringFieldBuilder;
|
|
809
|
+
}, "held">;
|
|
810
|
+
export { Held }
|
|
811
|
+
export { Held as Held_alias_1 }
|
|
812
|
+
export { Held as Held_alias_2 }
|
|
813
|
+
|
|
814
|
+
declare const HitGeometry: HitGeometryDef;
|
|
815
|
+
export { HitGeometry }
|
|
816
|
+
export { HitGeometry as HitGeometry_alias_1 }
|
|
817
|
+
export { HitGeometry as HitGeometry_alias_2 }
|
|
818
|
+
|
|
819
|
+
declare class HitGeometryDef extends CanvasComponentDef<typeof HitGeometrySchema> {
|
|
820
|
+
constructor();
|
|
821
|
+
getCapsuleAt(ctx: Context, entityId: EntityId, index: number): Capsule;
|
|
822
|
+
setCapsuleAt(ctx: Context, entityId: EntityId, index: number, capsule: Capsule): void;
|
|
823
|
+
getArcAt(ctx: Context, entityId: EntityId, index: number): Arc;
|
|
824
|
+
setArcAt(ctx: Context, entityId: EntityId, index: number, arc: Arc): void;
|
|
825
|
+
containsPointWorld(ctx: Context, entityId: EntityId, point: Vec2): boolean;
|
|
826
|
+
intersectsAabbWorld(ctx: Context, entityId: EntityId, aabb: Aabb_2): boolean;
|
|
827
|
+
getExtremaWorld(ctx: Context, entityId: EntityId): Vec2[];
|
|
828
|
+
addCapsule(ctx: Context, entityId: EntityId, capsule: Capsule): void;
|
|
829
|
+
addCapsuleUv(ctx: Context, entityId: EntityId, uvA: Vec2, uvB: Vec2, worldRadius: number): void;
|
|
830
|
+
addCapsuleWorld(ctx: Context, entityId: EntityId, worldA: Vec2, worldB: Vec2, worldRadius: number): void;
|
|
831
|
+
addArc(ctx: Context, entityId: EntityId, arc: Arc): void;
|
|
832
|
+
addArcUv(ctx: Context, entityId: EntityId, uvA: Vec2, uvB: Vec2, uvC: Vec2, worldThickness: number): void;
|
|
833
|
+
addArcWorld(ctx: Context, entityId: EntityId, worldA: Vec2, worldB: Vec2, worldC: Vec2, worldThickness: number): void;
|
|
834
|
+
clear(ctx: Context, entityId: EntityId): void;
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
declare const HitGeometrySchema: {
|
|
838
|
+
hitCapsules: BufferFieldBuilder<"float32">;
|
|
839
|
+
capsuleCount: NumberFieldBuilder<"uint16">;
|
|
840
|
+
hitArcs: BufferFieldBuilder<"float32">;
|
|
841
|
+
arcCount: NumberFieldBuilder<"uint16">;
|
|
842
|
+
};
|
|
843
|
+
|
|
844
|
+
declare const Hovered: CanvasComponentDef< {}, "hovered">;
|
|
845
|
+
export { Hovered }
|
|
846
|
+
export { Hovered as Hovered_alias_1 }
|
|
847
|
+
export { Hovered as Hovered_alias_2 }
|
|
848
|
+
|
|
849
|
+
declare const Image_2: CanvasComponentDef< {
|
|
850
|
+
width: NumberFieldBuilder<"uint16">;
|
|
851
|
+
height: NumberFieldBuilder<"uint16">;
|
|
852
|
+
alt: StringFieldBuilder;
|
|
853
|
+
}, "image">;
|
|
854
|
+
export { Image_2 as Image }
|
|
855
|
+
export { Image_2 as Image_alias_1 }
|
|
856
|
+
export { Image_2 as Image_alias_2 }
|
|
857
|
+
|
|
858
|
+
export { InferCanvasComponentType }
|
|
859
|
+
|
|
860
|
+
declare type InferMachineContext<T extends StateSchema> = Omit<InferCanvasComponentType<T>, 'state'>;
|
|
861
|
+
|
|
862
|
+
declare type InferStateContext<T> = T extends EditorStateDef<infer S> ? Omit<InferMachineContext<S>, '_exists' | '_version'> : never;
|
|
863
|
+
export { InferStateContext }
|
|
864
|
+
export { InferStateContext as InferStateContext_alias_1 }
|
|
865
|
+
|
|
866
|
+
declare const Intersect: IntersectDef;
|
|
867
|
+
export { Intersect }
|
|
868
|
+
export { Intersect as Intersect_alias_1 }
|
|
869
|
+
export { Intersect as Intersect_alias_2 }
|
|
870
|
+
|
|
871
|
+
declare function intersectAabb(ctx: Context, bounds: Aabb_2, entityIds?: Iterable<EntityId>): EntityId[];
|
|
872
|
+
export { intersectAabb }
|
|
873
|
+
export { intersectAabb as intersectAabb_alias_1 }
|
|
874
|
+
export { intersectAabb as intersectAabb_alias_2 }
|
|
875
|
+
|
|
876
|
+
declare function intersectCapsule(ctx: Context, capsule: Capsule, entityIds: Iterable<EntityId>): EntityId[];
|
|
877
|
+
export { intersectCapsule }
|
|
878
|
+
export { intersectCapsule as intersectCapsule_alias_1 }
|
|
879
|
+
export { intersectCapsule as intersectCapsule_alias_2 }
|
|
880
|
+
|
|
881
|
+
declare class IntersectDef extends CanvasSingletonDef<typeof IntersectSchema> {
|
|
882
|
+
constructor();
|
|
883
|
+
getTop(ctx: Context): EntityId | null;
|
|
884
|
+
getAll(ctx: Context): EntityId[];
|
|
885
|
+
setAll(ctx: Context, entities: EntityId[]): void;
|
|
886
|
+
clear(ctx: Context): void;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
declare function intersectPoint(ctx: Context, point: Vec2, entityIds?: Iterable<EntityId>): EntityId[];
|
|
890
|
+
export { intersectPoint }
|
|
891
|
+
export { intersectPoint as intersectPoint_alias_1 }
|
|
892
|
+
export { intersectPoint as intersectPoint_alias_2 }
|
|
893
|
+
|
|
894
|
+
declare const IntersectSchema: {
|
|
895
|
+
entity1: RefFieldBuilder;
|
|
896
|
+
entity2: RefFieldBuilder;
|
|
897
|
+
entity3: RefFieldBuilder;
|
|
898
|
+
entity4: RefFieldBuilder;
|
|
899
|
+
entity5: RefFieldBuilder;
|
|
900
|
+
};
|
|
901
|
+
|
|
902
|
+
declare const intersectSystem: EditorSystem;
|
|
903
|
+
export { intersectSystem }
|
|
904
|
+
export { intersectSystem as intersectSystem_alias_1 }
|
|
905
|
+
|
|
906
|
+
export { isAlive }
|
|
907
|
+
|
|
908
|
+
declare function isHeldByRemote(ctx: Context, entityId: EntityId): boolean;
|
|
909
|
+
export { isHeldByRemote }
|
|
910
|
+
export { isHeldByRemote as isHeldByRemote_alias_1 }
|
|
911
|
+
export { isHeldByRemote as isHeldByRemote_alias_2 }
|
|
912
|
+
|
|
913
|
+
declare const Key: {
|
|
914
|
+
readonly A: number;
|
|
915
|
+
readonly B: number;
|
|
916
|
+
readonly C: number;
|
|
917
|
+
readonly D: number;
|
|
918
|
+
readonly E: number;
|
|
919
|
+
readonly F: number;
|
|
920
|
+
readonly G: number;
|
|
921
|
+
readonly H: number;
|
|
922
|
+
readonly I: number;
|
|
923
|
+
readonly J: number;
|
|
924
|
+
readonly K: number;
|
|
925
|
+
readonly L: number;
|
|
926
|
+
readonly M: number;
|
|
927
|
+
readonly N: number;
|
|
928
|
+
readonly O: number;
|
|
929
|
+
readonly P: number;
|
|
930
|
+
readonly Q: number;
|
|
931
|
+
readonly R: number;
|
|
932
|
+
readonly S: number;
|
|
933
|
+
readonly T: number;
|
|
934
|
+
readonly U: number;
|
|
935
|
+
readonly V: number;
|
|
936
|
+
readonly W: number;
|
|
937
|
+
readonly X: number;
|
|
938
|
+
readonly Y: number;
|
|
939
|
+
readonly Z: number;
|
|
940
|
+
readonly Digit0: number;
|
|
941
|
+
readonly Digit1: number;
|
|
942
|
+
readonly Digit2: number;
|
|
943
|
+
readonly Digit3: number;
|
|
944
|
+
readonly Digit4: number;
|
|
945
|
+
readonly Digit5: number;
|
|
946
|
+
readonly Digit6: number;
|
|
947
|
+
readonly Digit7: number;
|
|
948
|
+
readonly Digit8: number;
|
|
949
|
+
readonly Digit9: number;
|
|
950
|
+
readonly F1: number;
|
|
951
|
+
readonly F2: number;
|
|
952
|
+
readonly F3: number;
|
|
953
|
+
readonly F4: number;
|
|
954
|
+
readonly F5: number;
|
|
955
|
+
readonly F6: number;
|
|
956
|
+
readonly F7: number;
|
|
957
|
+
readonly F8: number;
|
|
958
|
+
readonly F9: number;
|
|
959
|
+
readonly F10: number;
|
|
960
|
+
readonly F11: number;
|
|
961
|
+
readonly F12: number;
|
|
962
|
+
readonly ShiftLeft: number;
|
|
963
|
+
readonly ShiftRight: number;
|
|
964
|
+
readonly ControlLeft: number;
|
|
965
|
+
readonly ControlRight: number;
|
|
966
|
+
readonly AltLeft: number;
|
|
967
|
+
readonly AltRight: number;
|
|
968
|
+
readonly MetaLeft: number;
|
|
969
|
+
readonly MetaRight: number;
|
|
970
|
+
readonly Escape: number;
|
|
971
|
+
readonly Space: number;
|
|
972
|
+
readonly Enter: number;
|
|
973
|
+
readonly Tab: number;
|
|
974
|
+
readonly Backspace: number;
|
|
975
|
+
readonly Delete: number;
|
|
976
|
+
readonly ArrowLeft: number;
|
|
977
|
+
readonly ArrowUp: number;
|
|
978
|
+
readonly ArrowRight: number;
|
|
979
|
+
readonly ArrowDown: number;
|
|
980
|
+
readonly Home: number;
|
|
981
|
+
readonly End: number;
|
|
982
|
+
readonly PageUp: number;
|
|
983
|
+
readonly PageDown: number;
|
|
984
|
+
readonly Insert: number;
|
|
985
|
+
readonly Semicolon: number;
|
|
986
|
+
readonly Equal: number;
|
|
987
|
+
readonly Comma: number;
|
|
988
|
+
readonly Minus: number;
|
|
989
|
+
readonly Period: number;
|
|
990
|
+
readonly Slash: number;
|
|
991
|
+
readonly Backquote: number;
|
|
992
|
+
readonly BracketLeft: number;
|
|
993
|
+
readonly Backslash: number;
|
|
994
|
+
readonly BracketRight: number;
|
|
995
|
+
readonly Quote: number;
|
|
996
|
+
readonly Numpad0: number;
|
|
997
|
+
readonly Numpad1: number;
|
|
998
|
+
readonly Numpad2: number;
|
|
999
|
+
readonly Numpad3: number;
|
|
1000
|
+
readonly Numpad4: number;
|
|
1001
|
+
readonly Numpad5: number;
|
|
1002
|
+
readonly Numpad6: number;
|
|
1003
|
+
readonly Numpad7: number;
|
|
1004
|
+
readonly Numpad8: number;
|
|
1005
|
+
readonly Numpad9: number;
|
|
1006
|
+
readonly NumpadAdd: number;
|
|
1007
|
+
readonly NumpadSubtract: number;
|
|
1008
|
+
readonly NumpadMultiply: number;
|
|
1009
|
+
readonly NumpadDivide: number;
|
|
1010
|
+
readonly NumpadDecimal: number;
|
|
1011
|
+
readonly NumpadEnter: number;
|
|
1012
|
+
};
|
|
1013
|
+
|
|
1014
|
+
declare type Key = (typeof Key)[keyof typeof Key];
|
|
1015
|
+
export { Key }
|
|
1016
|
+
export { Key as Key_alias_1 }
|
|
1017
|
+
export { Key as Key_alias_2 }
|
|
1018
|
+
|
|
1019
|
+
declare const Keybind: z.ZodObject<{
|
|
1020
|
+
command: z.ZodString;
|
|
1021
|
+
key: z.ZodNumber;
|
|
1022
|
+
mod: z.ZodOptional<z.ZodBoolean>;
|
|
1023
|
+
shift: z.ZodOptional<z.ZodBoolean>;
|
|
1024
|
+
}, z.core.$strip>;
|
|
1025
|
+
|
|
1026
|
+
declare type Keybind = z.infer<typeof Keybind>;
|
|
1027
|
+
export { Keybind }
|
|
1028
|
+
export { Keybind as Keybind_alias_1 }
|
|
1029
|
+
|
|
1030
|
+
declare type KeybindInput = z.input<typeof Keybind>;
|
|
1031
|
+
export { KeybindInput }
|
|
1032
|
+
export { KeybindInput as KeybindInput_alias_1 }
|
|
1033
|
+
|
|
1034
|
+
declare const keybindSystem: EditorSystem;
|
|
1035
|
+
export { keybindSystem }
|
|
1036
|
+
export { keybindSystem as keybindSystem_alias_1 }
|
|
1037
|
+
|
|
1038
|
+
declare const Keyboard: KeyboardDef;
|
|
1039
|
+
export { Keyboard }
|
|
1040
|
+
export { Keyboard as Keyboard_alias_1 }
|
|
1041
|
+
export { Keyboard as Keyboard_alias_2 }
|
|
1042
|
+
|
|
1043
|
+
declare class KeyboardDef extends CanvasSingletonDef<typeof KeyboardSchema> {
|
|
1044
|
+
constructor();
|
|
1045
|
+
isKeyDown(ctx: Context, key: number): boolean;
|
|
1046
|
+
isKeyDownTrigger(ctx: Context, key: number): boolean;
|
|
1047
|
+
isKeyUpTrigger(ctx: Context, key: number): boolean;
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
declare interface KeyboardInput {
|
|
1051
|
+
type: KeyboardInputType;
|
|
1052
|
+
key: number;
|
|
1053
|
+
ctx: Context;
|
|
1054
|
+
}
|
|
1055
|
+
export { KeyboardInput }
|
|
1056
|
+
export { KeyboardInput as KeyboardInput_alias_1 }
|
|
1057
|
+
export { KeyboardInput as KeyboardInput_alias_2 }
|
|
1058
|
+
|
|
1059
|
+
declare type KeyboardInputType = 'keyDown' | 'keyUp';
|
|
1060
|
+
export { KeyboardInputType }
|
|
1061
|
+
export { KeyboardInputType as KeyboardInputType_alias_1 }
|
|
1062
|
+
export { KeyboardInputType as KeyboardInputType_alias_2 }
|
|
1063
|
+
|
|
1064
|
+
declare const KeyboardSchema: {
|
|
1065
|
+
keysDown: BufferFieldBuilder<"uint8">;
|
|
1066
|
+
keysDownTrigger: BufferFieldBuilder<"uint8">;
|
|
1067
|
+
keysUpTrigger: BufferFieldBuilder<"uint8">;
|
|
1068
|
+
shiftDown: BooleanFieldBuilder;
|
|
1069
|
+
altDown: BooleanFieldBuilder;
|
|
1070
|
+
modDown: BooleanFieldBuilder;
|
|
1071
|
+
};
|
|
1072
|
+
|
|
1073
|
+
declare const keyboardSystem: EditorSystem;
|
|
1074
|
+
export { keyboardSystem }
|
|
1075
|
+
export { keyboardSystem as keyboardSystem_alias_1 }
|
|
1076
|
+
|
|
1077
|
+
declare interface MachineResult<TState, TContext> {
|
|
1078
|
+
value: TState;
|
|
1079
|
+
context: TContext;
|
|
1080
|
+
}
|
|
1081
|
+
export { MachineResult }
|
|
1082
|
+
export { MachineResult as MachineResult_alias_1 }
|
|
1083
|
+
|
|
1084
|
+
export { MainThreadSystem }
|
|
1085
|
+
|
|
1086
|
+
declare const MAX_HIT_ARCS = 2;
|
|
1087
|
+
export { MAX_HIT_ARCS }
|
|
1088
|
+
export { MAX_HIT_ARCS as MAX_HIT_ARCS_alias_1 }
|
|
1089
|
+
export { MAX_HIT_ARCS as MAX_HIT_ARCS_alias_2 }
|
|
1090
|
+
|
|
1091
|
+
declare const MAX_HIT_CAPSULES = 64;
|
|
1092
|
+
export { MAX_HIT_CAPSULES }
|
|
1093
|
+
export { MAX_HIT_CAPSULES as MAX_HIT_CAPSULES_alias_1 }
|
|
1094
|
+
export { MAX_HIT_CAPSULES as MAX_HIT_CAPSULES_alias_2 }
|
|
1095
|
+
|
|
1096
|
+
declare const Mouse: MouseDef;
|
|
1097
|
+
export { Mouse }
|
|
1098
|
+
export { Mouse as Mouse_alias_1 }
|
|
1099
|
+
export { Mouse as Mouse_alias_2 }
|
|
1100
|
+
|
|
1101
|
+
declare class MouseDef extends CanvasSingletonDef<typeof MouseSchema> {
|
|
1102
|
+
constructor();
|
|
1103
|
+
didMove(ctx: Context): boolean;
|
|
1104
|
+
didScroll(ctx: Context): boolean;
|
|
1105
|
+
didEnter(ctx: Context): boolean;
|
|
1106
|
+
didLeave(ctx: Context): boolean;
|
|
1107
|
+
getPosition(ctx: Context): Vec2;
|
|
1108
|
+
getWheelDelta(ctx: Context): Vec2;
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
declare interface MouseInput {
|
|
1112
|
+
type: MouseInputType;
|
|
1113
|
+
ctx: Context;
|
|
1114
|
+
screenPosition: Vec2;
|
|
1115
|
+
worldPosition: Vec2;
|
|
1116
|
+
wheelDeltaX: number;
|
|
1117
|
+
wheelDeltaY: number;
|
|
1118
|
+
}
|
|
1119
|
+
export { MouseInput }
|
|
1120
|
+
export { MouseInput as MouseInput_alias_1 }
|
|
1121
|
+
export { MouseInput as MouseInput_alias_2 }
|
|
1122
|
+
|
|
1123
|
+
declare type MouseInputType = 'wheel' | 'mouseMove';
|
|
1124
|
+
export { MouseInputType }
|
|
1125
|
+
export { MouseInputType as MouseInputType_alias_1 }
|
|
1126
|
+
export { MouseInputType as MouseInputType_alias_2 }
|
|
1127
|
+
|
|
1128
|
+
declare const MouseSchema: {
|
|
1129
|
+
position: TupleFieldBuilder<NumberFieldBuilder<"float32">, 2>;
|
|
1130
|
+
wheelDeltaX: NumberFieldBuilder<"float32">;
|
|
1131
|
+
wheelDeltaY: NumberFieldBuilder<"float32">;
|
|
1132
|
+
moveTrigger: BooleanFieldBuilder;
|
|
1133
|
+
wheelTrigger: BooleanFieldBuilder;
|
|
1134
|
+
enterTrigger: BooleanFieldBuilder;
|
|
1135
|
+
leaveTrigger: BooleanFieldBuilder;
|
|
1136
|
+
};
|
|
1137
|
+
|
|
1138
|
+
declare const mouseSystem: EditorSystem;
|
|
1139
|
+
export { mouseSystem }
|
|
1140
|
+
export { mouseSystem as mouseSystem_alias_1 }
|
|
1141
|
+
|
|
1142
|
+
declare function on<T>(ctx: Context, def: CommandDef<T>, handler: (ctx: Context, payload: T) => void): void;
|
|
1143
|
+
export { on }
|
|
1144
|
+
export { on as on_alias_1 }
|
|
1145
|
+
|
|
1146
|
+
declare const Opacity: CanvasComponentDef< {
|
|
1147
|
+
value: NumberFieldBuilder<"uint8">;
|
|
1148
|
+
}, "opacity">;
|
|
1149
|
+
export { Opacity }
|
|
1150
|
+
export { Opacity as Opacity_alias_1 }
|
|
1151
|
+
export { Opacity as Opacity_alias_2 }
|
|
1152
|
+
|
|
1153
|
+
declare function parsePlugin(input: EditorPluginInput): EditorPlugin;
|
|
1154
|
+
export { parsePlugin }
|
|
1155
|
+
export { parsePlugin as parsePlugin_alias_1 }
|
|
1156
|
+
|
|
1157
|
+
export declare const PLUGIN_NAME = "core";
|
|
1158
|
+
|
|
1159
|
+
declare const Pointer: PointerDef;
|
|
1160
|
+
export { Pointer }
|
|
1161
|
+
export { Pointer as Pointer_alias_1 }
|
|
1162
|
+
export { Pointer as Pointer_alias_2 }
|
|
1163
|
+
|
|
1164
|
+
declare const PointerButton: {
|
|
1165
|
+
readonly None: "none";
|
|
1166
|
+
readonly Left: "left";
|
|
1167
|
+
readonly Middle: "middle";
|
|
1168
|
+
readonly Right: "right";
|
|
1169
|
+
readonly Back: "back";
|
|
1170
|
+
readonly Forward: "forward";
|
|
1171
|
+
};
|
|
1172
|
+
|
|
1173
|
+
declare type PointerButton = (typeof PointerButton)[keyof typeof PointerButton];
|
|
1174
|
+
export { PointerButton }
|
|
1175
|
+
export { PointerButton as PointerButton_alias_1 }
|
|
1176
|
+
export { PointerButton as PointerButton_alias_2 }
|
|
1177
|
+
|
|
1178
|
+
declare class PointerDef extends CanvasComponentDef<typeof PointerSchema> {
|
|
1179
|
+
constructor();
|
|
1180
|
+
getVelocity(ctx: Context, entityId: number): Vec2;
|
|
1181
|
+
getButton(button: number): PointerButton;
|
|
1182
|
+
getType(pointerType: string): PointerType;
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
declare interface PointerInput {
|
|
1186
|
+
type: PointerInputType;
|
|
1187
|
+
ctx: Context;
|
|
1188
|
+
screenPosition: Vec2;
|
|
1189
|
+
worldPosition: Vec2;
|
|
1190
|
+
velocity: Vec2;
|
|
1191
|
+
pressure: number;
|
|
1192
|
+
button: PointerButton;
|
|
1193
|
+
pointerType: PointerType;
|
|
1194
|
+
obscured: boolean;
|
|
1195
|
+
shiftDown: boolean;
|
|
1196
|
+
altDown: boolean;
|
|
1197
|
+
modDown: boolean;
|
|
1198
|
+
cameraLeft: number;
|
|
1199
|
+
cameraTop: number;
|
|
1200
|
+
cameraZoom: number;
|
|
1201
|
+
pointerId: number;
|
|
1202
|
+
intersects: EntityId[];
|
|
1203
|
+
}
|
|
1204
|
+
export { PointerInput }
|
|
1205
|
+
export { PointerInput as PointerInput_alias_1 }
|
|
1206
|
+
export { PointerInput as PointerInput_alias_2 }
|
|
1207
|
+
|
|
1208
|
+
declare interface PointerInputOptions {
|
|
1209
|
+
includeFrameEvent?: boolean;
|
|
1210
|
+
clickMoveThreshold?: number;
|
|
1211
|
+
clickFrameThreshold?: number;
|
|
1212
|
+
}
|
|
1213
|
+
export { PointerInputOptions }
|
|
1214
|
+
export { PointerInputOptions as PointerInputOptions_alias_1 }
|
|
1215
|
+
export { PointerInputOptions as PointerInputOptions_alias_2 }
|
|
1216
|
+
|
|
1217
|
+
declare type PointerInputType = 'pointerDown' | 'pointerMove' | 'pointerUp' | 'click' | 'cancel' | 'frame';
|
|
1218
|
+
export { PointerInputType }
|
|
1219
|
+
export { PointerInputType as PointerInputType_alias_1 }
|
|
1220
|
+
export { PointerInputType as PointerInputType_alias_2 }
|
|
1221
|
+
|
|
1222
|
+
declare const PointerSchema: {
|
|
1223
|
+
pointerId: NumberFieldBuilder<"uint16">;
|
|
1224
|
+
position: TupleFieldBuilder<NumberFieldBuilder<"float32">, 2>;
|
|
1225
|
+
downPosition: TupleFieldBuilder<NumberFieldBuilder<"float32">, 2>;
|
|
1226
|
+
downFrame: NumberFieldBuilder<"uint32">;
|
|
1227
|
+
button: EnumFieldBuilder<"none" | "left" | "middle" | "right" | "back" | "forward">;
|
|
1228
|
+
pointerType: EnumFieldBuilder<"mouse" | "pen" | "touch">;
|
|
1229
|
+
pressure: NumberFieldBuilder<"float32">;
|
|
1230
|
+
obscured: BooleanFieldBuilder;
|
|
1231
|
+
_prevPositions: ArrayFieldBuilder<NumberFieldBuilder<"float32">>;
|
|
1232
|
+
_prevTimes: ArrayFieldBuilder<NumberFieldBuilder<"float32">>;
|
|
1233
|
+
_sampleCount: NumberFieldBuilder<"int32">;
|
|
1234
|
+
_velocity: TupleFieldBuilder<NumberFieldBuilder<"float32">, 2>;
|
|
1235
|
+
};
|
|
1236
|
+
|
|
1237
|
+
declare const pointerSystem: EditorSystem;
|
|
1238
|
+
export { pointerSystem }
|
|
1239
|
+
export { pointerSystem as pointerSystem_alias_1 }
|
|
1240
|
+
|
|
1241
|
+
declare const PointerType: {
|
|
1242
|
+
readonly Mouse: "mouse";
|
|
1243
|
+
readonly Pen: "pen";
|
|
1244
|
+
readonly Touch: "touch";
|
|
1245
|
+
};
|
|
1246
|
+
|
|
1247
|
+
declare type PointerType = (typeof PointerType)[keyof typeof PointerType];
|
|
1248
|
+
export { PointerType }
|
|
1249
|
+
export { PointerType as PointerType_alias_1 }
|
|
1250
|
+
export { PointerType as PointerType_alias_2 }
|
|
1251
|
+
|
|
1252
|
+
declare const presenceSystem: EditorSystem;
|
|
1253
|
+
export { presenceSystem }
|
|
1254
|
+
export { presenceSystem as presenceSystem_alias_1 }
|
|
1255
|
+
|
|
1256
|
+
declare type QueryCallback = (ctx: Context, result: {
|
|
1257
|
+
added: number[];
|
|
1258
|
+
changed: number[];
|
|
1259
|
+
removed: number[];
|
|
1260
|
+
}) => void;
|
|
1261
|
+
export { QueryCallback }
|
|
1262
|
+
export { QueryCallback as QueryCallback_alias_1 }
|
|
1263
|
+
|
|
1264
|
+
export { QueryDef }
|
|
1265
|
+
|
|
1266
|
+
declare const RankBounds: RankBoundsDef;
|
|
1267
|
+
export { RankBounds }
|
|
1268
|
+
export { RankBounds as RankBounds_alias_1 }
|
|
1269
|
+
export { RankBounds as RankBounds_alias_2 }
|
|
1270
|
+
|
|
1271
|
+
declare class RankBoundsDef extends CanvasSingletonDef<typeof RankBoundsSchema> {
|
|
1272
|
+
constructor();
|
|
1273
|
+
genNext(ctx: Context): string;
|
|
1274
|
+
genPrev(ctx: Context): string;
|
|
1275
|
+
genBetween(before: string | null, after: string | null): string;
|
|
1276
|
+
add(ctx: Context, rank: string): void;
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
declare const RankBoundsSchema: {
|
|
1280
|
+
minRank: StringFieldBuilder;
|
|
1281
|
+
maxRank: StringFieldBuilder;
|
|
1282
|
+
};
|
|
1283
|
+
|
|
1284
|
+
declare const rankBoundsSystem: EditorSystem;
|
|
1285
|
+
export { rankBoundsSystem }
|
|
1286
|
+
export { rankBoundsSystem as rankBoundsSystem_alias_1 }
|
|
1287
|
+
|
|
1288
|
+
declare const Redo: CommandDef<void>;
|
|
1289
|
+
export { Redo }
|
|
1290
|
+
export { Redo as Redo_alias_1 }
|
|
1291
|
+
|
|
1292
|
+
export { removeComponent }
|
|
1293
|
+
|
|
1294
|
+
export { removeEntity }
|
|
1295
|
+
|
|
1296
|
+
declare type ResizeMode = 'scale' | 'text' | 'free' | 'groupOnly';
|
|
1297
|
+
export { ResizeMode }
|
|
1298
|
+
export { ResizeMode as ResizeMode_alias_1 }
|
|
1299
|
+
|
|
1300
|
+
declare function runMachine<TState extends string, TContext extends object>(machine: AnyStateMachine, currentState: TState, context: TContext, events: Array<{
|
|
1301
|
+
type: string;
|
|
1302
|
+
[key: string]: unknown;
|
|
1303
|
+
}>): MachineResult<TState, TContext>;
|
|
1304
|
+
export { runMachine }
|
|
1305
|
+
export { runMachine as runMachine_alias_1 }
|
|
1306
|
+
|
|
1307
|
+
declare const ScaleWithZoom: CanvasComponentDef< {
|
|
1308
|
+
anchor: TupleFieldBuilder<NumberFieldBuilder<"float64">, 2>;
|
|
1309
|
+
startPosition: TupleFieldBuilder<NumberFieldBuilder<"float64">, 2>;
|
|
1310
|
+
startSize: TupleFieldBuilder<NumberFieldBuilder<"float64">, 2>;
|
|
1311
|
+
scaleMultiplier: TupleFieldBuilder<NumberFieldBuilder<"float64">, 2>;
|
|
1312
|
+
}, "scaleWithZoom">;
|
|
1313
|
+
export { ScaleWithZoom }
|
|
1314
|
+
export { ScaleWithZoom as ScaleWithZoom_alias_1 }
|
|
1315
|
+
export { ScaleWithZoom as ScaleWithZoom_alias_2 }
|
|
1316
|
+
|
|
1317
|
+
declare const ScaleWithZoomState: CanvasSingletonDef< {
|
|
1318
|
+
lastZoom: NumberFieldBuilder<"float64">;
|
|
1319
|
+
}, "scaleWithZoomState">;
|
|
1320
|
+
export { ScaleWithZoomState }
|
|
1321
|
+
export { ScaleWithZoomState as ScaleWithZoomState_alias_1 }
|
|
1322
|
+
export { ScaleWithZoomState as ScaleWithZoomState_alias_2 }
|
|
1323
|
+
|
|
1324
|
+
declare const scaleWithZoomSystem: EditorSystem;
|
|
1325
|
+
export { scaleWithZoomSystem }
|
|
1326
|
+
export { scaleWithZoomSystem as scaleWithZoomSystem_alias_1 }
|
|
1327
|
+
|
|
1328
|
+
declare const Screen_2: ScreenDef;
|
|
1329
|
+
export { Screen_2 as Screen }
|
|
1330
|
+
export { Screen_2 as Screen_alias_1 }
|
|
1331
|
+
export { Screen_2 as Screen_alias_2 }
|
|
1332
|
+
|
|
1333
|
+
declare class ScreenDef extends CanvasSingletonDef<typeof ScreenSchema> {
|
|
1334
|
+
constructor();
|
|
1335
|
+
getSize(ctx: Context): Vec2;
|
|
1336
|
+
getPosition(ctx: Context): Vec2;
|
|
1337
|
+
getCenter(ctx: Context): Vec2;
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
declare const ScreenSchema: {
|
|
1341
|
+
width: NumberFieldBuilder<"float64">;
|
|
1342
|
+
height: NumberFieldBuilder<"float64">;
|
|
1343
|
+
left: NumberFieldBuilder<"float64">;
|
|
1344
|
+
top: NumberFieldBuilder<"float64">;
|
|
1345
|
+
};
|
|
1346
|
+
|
|
1347
|
+
declare const screenSystem: EditorSystem;
|
|
1348
|
+
export { screenSystem }
|
|
1349
|
+
export { screenSystem as screenSystem_alias_1 }
|
|
1350
|
+
|
|
1351
|
+
declare function setBit(buffer: {
|
|
1352
|
+
[index: number]: number;
|
|
1353
|
+
length: number;
|
|
1354
|
+
}, bitIndex: number, value: boolean): void;
|
|
1355
|
+
export { setBit }
|
|
1356
|
+
export { setBit as setBit_alias_1 }
|
|
1357
|
+
|
|
1358
|
+
declare const Shape: CanvasComponentDef< {
|
|
1359
|
+
kind: StringFieldBuilder;
|
|
1360
|
+
strokeKind: EnumFieldBuilder<"none" | "solid" | "dashed">;
|
|
1361
|
+
strokeWidth: NumberFieldBuilder<"uint16">;
|
|
1362
|
+
strokeRed: NumberFieldBuilder<"uint8">;
|
|
1363
|
+
strokeGreen: NumberFieldBuilder<"uint8">;
|
|
1364
|
+
strokeBlue: NumberFieldBuilder<"uint8">;
|
|
1365
|
+
strokeAlpha: NumberFieldBuilder<"uint8">;
|
|
1366
|
+
fillRed: NumberFieldBuilder<"uint8">;
|
|
1367
|
+
fillGreen: NumberFieldBuilder<"uint8">;
|
|
1368
|
+
fillBlue: NumberFieldBuilder<"uint8">;
|
|
1369
|
+
fillAlpha: NumberFieldBuilder<"uint8">;
|
|
1370
|
+
}, "shape">;
|
|
1371
|
+
export { Shape }
|
|
1372
|
+
export { Shape as Shape_alias_1 }
|
|
1373
|
+
export { Shape as Shape_alias_2 }
|
|
1374
|
+
|
|
1375
|
+
export { SINGLETON_ENTITY_ID }
|
|
1376
|
+
|
|
1377
|
+
export { SingletonSyncBehavior }
|
|
1378
|
+
|
|
1379
|
+
export declare function sortPluginsByDependencies(plugins: EditorPlugin[]): EditorPlugin[];
|
|
1380
|
+
|
|
1381
|
+
declare interface StateSchema extends ComponentSchema {
|
|
1382
|
+
state: {
|
|
1383
|
+
def: StringFieldDef | EnumFieldDef<any>;
|
|
1384
|
+
};
|
|
1385
|
+
}
|
|
1386
|
+
export { StateSchema }
|
|
1387
|
+
export { StateSchema as StateSchema_alias_1 }
|
|
1388
|
+
|
|
1389
|
+
declare const Stratum: z.ZodEnum<{
|
|
1390
|
+
background: "background";
|
|
1391
|
+
content: "content";
|
|
1392
|
+
overlay: "overlay";
|
|
1393
|
+
}>;
|
|
1394
|
+
|
|
1395
|
+
declare type Stratum = z.infer<typeof Stratum>;
|
|
1396
|
+
export { Stratum }
|
|
1397
|
+
export { Stratum as Stratum_alias_1 }
|
|
1398
|
+
|
|
1399
|
+
declare const STRATUM_ORDER: {
|
|
1400
|
+
readonly background: 0;
|
|
1401
|
+
readonly content: 1;
|
|
1402
|
+
readonly overlay: 2;
|
|
1403
|
+
};
|
|
1404
|
+
export { STRATUM_ORDER }
|
|
1405
|
+
export { STRATUM_ORDER as STRATUM_ORDER_alias_1 }
|
|
1406
|
+
|
|
1407
|
+
declare const StrokeKind: {
|
|
1408
|
+
readonly Solid: "solid";
|
|
1409
|
+
readonly Dashed: "dashed";
|
|
1410
|
+
readonly None: "none";
|
|
1411
|
+
};
|
|
1412
|
+
|
|
1413
|
+
declare type StrokeKind = (typeof StrokeKind)[keyof typeof StrokeKind];
|
|
1414
|
+
export { StrokeKind }
|
|
1415
|
+
export { StrokeKind as StrokeKind_alias_1 }
|
|
1416
|
+
export { StrokeKind as StrokeKind_alias_2 }
|
|
1417
|
+
|
|
1418
|
+
export { SyncBehavior }
|
|
1419
|
+
|
|
1420
|
+
export { Synced }
|
|
1421
|
+
|
|
1422
|
+
export { System }
|
|
1423
|
+
|
|
1424
|
+
export declare type SystemPhase = 'input' | 'capture' | 'update' | 'render';
|
|
1425
|
+
|
|
1426
|
+
declare const Text_2: CanvasComponentDef< {
|
|
1427
|
+
content: StringFieldBuilder;
|
|
1428
|
+
fontSizePx: NumberFieldBuilder<"float64">;
|
|
1429
|
+
fontFamily: StringFieldBuilder;
|
|
1430
|
+
lineHeight: NumberFieldBuilder<"float64">;
|
|
1431
|
+
letterSpacingEm: NumberFieldBuilder<"float64">;
|
|
1432
|
+
constrainWidth: BooleanFieldBuilder;
|
|
1433
|
+
defaultAlignment: EnumFieldBuilder<"center" | "left" | "right" | "justify">;
|
|
1434
|
+
}, "text">;
|
|
1435
|
+
export { Text_2 as Text }
|
|
1436
|
+
export { Text_2 as Text_alias_1 }
|
|
1437
|
+
export { Text_2 as Text_alias_2 }
|
|
1438
|
+
|
|
1439
|
+
declare const TextAlignment: {
|
|
1440
|
+
readonly Left: "left";
|
|
1441
|
+
readonly Center: "center";
|
|
1442
|
+
readonly Right: "right";
|
|
1443
|
+
readonly Justify: "justify";
|
|
1444
|
+
};
|
|
1445
|
+
|
|
1446
|
+
declare type TextAlignment = (typeof TextAlignment)[keyof typeof TextAlignment];
|
|
1447
|
+
export { TextAlignment }
|
|
1448
|
+
export { TextAlignment as TextAlignment_alias_1 }
|
|
1449
|
+
|
|
1450
|
+
declare const Undo: CommandDef<void>;
|
|
1451
|
+
export { Undo }
|
|
1452
|
+
export { Undo as Undo_alias_1 }
|
|
1453
|
+
|
|
1454
|
+
declare const UploadState: {
|
|
1455
|
+
readonly Pending: "pending";
|
|
1456
|
+
readonly Uploading: "uploading";
|
|
1457
|
+
readonly Complete: "complete";
|
|
1458
|
+
readonly Failed: "failed";
|
|
1459
|
+
};
|
|
1460
|
+
export { UploadState }
|
|
1461
|
+
export { UploadState as UploadState_alias_1 }
|
|
1462
|
+
export { UploadState as UploadState_alias_2 }
|
|
1463
|
+
|
|
1464
|
+
declare const User: CanvasComponentDef< {
|
|
1465
|
+
userId: StringFieldBuilder;
|
|
1466
|
+
sessionId: StringFieldBuilder;
|
|
1467
|
+
color: StringFieldBuilder;
|
|
1468
|
+
name: StringFieldBuilder;
|
|
1469
|
+
avatar: StringFieldBuilder;
|
|
1470
|
+
position: TupleFieldBuilder<NumberFieldBuilder<"float32">, 2>;
|
|
1471
|
+
}, "user">;
|
|
1472
|
+
export { User }
|
|
1473
|
+
export { User as User_alias_1 }
|
|
1474
|
+
export { User as User_alias_2 }
|
|
1475
|
+
|
|
1476
|
+
declare const UserData: z.ZodObject<{
|
|
1477
|
+
userId: z.ZodDefault<z.ZodString>;
|
|
1478
|
+
sessionId: z.ZodDefault<z.ZodString>;
|
|
1479
|
+
color: z.ZodDefault<z.ZodString>;
|
|
1480
|
+
name: z.ZodDefault<z.ZodString>;
|
|
1481
|
+
avatar: z.ZodDefault<z.ZodString>;
|
|
1482
|
+
}, z.core.$strip>;
|
|
1483
|
+
|
|
1484
|
+
declare type UserData = z.infer<typeof UserData>;
|
|
1485
|
+
export { UserData }
|
|
1486
|
+
export { UserData as UserData_alias_1 }
|
|
1487
|
+
|
|
1488
|
+
declare type UserDataInput = z.input<typeof UserData>;
|
|
1489
|
+
export { UserDataInput }
|
|
1490
|
+
export { UserDataInput as UserDataInput_alias_1 }
|
|
1491
|
+
|
|
1492
|
+
export { Vec2 }
|
|
1493
|
+
|
|
1494
|
+
declare const VerticalAlign: CanvasComponentDef< {
|
|
1495
|
+
value: EnumFieldBuilder<"center" | "top" | "bottom">;
|
|
1496
|
+
}, "verticalAlign">;
|
|
1497
|
+
export { VerticalAlign }
|
|
1498
|
+
export { VerticalAlign as VerticalAlign_alias_1 }
|
|
1499
|
+
export { VerticalAlign as VerticalAlign_alias_2 }
|
|
1500
|
+
|
|
1501
|
+
declare const VerticalAlignment: {
|
|
1502
|
+
readonly Top: "top";
|
|
1503
|
+
readonly Center: "center";
|
|
1504
|
+
readonly Bottom: "bottom";
|
|
1505
|
+
};
|
|
1506
|
+
export { VerticalAlignment }
|
|
1507
|
+
export { VerticalAlignment as VerticalAlignment_alias_1 }
|
|
1508
|
+
|
|
1509
|
+
export { }
|