@hozo/canvas 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.
Files changed (43) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +152 -0
  3. package/dist/accessibility.d.ts +20 -0
  4. package/dist/accessibility.d.ts.map +1 -0
  5. package/dist/accessibility.js +9 -0
  6. package/dist/accessibility.js.map +1 -0
  7. package/dist/hit-test.d.ts +96 -0
  8. package/dist/hit-test.d.ts.map +1 -0
  9. package/dist/hit-test.js +354 -0
  10. package/dist/hit-test.js.map +1 -0
  11. package/dist/index.d.ts +80 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +317 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/index.native.d.ts +83 -0
  16. package/dist/index.native.d.ts.map +1 -0
  17. package/dist/index.native.js +435 -0
  18. package/dist/index.native.js.map +1 -0
  19. package/dist/render-canvas-2d.d.ts +6 -0
  20. package/dist/render-canvas-2d.d.ts.map +1 -0
  21. package/dist/render-canvas-2d.js +213 -0
  22. package/dist/render-canvas-2d.js.map +1 -0
  23. package/dist/scene.d.ts +495 -0
  24. package/dist/scene.d.ts.map +1 -0
  25. package/dist/scene.js +591 -0
  26. package/dist/scene.js.map +1 -0
  27. package/dist/viewport.d.ts +9 -0
  28. package/dist/viewport.d.ts.map +1 -0
  29. package/dist/viewport.js +2 -0
  30. package/dist/viewport.js.map +1 -0
  31. package/dist/wrap-text.d.ts +28 -0
  32. package/dist/wrap-text.d.ts.map +1 -0
  33. package/dist/wrap-text.js +148 -0
  34. package/dist/wrap-text.js.map +1 -0
  35. package/package.json +79 -0
  36. package/src/accessibility.ts +28 -0
  37. package/src/hit-test.ts +499 -0
  38. package/src/index.native.tsx +733 -0
  39. package/src/index.tsx +510 -0
  40. package/src/render-canvas-2d.ts +259 -0
  41. package/src/scene.tsx +1037 -0
  42. package/src/viewport.ts +8 -0
  43. package/src/wrap-text.ts +157 -0
