viewkitjs 0.24.0 → 0.25.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.
Files changed (82) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/fields/dist/creatable.d.ts +9 -5
  3. package/fields/dist/creatable.js +8 -1
  4. package/fields/dist/messages.d.ts +19 -1
  5. package/fields/dist/messages.js +75 -0
  6. package/fields/dist/registry.js +4 -7
  7. package/fields/dist/types.d.ts +4 -2
  8. package/fields/dist/zod.d.ts +58 -0
  9. package/fields/dist/zod.js +430 -2
  10. package/fields/docs/guides/checking-definitions.md +6 -1
  11. package/fields/docs/guides/field-types.md +5 -1
  12. package/fields/docs/reference/definitions.md +1 -2
  13. package/fields/docs/reference/types.md +2 -1
  14. package/fields/skills/viewkit/SKILL.md +2 -2
  15. package/package.json +1 -1
  16. package/views/dist/controls/avatar/avatar.d.ts +58 -0
  17. package/views/dist/controls/avatar/avatar.js +54 -0
  18. package/views/dist/controls/avatar/looks.d.ts +4 -0
  19. package/views/dist/controls/avatar/looks.js +5 -0
  20. package/views/dist/controls/avatar/tokens.d.ts +131 -0
  21. package/views/dist/controls/avatar/tokens.js +35 -0
  22. package/views/dist/controls/avatar.css +163 -0
  23. package/views/dist/controls/controls.d.ts +2 -0
  24. package/views/dist/controls/controls.js +2 -0
  25. package/views/dist/controls/index.d.ts +12 -0
  26. package/views/dist/controls/index.js +12 -0
  27. package/views/dist/controls/internal/phone.d.ts +9 -0
  28. package/views/dist/controls/internal/phone.js +15 -0
  29. package/views/dist/controls/internal/read-token.d.ts +2 -1
  30. package/views/dist/controls/internal/read-token.js +1 -1
  31. package/views/dist/controls/internal/scroll.d.ts +38 -0
  32. package/views/dist/controls/internal/scroll.js +126 -0
  33. package/views/dist/controls/list/looks.d.ts +4 -0
  34. package/views/dist/controls/list/looks.js +12 -0
  35. package/views/dist/controls/list.css +17 -13
  36. package/views/dist/controls/menu/map-menu.d.ts +11 -0
  37. package/views/dist/controls/menu/map-menu.js +47 -0
  38. package/views/dist/controls/menu/menu.d.ts +75 -0
  39. package/views/dist/controls/menu/menu.js +105 -0
  40. package/views/dist/controls/menu/tokens.d.ts +23 -0
  41. package/views/dist/controls/menu/tokens.js +8 -0
  42. package/views/dist/controls/menu-list/looks.d.ts +5 -1
  43. package/views/dist/controls/menu-list/looks.js +6 -4
  44. package/views/dist/controls/menu-list/menu-list.js +3 -1
  45. package/views/dist/controls/menu-list.css +39 -31
  46. package/views/dist/controls/menu.css +25 -0
  47. package/views/dist/controls/picker/looks.d.ts +19 -0
  48. package/views/dist/controls/picker/looks.js +32 -0
  49. package/views/dist/controls/picker/picker.d.ts +153 -0
  50. package/views/dist/controls/picker/picker.js +773 -0
  51. package/views/dist/controls/picker/rows.d.ts +129 -0
  52. package/views/dist/controls/picker/rows.js +90 -0
  53. package/views/dist/controls/picker/tokens.d.ts +147 -0
  54. package/views/dist/controls/picker/tokens.js +39 -0
  55. package/views/dist/controls/picker.css +237 -0
  56. package/views/dist/controls/popup-line/tokens.d.ts +23 -0
  57. package/views/dist/controls/popup-line/tokens.js +8 -0
  58. package/views/dist/controls/popup-line.css +44 -0
  59. package/views/dist/controls/select/filled.d.ts +7 -0
  60. package/views/dist/controls/select/filled.js +5 -0
  61. package/views/dist/controls/select/fit.d.ts +9 -0
  62. package/views/dist/controls/select/fit.js +11 -0
  63. package/views/dist/controls/select/select.d.ts +131 -0
  64. package/views/dist/controls/select/select.js +227 -0
  65. package/views/dist/controls/select/side.d.ts +3 -0
  66. package/views/dist/controls/select/side.js +4 -0
  67. package/views/dist/controls/select/tokens.d.ts +27 -0
  68. package/views/dist/controls/select/tokens.js +9 -0
  69. package/views/dist/controls/select.css +91 -0
  70. package/views/dist/controls/tokens.js +10 -0
  71. package/views/dist/looks/index.d.ts +4 -0
  72. package/views/dist/looks/index.js +4 -0
  73. package/views/dist/looks/pieces.js +6 -0
  74. package/views/dist/styles.css +586 -62
  75. package/views/dist/styles.unlayered.css +586 -62
  76. package/views/docs/controls/avatar.md +38 -0
  77. package/views/docs/controls/menu.md +11 -0
  78. package/views/docs/controls/picker.md +42 -0
  79. package/views/docs/controls/popup-line.md +11 -0
  80. package/views/docs/controls/select.md +12 -0
  81. package/views/docs/reference/controls.md +86 -0
  82. package/views/docs/reference/looks.md +8 -0
