@maxenve/ren-three 0.0.0-stage → 0.1.1

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.
@@ -0,0 +1,56 @@
1
+ import { Document } from 'ren-canv';
2
+ import { Replay2D } from 'ren-canv/backend';
3
+ export type Renderer = import('./index.js').Renderer;
4
+ /** @typedef {import('./index.js').Renderer} Renderer */
5
+ export declare class Surface extends Document {
6
+ owner: import("./index.js").Renderer;
7
+ panel: boolean;
8
+ replay: Replay2D;
9
+ /** The 2D canvas it draws on, where there is a document. @type {any} */
10
+ image: any;
11
+ /** @type {any} */
12
+ ctx: any;
13
+ texture: any;
14
+ mesh: any;
15
+ /** Stops the entry and mirror beside the three.js canvas. @type {(() => void) | null} */
16
+ stop: (() => void) | null;
17
+ /**
18
+ * @param {Renderer} owner @param {boolean} panel
19
+ */
20
+ constructor(owner: Renderer, panel: boolean);
21
+ get kind(): string;
22
+ get drawing(): boolean;
23
+ /** Sizes the canvas and the texture to the page, and a panel's plane. */
24
+ grow(): void;
25
+ sized(): void;
26
+ /** @param {import('ren-canv/backend').Frame} frame @param {import('ren-canv/backend').Damage | null} damage */
27
+ draw(frame: import('ren-canv/backend').Frame, damage: import('ren-canv/backend').Damage | null): void;
28
+ present(): boolean;
29
+ /**
30
+ * Keyboard focus to `item` in this surface (null blurs), as ren-canv's
31
+ * Document moves it, taking the focus from every other surface of the
32
+ * renderer first: one surface has the focus and hears the keys, also when
33
+ * code focuses an item (`focus()`, `focusFirst()`, ren-core's `$focus`)
34
+ * rather than a press. An item that cannot take the focus (not an Edit
35
+ * or an Action, or disabled) takes it from no other surface. A blur
36
+ * handler there that moves the focus (in its own surface or this one)
37
+ * wins, and `item` hears nothing, as in Chrome.
38
+ * @param {import('ren-canv').Item | null} item @param {boolean} [ring]
39
+ */
40
+ focus(item: import('ren-canv').Item | null, ring?: boolean): void;
41
+ /**
42
+ * Whether the item under a point, or an ancestor, hears a drag or a drop:
43
+ * where the overlay takes files dragged over it though nothing is painted
44
+ * there (a bare View with `onDrop`), as the DOM's element under them.
45
+ * @param {number} x @param {number} y
46
+ */
47
+ drops(x: number, y: number): boolean;
48
+ /**
49
+ * Where a box of the page shows on screen: the overlay's is the canvas's;
50
+ * a panel's corners are projected through the camera.
51
+ * @param {any} canvas @param {number} x @param {number} y @param {number} right @param {number} bottom
52
+ * @returns {[number, number, number, number]}
53
+ */
54
+ screen(canvas: any, x: number, y: number, right: number, bottom: number): [number, number, number, number];
55
+ close(): void;
56
+ }