@flighthq/path-formats 0.5.1-next.4389.185df52 → 0.5.1-next.5076.44cab46

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/README.md CHANGED
@@ -13,5 +13,5 @@ Import the supported application-facing API from `@flighthq/path-formats`. The `
13
13
  This package is part of the locked-version Flight SDK graph. Applications may instead install and import `@flighthq/sdk` when package-level tree shaking is sufficient.
14
14
 
15
15
  - [Flight project](https://github.com/flighthq/flight)
16
- - [Source for @flighthq/path-formats@0.5.1-next.4389.185df52](https://github.com/flighthq/flight/tree/185df5255e2b2eec457050ac283aa23274fc84fc/packages/path-formats)
17
- - [License](https://github.com/flighthq/flight/blob/185df5255e2b2eec457050ac283aa23274fc84fc/LICENSE.md)
16
+ - [Source for @flighthq/path-formats@0.5.1-next.5076.44cab46](https://github.com/flighthq/flight/tree/44cab464341f8ac6e5e9df951cf974739ba9d3b7/packages/path-formats)
17
+ - [License](https://github.com/flighthq/flight/blob/44cab464341f8ac6e5e9df951cf974739ba9d3b7/LICENSE.md)
@@ -1,2 +1,3 @@
1
- export * from './svgPathData.ts';
1
+ export { appendSvgPathData, explainSvgPathData, formatSvgPathData, parseSvgPathData } from './svgPathData.ts';
2
+ export type { SvgPathDataExplanation, SvgPathDataFormatOptions } from './types.ts';
2
3
  //# sourceMappingURL=contract.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC9G,YAAY,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC"}
package/dist/contract.js CHANGED
@@ -1,2 +1,2 @@
1
- export * from './svgPathData.js';
1
+ export { appendSvgPathData, explainSvgPathData, formatSvgPathData, parseSvgPathData } from './svgPathData.js';
2
2
  //# sourceMappingURL=contract.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export { appendSvgPathData, explainSvgPathData, formatSvgPathData, parseSvgPathData } from './contract.ts';
2
+ export type { SvgPathDataExplanation, SvgPathDataFormatOptions } from './contract.ts';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAE3G,YAAY,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC"}
@@ -1,41 +1,41 @@
1
- import type { Path, SvgPathDataFormatOptions } from '@flighthq/types/contract';
1
+ import type { Path } from '@flighthq/path/contract';
2
+ import type { SvgPathDataExplanation, SvgPathDataFormatOptions } from './types.ts';
2
3
  /**
3
4
  * Parses an SVG path `d` string into the end of an existing `path`, appending its contours via the
4
- * `@flighthq/path` builders. Supports the full SVG path grammar: absolute (uppercase) and relative
5
+ * flight-path builders. Supports the full SVG path grammar: absolute (uppercase) and relative
5
6
  * (lowercase) `M L H V C S Q T A Z`, implicit repeated commands, and the smooth-curve shorthands
6
- * `S`/`T` (reflecting the previous cubic/quadratic control point). Returns `false` without further
7
- * mutation guarantee on structurally malformed input (a leading command that is not moveto, an
8
- * unknown command letter, or a missing/short coordinate run). A failed parse leaves `path`
9
- * unchanged; returns `true` when the whole string parses. An empty or whitespace-only string is
10
- * well-formed and appends nothing.
7
+ * `S`/`T` (reflecting the previous cubic/quadratic control point). Returns `false` on structurally
8
+ * malformed input (a leading command that is not moveto, an unknown command letter, or a
9
+ * missing/short coordinate run); the input is parsed into a scratch path first, so a failed parse
10
+ * leaves `path` unchanged. Returns `true` when the whole string parses. An empty or
11
+ * whitespace-only string is well-formed and appends nothing.
11
12
  *
12
- * Elliptic arcs (`A`/`a`) are appended through `appendPathEllipticalArcTo`, which approximates them as cubic
13
- * bezier segments — a subsequent `forEachPathSegment` walk (and `formatSvgPathData`) therefore sees
14
- * cubics, not an arc verb. The geometry round-trips; the arc command does not.
13
+ * Elliptic arcs (`A`/`a`) are appended through `appendPathEllipticalArcTo`, which approximates
14
+ * them as cubic bezier segments, so a later `forEachPathSegment` walk (and
15
+ * `formatSvgPathData`) sees cubics, not an arc verb. The geometry round-trips; the arc command
16
+ * does not.
15
17
  */
16
18
  export declare function appendSvgPathData(path: Path, d: string): boolean;
17
19
  /**
18
- * Explains why an SVG path `d` string cannot be parsed. Returns `null` for well-formed input, or
19
- * the input position and a stable reason for malformed input.
20
+ * Explains why an SVG path `d` string cannot be parsed: `undefined` for well-formed input, or the input
21
+ * position (UTF-16 code-unit index) and a stable reason for malformed input.
20
22
  */
21
- export declare function explainSvgPathData(d: string): {
22
- position: number;
23
- reason: string;
24
- } | null;
23
+ export declare function explainSvgPathData(d: string): SvgPathDataExplanation | undefined;
25
24
  /**
26
25
  * Serializes a `Path` to an SVG path `d` string, emitting absolute commands. Each `PathSegment`
27
- * maps to its SVG verb: `moveTo`→`M`, `lineTo`→`L`, `quadraticCurveTo`→`Q`, `cubicCurveTo`→`C`,
28
- * `close`→`Z`. Arcs are not a distinct segment kind — the path stores them as cubics — so no `A`
26
+ * maps to its SVG verb: `MoveTo`→`M`, `LineTo`→`L`, `QuadraticCurveTo`→`Q`, `CubicCurveTo`→`C`,
27
+ * `Close`→`Z`. Arcs are not a distinct segment kind (the path stores them as cubics), so no `A`
29
28
  * command is produced.
30
29
  *
31
30
  * `options.precision`, when given, rounds every coordinate to that many decimal places and drops
32
- * trailing zeros; the default emits full-precision numbers (also trailing-zero-free).
31
+ * trailing zeros; the default emits full-precision numbers (also trailing-zero-free). Numbers are
32
+ * spelled as JavaScript's `String(number)` spells them.
33
33
  */
34
34
  export declare function formatSvgPathData(path: Readonly<Path>, options?: Readonly<SvgPathDataFormatOptions>): string;
35
35
  /**
36
- * Parses an SVG path `d` string into a freshly allocated `Path`, or returns `null` on structurally
37
- * malformed input (see `appendSvgPathData` for the malformed cases). An empty or whitespace-only
38
- * string yields an empty path, not `null`.
36
+ * Parses an SVG path `d` string into a freshly allocated `Path`, or `undefined` on structurally
37
+ * malformed input (see `appendSvgPathData` for the malformed cases). An empty or
38
+ * whitespace-only string yields an empty path, not `undefined`.
39
39
  */
40
- export declare function parseSvgPathData(d: string): Path | null;
40
+ export declare function parseSvgPathData(d: string): Path | undefined;
41
41
  //# sourceMappingURL=svgPathData.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"svgPathData.d.ts","sourceRoot":"","sources":["../src/svgPathData.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAE/E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAMhE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,MAAM,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IA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