qrdx 0.0.54 → 0.0.55

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.
Files changed (113) hide show
  1. package/README.md +1 -1
  2. package/dist/core.js +7 -7
  3. package/dist/core.js.map +1 -1
  4. package/dist/core.mjs +7 -7
  5. package/dist/core.mjs.map +1 -1
  6. package/dist/element.browser.mjs +6 -67
  7. package/dist/element.browser.mjs.map +1 -1
  8. package/dist/index.js +7 -7
  9. package/dist/index.js.map +1 -1
  10. package/dist/index.mjs +7 -7
  11. package/dist/index.mjs.map +1 -1
  12. package/dist/qr-code-canvas.js +1 -1
  13. package/dist/qr-code-canvas.js.map +1 -1
  14. package/dist/qr-code-canvas.mjs +1 -1
  15. package/dist/qr-code-canvas.mjs.map +1 -1
  16. package/dist/schemas.js +2 -0
  17. package/dist/schemas.js.map +1 -0
  18. package/dist/schemas.mjs +2 -0
  19. package/dist/schemas.mjs.map +1 -0
  20. package/dist/src/art.d.ts +1 -1
  21. package/dist/src/art.d.ts.map +1 -1
  22. package/dist/src/engine.d.ts +2 -1
  23. package/dist/src/engine.d.ts.map +1 -1
  24. package/dist/src/eps.d.ts.map +1 -1
  25. package/dist/src/frame-import.d.ts +1 -1
  26. package/dist/src/frame-import.d.ts.map +1 -1
  27. package/dist/src/frame-spec.d.ts +5 -4
  28. package/dist/src/frame-spec.d.ts.map +1 -1
  29. package/dist/src/frame.d.ts +1 -1
  30. package/dist/src/frame.d.ts.map +1 -1
  31. package/dist/src/frames/builtin.d.ts +1 -1
  32. package/dist/src/frames/builtin.d.ts.map +1 -1
  33. package/dist/src/qr-outline.d.ts +1 -2
  34. package/dist/src/qr-outline.d.ts.map +1 -1
  35. package/dist/src/qr-shape.d.ts +1 -1
  36. package/dist/src/qr-shape.d.ts.map +1 -1
  37. package/dist/src/silhouette.d.ts +1 -2
  38. package/dist/src/silhouette.d.ts.map +1 -1
  39. package/dist/src/template/dot-ring-layout.d.ts +26 -3
  40. package/dist/src/template/dot-ring-layout.d.ts.map +1 -1
  41. package/dist/src/template/dot-ring.d.ts +22 -4
  42. package/dist/src/template/dot-ring.d.ts.map +1 -1
  43. package/dist/src/utils.d.ts +1 -1
  44. package/dist/src/utils.d.ts.map +1 -1
  45. package/dist/types/art.d.ts +1 -18
  46. package/dist/types/art.d.ts.map +1 -1
  47. package/dist/types/color-helpers.d.ts +26 -0
  48. package/dist/types/color-helpers.d.ts.map +1 -0
  49. package/dist/types/color.d.ts +1 -24
  50. package/dist/types/color.d.ts.map +1 -1
  51. package/dist/types/constants.d.ts +97 -0
  52. package/dist/types/constants.d.ts.map +1 -0
  53. package/dist/types/corner-dot.d.ts +2 -12
  54. package/dist/types/corner-dot.d.ts.map +1 -1
  55. package/dist/types/corner-eye.d.ts +2 -11
  56. package/dist/types/corner-eye.d.ts.map +1 -1
  57. package/dist/types/frame-spec-parse.d.ts +21 -0
  58. package/dist/types/frame-spec-parse.d.ts.map +1 -0
  59. package/dist/types/frame-spec-rules.d.ts +95 -0
  60. package/dist/types/frame-spec-rules.d.ts.map +1 -0
  61. package/dist/types/frame-spec.d.ts +2 -83
  62. package/dist/types/frame-spec.d.ts.map +1 -1
  63. package/dist/types/frame.d.ts +1 -8
  64. package/dist/types/frame.d.ts.map +1 -1
  65. package/dist/types/image-pattern.d.ts +1 -1
  66. package/dist/types/image-pattern.d.ts.map +1 -1
  67. package/dist/types/index.d.ts +3 -22
  68. package/dist/types/index.d.ts.map +1 -1
  69. package/dist/types/index.js +2 -2
  70. package/dist/types/index.js.map +1 -1
  71. package/dist/types/index.mjs +2 -2
  72. package/dist/types/index.mjs.map +1 -1
  73. package/dist/types/plain.d.ts +17 -0
  74. package/dist/types/plain.d.ts.map +1 -0
  75. package/dist/types/qr.d.ts +2 -46
  76. package/dist/types/qr.d.ts.map +1 -1
  77. package/dist/types/schemas.d.ts +12 -0
  78. package/dist/types/schemas.d.ts.map +1 -0
  79. package/dist/vanilla.browser.mjs +28 -28
  80. package/dist/vanilla.browser.mjs.map +1 -1
  81. package/package.json +1 -1
  82. package/src/art.tsx +3 -6
  83. package/src/body-patterns.tsx +1 -1
  84. package/src/engine.ts +53 -1
  85. package/src/eps.ts +6 -1
  86. package/src/frame-import.ts +7 -6
  87. package/src/frame-spec.ts +17 -23
  88. package/src/frame.tsx +3 -2
  89. package/src/frames/builtin.ts +2 -5
  90. package/src/helpers.ts +1 -1
  91. package/src/qr-outline.ts +2 -2
  92. package/src/qr-shape.ts +2 -5
  93. package/src/scan-score.ts +2 -2
  94. package/src/silhouette.ts +2 -2
  95. package/src/template/dot-ring-layout.ts +281 -15
  96. package/src/template/dot-ring.tsx +27 -8
  97. package/src/utils/print-shared.ts +1 -1
  98. package/src/utils.tsx +6 -5
  99. package/types/art.ts +10 -20
  100. package/types/color-helpers.ts +132 -0
  101. package/types/color.ts +9 -122
  102. package/types/constants.ts +222 -0
  103. package/types/corner-dot.ts +8 -40
  104. package/types/corner-eye.ts +2 -31
  105. package/types/frame-spec-parse.ts +683 -0
  106. package/types/frame-spec-rules.ts +645 -0
  107. package/types/frame-spec.ts +38 -635
  108. package/types/frame.ts +14 -34
  109. package/types/image-pattern.ts +2 -26
  110. package/types/index.ts +6 -162
  111. package/types/plain.ts +117 -0
  112. package/types/qr.ts +29 -51
  113. package/types/schemas.ts +62 -0
