Parameters
- pattern: {
colors: {
hex?: string;
id: number & $brand<"ColorId">;
name: string;
strands: {
brand:
| "Anchor"
| "Appletons"
| "Cosmo"
| "DMC"
| "J&P Coats"
| "Kreinik"
| "Madeira"
| "Presencia"
| "Sullivans"
| "Unbranded";
code: string;
hex?: string;
name: string;
strandCount: number;
}[];
symbol: string;
}[];
fabric?: { count: number; hex?: string; kind?: string };
metadata?: {
author?: string;
copyright?: string;
notes?: string;
title?: string;
};
schemaVersion: 1;
stitches: (
| {
colorId: number & $brand<"ColorId">;
kind: "full";
x: number & $brand<"CellCoordinate">;
y: number & $brand<"CellCoordinate">;
}
| {
angle: "tl-br"
| "bl-tr";
colorId: number & $brand<"ColorId">;
kind: "half";
x: number & $brand<"CellCoordinate">;
y: number & $brand<"CellCoordinate">;
}
| {
colorId: number & $brand<"ColorId">;
kind: "quarter";
placement: "top-right" | "bottom-right" | "bottom-left" | "top-left";
x: number & $brand<"CellCoordinate">;
y: number & $brand<"CellCoordinate">;
}
| {
angle: "tl-br"
| "bl-tr";
colorId: number & $brand<"ColorId">;
kind: "three-quarter";
placement: "top-right" | "bottom-right" | "bottom-left" | "top-left";
x: number & $brand<"CellCoordinate">;
y: number & $brand<"CellCoordinate">;
}
| {
colorId: number & $brand<"ColorId">;
from: {
x: number & $brand<"SegmentCoordinate">;
y: number & $brand<"SegmentCoordinate">;
};
kind: "back";
to: {
x: number & $brand<"SegmentCoordinate">;
y: number & $brand<"SegmentCoordinate">;
};
}
| {
colorId: number & $brand<"ColorId">;
from: {
x: number & $brand<"SegmentCoordinate">;
y: number & $brand<"SegmentCoordinate">;
};
kind: "long";
to: {
x: number & $brand<"SegmentCoordinate">;
y: number & $brand<"SegmentCoordinate">;
};
}
)[];
}
The JSON string, or the collected issues.
Public entry point (
cross-stitch). Exposes the blessed surface: the validate/serialize facade, the derived-data helpers, and every type needed to describe and work with a pattern - none of which require importing Zod. The Zod schema objects themselves (for composition with.pick/.extendor direct.safeParse) are published separately on thecross-stitch/schemasubpath.