@@ -0,0 +1,495 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { CanvasPoint } from './hit-test.ts';
3
+ export interface CanvasPressEvent {
4
+ /** Position in the root Canvas scene coordinate system. */
5
+ point: CanvasPoint;
6
+ /** Position in logical CSS pixels or React Native points. */
7
+ surfacePoint: CanvasPoint;
8
+ /** Browser-style modifier state, also present (as false) on touch-only hosts. */
9
+ altKey: boolean;
10
+ ctrlKey: boolean;
11
+ metaKey: boolean;
12
+ shiftKey: boolean;
13
+ /** `0` for the primary button and `1` for a mouse-wheel press. */
14
+ button: number;
15
+ /** Whether the authored handler kept this activation from following its destination. */
16
+ readonly defaultPrevented: boolean;
17
+ /** Keep an href-bearing shape available for authored selection or another local interaction. */
18
+ preventDefault(): void;
19
+ }
20
+ export interface CanvasDestination {
21
+ href: string;
22
+ /** Bypass an installed application router and open the platform destination. */
23
+ external?: boolean;
24
+ /** Replace the router history entry for an ordinary primary activation. */
25
+ replace?: boolean;
26
+ }
27
+ interface CanvasPressModifiers {
28
+ altKey?: boolean;
29
+ ctrlKey?: boolean;
30
+ metaKey?: boolean;
31
+ shiftKey?: boolean;
32
+ button?: number;
33
+ }
34
+ /** Builds the cancellable event shared by pointer, keyboard, and accessibility activation. */
35
+ export declare function canvasPressEvent(point: CanvasPoint, surfacePoint: CanvasPoint, modifiers?: CanvasPressModifiers): CanvasPressEvent;
36
+ export interface CanvasInteractionProps {
37
+ /** Portable discrete activation for closed Canvas geometry. */
38
+ onPress?: (event: CanvasPressEvent) => void;
39
+ /** Turns this shape into a destination while leaving its pixels on the Canvas surface. */
40
+ href?: string;
41
+ external?: boolean;
42
+ replace?: boolean;
43
+ /**
44
+ * The shape a person is currently indicating, by whatever means the
45
+ * device has. `undefined` when they stop indicating it.
46
+ *
47
+ * One notion rather than one per input, because a tooltip is one
48
+ * feature and a chart should not carry three implementations of it. A
49
+ * mouse or a pen indicates by hovering; a finger indicates by holding.
50
+ * Both arrive here, and the handler cannot tell which -- deliberately,
51
+ * since the answer never changes what a tooltip does.
52
+ *
53
+ * Hover is not a Web-only idea, which is worth stating because it is
54
+ * easy to assume: React Native's `View` declares the whole W3C pointer
55
+ * set and its payload carries `pointerType` and `offsetX`/`offsetY`,
56
+ * the same as the browser's. A tablet with a trackpad hovers.
57
+ *
58
+ * Keyboard is *not* a source yet, and that is the honest gap. Making
59
+ * one would mean deciding how a shape inside a canvas takes focus
60
+ * without inventing a control nobody can see, which is its own
61
+ * question -- see #26.
62
+ */
63
+ onActiveChange?: (event: CanvasPressEvent | undefined) => void;
64
+ /**
65
+ * What this shape is called, which is what makes it reachable at all.
66
+ *
67
+ * An interactive shape is a control, and a control on a canvas is
68
+ * unreachable by every route except a pointer: there is one element,
69
+ * and the shapes inside it are pixels. So a named one is given a real
70
+ * semantic control in the surface's hidden layer -- a button for an
71
+ * action or an anchor for a destination -- and the canvas keeps the drawing.
72
+ *
73
+ * Required for that to happen, and deliberately: a button with no
74
+ * accessible name is announced as "button" and is exactly the invisible
75
+ * control this is meant to avoid. A shape with a handler and no name
76
+ * says so in development rather than being silently pointer-only.
77
+ */
78
+ accessibilityLabel?: string;
79
+ disabled?: boolean;
80
+ }
81
+ /** One colour at one position along a gradient, `0` to `1`. */
82
+ export interface CanvasGradientStop {
83
+ offset: number;
84
+ color: string;
85
+ }
86
+ /**
87
+ * A gradient, in the shape both platforms take.
88
+ *
89
+ * Canvas2D builds one from coordinates and `addColorStop`; Skia takes a
90
+ * `start`/`end` pair with parallel `colors` and `positions` arrays. The two
91
+ * are the same description written differently, so this is the
92
+ * description and each renderer writes it its own way.
93
+ *
94
+ * The coordinates are the shape's own, on both. That is not a choice
95
+ * either: Canvas2D reads them in the current transform, which is the
96
+ * one Hozo set for this node, and Skia reads them in the shape's space.
97
+ *
98
+ * A radial gradient here is one circle, not Canvas2D's two. `r0` and a
99
+ * second centre have no counterpart in Skia, and a portable contract
100
+ * cannot promise what one side cannot draw.
101
+ */
102
+ export interface CanvasLinearGradient {
103
+ kind: 'linear';
104
+ from: CanvasPoint;
105
+ to: CanvasPoint;
106
+ stops: readonly CanvasGradientStop[];
107
+ }
108
+ export interface CanvasRadialGradient {
109
+ kind: 'radial';
110
+ center: CanvasPoint;
111
+ radius: number;
112
+ stops: readonly CanvasGradientStop[];
113
+ }
114
+ /**
115
+ * What a shape can be painted with.
116
+ *
117
+ * A string is a colour, and `'none'` is the absence of paint -- the two
118
+ * meanings the paint props had before gradients existed, unchanged.
119
+ */
120
+ export type CanvasPaint = string | CanvasLinearGradient | CanvasRadialGradient;
121
+ /** Whether a paint is a gradient rather than a colour. */
122
+ export declare function isGradient(paint: CanvasPaint | undefined): paint is CanvasLinearGradient | CanvasRadialGradient;
123
+ export interface CanvasPaintProps {
124
+ /** Compiler input. Runtime drawing uses the explicit paint props below. */
125
+ className?: string;
126
+ fill?: CanvasPaint;
127
+ stroke?: CanvasPaint;
128
+ strokeWidth?: number;
129
+ opacity?: number;
130
+ lineCap?: 'butt' | 'round' | 'square';
131
+ lineJoin?: 'bevel' | 'round' | 'miter';
132
+ }
133
+ /**
134
+ * Whether this paint puts anything on the surface, per channel.
135
+ *
136
+ * Both renderers had these two conditions written out, identically and
137
+ * separately -- Canvas2D in `applyPaint`, Skia in `paintLayers`. Hit
138
+ * testing needs the same answer for a third time, and a hit test that
139
+ * disagrees with the paint is worse than one that refuses: it reports a
140
+ * press on something nobody can see. So the condition is written once and
141
+ * all three read it.
142
+ *
143
+ * The defaults are the platforms' own and agree: an unset `strokeWidth`
144
+ * is 1 in Canvas2D and in Skia, so `?? 1` is not a Hozo policy.
145
+ */
146
+ export declare function paintStrokes(paint: CanvasPaintProps): boolean;
147
+ export declare function paintFills(paint: CanvasPaintProps): boolean;
148
+ /**
149
+ * The four fields both platforms take, defaulted once.
150
+ *
151
+ * Shared so a face cannot differ between the surfaces for a reason Hozo
152
+ * chose. What it cannot make equal is the face a *system* resolves these
153
+ * to, which is why `fontFamily` is passed through untouched rather than
154
+ * mapped to something clever.
155
+ */
156
+ export declare function textFontSpec(props: TextProps): {
157
+ readonly fontFamily: string;
158
+ readonly fontSize: number;
159
+ readonly fontStyle: "italic" | "normal";
160
+ readonly fontWeight: "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | "bold" | "normal";
161
+ };
162
+ /** The same four as the CSS shorthand `CanvasRenderingContext2D.font` takes. */
163
+ export declare function cssFontShorthand(props: TextProps): string;
164
+ export interface CanvasTransform {
165
+ translateX?: number;
166
+ translateY?: number;
167
+ scaleX?: number;
168
+ scaleY?: number;
169
+ /** Clockwise degrees. */
170
+ rotate?: number;
171
+ originX?: number;
172
+ originY?: number;
173
+ }
174
+ export interface GroupProps {
175
+ children?: ReactNode;
176
+ opacity?: number;
177
+ transform?: CanvasTransform;
178
+ }
179
+ export interface RectProps extends CanvasPaintProps, CanvasInteractionProps {
180
+ x?: number;
181
+ y?: number;
182
+ width: number;
183
+ height: number;
184
+ }
185
+ export interface RoundedRectProps extends RectProps {
186
+ radius: number;
187
+ }
188
+ export interface CircleProps extends CanvasPaintProps, CanvasInteractionProps {
189
+ cx: number;
190
+ cy: number;
191
+ radius: number;
192
+ }
193
+ export interface EllipseProps extends CanvasPaintProps, CanvasInteractionProps {
194
+ cx: number;
195
+ cy: number;
196
+ radiusX: number;
197
+ radiusY: number;
198
+ }
199
+ export interface LineProps extends CanvasPaintProps, CanvasInteractionProps {
200
+ x1: number;
201
+ y1: number;
202
+ x2: number;
203
+ y2: number;
204
+ }
205
+ /**
206
+ * A single line of text, drawn at a baseline.
207
+ *
208
+ * One line, and no wrapping. Neither renderer breaks lines -- Canvas2D's
209
+ * `fillText` and Skia's `Text` both draw a run and stop -- so wrapping
210
+ * would be Hozo's own layout engine rather than a shared contract, and
211
+ * the labels a chart needs are one line each.
212
+ *
213
+ * `x` is the left edge and `y` the alphabetic baseline, which is not a
214
+ * choice so much as the one place the platforms already agreed: it is
215
+ * Skia's only model and Canvas2D's default.
216
+ *
217
+ * The font is named rather than supplied. Skia's `matchFont` resolves a
218
+ * system face from these four fields synchronously, and Canvas2D takes
219
+ * the same four as a CSS shorthand, so nothing has to ship a font file.
220
+ * The cost is that the two may not resolve to the same face: system fonts
221
+ * differ, and a chart that needs identical glyphs on both has to load
222
+ * one, which is outside this contract.
223
+ */
224
+ export interface TextProps extends CanvasPaintProps, CanvasInteractionProps {
225
+ text: string;
226
+ x: number;
227
+ y: number;
228
+ /**
229
+ * Required, because the platforms disagree on a default and neither
230
+ * default is a good one -- Canvas2D starts at 10px, which is smaller
231
+ * than any label anybody wants.
232
+ */
233
+ fontSize: number;
234
+ fontFamily?: string;
235
+ fontStyle?: 'normal' | 'italic';
236
+ fontWeight?: 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
237
+ /** Which part of the run sits at `x`. */
238
+ textAlign?: 'left' | 'center' | 'right';
239
+ /**
240
+ * The width to wrap within, in the scene’s own coordinates.
241
+ *
242
+ * Without it a label is one line however long it is, which is what
243
+ * every drawing API does and what nobody wants for a legend. The
244
+ * break opportunities are the shared ones -- spaces, the boundaries
245
+ * around CJK, and the two kinsoku classes -- and the widths are the
246
+ * renderer’s own, so where a line ends can differ between platforms
247
+ * while what is allowed to end it cannot.
248
+ */
249
+ maxWidth?: number;
250
+ /**
251
+ * The distance between baselines, as a multiple of `fontSize`.
252
+ *
253
+ * A multiple rather than a length, so a label that changes size
254
+ * keeps its spacing. `y` stays the first baseline, which is where it
255
+ * is with no wrapping at all.
256
+ */
257
+ lineHeight?: number;
258
+ /**
259
+ * That these words are decoration rather than information.
260
+ *
261
+ * Text drawn on a canvas is pixels: no screen reader will ever read it,
262
+ * whatever the surface calls itself. So a surface that draws words and
263
+ * offers only a name has lost them, and `canvasUnreadableText` says so.
264
+ *
265
+ * This is the answer for the case where nothing was lost, and there are
266
+ * two of those. The words may carry no information -- a watermark, a
267
+ * repeated glyph. Or their information may already be exposed
268
+ * elsewhere, which is the commoner one: a label reading "Revenue rose
269
+ * from 3,200 in January to 4,800 in March" covers the drawn "Jan" and
270
+ * "4800" without containing either string, and no test of the text
271
+ * could tell.
272
+ *
273
+ * Both are what "presentational" means in ARIA. The word is not "this
274
+ * is pretty" but "this needs no accessible representation of its own",
275
+ * and a thing already said elsewhere needs none. So marking a covered
276
+ * label `decorative` is the word used correctly rather than a warning
277
+ * suppressed, which is why it is spelled the way the surface's own
278
+ * `decorative` is: the two say the same thing at different scales.
279
+ *
280
+ * The containment check that runs alongside this only catches the
281
+ * literal case -- `accessibilityLabel="Unread: 42"` over a drawn `42`.
282
+ * It is a convenience, not the boundary; semantics are the author's to
283
+ * assert because nothing here can read them.
284
+ */
285
+ decorative?: boolean;
286
+ }
287
+ export interface PathProps extends CanvasPaintProps, CanvasInteractionProps {
288
+ path: string;
289
+ fillRule?: 'nonzero' | 'evenodd';
290
+ }
291
+ export type ClipProps = ({
292
+ path: string;
293
+ x?: never;
294
+ y?: never;
295
+ width?: never;
296
+ height?: never;
297
+ } | {
298
+ path?: never;
299
+ x?: number;
300
+ y?: number;
301
+ width: number;
302
+ height: number;
303
+ }) & {
304
+ children?: ReactNode;
305
+ };
306
+ type SceneProps<Props> = Omit<Props, keyof CanvasInteractionProps>;
307
+ export type CanvasLeafNode = {
308
+ id?: string;
309
+ kind: 'rect';
310
+ props: SceneProps<RectProps>;
311
+ } | {
312
+ id?: string;
313
+ kind: 'rounded-rect';
314
+ props: SceneProps<RoundedRectProps>;
315
+ } | {
316
+ id?: string;
317
+ kind: 'circle';
318
+ props: SceneProps<CircleProps>;
319
+ } | {
320
+ id?: string;
321
+ kind: 'ellipse';
322
+ props: SceneProps<EllipseProps>;
323
+ } | {
324
+ id?: string;
325
+ kind: 'line';
326
+ props: SceneProps<LineProps>;
327
+ } | {
328
+ id?: string;
329
+ kind: 'text';
330
+ props: SceneProps<TextProps>;
331
+ } | {
332
+ id?: string;
333
+ kind: 'path';
334
+ props: SceneProps<PathProps>;
335
+ };
336
+ export type CanvasSceneNode = CanvasLeafNode | {
337
+ id?: string;
338
+ kind: 'group';
339
+ props: Omit<GroupProps, 'children'>;
340
+ children: readonly CanvasSceneNode[];
341
+ } | {
342
+ id?: string;
343
+ kind: 'clip';
344
+ props: Omit<ClipProps, 'children'>;
345
+ children: readonly CanvasSceneNode[];
346
+ };
347
+ export type CanvasScene = readonly CanvasSceneNode[];
348
+ type FlatNode = CanvasLeafNode | {
349
+ kind: 'group';
350
+ props: Omit<GroupProps, 'children'>;
351
+ } | {
352
+ kind: 'clip';
353
+ props: Omit<ClipProps, 'children'>;
354
+ };
355
+ declare class CanvasInteractionStore {
356
+ #private;
357
+ get version(): number;
358
+ subscribe(listener: () => void): () => void;
359
+ set(id: string, handler: ((event: CanvasPressEvent) => void) | undefined, label: string | undefined, destination: CanvasDestination | undefined): void;
360
+ label(id: string): string | undefined;
361
+ remove(id: string): void;
362
+ has(id: string): boolean;
363
+ press(id: string, event: CanvasPressEvent): void;
364
+ destination(id: string): CanvasDestination | undefined;
365
+ }
366
+ /** A small platform-neutral retained scene. It is deliberately not Hozo's semantic/SVG IR. */
367
+ export declare class CanvasSceneStore {
368
+ #private;
369
+ get version(): number;
370
+ subscribe(listener: () => void): () => void;
371
+ upsert(id: string, parentId: string | undefined, node: FlatNode): void;
372
+ remove(id: string): void;
373
+ snapshot(): CanvasScene;
374
+ }
375
+ export declare const Rect: {
376
+ ({ onPress, onActiveChange, accessibilityLabel, disabled, href, external, replace, ...props }: RectProps): null;
377
+ displayName: string;
378
+ };
379
+ export declare const RoundedRect: {
380
+ ({ onPress, onActiveChange, accessibilityLabel, disabled, href, external, replace, ...props }: RoundedRectProps): null;
381
+ displayName: string;
382
+ };
383
+ export declare const Circle: {
384
+ ({ onPress, onActiveChange, accessibilityLabel, disabled, href, external, replace, ...props }: CircleProps): null;
385
+ displayName: string;
386
+ };
387
+ export declare const Ellipse: {
388
+ ({ onPress, onActiveChange, accessibilityLabel, disabled, href, external, replace, ...props }: EllipseProps): null;
389
+ displayName: string;
390
+ };
391
+ export declare const Line: {
392
+ ({ onPress, onActiveChange, accessibilityLabel, disabled, href, external, replace, ...props }: LineProps): null;
393
+ displayName: string;
394
+ };
395
+ export declare const Text: {
396
+ ({ onPress, onActiveChange, accessibilityLabel, disabled, href, external, replace, ...props }: TextProps): null;
397
+ displayName: string;
398
+ };
399
+ export declare const Path: {
400
+ ({ onPress, onActiveChange, accessibilityLabel, disabled, href, external, replace, ...props }: PathProps): null;
401
+ displayName: string;
402
+ };
403
+ export declare function Group({ children, ...props }: GroupProps): import("react").JSX.Element;
404
+ export declare function Clip({ children, ...props }: ClipProps): import("react").JSX.Element;
405
+ /**
406
+ * A cache that forgets, because the things it holds are not a fixed set.
407
+ *
408
+ * Fonts are: a chart uses a handful of specs and reuses them, so an
409
+ * unbounded map is fine there. Paths are not. A line chart that animates
410
+ * builds a new `d` string every frame, and each one parsed by `Path2D`
411
+ * or by `MakeFromSVGString` was kept for the life of the process -- the
412
+ * exact workload #154 describes as Canvas mode's reason to exist.
413
+ *
414
+ * Least-recently-used, by the oldest insertion, which a `Map` gives for
415
+ * free: its iteration order is insertion order, so the first key is the
416
+ * oldest. Re-inserting on a hit is what makes "oldest insertion" mean
417
+ * "least recently used".
418
+ *
419
+ * The bound is generous rather than tuned. A frame draws every path it
420
+ * has, so anything smaller than one frame's worth of paths would evict
421
+ * entries it is about to need; anything larger only delays the same
422
+ * behaviour.
423
+ */
424
+ export declare class BoundedCache<Value> {
425
+ #private;
426
+ constructor(limit: number);
427
+ get size(): number;
428
+ get(key: string): Value | undefined;
429
+ set(key: string, value: Value): void;
430
+ }
431
+ /**
432
+ * The compiler's proof that every shape was handled.
433
+ *
434
+ * Three places switch on `kind` -- the two renderers and the hit test --
435
+ * and none of them was checked. Adding a kind to `CanvasLeafNode`
436
+ * produced no error in any of them, verified by adding one: zero
437
+ * diagnostics, because `drawNode` returns `void` so a missing case falls
438
+ * through, `renderNode` returns `ReactNode` and `undefined` is a valid
439
+ * one, and `pointInNode`'s caller takes its result as a condition. A
440
+ * shape whose renderer was forgotten drew nothing, refused every press,
441
+ * and said nothing about either.
442
+ *
443
+ * The parameter typed `never` is what fixes that: reaching it with a kind
444
+ * still in the union is a compile error naming the kind. At run time it
445
+ * warns rather than throws -- the type has already made this unreachable
446
+ * from TypeScript, and a hand-built scene from JavaScript should lose one
447
+ * shape rather than the whole chart.
448
+ */
449
+ export declare function unhandledShape(node: never, where: string): undefined;
450
+ export interface CanvasControl {
451
+ id: string;
452
+ label: string;
453
+ destination?: CanvasDestination;
454
+ }
455
+ export declare function canvasControls(scene: CanvasScene, interactions: CanvasInteractionStore, warn?: (message: string) => void): CanvasControl[];
456
+ /**
457
+ * The drawn words a person using a screen reader will never get.
458
+ *
459
+ * Canvas text is pixels. Unlike SVG, where the fix was a role that stops
460
+ * hiding the children, there is nothing here to expose -- so `role="img"`
461
+ * on a Canvas is right, and the defect is not the role but the silence.
462
+ *
463
+ * Four things mean nothing was lost, and each is the author saying
464
+ * something different rather than the same suppression spelled four ways:
465
+ *
466
+ * - an `accessibleFallback`: "the content is here". The fix, and the
467
+ * only one that supplies the data. Whether it really contains it is
468
+ * not checkable from here, and presence is the honest signal.
469
+ * - `decorative` on the surface: "this drawing carries no information".
470
+ * - `decorative` on the text: "these words are decoration".
471
+ * - the words being in the name already.
472
+ *
473
+ * Returns what is lost rather than a boolean, so a caller can say which
474
+ * words rather than that some exist.
475
+ */
476
+ export declare function canvasUnreadableText(scene: CanvasScene, accessibleName?: string): string[];
477
+ /**
478
+ * Says it once per surface per distinct loss.
479
+ *
480
+ * Not once ever: a chart whose labels change has lost different words and
481
+ * that is news. Not once per render either -- a redraw is not.
482
+ */
483
+ export declare function reportUnreadableText(lost: string[], warn: (message: string) => void): void;
484
+ /** Shared by the Web and Native roots; `collector` executes arbitrary React composition. */
485
+ export declare function useCanvasScene(children: ReactNode): {
486
+ scene: CanvasScene;
487
+ collector: import("react").JSX.Element;
488
+ isInteractive: (id: string) => boolean;
489
+ press: (id: string, event: CanvasPressEvent) => CanvasDestination | undefined;
490
+ activate: (id: string | undefined, event: CanvasPressEvent | undefined) => void;
491
+ interactions: CanvasInteractionStore;
492
+ interactionRevision: number;
493
+ };
494
+ export {};
495
+ //# sourceMappingURL=scene.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scene.d.ts","sourceRoot":"","sources":["../src/scene.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EASf,MAAM,OAAO,CAAA;AAEd,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEhD,MAAM,WAAW,gBAAgB;IAC/B,2DAA2D;IAC3D,KAAK,EAAE,WAAW,CAAA;IAClB,6DAA6D;IAC7D,YAAY,EAAE,WAAW,CAAA;IACzB,iFAAiF;IACjF,MAAM,EAAE,OAAO,CAAA;IACf,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,OAAO,CAAA;IACjB,kEAAkE;IAClE,MAAM,EAAE,MAAM,CAAA;IACd,wFAAwF;IACxF,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAA;IAClC,gGAAgG;IAChG,cAAc,IAAI,IAAI,CAAA;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,gFAAgF;IAChF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,UAAU,oBAAoB;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,8FAA8F;AAC9F,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,WAAW,EAClB,YAAY,EAAE,WAAW,EACzB,SAAS,GAAE,oBAAyB,GACnC,gBAAgB,CAqBlB;AAED,MAAM,WAAW,sBAAsB;IACrC,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