@@ -1 +1 @@
1
- {"version":3,"file":"silhouette.d.ts","sourceRoot":"","sources":["../../src/silhouette.ts"],"names":[],"mappings":"AAAA,qEAAqE;AAQrE,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAOzC,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACjC,kFAAkF;IAClF,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAoID;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,WAAW,EACnB,OAAO,GAAE,mBAAwB,GAChC,YAAY,CAyFd;AAiCD;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,gBAAgB,EACxC,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,YAAY,CAAC,CAgCvB"}
1
+ {"version":3,"file":"silhouette.d.ts","sourceRoot":"","sources":["../../src/silhouette.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAOzC,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACjC,kFAAkF;IAClF,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAoID;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,WAAW,EACnB,OAAO,GAAE,mBAAwB,GAChC,YAAY,CAyFd;AAiCD;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,gBAAgB,EACxC,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,YAAY,CAAC,CAgCvB"}
@@ -28,17 +28,40 @@ export declare function dotsClearOfCode(dots: readonly Dot[], moduleSize: number
28
28
  export declare const DEFAULT_TEXT = "Scan the QR code * Scan the QR code * Scan the QR code * Scan the QR code *";
29
29
  export declare const DEFAULT_FONT_SIZE = 32;
30
30
  export declare const DEFAULT_LETTER_SPACING = 3.5;
31
+ /**
32
+ * Smallest font long text shrinks to before it's cut: half the default, as
33
+ * frame labels go no smaller than half their size (FRAME_FONT_SCALE_MIN).
34
+ * That's the share of the code the circle frame's smallest labels take.
35
+ */
36
+ export declare const MIN_FONT_SIZE: number;
31
37
  export interface RingLetter {
32
38
  char: string;
33
39
  x: number;
34
40
  y: number;
35
41
  rotate: number;
36
42
  }
37
- /** Letters of `text` along the ring, centered at the top or the bottom. */
38
- export declare function dotRingLetters(text: string, options: {
43
+ /** The text along the ring: its letters, and the size they're drawn at. */
44
+ export interface RingText {
45
+ /** The line as set: the text, cut or repeated to fit */
46
+ text: string;
47
+ letters: RingLetter[];
48
+ /** The asked size, or smaller when long text had to shrink */
49
+ fontSize: number;
50
+ letterSpacing: number;
51
+ }
52
+ /**
53
+ * Letters of `text` along the ring, centered at the top or the bottom.
54
+ * Text that fits is set as asked. Longer text tightens its spacing, then
55
+ * shrinks, then is cut at a word (fitRing), and never meets its own start.
56
+ * `fill: "repeat"` repeats the phrase round the whole ring (repeatRing).
57
+ */
58
+ export declare function dotRingText(text: string, options: {
39
59
  fontSize: number;
40
60
  letterSpacing: number;
41
61
  position: "top" | "bottom";
42
62
  rotation: number;
43
- }): RingLetter[];
63
+ fill?: "none" | "repeat";
64
+ }): RingText;
65
+ /** Letters of `text` along the ring (see dotRingText). */
66
+ export declare function dotRingLetters(text: string, options: Parameters<typeof dotRingText>[1]): RingLetter[];
44
67
  //# sourceMappingURL=dot-ring-layout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dot-ring-layout.d.ts","sourceRoot":"","sources":["../../../src/template/dot-ring-layout.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,IAAI,MAAM,CAAC;AACxB,eAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,+CAA+C;AAC/C,eAAO,MAAM,WAAW,QAAQ,CAAC;AACjC,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AACvC,eAAO,MAAM,iBAAiB,UAAU,CAAC;AACzC,oDAAoD;AACpD,eAAO,MAAM,SAAS,2XACoW,CAAC;AAoB3X,MAAM,WAAW,GAAG;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ;AAYD,gDAAgD;AAChD,wBAAgB,gBAAgB,IAAI,SAAS,GAAG,EAAE,CAejD;AAYD;;;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";
4
4
  export interface DotRingProps {
5
5
  /**
6
6
  * Text set along the ring. Defaults to "Scan the QR code" four times
7
- * round; `""` leaves the ring empty. Letters that don't fit around the
8
- * ring are left out.
7
+ * round; `""` leaves the ring empty. Text too long for the ring gets
8
+ * tighter letter spacing, then a smaller font (down to half of
9
+ * `fontSize`'s default); it never runs into its own start. Past that,
10
+ * text that repeats a phrase keeps as many whole copies as fit, and other
11
+ * text is cut after the last whole word that fits and ends with "…".
9
12
  */
10
13
  customText?: string;
14
+ /**
15
+ * "repeat" fills the ring: the phrase is repeated as many times as fit,
16
+ * with the spacing evened out so the copies close the ring with the same
17
+ * gap as between them. Give the phrase once ("Read the docs *"); text
18
+ * that already repeats a phrase ("A * A * A *") is read as that phrase.
19
+ * Default "none": the text is set once, centered over the top (or along
20
+ * the bottom).
21
+ */
22
+ textFill?: "none" | "repeat";
11
23
  /** "top" (default): centered over the top, reading clockwise. "bottom": centered along the bottom, reading left to right. */
12
24
  textPosition?: "top" | "bottom";
13
25
  /** Turns the text around the center, in degrees clockwise (default 0). */
@@ -18,9 +30,15 @@ export interface DotRingProps {
18
30
  fontFamily?: string;
19
31
  /** Font weight (default 900). */
20
32
  fontWeight?: number | string;
21
- /** Font size in the template's 593-unit drawing, where the code is 300 across (default 32). */
33
+ /**
34
+ * Font size in the template's 593-unit drawing, where the code is 300
35
+ * across (default 32). Long text may be drawn smaller (see `customText`).
36
+ */
22
37
  fontSize?: number;
23
- /** Extra space between letters, in the same units (default 3.5). */
38
+ /**
39
+ * Extra space between letters, in the same units (default 3.5). Long text
40
+ * and `textFill: "repeat"` adjust it to fit the ring.
41
+ */
24
42
  fontLetterSpacing?: number;
25
43
  /** Color of the ring (default: the code's `fgColor`). */
26
44
  outerCircleColor?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"dot-ring.d.ts","sourceRoot":"","sources":["../../../src/template/dot-ring.tsx"],"names":[],"mappings":"AAAA,8BAA8B;AAK9B,OAAO,KAAK,EAAE,kBAAkB,EAAE,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AAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC7B,6HAA6H;IAC7H,YAAY,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAChC,0EAA0E;IAC1E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kCAAkC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qFAAqF;IACrF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iCAAiC;IACjC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,yDAAyD;IACzD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4CAA4C;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6EAA6E;IAC7E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,6EAA6E;IAC7E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAKD,eAAO,MAAM,OAAO,EAAE,kBAAkB,CAAC,YAAY,CAoGpD,CAAC"}
@@ -1,6 +1,6 @@
1
1
  /** @jsxImportSource ./jsx */
2
2
  import type { ErrorLevel, Excavation, ImageSettings, Modules, QRSVGOptions } from "../types";
3
- import { type QRCodeShape } from "../types/qr";
3
+ import type { QRCodeShape } from "../types/qr";
4
4
  import { type QRNode } from "./jsx/runtime";
5
5
  export declare function excavateModules(modules: Modules, excavation: Excavation): Modules;
6
6
  export declare function generatePath(modules: Modules, margin?: number): string;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.tsx"],"names":[],"mappings":"AAAA,6BA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,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAqBxC,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,KAAG,MAM9D,CAAC;AAcF,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,EAAE,QAAQ,MAAM,KAAG,MAejE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC3B,OAAO,MAAM,KACZ;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAmBpD,CAAC"}
@@ -1,25 +1,10 @@
1
1
  import { z } from "zod";
2
- /**
3
- * Art modes blend a picture into the code itself (vector output, no AI):
4
- * - "logo" (Logo QR): the logo, traced into crisp vector shapes, either fills
5
- * the code under a fine dot screen ("blend") or sits on a rounded plate in
6
- * the middle of a code tinted with its colors ("badge").
7
- * - "halftone" (Image QR): the photo shows through every module around a
8
- * small center dot that keeps the module's dark/light value, in full color
9
- * ("color") or as an error-diffused black-and-white halftone ("mono").
10
- * Finder, alignment and format patterns always stay crisp.
11
- */
12
- export declare const QR_ART_MODES: readonly ["logo", "halftone"];
2
+ export { QR_ART_MAX_SAMPLE_SIZE, QR_ART_MODES, QR_ART_VARIANTS, } from "./constants";
13
3
  export declare const qrArtModeSchema: z.ZodEnum<{
14
4
  logo: "logo";
15
5
  halftone: "halftone";
16
6
  }>;
17
7
  export type QRArtMode = z.infer<typeof qrArtModeSchema>;
18
- /** Looks within each mode; the first one is the mode's default. */
19
- export declare const QR_ART_VARIANTS: {
20
- readonly logo: readonly ["blend", "badge"];
21
- readonly halftone: readonly ["color", "mono"];
22
- };
23
8
  export declare const qrArtVariantSchema: z.ZodEnum<{
24
9
  color: "color";
25
10
  blend: "blend";
@@ -27,8 +12,6 @@ export declare const qrArtVariantSchema: z.ZodEnum<{
27
12
  mono: "mono";
28
13
  }>;
29
14
  export type QRArtVariant = z.infer<typeof qrArtVariantSchema>;
30
- /** Largest side of an art sample grid, in pixels. */
31
- export declare const QR_ART_MAX_SAMPLE_SIZE = 192;
32
15
  /**
33
16
  * A small RGBA bitmap sampled from the source image (see `createQRArtImage`
34
17
  * and `loadQRArtImage`). Storing pixels instead of an image URL keeps
@@ -1 +1 @@
1
- {"version":3,"file":"art.d.ts","sourceRoot":"","sources":["../../types/art.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,+BAAgC,CAAC;AAE1D,eAAO,MAAM,eAAe;;;EAAuB,CAAC;AACpD,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,mEAAmE;AACnE,eAAO,MAAM,eAAe;;;CAG6B,CAAC;AAE1D,eAAO,MAAM,kBAAkB;;;;;EAG7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,qDAAqD;AACrD,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAI1C;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;;;;iBAa1B,CAAC;AACJ,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;iBAgBtB,CAAC;AACH,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
1
+ {"version":3,"file":"art.d.ts","sourceRoot":"","sources":["../../types/art.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,eAAe;;;EAAuB,CAAC;AACpD,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,kBAAkB;;;;;EAG7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;;;;iBAa1B,CAAC;AACJ,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;iBAgBtB,CAAC;AACH,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
@@ -0,0 +1,26 @@
1
+ import type { ColorConfig, Gradient, ImagePaint, ImagePosition, SolidColor } from "./color";
2
+ /**
3
+ * Helper to normalize color config to object format
4
+ */
5
+ export declare function normalizeColorConfig(color: ColorConfig | undefined, fallback?: string): SolidColor | Gradient | ImagePaint;
6
+ /**
7
+ * Helper to check if color is gradient
8
+ */
9
+ export declare function isGradient(color: ColorConfig | undefined): color is Gradient;
10
+ /** True for an image fill. */
11
+ export declare function isImagePaint(color: ColorConfig | undefined): color is ImagePaint;
12
+ /**
13
+ * Helper to get a solid color string from any ColorConfig
14
+ * For gradients, returns the first stop color; for an image fill, its
15
+ * underlay (or `fallback`)
16
+ */
17
+ export declare function getColorString(color: ColorConfig | undefined, fallback?: string): string;
18
+ /** CSS `background-position` for an image fill's position. */
19
+ export declare function imagePositionCss(position?: ImagePosition): string;
20
+ /**
21
+ * CSS `background` for a color config, for swatches and previews: the color
22
+ * itself, or a CSS gradient that matches how the engine draws it (a linear
23
+ * angle of 0 runs left to right, as in the QR code).
24
+ */
25
+ export declare function getNormalizedColor(color: ColorConfig | string | undefined): string;
26
+ //# sourceMappingURL=color-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color-helpers.d.ts","sourceRoot":"","sources":["../../types/color-helpers.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,WAAW,EACX,QAAQ,EACR,UAAU,EACV,aAAa,EACb,UAAU,EACX,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,WAAW,GAAG,SAAS,EAC9B,QAAQ,SAAY,GACnB,UAAU,GAAG,QAAQ,GAAG,UAAU,CAQpC;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,GAAG,KAAK,IAAI,QAAQ,CAS5E;AAED,8BAA8B;AAC9B,wBAAgB,YAAY,CAC1B,KAAK,EAAE,WAAW,GAAG,SAAS,GAC7B,KAAK,IAAI,UAAU,CAErB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,WAAW,GAAG,SAAS,EAC9B,QAAQ,SAAY,GACnB,MAAM,CASR;AAED,8DAA8D;AAC9D,wBAAgB,gBAAgB,CAAC,QAAQ,GAAE,aAAwB,GAAG,MAAM,CAW3E;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,GACtC,MAAM,CA2CR"}
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ export { getColorString, getNormalizedColor, imagePositionCss, isGradient, isImagePaint, normalizeColorConfig, } from "./color-helpers";
2
3
  /**
3
4
  * Color type discriminator
4
5
  */
@@ -183,28 +184,4 @@ export declare const colorConfigSchema: z.ZodUnion<readonly [z.ZodString, z.ZodO
183
184
  underlay: z.ZodOptional<z.ZodString>;
184
185
  }, z.core.$strip>]>;
185
186
  export type ColorConfig = z.infer<typeof colorConfigSchema>;
186
- /**
187
- * Helper to normalize color config to object format
188
- */
189
- export declare function normalizeColorConfig(color: ColorConfig | undefined, fallback?: string): SolidColor | Gradient | ImagePaint;
190
- /**
191
- * Helper to check if color is gradient
192
- */
193
- export declare function isGradient(color: ColorConfig | undefined): color is Gradient;
194
- /** True for an image fill. */
195
- export declare function isImagePaint(color: ColorConfig | undefined): color is ImagePaint;
196
- /**
197
- * Helper to get a solid color string from any ColorConfig
198
- * For gradients, returns the first stop color; for an image fill, its
199
- * underlay (or `fallback`)
200
- */
201
- export declare function getColorString(color: ColorConfig | undefined, fallback?: string): string;
202
- /** CSS `background-position` for an image fill's position. */
203
- export declare function imagePositionCss(position?: ImagePosition): string;
204
- /**
205
- * CSS `background` for a color config, for swatches and previews: the color
206
- * itself, or a CSS gradient that matches how the engine draws it (a linear
207
- * angle of 0 runs left to right, as in the QR code).
208
- */
209
- export declare function getNormalizedColor(color: ColorConfig | string | undefined): string;
210
187
  //# sourceMappingURL=color.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../types/color.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;EAM1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;;iBAG3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;iBAG7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;iBAI/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,oBA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,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB;;;;;;;iBAIhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,+CAA+C;AAC/C,MAAM,MAAM,QAAQ,GAAG,cAAc,GAAG,cAAc,GAAG,eAAe,CAAC;AAEzE,6EAA6E;AAC7E,eAAO,MAAM,cAAc;;;;EAAuC,CAAC;AACnE,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,gFAAgF;AAChF,eAAO,MAAM,mBAAmB;;;;;;;;;;EAU9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;iBAQ3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAO5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Art modes blend a picture into the code itself (vector output, no AI):
3
+ * - "logo" (Logo QR): the logo, traced into crisp vector shapes, either fills
4
+ * the code under a fine dot screen ("blend") or sits on a rounded plate in
5
+ * the middle of a code tinted with its colors ("badge").
6
+ * - "halftone" (Image QR): the photo shows through every module around a
7
+ * small center dot that keeps the module's dark/light value, in full color
8
+ * ("color") or as an error-diffused black-and-white halftone ("mono").
9
+ * Finder, alignment and format patterns always stay crisp.
10
+ */
11
+ export declare const QR_ART_MODES: readonly ["logo", "halftone"];
12
+ /** Looks within each mode; the first one is the mode's default. */
13
+ export declare const QR_ART_VARIANTS: {
14
+ readonly logo: readonly ["blend", "badge"];
15
+ readonly halftone: readonly ["color", "mono"];
16
+ };
17
+ /** Largest side of an art sample grid, in pixels. */
18
+ export declare const QR_ART_MAX_SAMPLE_SIZE = 192;
19
+ /**
20
+ * Eye centres to offer: every one decodes with jsQR and ZXing through a
21
+ * phone-camera model and in sharp renders (tests/catalog-*.test.ts).
22
+ */
23
+ export declare const CORNER_EYE_DOT_PATTERNS: readonly ["square", "rounded", "circle", "message", "message-reverse", "diya", "diya-reverse", "rounded-triangle", "leaf", "drop", "plus", "cross-rounded", "hexagon", "octagon", "flower", "heart", "squircle", "dots", "extra-rounded", "leaf-reverse", "drop-reverse"];
24
+ /**
25
+ * @deprecated Retired eye centres: they don't decode reliably (`diamond`
26
+ * and `star` fail ZXing at phone distances, `banner` fails jsQR in every
27
+ * sharp render). The renderer still draws them so saved designs keep
28
+ * working, but nothing offers them any more.
29
+ */
30
+ export declare const RETIRED_CORNER_EYE_DOT_PATTERNS: readonly ["diamond", "star", "banner"];
31
+ /**
32
+ * Eye frames to offer: every one decodes with jsQR and ZXing through a
33
+ * phone-camera model and in sharp renders (tests/catalog-*.test.ts).
34
+ */
35
+ export declare const CORNER_EYE_PATTERNS: readonly ["square", "rounded", "gear", "circle", "diya", "extra-rounded", "message", "pointy", "leaf", "drop", "octagon", "bevel", "squircle", "cushion", "shield", "petal", "leaf-reverse"];
36
+ /**
37
+ * @deprecated Retired eye frames: `curly` fails ZXing (most Android
38
+ * scanners) at 4–6 px per module and in sharp renders. The renderer still
39
+ * draws it so saved designs keep working, but nothing offers it any more.
40
+ */
41
+ export declare const RETIRED_CORNER_EYE_PATTERNS: readonly ["curly"];
42
+ export declare const BODY_PATTERN: readonly ["circle", "circle-large", "square", "diamond", "circle-mixed", "pacman", "rounded", "small-square", "vertical-line", "horizontal-line", "liquid", "liquid-horizontal", "liquid-vertical", "classy", "classy-rounded", "leaf", "plus", "hexagon", "star", "heart", "random-dots", "mosaic", "octagon"];
43
+ export declare const FRAME_STYLES: readonly ["none", "banner-bottom", "banner-top", "border", "rounded-border", "speech-bubble", "banner-top-bottom", "speech-bubble-top", "chat-bubble", "circle", "polaroid", "phone", "ticket", "badge", "envelope", "tag", "menu-card", "sticker", "gradient-border", "focus"];
44
+ /** Longest call-to-action label a frame renders. */
45
+ export declare const FRAME_TEXT_MAX_LENGTH = 24;
46
+ /** Label used when a frame has no `text`. Pass `""` to hide the label. */
47
+ export declare const DEFAULT_FRAME_TEXT = "Scan me";
48
+ /** Smallest and largest `fontScale` (label size relative to the default). */
49
+ export declare const FRAME_FONT_SCALE_MIN = 0.5;
50
+ export declare const FRAME_FONT_SCALE_MAX = 1.5;
51
+ /**
52
+ * How a logo is cropped: "square" (as uploaded), "rounded" corners or a
53
+ * "circle". A plate behind the logo takes the same shape.
54
+ */
55
+ export declare const LOGO_SHAPES: readonly ["square", "rounded", "circle"];
56
+ /**
57
+ * Smallest and largest logo width, as a share of the code's width. Above
58
+ * 25% even level H stops reading in our decode tests (tests/engine-options).
59
+ */
60
+ export declare const LOGO_SIZE_MIN = 0.1;
61
+ export declare const LOGO_SIZE_MAX = 0.3;
62
+ /** Logo width `getQRData` uses when no size is given (25%). */
63
+ export declare const LOGO_SIZE_DEFAULT = 0.25;
64
+ /** Most clear space around a logo, in modules. */
65
+ export declare const LOGO_PADDING_MAX = 2;
66
+ /** Smallest and largest `moduleScale` (size of each data module). */
67
+ export declare const MODULE_SCALE_MIN = 0.5;
68
+ export declare const MODULE_SCALE_MAX = 1;
69
+ /**
70
+ * Share of the code a logo may cover before `autoLevel` raises error
71
+ * correction to H (level L recovers about 7%).
72
+ */
73
+ export declare const AUTO_LEVEL_LOGO_COVERAGE = 0.07;
74
+ /**
75
+ * Outline of the whole code: "square" (the QR symbol as is), "circle" or
76
+ * "heart": the symbol sits in a disc or a heart filled with decorative
77
+ * modules. Decoders read only the symbol, which keeps its quiet ring
78
+ * (`margin`, at least QR_CIRCLE_QUIET_MIN modules) before the decoration
79
+ * starts. `shape` also takes a `QRSilhouette`, an outline of your own.
80
+ */
81
+ export declare const QR_SHAPES: readonly ["square", "circle", "heart"];
82
+ /** Smallest light ring between a shaped code's symbol and its decoration. */
83
+ export declare const QR_CIRCLE_QUIET_MIN = 3;
84
+ /** Most cells along a silhouette's longer side. */
85
+ export declare const QR_SILHOUETTE_MAX_CELLS = 64;
86
+ /** Fewest cells along each side of a silhouette. */
87
+ export declare const QR_SILHOUETTE_MIN_CELLS = 8;
88
+ /**
89
+ * Smallest share of the artwork's width the symbol and its quiet ring may
90
+ * take inside a silhouette (a circle code's is about 0.7, a heart's 0.6).
91
+ * Thinner silhouettes are refused: the code would be a small square in a
92
+ * large field of decoration.
93
+ */
94
+ export declare const QR_SILHOUETTE_MIN_SHARE = 0.42;
95
+ /** The three finder patterns, for per-eye colors. */
96
+ export declare const EYE_POSITIONS: readonly ["topLeft", "topRight", "bottomLeft"];
97
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../types/constants.ts"],"names":[],"mappings":"AAOA;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,+BAAgC,CAAC;AAE1D,mEAAmE;AACnE,eAAO,MAAM,eAAe;;;CAGiD,CAAC;AAE9E,qDAAqD;AACrD,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAI1C;;;GAGG;AACH,eAAO,MAAM,uBAAuB,2QAuB1B,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B,wCAIlC,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,mBAAmB,8LAmBtB,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,oBAAqB,CAAC;AAI9D,eAAO,MAAM,YAAY,iTAyBf,CAAC;AAIX,eAAO,MAAM,YAAY,iRAsBf,CAAC;AAEX,oDAAoD;AACpD,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,0EAA0E;AAC1E,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAE5C,6EAA6E;AAC7E,eAAO,MAAM,oBAAoB,MAAM,CAAC;AACxC,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAIxC;;;GAGG;AACH,eAAO,MAAM,WAAW,0CAA2C,CAAC;AAEpE;;;GAGG;AACH,eAAO,MAAM,aAAa,MAAM,CAAC;AACjC,eAAO,MAAM,aAAa,MAAM,CAAC;AACjC,+DAA+D;AAC/D,eAAO,MAAM,iBAAiB,OAAO,CAAC;AACtC,kDAAkD;AAClD,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC,qEAAqE;AACrE,eAAO,MAAM,gBAAgB,MAAM,CAAC;AACpC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC;;;GAGG;AACH,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAE7C;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,wCAAyC,CAAC;AAChE,6EAA6E;AAC7E,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC,mDAAmD;AACnD,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAC1C,oDAAoD;AACpD,eAAO,MAAM,uBAAuB,IAAI,CAAC;AACzC;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAE5C,qDAAqD;AACrD,eAAO,MAAM,aAAa,gDAAiD,CAAC"}
@@ -1,16 +1,6 @@
1
1
  import { z } from "zod";
2
- /**
3
- * Eye centres to offer: every one decodes with jsQR and ZXing through a
4
- * phone-camera model and in sharp renders (tests/catalog-*.test.ts).
5
- */
6
- export declare const CORNER_EYE_DOT_PATTERNS: readonly ["square", "rounded", "circle", "message", "message-reverse", "diya", "diya-reverse", "rounded-triangle", "leaf", "drop", "plus", "cross-rounded", "hexagon", "octagon", "flower", "heart", "squircle", "dots", "extra-rounded", "leaf-reverse", "drop-reverse"];
7
- /**
8
- * @deprecated Retired eye centres: they don't decode reliably (`diamond`
9
- * and `star` fail ZXing at phone distances, `banner` fails jsQR in every
10
- * sharp render). The renderer still draws them so saved designs keep
11
- * working, but nothing offers them any more.
12
- */
13
- export declare const RETIRED_CORNER_EYE_DOT_PATTERNS: readonly ["diamond", "star", "banner"];
2
+ import { CORNER_EYE_DOT_PATTERNS } from "./constants";
3
+ export { CORNER_EYE_DOT_PATTERNS, RETIRED_CORNER_EYE_DOT_PATTERNS, } from "./constants";
14
4
  /** Accepts current and retired values, so saved designs still validate. */
15
5
  export declare const cornerEyeDotPatternSchema: z.ZodEnum<{
16
6
  message: "message";
@@ -1 +1 @@
1
- {"version":3,"file":"corner-dot.d.ts","sourceRoot":"","sources":["../../types/corner-dot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,uBAAuB,2QAuB1B,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B,wCAIlC,CAAC;AAEX,2EAA2E;AAC3E,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;EAGpC,CAAC;AAEH,4EAA4E;AAC5E,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;EAE7C,CAAC;AAGF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,2BAA2B,GACrC,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"corner-dot.d.ts","sourceRoot":"","sources":["../../types/corner-dot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,uBAAuB,EAExB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,uBAAuB,EACvB,+BAA+B,GAChC,MAAM,aAAa,CAAC;AAErB,2EAA2E;AAC3E,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;EAGpC,CAAC;AAEH,4EAA4E;AAC5E,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;EAE7C,CAAC;AAGF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,2BAA2B,GACrC,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -1,15 +1,6 @@
1
1
  import { z } from "zod";
2
- /**
3
- * Eye frames to offer: every one decodes with jsQR and ZXing through a
4
- * phone-camera model and in sharp renders (tests/catalog-*.test.ts).
5
- */
6
- export declare const CORNER_EYE_PATTERNS: readonly ["square", "rounded", "gear", "circle", "diya", "extra-rounded", "message", "pointy", "leaf", "drop", "octagon", "bevel", "squircle", "cushion", "shield", "petal", "leaf-reverse"];
7
- /**
8
- * @deprecated Retired eye frames: `curly` fails ZXing (most Android
9
- * scanners) at 4–6 px per module and in sharp renders. The renderer still
10
- * draws it so saved designs keep working, but nothing offers it any more.
11
- */
12
- export declare const RETIRED_CORNER_EYE_PATTERNS: readonly ["curly"];
2
+ import { CORNER_EYE_PATTERNS } from "./constants";
3
+ export { CORNER_EYE_PATTERNS, RETIRED_CORNER_EYE_PATTERNS } from "./constants";
13
4
  /** Accepts current and retired values, so saved designs still validate. */
14
5
  export declare const cornerEyePatternSchema: z.ZodEnum<{
15
6
  message: "message";
@@ -1 +1 @@
1
- {"version":3,"file":"corner-eye.d.ts","sourceRoot":"","sources":["../../types/corner-eye.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,mBAAmB,8LAmBtB,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,oBAAqB,CAAC;AAE9D,2EAA2E;AAC3E,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;EAGjC,CAAC;AAEH,4EAA4E;AAC5E,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;EAA8B,CAAC;AAG1E,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"corner-eye.d.ts","sourceRoot":"","sources":["../../types/corner-eye.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAA+B,MAAM,aAAa,CAAC;AAE/E,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAE/E,2EAA2E;AAC3E,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;EAGjC,CAAC;AAEH,4EAA4E;AAC5E,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;EAA8B,CAAC;AAG1E,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ /** biome-ignore-all lint/style/noMagicNumbers: spec limits */
2
+ import type { FrameSpec } from "./frame-spec";
3
+ /** One problem with a spec: where it is, and what's wrong. */
4
+ export interface FrameSpecIssue {
5
+ path: (string | number)[];
6
+ message: string;
7
+ }
8
+ /**
9
+ * Parses `input` as a frame spec with every limit and check: a copy of it,
10
+ * or the problems. What `frameSpecSchema.safeParse` gives, without zod.
11
+ */
12
+ export declare function parseFrameSpec(input: unknown): {
13
+ success: true;
14
+ data: FrameSpec;
15
+ } | {
16
+ success: false;
17
+ issues: FrameSpecIssue[];
18
+ };
19
+ /** An issue as one line: `shapes.0.fill: Invalid input`. */
20
+ export declare const frameSpecIssueText: ({ path, message }: FrameSpecIssue) => string;
21
+ //# sourceMappingURL=frame-spec-parse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frame-spec-parse.d.ts","sourceRoot":"","sources":["../../types/frame-spec-parse.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAY9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAW9C,8DAA8D;AAC9D,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB;AA0nBD;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,OAAO,GAEZ;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,SAAS,CAAA;CAAE,GAClC;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,cAAc,EAAE,CAAA;CAAE,CAS/C;AAED,4DAA4D;AAC5D,eAAO,MAAM,kBAAkB,GAAI,mBAAmB,cAAc,WACP,CAAC"}
@@ -0,0 +1,95 @@
1
+ /** biome-ignore-all lint/style/noMagicNumbers: spec limits */
2
+ import type { FrameSpec, FrameSpecShape } from "./frame-spec";
3
+ export declare const FRAME_SPEC_KIND = "qrdx.frame";
4
+ export declare const FRAME_SPEC_VERSION = 1;
5
+ /** Value of `frame.style` that draws `frame.spec`. */
6
+ export declare const CUSTOM_FRAME_STYLE = "custom";
7
+ export declare const FRAME_SPEC_LIMITS: {
8
+ /** Artboard sides, in spec units */
9
+ readonly minArtboard: 50;
10
+ readonly maxArtboard: 2000;
11
+ /** Largest absolute coordinate anywhere in a spec */
12
+ readonly maxCoordinate: 4000;
13
+ /** Decimals a number may have */
14
+ readonly maxDecimals: 3;
15
+ readonly maxShapes: 64;
16
+ readonly maxLabels: 8;
17
+ readonly maxPolygonPoints: 256;
18
+ /** Characters in one path's data */
19
+ readonly maxPathLength: 16000;
20
+ /** Segments across the spec: path commands (arcs count 4), polygon points, dashes */
21
+ readonly maxSegments: 2000;
22
+ /** Gradient steps on one shape */
23
+ readonly maxGradientSteps: 64;
24
+ /** Gradient work across the spec: steps × the shape's segments */
25
+ readonly maxGradientWork: 16000;
26
+ /** Size of the spec as JSON, in UTF-8 bytes */
27
+ readonly maxBytes: 32768;
28
+ /** The code must be at least this share of the artboard's shorter side */
29
+ readonly minQrShare: 0.5;
30
+ /** Light padding around the code, as a share of its size */
31
+ readonly minPadding: 0.04;
32
+ readonly defaultPadding: 0.08;
33
+ /** Characters in a label */
34
+ readonly maxTextLength: 24;
35
+ };
36
+ /** Built-in glyphs a spec can place with an `icon` shape (no images). */
37
+ export declare const FRAME_ICONS: readonly ["wifi", "star", "heart", "phone", "headphones", "calendar", "user", "chat", "bag", "bell", "cup", "card", "check", "info", "home", "pin", "share", "download", "clock", "snowflake", "pumpkin", "tree", "sparkle", "gift"];
38
+ /**
39
+ * Largest label font as a share of its row height, so ascenders and
40
+ * descenders stay inside the row (and so off the code's padding).
41
+ */
42
+ export declare const FRAME_SPEC_LABEL_MAX_FONT = 0.95;
43
+ /** Most segments any built-in icon has (counted against maxSegments). */
44
+ export declare const FRAME_ICON_MAX_SEGMENTS = 200;
45
+ /**
46
+ * Theme colors a spec can bind to: `frame` is `frame.color`, `text` is
47
+ * `frame.textColor`, `accent` is `frame.secondaryColor` (the gradient end)
48
+ * and `background` is the code's background color.
49
+ */
50
+ export declare const FRAME_COLOR_TOKENS: readonly ["frame", "text", "accent", "background"];
51
+ /**
52
+ * Label text as a frame may draw it: NFC, no control, invisible or
53
+ * bidirectional-override characters, single spaces, trimmed and at most
54
+ * `maxLength` characters (code points).
55
+ */
56
+ export declare function sanitizeFrameText(text: string, maxLength?: number): string;
57
+ /** True when `text` uses only Latin-1 (what PDF and EPS labels can print). */
58
+ export declare function isLatin1Text(text: string): boolean;
59
+ /** True when `value` has at most FRAME_SPEC_LIMITS.maxDecimals decimals. */
60
+ export declare const hasPrecision: (value: number) => boolean;
61
+ interface Box {
62
+ x0: number;
63
+ y0: number;
64
+ x1: number;
65
+ y1: number;
66
+ }
67
+ /** The code plus its padding: nothing may be drawn over it. */
68
+ export declare function frameSpecQrZone(spec: FrameSpec): Box;
69
+ /** The plate's padding around the code, in spec units. */
70
+ export declare function frameSpecPadding(spec: FrameSpec): number;
71
+ /** Font size of a text label with no `fontSize`, as a share of its row. */
72
+ export declare const FRAME_SPEC_DEFAULT_FONT = 0.52;
73
+ /**
74
+ * Half the height a label's capitals fill, as a share of its font size: a
75
+ * text label's letters are centered on its row, so they fill the row's
76
+ * middle, this far above and below it.
77
+ */
78
+ export declare const FRAME_SPEC_CAP_HALF = 0.35;
79
+ /**
80
+ * Bounds of a spec shape (null for path data outside the grammar) and the
81
+ * segments it counts against FRAME_SPEC_LIMITS.maxSegments.
82
+ */
83
+ export declare function frameSpecShapeBounds(shape: FrameSpecShape): {
84
+ bounds: Box | null;
85
+ segments: number;
86
+ };
87
+ /**
88
+ * The checks across fields that a frame spec's structure can't express:
89
+ * size, placement, overlaps and budgets. Reports each problem through
90
+ * `issue`; both frameSpecSchema (zod) and the engine's own parser
91
+ * (frame-spec-parse.ts) run it on a structurally valid spec.
92
+ */
93
+ export declare function checkFrameSpec(spec: FrameSpec, issue: (message: string, path?: (string | number)[]) => void): void;
94
+ export {};
95
+ //# sourceMappingURL=frame-spec-rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frame-spec-rules.d.ts","sourceRoot":"","sources":["../../types/frame-spec-rules.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAW9D,OAAO,KAAK,EAAE,SAAS,EAAkB,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9E,eAAO,MAAM,eAAe,eAAe,CAAC;AAC5C,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC,sDAAsD;AACtD,eAAO,MAAM,kBAAkB,WA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