package/CHANGELOG.md CHANGED
@@ -5,6 +5,26 @@ Until 0.19.0 ViewKit shipped as three packages; their changes are in [fields/CHA
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [0.25.0] — 2026-11-26
9
+
10
+ viewkitjs/views/controls: the Menu (the components map's default `Menu`, with `menuEntries`), its context menu and its ⋯, the Avatar and its stack, the Select, and the Picker's core (`usePicker`, `Picker`, `PickerUnder` and its rows), with the popup line's stylesheet, the phone's line (`usePhone`, `PhoneHost`, `ComputerHost`) and a list's own scrolling; their looks (`LIST_LOOKS`, `PICKER_LOOKS`, `AVATAR_LOOKS`) in viewkitjs/views/looks.
11
+
12
+ ### Added
13
+
14
+ - `viewkitjs/fields/definitions`: every setting `creatableFieldTypes(cv)` lists carries a `label` in the host's words, and a word or words setting carries `wordLabels`, a name for each of its words, so a New field dialog names every setting and choice without a copy of its own.
15
+ - Two message keys, so a host renames them in its own language; an exhaustive resolver words them:
16
+ - `setting.label` (values `type`, `path`): Default value, Fewest characters, Most characters (a name's and a place's: Most characters in each part), Pattern it must match, Written over several lines, Stored as, Lowest value, Highest value, Whole numbers only, Most decimals, Shown as, Decimals shown, Unit after the number, Show + and −, A rise reads as, Stored in, Duration style, Currency, A range of, Per, A date to look forward to, Date style, Show the time, Options, Values allowed, Most values (a multi-select's: Most choices), Tidy each value, Links to, How many, Holds several values, Parts of the place.
17
+ - `setting.word` (values `type`, `path`, `word`): Number and Exact decimal; Number and Duration; Checkbox, Icon, Marker and Words; Up is good and Neutral; Milliseconds and Seconds; Adaptive, Clock and Units; Number, Bar and Ring; Numbers, Amounts and Percents; Hour, Day, Week, Month and Year; Short, Long, Numbers only and Relative; Only the listed options and Any value typed in; Trim spaces, Lowercase and Spaces to hyphens; One record and Several records; Address line 1, Address line 2, Postal code, City, Region, Region code and Country.
18
+
19
+ ### Changed
20
+
21
+ - `viewkitjs/fields`: a text field's `validation.pattern` is read in ViewKit's own pattern dialect and matched without backtracking: each character of a value costs at most one pass over the pattern's steps, and one value may cost at most 20,000,000 steps in all (its characters times the pattern's steps, about a fifth of a second). The dialect is JavaScript's regular-expression syntax with no flags and answers as `RegExp` does, without lookahead, lookbehind, backreferences or group flags (`(?i:…)`), and without the legacy forms whose meaning depends on where they sit (a lone `{`, `}` or `]`); its escapes are `\d \w \s \b`, their capitals, `\t \n \r \f \v \0 \xHH \uHHHH` and any escaped ASCII symbol, and an escaped letter or digit it doesn't know (`\q`, `\cJ`, `\u{41}`) is refused. A pattern is at most 500 characters and 1,000 steps once its repeats are counted out. `checkFieldSpec`, `defineFields` and `zodFor` refuse a pattern outside it, in the same words. Before, any pattern that compiled was taken: a pattern declared in code that uses one of these now fails at definition and is rewritten, for example `"^(?!test)\\w+$"` (lookahead) as a check of its own, `"(\\w)\\1"` (a backreference) as a check of its own, `"a{"` as `"a\\{"`, `"\\q"` as `"q"`. A definition already stored as data is checked the same way when `zodFor` builds its schema: run `checkFieldSpec` over your stored definitions before you upgrade.
22
+ - `viewkitjs/fields`: `zodFor` refuses a value too long for its field's pattern to read within that cost as too long ("Too long — at most N characters", `validation.max-length`), before the pattern reads it: 20,000 characters for a cap-sized pattern of 1,000 steps, far more for a short one. A field's own `maxLength`, when lower, says the limit as before.
23
+
24
+ ### Fixed
25
+
26
+ - `viewkitjs/fields`: a pattern such as `(a+)+$`, accepted from data by `checkFieldSpec`, no longer lets one crafted value hold a server's thread: no pattern and no value cost more than the bound above.
27
+
8
28
  ## [0.24.0] — 2026-11-26
9
29
 
10
30
  viewkitjs/views/controls: the menu list, the list's stylesheet and the helpers they stand on (Icon, Grip, useHoldDrag, useReorder); the menu list's looks in viewkitjs/views/looks. A piece's looks may pick fewer options than it has (`PieceLooks<Id, Picked>`).
@@ -1,9 +1,8 @@
1
1
  import { type FieldConventions } from "./conventions.js";
2
2
  import type { CategoryColor } from "./design/category-colors.js";
3
3
  import type { StatusSlot } from "./design/status-slots.js";
4
- import type { FieldSpec, FieldType } from "./types.js";
5
- /** A type a person may create: every type but the one the system sets (actor) and those worked out from others. */
6
- export type CreatableFieldType = Exclude<FieldType, "actor" | "lookup" | "rollup" | "formula">;
4
+ import type { CreatableFieldType, FieldSpec } from "./types.js";
5
+ export type { CreatableFieldType } from "./types.js";
7
6
  /** A setting applies only while another word or switch setting holds `is`; absent, that setting reads as its
8
7
  * first word (a switch: off). When it stops holding, the setting is removed, and a block it leaves empty
9
8
  * (`validation`, `format`, `code`) is removed with it: `checkFieldSpec` refuses the leftovers. */
@@ -16,6 +15,8 @@ export type FieldSettingWhen = {
16
15
  type SettingBase = {
17
16
  /** Where it sits in a definition, dotted: "validation.maxLength", "code.fixed". */
18
17
  path: string;
18
+ /** Its name in the host's words, the message `setting.label`: "Decimals shown". */
19
+ label: string;
19
20
  /** It holds a value whenever it applies: the starting definition carries one, or (a relation's kind) the app
20
21
  * sets it before it saves. */
21
22
  required?: true;
@@ -26,14 +27,18 @@ type SettingBase = {
26
27
  /** One setting a definition of a type takes, with its kind and, for a word, its allowed words. */
27
28
  export type FieldTypeSetting = SettingBase & ({
28
29
  kind: "switch";
29
- } | {
30
+ }
31
+ /** `wordLabels` names each word in the host's words, the message `setting.word`: "Up is good". */
32
+ | {
30
33
  kind: "word";
31
34
  words: readonly string[];
35
+ wordLabels: Readonly<Record<string, string>>;
32
36
  }
33
37
  /** Several of `words`, each once, in the person's order. */
34
38
  | {
35
39
  kind: "words";
36
40
  words: readonly string[];
41
+ wordLabels: Readonly<Record<string, string>>;
37
42
  } | {
38
43
  kind: "number";
39
44
  min?: number;
@@ -82,4 +87,3 @@ export declare const CREATABLE_FIELD_TYPES: readonly CreatableFieldType[];
82
87
  * system sets, nor a lookup, rollup or formula, which are worked out from other fields.
83
88
  */
84
89
  export declare function creatableFieldTypes(cv?: FieldConventions): readonly FieldTypeEntry[];
85
- export {};
@@ -172,6 +172,13 @@ function deepFreeze(value) {
172
172
  }
173
173
  deepFreeze(ENTRIES);
174
174
  export const CREATABLE_FIELD_TYPES = Object.freeze(ENTRIES.map((e) => e.type));
175
+ function labelled(type, setting, cv) {
176
+ const label = cv.messages({ key: "setting.label", values: { type, path: setting.path } });
177
+ if (setting.kind !== "word" && setting.kind !== "words")
178
+ return Object.freeze({ ...setting, label });
179
+ const wordLabels = Object.freeze(Object.fromEntries(setting.words.map((word) => [word, cv.messages({ key: "setting.word", values: { type, path: setting.path, word } })])));
180
+ return Object.freeze({ ...setting, label, wordLabels });
181
+ }
175
182
  export function creatableFieldTypes(cv = DEFAULT_CONVENTIONS) {
176
183
  cv = conventionsOr(cv);
177
184
  return Object.freeze(ENTRIES.map(({ type, several, start, settings }) => {
@@ -181,7 +188,7 @@ export function creatableFieldTypes(cv = DEFAULT_CONVENTIONS) {
181
188
  label,
182
189
  icon: type,
183
190
  several,
184
- settings,
191
+ settings: Object.freeze(settings.map((setting) => labelled(type, setting, cv))),
185
192
  spec: deepFreeze(JSON.parse(JSON.stringify({ type, label, ...start }))),
186
193
  });
187
194
  }));
@@ -1,4 +1,4 @@
1
- import type { ActorType, FieldType, RollupFn } from "./types.js";
1
+ import type { ActorType, CreatableFieldType, FieldType, RollupFn } from "./types.js";
2
2
  /**
3
3
  * A typed message plus the values its host may interpolate. EVERY sentence the
4
4
  * library writes is one of these — a host that translates them translates the
@@ -69,6 +69,24 @@ export type FieldMessage = {
69
69
  values: {
70
70
  type: FieldType;
71
71
  };
72
+ }
73
+ /** A setting a New field dialog offers (`creatableFieldTypes`), by where it sits in the type's definition:
74
+ * "Decimals shown" for `format.decimals`. */
75
+ | {
76
+ key: "setting.label";
77
+ values: {
78
+ type: CreatableFieldType;
79
+ path: string;
80
+ };
81
+ }
82
+ /** One of the words a word or words setting offers: "Up is good" for `format.signedTone`'s `positive-good`. */
83
+ | {
84
+ key: "setting.word";
85
+ values: {
86
+ type: CreatableFieldType;
87
+ path: string;
88
+ word: string;
89
+ };
72
90
  } | {
73
91
  key: "field.cannot-empty";
74
92
  } | {
@@ -24,6 +24,75 @@ const TYPE_LABELS = {
24
24
  rollup: "Rollup",
25
25
  formula: "Formula",
26
26
  };
27
+ const SETTING_LABELS = {
28
+ default: "Default value",
29
+ "validation.minLength": "Fewest characters",
30
+ "validation.maxLength": "Most characters",
31
+ "validation.pattern": "Pattern it must match",
32
+ "format.long": "Written over several lines",
33
+ storage: "Stored as",
34
+ "validation.min": "Lowest value",
35
+ "validation.max": "Highest value",
36
+ "validation.integer": "Whole numbers only",
37
+ "validation.decimals": "Most decimals",
38
+ "format.style": "Shown as",
39
+ "format.decimals": "Decimals shown",
40
+ "format.suffix": "Unit after the number",
41
+ "format.signed": "Show + and −",
42
+ "format.signedTone": "A rise reads as",
43
+ "format.unit": "Stored in",
44
+ "format.durationStyle": "Duration style",
45
+ "format.display": "Shown as",
46
+ "code.fixed": "Currency",
47
+ of: "A range of",
48
+ period: "Per",
49
+ ahead: "A date to look forward to",
50
+ "format.dateStyle": "Date style",
51
+ "format.withTime": "Show the time",
52
+ options: "Options",
53
+ vocabulary: "Values allowed",
54
+ "validation.maxItems": "Most values",
55
+ normalize: "Tidy each value",
56
+ "relation.kind": "Links to",
57
+ cardinality: "How many",
58
+ multiple: "Holds several values",
59
+ parts: "Parts of the place",
60
+ };
61
+ const SETTING_LABEL_BY_TYPE = {
62
+ multiselect: { "validation.maxItems": "Most choices" },
63
+ name: { "validation.maxLength": "Most characters in each part" },
64
+ location: { "validation.maxLength": "Most characters in each part" },
65
+ };
66
+ const SETTING_WORDS = {
67
+ storage: { number: "Number", decimal: "Exact decimal" },
68
+ "format.style": {
69
+ plain: "Number",
70
+ duration: "Duration",
71
+ checkbox: "Checkbox",
72
+ icon: "Icon",
73
+ marker: "Marker",
74
+ text: "Words",
75
+ },
76
+ "format.signedTone": { "positive-good": "Up is good", neutral: "Neutral" },
77
+ "format.unit": { ms: "Milliseconds", s: "Seconds" },
78
+ "format.durationStyle": { adaptive: "Adaptive", clock: "Clock", units: "Units" },
79
+ "format.display": { text: "Number", bar: "Bar", ring: "Ring" },
80
+ of: { number: "Numbers", currency: "Amounts", percent: "Percents" },
81
+ period: { hour: "Hour", day: "Day", week: "Week", month: "Month", year: "Year" },
82
+ "format.dateStyle": { short: "Short", long: "Long", numeric: "Numbers only", relative: "Relative" },
83
+ vocabulary: { closed: "Only the listed options", "custom-values": "Any value typed in" },
84
+ normalize: { trim: "Trim spaces", lowercase: "Lowercase", hyphenate: "Spaces to hyphens" },
85
+ cardinality: { one: "One record", many: "Several records" },
86
+ parts: {
87
+ line1: "Address line 1",
88
+ line2: "Address line 2",
89
+ postalCode: "Postal code",
90
+ city: "City",
91
+ region: "Region",
92
+ regionCode: "Region code",
93
+ countryCode: "Country",
94
+ },
95
+ };
27
96
  const ROLLUP_VERB = {
28
97
  sum: "The sum of",
29
98
  avg: "The average",
@@ -114,6 +183,12 @@ export const resolveFieldMessage = (message) => {
114
183
  return message.values.provider;
115
184
  case "type.label":
116
185
  return TYPE_LABELS[message.values.type];
186
+ case "setting.label": {
187
+ const { type, path } = message.values;
188
+ return SETTING_LABEL_BY_TYPE[type]?.[path] ?? SETTING_LABELS[path] ?? path;
189
+ }
190
+ case "setting.word":
191
+ return SETTING_WORDS[message.values.path]?.[message.values.word] ?? message.values.word;
117
192
  case "field.cannot-empty":
118
193
  return "This field can't be emptied";
119
194
  case "field.cannot-edit":
@@ -8,7 +8,7 @@ import { NORMALIZE_STEPS } from "./normalize.js";
8
8
  import { isDecimalText } from "./parse-number.js";
9
9
  import { LOCATION_PARTS } from "./location.js";
10
10
  import { isMultipleType } from "./value-list.js";
11
- import { buildFieldSchema } from "./zod.js";
11
+ import { buildFieldSchema, readPattern } from "./zod.js";
12
12
  export const FIELD_TYPES = [
13
13
  "text",
14
14
  "number",
@@ -463,12 +463,9 @@ export function checkFieldSpec(key, spec, all = {}, context = {}) {
463
463
  if (f.emptiable && v?.minLength)
464
464
  fail("an emptiable field cannot state a minLength above 0");
465
465
  if (v?.pattern !== undefined) {
466
- try {
467
- new RegExp(v.pattern);
468
- }
469
- catch {
470
- fail("pattern is not a valid regular expression");
471
- }
466
+ const read = readPattern(v.pattern);
467
+ if (!read.ok)
468
+ fail(`pattern ${read.why}`);
472
469
  }
473
470
  }
474
471
  if (f.type === "location" && f.parts !== undefined) {
@@ -12,6 +12,8 @@ import type { ValueItem } from "./value-list.js";
12
12
  * `datetime` is an instant. `percent` is stored 0–100 — the value IS the
13
13
  * percent. `rollup` and `formula` carry a `result` that names what comes out. */
14
14
  export type FieldType = "text" | "number" | "percent" | "currency" | "date" | "datetime" | "boolean" | "select" | "status" | "multiselect" | "relation" | "user" | "url" | "domain" | "email" | "phone" | "location" | "name" | "actor" | "rich_text" | "range" | "lookup" | "rollup" | "formula";
15
+ /** A type a person may create: every type but the one the system sets (actor) and those worked out from others. */
16
+ export type CreatableFieldType = Exclude<FieldType, "actor" | "lookup" | "rollup" | "formula">;
15
17
  export type LocationValue = {
16
18
  /** The street and number. */
17
19
  line1?: string | null;
@@ -275,8 +277,8 @@ export type Breakdown = {
275
277
  export type Freshness = "live" | "minute" | "sync";
276
278
  /** The member shapes a rollup or formula may produce — declared once, used
277
279
  * by the def union (with base keys) and by `result` (without them). */
278
- /** What a text-like value may be held to. `pattern` is a regular expression
279
- * source; `checkFieldSpec` refuses one that does not compile. */
280
+ /** What a text-like value may be held to. `pattern` is a regular expression source in ViewKit's dialect, matched
281
+ * without backtracking; `checkFieldSpec` and `zodFor` refuse one outside it. */
280
282
  export type TextualValidation = {
281
283
  maxLength?: number;
282
284
  pattern?: string;
@@ -26,4 +26,62 @@ export declare function linkRoleKey(kind: string, id: string, role: string): str
26
26
  * is one once `https://` is put before it. What a kept url is held to (`accept.ts`). Text with a space or a control
27
27
  * character inside is none: a split `java\tscript:` would hide its scheme here and lose it in the address parser. */
28
28
  export declare function readsAsLink(value: unknown): boolean;
29
+ /** A pattern's source is at most this many characters. */
30
+ export declare const PATTERN_MAX_LENGTH = 500;
31
+ /** A pattern's program holds at most this many steps once its repeats are counted out (`a{3}` is three). */
32
+ export declare const PATTERN_MAX_STEPS = 1000;
33
+ /** What one value may cost against a pattern: its characters times the pattern's steps, at most this many, about a
34
+ * fifth of a second. A longer value is refused as too long before the pattern reads it (`BoundedPattern.maxValueLength`). */
35
+ export declare const PATTERN_MAX_WORK = 20000000;
36
+ /** A set of UTF-16 code units: sorted, merged, inclusive [low, high] pairs, read by binary search, so a class of any
37
+ * size costs one search per character. */
38
+ type Ranges = Int32Array;
39
+ type Assertion = "start" | "end" | "word" | "not-word";
40
+ declare const CHAR = 0;
41
+ declare const SPLIT = 1;
42
+ declare const JUMP = 2;
43
+ declare const ASSERT = 3;
44
+ declare const MATCH = 4;
45
+ type Step = {
46
+ op: typeof CHAR;
47
+ set: Ranges;
48
+ } | {
49
+ op: typeof SPLIT;
50
+ x: number;
51
+ y: number;
52
+ } | {
53
+ op: typeof JUMP;
54
+ x: number;
55
+ } | {
56
+ op: typeof ASSERT;
57
+ a: Assertion;
58
+ } | {
59
+ op: typeof MATCH;
60
+ };
61
+ type Program = readonly Step[];
62
+ /**
63
+ * A `RegExp` whose `test` runs ViewKit's matcher: what zod's `.regex()` calls, and the `source` a JSON Schema
64
+ * describes. Only `test` is bounded; `exec`, `match` and `replace` stay the engine's own, so nothing else should be
65
+ * handed one.
66
+ */
67
+ export declare class BoundedPattern extends RegExp {
68
+ #private;
69
+ /** The longest value this pattern reads within `PATTERN_MAX_WORK`; `test` answers false past it, unread. */
70
+ readonly maxValueLength: number;
71
+ constructor(source: string, program: Program);
72
+ /** Built-ins that make a new expression from this one (`split`, `matchAll`) make a plain one. */
73
+ static get [Symbol.species](): RegExpConstructor;
74
+ test(value: string): boolean;
75
+ }
76
+ /**
77
+ * The pattern read in ViewKit's dialect, or why it is refused: words that follow "pattern ", the same wherever a
78
+ * pattern is checked (`checkFieldSpec`, `zodFor`).
79
+ */
80
+ export declare function readPattern(source: string): {
81
+ ok: true;
82
+ pattern: BoundedPattern;
83
+ } | {
84
+ ok: false;
85
+ why: string;
86
+ };
29
87
  export {};