@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.
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): string;
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): string;
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[];