@grida/canvas-wasm 0.0.84-canary.0 → 0.0.86-canary.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.
Binary file
package/dist/index.d.mts CHANGED
@@ -193,6 +193,32 @@ declare namespace fonts {
193
193
  }
194
194
  }
195
195
 
196
+ declare namespace markdown {
197
+ export type MarkdownToHtmlResponse = CAPIMethodResult<{
198
+ /** Converted HTML string */
199
+ html: string;
200
+ }>;
201
+
202
+ // ====================================================================================================
203
+ // #region: WASM Function Declarations
204
+ // ====================================================================================================
205
+
206
+ export interface MarkdownModule {
207
+ // ====================================================================================================
208
+ // #region: High-Level Markdown APIs
209
+ // ====================================================================================================
210
+
211
+ /**
212
+ * Converts markdown text to HTML.
213
+ * Parses markdown content and converts it to HTML using the pulldown-cmark library.
214
+ *
215
+ * @param markdown - Pointer to input markdown string (null-terminated C string)
216
+ * @returns Pointer to JSON string containing {@link MarkdownToHtmlResponse}
217
+ */
218
+ _grida_markdown_to_html(markdown: CPtr): CPtr;
219
+ }
220
+ }
221
+
196
222
  declare namespace svgtypes {
197
223
  // ====================================================================================================
198
224
  // #region: Core Type Definitions
@@ -398,6 +424,7 @@ declare namespace createGridaCanvas$1 {
398
424
  extends emscripten.emscripten_EXPORTED_RUNTIME_METHODS,
399
425
  canvas.CanvasModule,
400
426
  fonts.FontsModule,
427
+ markdown.MarkdownModule,
401
428
  svg.SVGModule {}
402
429
  }
403
430
 
@@ -453,6 +480,37 @@ declare class FontsAPI {
453
480
  parseFont(fontData: ArrayBuffer | Uint8Array, faceId: string, userFontStyleItalic?: boolean): Promise<fonts.types.FaceRecord>;
454
481
  }
455
482
 
483
+ declare class MarkdownAPI {
484
+ private module;
485
+ constructor(module: any);
486
+ /**
487
+ * Allocates memory for a string and returns pointer and length.
488
+ * @param txt - String to allocate
489
+ * @returns [pointer, length] tuple
490
+ */
491
+ private _alloc_string;
492
+ /**
493
+ * Frees memory allocated for a string.
494
+ * @param ptr - Pointer to free
495
+ * @param len - Length of allocated memory
496
+ */
497
+ private _free_string;
498
+ /**
499
+ * Converts a WASM-allocated string to JavaScript string and frees the WASM memory.
500
+ * @param ptr - Pointer to WASM string
501
+ * @returns JavaScript string
502
+ */
503
+ private _string_from_wasm;
504
+ /**
505
+ * Converts markdown text to HTML with JavaScript-friendly interface.
506
+ * Parses markdown content and converts it to HTML using the pulldown-cmark library.
507
+ *
508
+ * @param markdown - Input markdown string
509
+ * @returns MarkdownToHtmlResponse containing the converted HTML or error information
510
+ */
511
+ toHtml(markdown: string): markdown.MarkdownToHtmlResponse;
512
+ }
513
+
456
514
  declare class SVGAPI {
457
515
  private module;
458
516
  constructor(module: any);
@@ -502,6 +560,7 @@ declare class Scene {
502
560
  private appptr;
503
561
  private module;
504
562
  readonly fontskit: FontsAPI;
563
+ readonly markdownkit: MarkdownAPI;
505
564
  readonly svgkit: SVGAPI;
506
565
  constructor(module: createGridaCanvas.GridaCanvasWasmBindings, ptr: number);
507
566
  /**
package/dist/index.d.ts CHANGED
@@ -193,6 +193,32 @@ declare namespace fonts {
193
193
  }
194
194
  }
195
195
 
196
+ declare namespace markdown {
197
+ export type MarkdownToHtmlResponse = CAPIMethodResult<{
198
+ /** Converted HTML string */
199
+ html: string;
200
+ }>;
201
+
202
+ // ====================================================================================================
203
+ // #region: WASM Function Declarations
204
+ // ====================================================================================================
205
+
206
+ export interface MarkdownModule {
207
+ // ====================================================================================================
208
+ // #region: High-Level Markdown APIs
209
+ // ====================================================================================================
210
+
211
+ /**
212
+ * Converts markdown text to HTML.
213
+ * Parses markdown content and converts it to HTML using the pulldown-cmark library.
214
+ *
215
+ * @param markdown - Pointer to input markdown string (null-terminated C string)
216
+ * @returns Pointer to JSON string containing {@link MarkdownToHtmlResponse}
217
+ */
218
+ _grida_markdown_to_html(markdown: CPtr): CPtr;
219
+ }
220
+ }
221
+
196
222
  declare namespace svgtypes {
197
223
  // ====================================================================================================
198
224
  // #region: Core Type Definitions
@@ -398,6 +424,7 @@ declare namespace createGridaCanvas$1 {
398
424
  extends emscripten.emscripten_EXPORTED_RUNTIME_METHODS,
399
425
  canvas.CanvasModule,
400
426
  fonts.FontsModule,
427
+ markdown.MarkdownModule,
401
428
  svg.SVGModule {}
402
429
  }
403
430
 
@@ -453,6 +480,37 @@ declare class FontsAPI {
453
480
  parseFont(fontData: ArrayBuffer | Uint8Array, faceId: string, userFontStyleItalic?: boolean): Promise<fonts.types.FaceRecord>;
454
481
  }
455
482
 
483
+ declare class MarkdownAPI {
484
+ private module;
485
+ constructor(module: any);
486
+ /**
487
+ * Allocates memory for a string and returns pointer and length.
488
+ * @param txt - String to allocate
489
+ * @returns [pointer, length] tuple
490
+ */
491
+ private _alloc_string;
492
+ /**
493
+ * Frees memory allocated for a string.
494
+ * @param ptr - Pointer to free
495
+ * @param len - Length of allocated memory
496
+ */
497
+ private _free_string;
498
+ /**
499
+ * Converts a WASM-allocated string to JavaScript string and frees the WASM memory.
500
+ * @param ptr - Pointer to WASM string
501
+ * @returns JavaScript string
502
+ */
503
+ private _string_from_wasm;
504
+ /**
505
+ * Converts markdown text to HTML with JavaScript-friendly interface.
506
+ * Parses markdown content and converts it to HTML using the pulldown-cmark library.
507
+ *
508
+ * @param markdown - Input markdown string
509
+ * @returns MarkdownToHtmlResponse containing the converted HTML or error information
510
+ */
511
+ toHtml(markdown: string): markdown.MarkdownToHtmlResponse;
512
+ }
513
+
456
514
  declare class SVGAPI {
457
515
  private module;
458
516
  constructor(module: any);
@@ -502,6 +560,7 @@ declare class Scene {
502
560
  private appptr;
503
561
  private module;
504
562
  readonly fontskit: FontsAPI;
563
+ readonly markdownkit: MarkdownAPI;
505
564
  readonly svgkit: SVGAPI;
506
565
  constructor(module: createGridaCanvas.GridaCanvasWasmBindings, ptr: number);
507
566
  /**