@grida/canvas-wasm 0.91.0-canary.20 → 0.91.0-canary.22

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/README.md CHANGED
@@ -24,8 +24,9 @@ const factory = await init({
24
24
  const canvas = document.getElementById("canvas") as HTMLCanvasElement;
25
25
  const scene = factory.createWebGLCanvasSurface(canvas);
26
26
 
27
- // ready to draw
28
- scene.loadDummyScene();
27
+ // load a .grida document
28
+ const bytes = new Uint8Array(await (await fetch("scene.grida")).arrayBuffer());
29
+ scene.loadSceneGrida(bytes);
29
30
  ```
30
31
 
31
32
  ### Node (raster export)
@@ -0,0 +1,28 @@
1
+ ///
2
+ /// @grida/canvas-wasm grida-canvas-wasm.js typescript definitions
3
+ /// this is NOT generated by emscripten. update manually.
4
+ ///
5
+ /// see also:
6
+ /// - https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/emscripten/index.d.ts
7
+ ///
8
+
9
+ import type { fonts } from "../modules/fonts-bindings";
10
+ import type { markdown } from "../modules/markdown-bindings";
11
+ import type { svg } from "../modules/svg-bindings";
12
+
13
+ export = createGridaCanvas;
14
+ export as namespace createGridaCanvas;
15
+
16
+ declare function createGridaCanvas(moduleArg?: {
17
+ locateFile?: (path: string, scriptDirectory: string) => string;
18
+ }): Promise<createGridaCanvas.GridaCanvasWasmBindings>;
19
+
20
+ declare namespace createGridaCanvas {
21
+ interface GridaCanvasWasmBindings
22
+ extends
23
+ emscripten.emscripten_EXPORTED_RUNTIME_METHODS,
24
+ canvas.CanvasModule,
25
+ fonts.FontsModule,
26
+ markdown.MarkdownModule,
27
+ svg.SVGModule {}
28
+ }