@grida/canvas-wasm 0.89.0-canary.2 → 0.89.0-canary.3

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
@@ -715,7 +715,18 @@ declare namespace types {
715
715
  height: number;
716
716
  };
717
717
  type ExportConstraints = {
718
- type: "SCALE" | "WIDTH" | "HEIGHT";
718
+ /**
719
+ * - none: as-is, no resizing, scaling
720
+ * - scale: scale with factor
721
+ * - scale-to-fit-width: scale to fit width (with same aspect ratio)
722
+ * - scale-to-fit-height: scale to fit height (with same aspect ratio)
723
+ */
724
+ type: "none" | "scale" | "scale-to-fit-width" | "scale-to-fit-height";
725
+ /**
726
+ * - scale: scale factor
727
+ * - scale-to-fit-width: width in pixels
728
+ * - scale-to-fit-height: height in pixels
729
+ */
719
730
  value: number;
720
731
  };
721
732
  type ExportAs = ExportAsImage | ExportAsPDF | ExportAsSVG;
@@ -725,10 +736,34 @@ declare namespace types {
725
736
  type ExportAsSVG = {
726
737
  format: "SVG";
727
738
  };
728
- type ExportAsImage = {
729
- format: "PNG" | "JPEG" | "WEBP" | "BMP";
739
+ type ExportAsPNG = {
740
+ format: "PNG";
730
741
  constraints: ExportConstraints;
731
742
  };
743
+ type ExportAsJPEG = {
744
+ format: "JPEG";
745
+ constraints: ExportConstraints;
746
+ /**
747
+ * Quality setting for JPEG compression (0-100). Higher values mean better quality but larger file size.
748
+ * @default 100
749
+ */
750
+ quality?: number;
751
+ };
752
+ type ExportAsWEBP = {
753
+ format: "WEBP";
754
+ constraints: ExportConstraints;
755
+ /**
756
+ * Quality setting for WEBP compression (0-100). Higher values mean better quality but larger file size.
757
+ * Quality 100 is lossless. Lower values use lossy compression.
758
+ * @default 75
759
+ */
760
+ quality?: number;
761
+ };
762
+ type ExportAsBMP = {
763
+ format: "BMP";
764
+ constraints: ExportConstraints;
765
+ };
766
+ type ExportAsImage = ExportAsPNG | ExportAsJPEG | ExportAsWEBP | ExportAsBMP;
732
767
  type FontKey = {
733
768
  family: string;
734
769
  };
package/dist/index.d.ts CHANGED
@@ -715,7 +715,18 @@ declare namespace types {
715
715
  height: number;
716
716
  };
717
717
  type ExportConstraints = {
718
- type: "SCALE" | "WIDTH" | "HEIGHT";
718
+ /**
719
+ * - none: as-is, no resizing, scaling
720
+ * - scale: scale with factor
721
+ * - scale-to-fit-width: scale to fit width (with same aspect ratio)
722
+ * - scale-to-fit-height: scale to fit height (with same aspect ratio)
723
+ */
724
+ type: "none" | "scale" | "scale-to-fit-width" | "scale-to-fit-height";
725
+ /**
726
+ * - scale: scale factor
727
+ * - scale-to-fit-width: width in pixels
728
+ * - scale-to-fit-height: height in pixels
729
+ */
719
730
  value: number;
720
731
  };
721
732
  type ExportAs = ExportAsImage | ExportAsPDF | ExportAsSVG;
@@ -725,10 +736,34 @@ declare namespace types {
725
736
  type ExportAsSVG = {
726
737
  format: "SVG";
727
738
  };
728
- type ExportAsImage = {
729
- format: "PNG" | "JPEG" | "WEBP" | "BMP";
739
+ type ExportAsPNG = {
740
+ format: "PNG";
730
741
  constraints: ExportConstraints;
731
742
  };
743
+ type ExportAsJPEG = {
744
+ format: "JPEG";
745
+ constraints: ExportConstraints;
746
+ /**
747
+ * Quality setting for JPEG compression (0-100). Higher values mean better quality but larger file size.
748
+ * @default 100
749
+ */
750
+ quality?: number;
751
+ };
752
+ type ExportAsWEBP = {
753
+ format: "WEBP";
754
+ constraints: ExportConstraints;
755
+ /**
756
+ * Quality setting for WEBP compression (0-100). Higher values mean better quality but larger file size.
757
+ * Quality 100 is lossless. Lower values use lossy compression.
758
+ * @default 75
759
+ */
760
+ quality?: number;
761
+ };
762
+ type ExportAsBMP = {
763
+ format: "BMP";
764
+ constraints: ExportConstraints;
765
+ };
766
+ type ExportAsImage = ExportAsPNG | ExportAsJPEG | ExportAsWEBP | ExportAsBMP;
732
767
  type FontKey = {
733
768
  family: string;
734
769
  };
package/dist/index.js CHANGED
@@ -6136,7 +6136,7 @@ module.exports = __toCommonJS(index_exports);
6136
6136
  var import_grida_canvas_wasm = __toESM(require_grida_canvas_wasm());
6137
6137
 
6138
6138
  // package.json
6139
- var version = "0.89.0-canary.2";
6139
+ var version = "0.89.0-canary.3";
6140
6140
 
6141
6141
  // lib/modules/fonts.ts
6142
6142
  var FontsAPI = class {
package/dist/index.mjs CHANGED
@@ -6125,7 +6125,7 @@ var require_grida_canvas_wasm = __commonJS({
6125
6125
  var import_grida_canvas_wasm = __toESM(require_grida_canvas_wasm());
6126
6126
 
6127
6127
  // package.json
6128
- var version = "0.89.0-canary.2";
6128
+ var version = "0.89.0-canary.3";
6129
6129
 
6130
6130
  // lib/modules/fonts.ts
6131
6131
  var FontsAPI = class {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@grida/canvas-wasm",
3
3
  "description": "WASM bindings for Grida Canvas",
4
- "version": "0.89.0-canary.2",
4
+ "version": "0.89.0-canary.3",
5
5
  "keywords": [
6
6
  "grida",
7
7
  "canvas",