@grida/canvas-wasm 0.0.61 → 0.0.63
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 +13 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +165 -124
- package/dist/index.mjs +165 -124
- package/package.json +1 -1
|
Binary file
|
package/dist/index.d.mts
CHANGED
|
@@ -266,6 +266,13 @@ declare class FontsAPI {
|
|
|
266
266
|
parseFont(fontData: ArrayBuffer | Uint8Array, faceId: string, userFontStyleItalic?: boolean): Promise<fonts.types.FaceRecord>;
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
+
interface CreateImageResourceResult {
|
|
270
|
+
hash: string;
|
|
271
|
+
url: string;
|
|
272
|
+
width: number;
|
|
273
|
+
height: number;
|
|
274
|
+
type: string;
|
|
275
|
+
}
|
|
269
276
|
declare class Scene {
|
|
270
277
|
private appptr;
|
|
271
278
|
private module;
|
|
@@ -306,7 +313,12 @@ declare class Scene {
|
|
|
306
313
|
* @param data - Raw font file bytes (e.g. TTF/OTF).
|
|
307
314
|
*/
|
|
308
315
|
addFont(family: string, data: Uint8Array): void;
|
|
309
|
-
addImage(data: Uint8Array):
|
|
316
|
+
addImage(data: Uint8Array): CreateImageResourceResult | false;
|
|
317
|
+
getImageBytes(ref: string): Uint8Array | null;
|
|
318
|
+
getImageSize(ref: string): {
|
|
319
|
+
width: number;
|
|
320
|
+
height: number;
|
|
321
|
+
} | null;
|
|
310
322
|
hasMissingFonts(): boolean;
|
|
311
323
|
listMissingFonts(): types.FontKey[];
|
|
312
324
|
listAvailableFonts(): types.FontKey[];
|
package/dist/index.d.ts
CHANGED
|
@@ -266,6 +266,13 @@ declare class FontsAPI {
|
|
|
266
266
|
parseFont(fontData: ArrayBuffer | Uint8Array, faceId: string, userFontStyleItalic?: boolean): Promise<fonts.types.FaceRecord>;
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
+
interface CreateImageResourceResult {
|
|
270
|
+
hash: string;
|
|
271
|
+
url: string;
|
|
272
|
+
width: number;
|
|
273
|
+
height: number;
|
|
274
|
+
type: string;
|
|
275
|
+
}
|
|
269
276
|
declare class Scene {
|
|
270
277
|
private appptr;
|
|
271
278
|
private module;
|
|
@@ -306,7 +313,12 @@ declare class Scene {
|
|
|
306
313
|
* @param data - Raw font file bytes (e.g. TTF/OTF).
|
|
307
314
|
*/
|
|
308
315
|
addFont(family: string, data: Uint8Array): void;
|
|
309
|
-
addImage(data: Uint8Array):
|
|
316
|
+
addImage(data: Uint8Array): CreateImageResourceResult | false;
|
|
317
|
+
getImageBytes(ref: string): Uint8Array | null;
|
|
318
|
+
getImageSize(ref: string): {
|
|
319
|
+
width: number;
|
|
320
|
+
height: number;
|
|
321
|
+
} | null;
|
|
310
322
|
hasMissingFonts(): boolean;
|
|
311
323
|
listMissingFonts(): types.FontKey[];
|
|
312
324
|
listAvailableFonts(): types.FontKey[];
|