@reearth/ezu 0.2.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-APACHE +201 -0
- package/LICENSE-MIT +21 -0
- package/README.md +88 -0
- package/bundler/ezu.d.ts +129 -0
- package/bundler/ezu.js +9 -0
- package/bundler/ezu_bg.js +577 -0
- package/bundler/ezu_bg.wasm +0 -0
- package/bundler/ezu_bg.wasm.d.ts +36 -0
- package/nodejs/ezu.d.ts +129 -0
- package/nodejs/ezu.js +585 -0
- package/nodejs/ezu_bg.wasm +0 -0
- package/nodejs/ezu_bg.wasm.d.ts +36 -0
- package/nodejs/package.json +1 -0
- package/package.json +63 -0
- package/web/ezu.d.ts +190 -0
- package/web/ezu.js +677 -0
- package/web/ezu_bg.wasm +0 -0
- package/web/ezu_bg.wasm.d.ts +36 -0
package/nodejs/ezu.d.ts
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Buffered log sink that captures `tracing` events from the renderer.
|
|
6
|
+
*
|
|
7
|
+
* Construct once near the top of your bootstrap, then either set a
|
|
8
|
+
* callback for live forwarding (`onEvent(e => console.log(e))`) or
|
|
9
|
+
* `drainLines()` periodically to flush into a UI panel.
|
|
10
|
+
*/
|
|
11
|
+
export class LogSink {
|
|
12
|
+
free(): void;
|
|
13
|
+
[Symbol.dispose](): void;
|
|
14
|
+
/**
|
|
15
|
+
* Drop all buffered records without returning them.
|
|
16
|
+
*/
|
|
17
|
+
clear(): void;
|
|
18
|
+
/**
|
|
19
|
+
* Drain every buffered record. Returns a JS array of structured
|
|
20
|
+
* objects `{ level, target, message, fields, timestampMs }`.
|
|
21
|
+
*/
|
|
22
|
+
drain(): Array<any>;
|
|
23
|
+
/**
|
|
24
|
+
* Drain buffered records and return pre-formatted strings — the
|
|
25
|
+
* same shape the CLI prints. Convenient for `console.log(lines.join('\n'))`.
|
|
26
|
+
*/
|
|
27
|
+
drainLines(): string[];
|
|
28
|
+
/**
|
|
29
|
+
* `true` if no records are buffered.
|
|
30
|
+
*/
|
|
31
|
+
isEmpty(): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Install (idempotently) the global tracing subscriber. `level` is
|
|
34
|
+
* an `EnvFilter` string — e.g. `"info"`, `"debug"`,
|
|
35
|
+
* `"info,ezu_graph::eval=debug"`. Honoured on first call only.
|
|
36
|
+
*/
|
|
37
|
+
constructor(level: string);
|
|
38
|
+
/**
|
|
39
|
+
* Set (or clear with `null` / `undefined`) the per-event JS
|
|
40
|
+
* callback. The callback receives a structured record object.
|
|
41
|
+
*/
|
|
42
|
+
onEvent(callback?: Function | null): void;
|
|
43
|
+
/**
|
|
44
|
+
* Resize the ring-buffer cap. Older entries are evicted FIFO once
|
|
45
|
+
* the buffer reaches the new cap. Default is 4096.
|
|
46
|
+
*/
|
|
47
|
+
setCapacity(cap: number): void;
|
|
48
|
+
/**
|
|
49
|
+
* Number of records currently buffered.
|
|
50
|
+
*/
|
|
51
|
+
readonly len: number;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Stateful WASM renderer.
|
|
56
|
+
*/
|
|
57
|
+
export class Renderer {
|
|
58
|
+
free(): void;
|
|
59
|
+
[Symbol.dispose](): void;
|
|
60
|
+
/**
|
|
61
|
+
* Number of brushes currently registered.
|
|
62
|
+
*/
|
|
63
|
+
brushCount(): number;
|
|
64
|
+
/**
|
|
65
|
+
* Drop every registered brush.
|
|
66
|
+
*/
|
|
67
|
+
clearBrushes(): void;
|
|
68
|
+
/**
|
|
69
|
+
* Build a renderer from a style JSON document.
|
|
70
|
+
*/
|
|
71
|
+
constructor(style_json: string);
|
|
72
|
+
/**
|
|
73
|
+
* Register a `.myb` brush under `name` so a `brush-file` node with
|
|
74
|
+
* `src: "@name"` (via the style's `assets` map) resolves to it.
|
|
75
|
+
* Re-registering the same name replaces the previous entry.
|
|
76
|
+
*/
|
|
77
|
+
registerBrush(name: string, myb_json: string): void;
|
|
78
|
+
/**
|
|
79
|
+
* Render a single tile to PNG bytes using the style's `tile-size` / `pad`.
|
|
80
|
+
* Pass `null` for `mvtBytes` to get a paper-only tile.
|
|
81
|
+
*
|
|
82
|
+
* Optional `options`: `{ png: { compression: 'fast' | 'default' | 'best' } }`.
|
|
83
|
+
*/
|
|
84
|
+
render(mvt_bytes: Uint8Array | null | undefined, z: number, x: number, y: number, options?: object | null): Uint8Array;
|
|
85
|
+
/**
|
|
86
|
+
* Like `render` but with `tile_size` / `pad` overridden — useful for
|
|
87
|
+
* hi-DPI / preview rendering without mutating the style.
|
|
88
|
+
*/
|
|
89
|
+
renderAt(mvt_bytes: Uint8Array | null | undefined, z: number, x: number, y: number, tile_size: number, pad: number, options?: object | null): Uint8Array;
|
|
90
|
+
/**
|
|
91
|
+
* Render a single tile to straight RGBA8 bytes (`tile_w * tile_h * 4`).
|
|
92
|
+
*/
|
|
93
|
+
renderRgba(mvt_bytes: Uint8Array | null | undefined, z: number, x: number, y: number): Uint8Array;
|
|
94
|
+
/**
|
|
95
|
+
* Like `renderRgba` but with `tile_size` / `pad` overridden.
|
|
96
|
+
*/
|
|
97
|
+
renderRgbaAt(mvt_bytes: Uint8Array | null | undefined, z: number, x: number, y: number, tile_size: number, pad: number): Uint8Array;
|
|
98
|
+
/**
|
|
99
|
+
* Render a single tile to lossless WebP bytes. Smaller than PNG
|
|
100
|
+
* for the same painterly content and decoded natively by every
|
|
101
|
+
* modern browser. WebP is lossless-only via the pure-Rust
|
|
102
|
+
* `image-webp` codec; for lossy WebP, see the
|
|
103
|
+
* `OffscreenCanvas.convertToBlob` recipe in the crate README.
|
|
104
|
+
*/
|
|
105
|
+
renderWebp(mvt_bytes: Uint8Array | null | undefined, z: number, x: number, y: number, options?: object | null): Uint8Array;
|
|
106
|
+
/**
|
|
107
|
+
* Like `renderWebp` but with `tile_size` / `pad` overridden.
|
|
108
|
+
*/
|
|
109
|
+
renderWebpAt(mvt_bytes: Uint8Array | null | undefined, z: number, x: number, y: number, tile_size: number, pad: number, options?: object | null): Uint8Array;
|
|
110
|
+
/**
|
|
111
|
+
* Replace the active style. Returns the new node count. Invalidates
|
|
112
|
+
* the intermediate cache.
|
|
113
|
+
*/
|
|
114
|
+
setStyle(style_json: string): number;
|
|
115
|
+
/**
|
|
116
|
+
* Remove a brush by name. Returns `true` if the brush existed.
|
|
117
|
+
*/
|
|
118
|
+
unregisterBrush(name: string): boolean;
|
|
119
|
+
/**
|
|
120
|
+
* `tile-size` declared by the current style.
|
|
121
|
+
*/
|
|
122
|
+
readonly tileSize: number;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Whether the wasm binary was compiled with `+simd128`. Lets the demo
|
|
127
|
+
* page label the renderer build accurately.
|
|
128
|
+
*/
|
|
129
|
+
export function simdEnabled(): boolean;
|