@grida/canvas-wasm 0.0.43 → 0.0.45
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/dist/grida-canvas-wasm.js +1 -1
- package/dist/grida_canvas_wasm.wasm +0 -0
- package/dist/index.d.mts +22 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +134 -102
- package/dist/index.mjs +134 -102
- package/package.json +1 -1
|
Binary file
|
package/dist/index.d.mts
CHANGED
|
@@ -133,6 +133,12 @@ declare namespace createGridaCanvas {
|
|
|
133
133
|
fmt_len: number
|
|
134
134
|
): Ptr;
|
|
135
135
|
|
|
136
|
+
_to_vector_network(
|
|
137
|
+
state: GridaCanvasWebGlApplicationPtr,
|
|
138
|
+
id_ptr: number,
|
|
139
|
+
id_len: number
|
|
140
|
+
): Ptr;
|
|
141
|
+
|
|
136
142
|
_command(
|
|
137
143
|
state: GridaCanvasWebGlApplicationPtr,
|
|
138
144
|
id: number,
|
|
@@ -193,6 +199,7 @@ interface GridaCanvasModuleInitOptions {
|
|
|
193
199
|
*/
|
|
194
200
|
locateFile(file: string, version: string): string;
|
|
195
201
|
}
|
|
202
|
+
type Vector2 = [number, number];
|
|
196
203
|
type Transform2D = [[number, number, number], [number, number, number]];
|
|
197
204
|
type Rectangle = {
|
|
198
205
|
x: number;
|
|
@@ -215,6 +222,17 @@ type ExportAsImage = {
|
|
|
215
222
|
format: "PNG" | "JPEG" | "WEBP" | "BMP";
|
|
216
223
|
constraints: ExportConstraints;
|
|
217
224
|
};
|
|
225
|
+
type VectorNetworkVertex = Vector2;
|
|
226
|
+
type VectorNetworkSegment = {
|
|
227
|
+
a: number;
|
|
228
|
+
b: number;
|
|
229
|
+
ta: Vector2;
|
|
230
|
+
tb: Vector2;
|
|
231
|
+
};
|
|
232
|
+
interface VectorNetwork {
|
|
233
|
+
vertices: VectorNetworkVertex[];
|
|
234
|
+
segments: VectorNetworkSegment[];
|
|
235
|
+
}
|
|
218
236
|
declare function init(opts?: GridaCanvasModuleInitOptions): Promise<ApplicationFactory>;
|
|
219
237
|
interface CreateWebGLCanvasSurfaceOptions {
|
|
220
238
|
/**
|
|
@@ -277,6 +295,10 @@ declare class Grida2D {
|
|
|
277
295
|
getNodeIdsFromPoint(x: number, y: number): string[];
|
|
278
296
|
getNodeIdsFromEnvelope(envelope: Rectangle): string[];
|
|
279
297
|
getNodeAbsoluteBoundingBox(id: string): Rectangle | null;
|
|
298
|
+
/**
|
|
299
|
+
* @deprecated not fully implemented yet
|
|
300
|
+
*/
|
|
301
|
+
toVectorNetwork(id: string): VectorNetwork | null;
|
|
280
302
|
exportNodeAs(id: string, format: ExportAs): {
|
|
281
303
|
data: Uint8Array;
|
|
282
304
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -133,6 +133,12 @@ declare namespace createGridaCanvas {
|
|
|
133
133
|
fmt_len: number
|
|
134
134
|
): Ptr;
|
|
135
135
|
|
|
136
|
+
_to_vector_network(
|
|
137
|
+
state: GridaCanvasWebGlApplicationPtr,
|
|
138
|
+
id_ptr: number,
|
|
139
|
+
id_len: number
|
|
140
|
+
): Ptr;
|
|
141
|
+
|
|
136
142
|
_command(
|
|
137
143
|
state: GridaCanvasWebGlApplicationPtr,
|
|
138
144
|
id: number,
|
|
@@ -193,6 +199,7 @@ interface GridaCanvasModuleInitOptions {
|
|
|
193
199
|
*/
|
|
194
200
|
locateFile(file: string, version: string): string;
|
|
195
201
|
}
|
|
202
|
+
type Vector2 = [number, number];
|
|
196
203
|
type Transform2D = [[number, number, number], [number, number, number]];
|
|
197
204
|
type Rectangle = {
|
|
198
205
|
x: number;
|
|
@@ -215,6 +222,17 @@ type ExportAsImage = {
|
|
|
215
222
|
format: "PNG" | "JPEG" | "WEBP" | "BMP";
|
|
216
223
|
constraints: ExportConstraints;
|
|
217
224
|
};
|
|
225
|
+
type VectorNetworkVertex = Vector2;
|
|
226
|
+
type VectorNetworkSegment = {
|
|
227
|
+
a: number;
|
|
228
|
+
b: number;
|
|
229
|
+
ta: Vector2;
|
|
230
|
+
tb: Vector2;
|
|
231
|
+
};
|
|
232
|
+
interface VectorNetwork {
|
|
233
|
+
vertices: VectorNetworkVertex[];
|
|
234
|
+
segments: VectorNetworkSegment[];
|
|
235
|
+
}
|
|
218
236
|
declare function init(opts?: GridaCanvasModuleInitOptions): Promise<ApplicationFactory>;
|
|
219
237
|
interface CreateWebGLCanvasSurfaceOptions {
|
|
220
238
|
/**
|
|
@@ -277,6 +295,10 @@ declare class Grida2D {
|
|
|
277
295
|
getNodeIdsFromPoint(x: number, y: number): string[];
|
|
278
296
|
getNodeIdsFromEnvelope(envelope: Rectangle): string[];
|
|
279
297
|
getNodeAbsoluteBoundingBox(id: string): Rectangle | null;
|
|
298
|
+
/**
|
|
299
|
+
* @deprecated not fully implemented yet
|
|
300
|
+
*/
|
|
301
|
+
toVectorNetwork(id: string): VectorNetwork | null;
|
|
280
302
|
exportNodeAs(id: string, format: ExportAs): {
|
|
281
303
|
data: Uint8Array;
|
|
282
304
|
};
|