@es-joy/jsoe 0.28.2 → 0.30.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 (167) hide show
  1. package/.claude/scheduled_tasks.lock +1 -0
  2. package/CHANGES.md +25 -0
  3. package/README.md +4 -0
  4. package/dist/formatAndTypeChoices.d.ts +6 -6
  5. package/dist/formatAndTypeChoices.d.ts.map +1 -1
  6. package/dist/formats/schema.d.ts +5 -0
  7. package/dist/formats/schema.d.ts.map +1 -1
  8. package/dist/formats.d.ts +2 -2
  9. package/dist/formats.d.ts.map +1 -1
  10. package/dist/fundamentalTypes/dateType.d.ts +26 -2
  11. package/dist/fundamentalTypes/dateType.d.ts.map +1 -1
  12. package/dist/fundamentalTypes/domexceptionType.d.ts +7 -0
  13. package/dist/fundamentalTypes/domexceptionType.d.ts.map +1 -1
  14. package/dist/index.d.ts +2 -0
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +2 -2
  17. package/dist/index.js.map +1 -1
  18. package/dist/jtltExtensions.d.ts +112 -0
  19. package/dist/jtltExtensions.d.ts.map +1 -0
  20. package/dist/search/fundamentalTypes/arraySearchType.d.ts +22 -0
  21. package/dist/search/fundamentalTypes/arraySearchType.d.ts.map +1 -0
  22. package/dist/search/fundamentalTypes/bigintSearchType.d.ts +10 -0
  23. package/dist/search/fundamentalTypes/bigintSearchType.d.ts.map +1 -0
  24. package/dist/search/fundamentalTypes/blobSearchType.d.ts +19 -0
  25. package/dist/search/fundamentalTypes/blobSearchType.d.ts.map +1 -0
  26. package/dist/search/fundamentalTypes/booleanSearchType.d.ts +11 -0
  27. package/dist/search/fundamentalTypes/booleanSearchType.d.ts.map +1 -0
  28. package/dist/search/fundamentalTypes/catchSearchType.d.ts +18 -0
  29. package/dist/search/fundamentalTypes/catchSearchType.d.ts.map +1 -0
  30. package/dist/search/fundamentalTypes/dateSearchType.d.ts +15 -0
  31. package/dist/search/fundamentalTypes/dateSearchType.d.ts.map +1 -0
  32. package/dist/search/fundamentalTypes/domexceptionSearchType.d.ts +16 -0
  33. package/dist/search/fundamentalTypes/domexceptionSearchType.d.ts.map +1 -0
  34. package/dist/search/fundamentalTypes/enumSearchType.d.ts +26 -0
  35. package/dist/search/fundamentalTypes/enumSearchType.d.ts.map +1 -0
  36. package/dist/search/fundamentalTypes/errorSearchType.d.ts +9 -0
  37. package/dist/search/fundamentalTypes/errorSearchType.d.ts.map +1 -0
  38. package/dist/search/fundamentalTypes/fileSearchType.d.ts +28 -0
  39. package/dist/search/fundamentalTypes/fileSearchType.d.ts.map +1 -0
  40. package/dist/search/fundamentalTypes/filelistSearchType.d.ts +24 -0
  41. package/dist/search/fundamentalTypes/filelistSearchType.d.ts.map +1 -0
  42. package/dist/search/fundamentalTypes/functionSearchType.d.ts +18 -0
  43. package/dist/search/fundamentalTypes/functionSearchType.d.ts.map +1 -0
  44. package/dist/search/fundamentalTypes/mapSearchType.d.ts +22 -0
  45. package/dist/search/fundamentalTypes/mapSearchType.d.ts.map +1 -0
  46. package/dist/search/fundamentalTypes/nanSearchType.d.ts +7 -0
  47. package/dist/search/fundamentalTypes/nanSearchType.d.ts.map +1 -0
  48. package/dist/search/fundamentalTypes/nullSearchType.d.ts +7 -0
  49. package/dist/search/fundamentalTypes/nullSearchType.d.ts.map +1 -0
  50. package/dist/search/fundamentalTypes/numberSearchType.d.ts +11 -0
  51. package/dist/search/fundamentalTypes/numberSearchType.d.ts.map +1 -0
  52. package/dist/search/fundamentalTypes/objectSearchType.d.ts +21 -0
  53. package/dist/search/fundamentalTypes/objectSearchType.d.ts.map +1 -0
  54. package/dist/search/fundamentalTypes/promiseSearchType.d.ts +20 -0
  55. package/dist/search/fundamentalTypes/promiseSearchType.d.ts.map +1 -0
  56. package/dist/search/fundamentalTypes/regexpSearchType.d.ts +20 -0
  57. package/dist/search/fundamentalTypes/regexpSearchType.d.ts.map +1 -0
  58. package/dist/search/fundamentalTypes/setSearchType.d.ts +15 -0
  59. package/dist/search/fundamentalTypes/setSearchType.d.ts.map +1 -0
  60. package/dist/search/fundamentalTypes/stringSearchType.d.ts +21 -0
  61. package/dist/search/fundamentalTypes/stringSearchType.d.ts.map +1 -0
  62. package/dist/search/fundamentalTypes/symbolSearchType.d.ts +16 -0
  63. package/dist/search/fundamentalTypes/symbolSearchType.d.ts.map +1 -0
  64. package/dist/search/fundamentalTypes/undefinedSearchType.d.ts +7 -0
  65. package/dist/search/fundamentalTypes/undefinedSearchType.d.ts.map +1 -0
  66. package/dist/search/index.d.ts +70 -0
  67. package/dist/search/index.d.ts.map +1 -0
  68. package/dist/search/queryTree.d.ts +12 -1
  69. package/dist/search/queryTree.d.ts.map +1 -1
  70. package/dist/search/queryTreeBuilders.d.ts +18 -0
  71. package/dist/search/queryTreeBuilders.d.ts.map +1 -1
  72. package/dist/search/searchDispatch.d.ts +44 -0
  73. package/dist/search/searchDispatch.d.ts.map +1 -1
  74. package/dist/search/searchElementUtils.d.ts +106 -0
  75. package/dist/search/searchElementUtils.d.ts.map +1 -0
  76. package/dist/search/searchUtils.d.ts +550 -0
  77. package/dist/search/searchUtils.d.ts.map +1 -0
  78. package/dist/search/subTypes/blobHTMLSearchType.d.ts +36 -0
  79. package/dist/search/subTypes/blobHTMLSearchType.d.ts.map +1 -0
  80. package/dist/search/subTypes/recordSearchType.d.ts +18 -0
  81. package/dist/search/subTypes/recordSearchType.d.ts.map +1 -0
  82. package/dist/search/subTypes/tupleSearchType.d.ts +21 -0
  83. package/dist/search/subTypes/tupleSearchType.d.ts.map +1 -0
  84. package/dist/search/superTypes/SpecialRealNumberSearchType.d.ts +14 -0
  85. package/dist/search/superTypes/SpecialRealNumberSearchType.d.ts.map +1 -0
  86. package/dist/search/superTypes/buffersourceSearchType.d.ts +17 -0
  87. package/dist/search/superTypes/buffersourceSearchType.d.ts.map +1 -0
  88. package/dist/search/superTypes/dommatrixSearchType.d.ts +11 -0
  89. package/dist/search/superTypes/dommatrixSearchType.d.ts.map +1 -0
  90. package/dist/search/superTypes/dompointSearchType.d.ts +9 -0
  91. package/dist/search/superTypes/dompointSearchType.d.ts.map +1 -0
  92. package/dist/search/superTypes/domrectSearchType.d.ts +9 -0
  93. package/dist/search/superTypes/domrectSearchType.d.ts.map +1 -0
  94. package/dist/search/superTypes/errorsSpecialSearchType.d.ts +11 -0
  95. package/dist/search/superTypes/errorsSpecialSearchType.d.ts.map +1 -0
  96. package/dist/search/unions/discriminatedUnionSearchType.d.ts +12 -0
  97. package/dist/search/unions/discriminatedUnionSearchType.d.ts.map +1 -0
  98. package/dist/search/unions/unionFamilySearchType.d.ts +36 -0
  99. package/dist/search/unions/unionFamilySearchType.d.ts.map +1 -0
  100. package/dist/search/unions/unionSearchType.d.ts +8 -0
  101. package/dist/search/unions/unionSearchType.d.ts.map +1 -0
  102. package/dist/search/unions/xorSearchType.d.ts +12 -0
  103. package/dist/search/unions/xorSearchType.d.ts.map +1 -0
  104. package/dist/superTypes/buffersourceType.d.ts.map +1 -1
  105. package/dist/typeChoices.d.ts +3 -3
  106. package/dist/typeChoices.d.ts.map +1 -1
  107. package/dist/types.d.ts +3 -3
  108. package/dist/types.d.ts.map +1 -1
  109. package/package.json +5 -4
  110. package/pnpm-workspace.yaml +1 -1
  111. package/rollup.config.js +12 -0
  112. package/src/formatAndTypeChoices.js +4 -4
  113. package/src/formats/schema.js +1 -1
  114. package/src/formats.js +1 -1
  115. package/src/fundamentalTypes/dateType.js +40 -14
  116. package/src/fundamentalTypes/domexceptionType.js +41 -33
  117. package/src/fundamentalTypes/regexpType.js +1 -1
  118. package/src/index.js +6 -0
  119. package/src/jsoe.css +204 -0
  120. package/src/jtltExtensions.js +103 -0
  121. package/src/search/fundamentalTypes/arraySearchType.js +101 -0
  122. package/src/search/fundamentalTypes/bigintSearchType.js +68 -0
  123. package/src/search/fundamentalTypes/blobSearchType.js +42 -0
  124. package/src/search/fundamentalTypes/booleanSearchType.js +40 -0
  125. package/src/search/fundamentalTypes/catchSearchType.js +59 -0
  126. package/src/search/fundamentalTypes/dateSearchType.js +166 -0
  127. package/src/search/fundamentalTypes/domexceptionSearchType.js +84 -0
  128. package/src/search/fundamentalTypes/enumSearchType.js +62 -0
  129. package/src/search/fundamentalTypes/errorSearchType.js +11 -0
  130. package/src/search/fundamentalTypes/fileSearchType.js +94 -0
  131. package/src/search/fundamentalTypes/filelistSearchType.js +103 -0
  132. package/src/search/fundamentalTypes/functionSearchType.js +102 -0
  133. package/src/search/fundamentalTypes/mapSearchType.js +117 -0
  134. package/src/search/fundamentalTypes/nanSearchType.js +11 -0
  135. package/src/search/fundamentalTypes/nullSearchType.js +11 -0
  136. package/src/search/fundamentalTypes/numberSearchType.js +59 -0
  137. package/src/search/fundamentalTypes/objectSearchType.js +367 -0
  138. package/src/search/fundamentalTypes/promiseSearchType.js +61 -0
  139. package/src/search/fundamentalTypes/regexpSearchType.js +72 -0
  140. package/src/search/fundamentalTypes/setSearchType.js +91 -0
  141. package/src/search/fundamentalTypes/stringSearchType.js +44 -0
  142. package/src/search/fundamentalTypes/symbolSearchType.js +39 -0
  143. package/src/search/fundamentalTypes/undefinedSearchType.js +11 -0
  144. package/src/search/index.js +96 -0
  145. package/src/search/queryTree.js +244 -0
  146. package/src/search/queryTreeBuilders.js +233 -0
  147. package/src/search/searchDispatch.js +291 -0
  148. package/src/search/searchElementUtils.js +373 -0
  149. package/src/search/searchUtils.js +847 -0
  150. package/src/search/subTypes/blobHTMLSearchType.js +122 -0
  151. package/src/search/subTypes/recordSearchType.js +105 -0
  152. package/src/search/subTypes/tupleSearchType.js +152 -0
  153. package/src/search/superTypes/SpecialRealNumberSearchType.js +42 -0
  154. package/src/search/superTypes/buffersourceSearchType.js +53 -0
  155. package/src/search/superTypes/dommatrixSearchType.js +24 -0
  156. package/src/search/superTypes/dompointSearchType.js +15 -0
  157. package/src/search/superTypes/domrectSearchType.js +15 -0
  158. package/src/search/superTypes/errorsSpecialSearchType.js +15 -0
  159. package/src/search/unions/discriminatedUnionSearchType.js +16 -0
  160. package/src/search/unions/unionFamilySearchType.js +168 -0
  161. package/src/search/unions/unionSearchType.js +12 -0
  162. package/src/search/unions/xorSearchType.js +16 -0
  163. package/src/superTypes/buffersourceType.js +13 -15
  164. package/src/typeChoices.js +2 -2
  165. package/src/types.js +2 -2
  166. package/tsconfig-prod.json +12 -0
  167. package/tsconfig.json +5 -10
@@ -0,0 +1,550 @@
1
+ /**
2
+ * @typedef {import('../types.js').JamilihArray} JamilihArray
3
+ */
4
+ /**
5
+ * Label for a leaf/container's own control, preferring the schema's own
6
+ * `meta.title`/`meta.description`/`description` (via `schemaLabel`, same
7
+ * precedence the value-editing side uses) and falling back to the JSON
8
+ * Pointer path's final segment so every control still has a legible label
9
+ * even when the schema carries no metadata.
10
+ * @param {import('../formats/schema.js').ZodexSchema|undefined} schemaObject
11
+ * @param {string} path
12
+ * @returns {string}
13
+ */
14
+ export function buildPathLabel(schemaObject: import("../formats/schema.js").ZodexSchema | undefined, path: string): string;
15
+ /**
16
+ * Finds a control belonging directly to `root`'s own widget - as opposed to
17
+ * one belonging to a search widget recursively nested inside it (e.g.
18
+ * `arraySearchType.js`'s own "size" input vs. a nested array-of-arrays'
19
+ * element widget's own "size" input, both reachable from `root` via a plain
20
+ * `querySelectorAll`). A match only counts if the nearest ancestor of the
21
+ * match carrying `data-search-path` is `root` itself; every search element
22
+ * carries that attribute (`searchElementUtils.js`'s `findSearchElement`), so
23
+ * this reliably stops at the first nested search element's boundary.
24
+ *
25
+ * This is also why every `build*`/`read*` pair below reads its class-based
26
+ * selector back through this helper rather than a raw
27
+ * `root.querySelector(...)`: a fixed class name is safe to reuse across
28
+ * every instance of a given control on the page precisely because lookups
29
+ * are always scoped this way, and - unlike a `name` built from a
30
+ * `typeNamespace` closed over inside a `$define` mixin, which is installed
31
+ * once on the shared custom-element prototype the first time a tag is
32
+ * defined - nothing here depends on a per-instance closure at all.
33
+ * @param {Element} root
34
+ * @param {string} selector
35
+ * @returns {HTMLElement|undefined}
36
+ */
37
+ export function findOwnControl(root: Element, selector: string): HTMLElement | undefined;
38
+ /**
39
+ * Whether `el` sits inside an `objectSearchType.js` has-property row whose
40
+ * own "Has"/"Doesn't have" tri-state is *already* explicitly chosen (not
41
+ * "(any)") - if so, that existence assertion alone is already a complete
42
+ * constraint for the row, so a per-field "no absent values" requirement
43
+ * inside it (a range's own "at least one bound", `buildRangeInputsPair`'s
44
+ * doc) should be relaxed. `setDescendantsRequired` handles this for plain
45
+ * `required`-attribute controls, but a range pair's requirement is
46
+ * re-asserted imperatively on every `input`/`change` via `setCustomValidity`
47
+ * (`syncRangeValidity`, `dateSearchType.js`'s own equivalent) - clearing it
48
+ * once wouldn't stick past the next keystroke, so those call this directly,
49
+ * live, instead.
50
+ *
51
+ * Returns `false` (not exempted) when `el` also sits inside a
52
+ * `buildOptInFieldset` fieldset (`jsoeSearchOptInFieldset--*`), for the same
53
+ * reason `setDescendantsRequired` skips those controls: a dimension range
54
+ * nested in `makeDomShapeSearchType`'s per-dimension opt-in gate (say,
55
+ * DOMRect's "Width") is only reachable at all once its own checkbox is
56
+ * checked, and checking it is itself the user's explicit request to
57
+ * constrain *that* facet - an enclosing "Has property" shouldn't then let
58
+ * its "From"/"To" sit blank and still read as valid, any more than
59
+ * `fileSearchType.js`'s "Name" facet should once opted into.
60
+ * @param {Element} el
61
+ * @returns {boolean}
62
+ */
63
+ export function isExemptedByAncestorHasProperty(el: Element): boolean;
64
+ /**
65
+ * Re-runs every `input`/`change`-driven validator within `root` by
66
+ * re-dispatching those events on each descendant form control -
67
+ * `objectSearchType.js`'s `buildHasPropertyRow` calls this when its own
68
+ * "Has"/"Doesn't have" tri-state changes, since a range pair (or anything
69
+ * else reactive) nested anywhere inside the child widget needs to
70
+ * re-evaluate `isExemptedByAncestorHasProperty` against the *new* tri-state
71
+ * value - nothing else would otherwise prompt it to run again until the
72
+ * user happens to interact with that specific field themselves.
73
+ * @param {Element} root
74
+ * @returns {void}
75
+ */
76
+ export function revalidateDescendants(root: Element): void;
77
+ /**
78
+ * The `buildRangeInputsPair` cross-validation check, factored out so a
79
+ * consuming widget's own `$define.connectedCallback` (custom elements,
80
+ * search plan §8) can also call it - the `input`/`change` events
81
+ * `buildRangeInputsPair` wires below only fire from the user's *first*
82
+ * interaction, so a freshly-built pair with both ends still empty would
83
+ * otherwise stay "valid" by the browser's reckoning (no `setCustomValidity`
84
+ * call has ever run yet) until then, contradicting the "leaving both blank
85
+ * is invalid" rule documented below. `connectedCallback` is a native
86
+ * Custom Elements lifecycle method (invoked once per instance the moment it
87
+ * connects to the document), so calling this from there closes that gap
88
+ * without needing any build-time live element reference.
89
+ *
90
+ * "Leaving both blank is invalid" is itself relaxed when
91
+ * `isExemptedByAncestorHasProperty` says so - a range nested as a has-
92
+ * property row's own child widget (e.g. a `date`/`number` property) needs
93
+ * the same "'Has property X' is already a complete constraint" relief
94
+ * `setDescendantsRequired` gives `required`-attribute controls, just
95
+ * re-checked live on every call rather than toggled once, since this runs
96
+ * imperatively on every keystroke regardless.
97
+ * @param {Element} root
98
+ * @param {string} [key]
99
+ * @returns {void}
100
+ */
101
+ export function syncRangeValidity(root: Element, key?: string): void;
102
+ /**
103
+ * A "from"/"to" pair of native inputs sharing one `type`, for the OR-range/
104
+ * Is-Not-Range README affordance (number/bigint/buffersource; `date` uses
105
+ * `dateType.js`'s own `buildDateInputControl` instead, since a
106
+ * `datetime-local` input needs its own ISO-slicing).
107
+ *
108
+ * `key` distinguishes multiple range pairs *within one widget* (e.g.
109
+ * `domrectSearchType.js`'s `x`/`y`/`width`/`height` dimensions, or
110
+ * `errorSearchType.js`'s `lineNumber`/`columnNumber`): `findOwnControl`
111
+ * already isolates one widget's controls from another's, but can't tell
112
+ * apart two same-class controls belonging to the *same* widget, so those
113
+ * need distinct classes. Leave it at the default `''` for the common case
114
+ * of a widget with only one range pair.
115
+ *
116
+ * Cross-validates the pair via the native Constraint Validation API,
117
+ * surfaced by `jsoe.css`'s `input:invalid` styling and a real `<form>`'s
118
+ * `reportValidity`/`checkValidity` (`src/search/index.js`): leaving *both*
119
+ * ends blank is invalid - the same "no absent values" reasoning
120
+ * `buildLiteralRegexControls`'s Value input documents, an added range row
121
+ * needs at least one bound to mean anything - and if both ends are filled
122
+ * with "To" less than "From", that's invalid too. An open-ended range (only
123
+ * one end filled) stays valid. A row nested under an
124
+ * `objectSearchType.js` required-property's opt-in `<fieldset disabled>`
125
+ * (or, for `dateSearchType.js`'s own equivalent pair, its own
126
+ * "Invalid date" fieldset) is unaffected either way, since a disabled field
127
+ * is excluded from constraint validation entirely. Every caller must also
128
+ * call `syncRangeValidity` from its own `connectedCallback` (see that
129
+ * function's doc) so the initial both-blank state is actually invalid from
130
+ * the moment the widget exists, not just after the user's first keystroke.
131
+ * `dateSearchType.js`'s own `datetime-local` pair needs the same two checks
132
+ * but isn't built through this helper (`buildDateInputControl` handles its
133
+ * own ISO-slicing), so it wires an equivalent handler itself.
134
+ * @param {{
135
+ * name: string,
136
+ * key?: string,
137
+ * type?: string,
138
+ * min?: string|number,
139
+ * max?: string|number,
140
+ * step?: string|number
141
+ * }} cfg
142
+ * @returns {JamilihArray[]}
143
+ */
144
+ export function buildRangeInputsPair({ name, key, type, min, max, step }: {
145
+ name: string;
146
+ key?: string;
147
+ type?: string;
148
+ min?: string | number;
149
+ max?: string | number;
150
+ step?: string | number;
151
+ }): JamilihArray[];
152
+ /**
153
+ * Reads back a `buildRangeInputsPair` - pass the same `key` it was built
154
+ * with.
155
+ * @param {HTMLElement} el
156
+ * @param {string} [key]
157
+ * @returns {{gte: string, lte: string}}
158
+ */
159
+ export function readRangeInputsPair(el: HTMLElement, key?: string): {
160
+ gte: string;
161
+ lte: string;
162
+ };
163
+ /**
164
+ * A `<select multiple>` populated from a fixed candidate list - used by
165
+ * `enum`/`multiSelect`/`literalSet` leaf controls (README: "multiple
166
+ * select").
167
+ *
168
+ * `required`, when set, makes leaving *every* option unselected invalid -
169
+ * `<select multiple required>` is natively satisfied by one or more
170
+ * selections, no custom validity code needed. `enumSearchType.js` passes
171
+ * this (an enum widget has nothing else to constrain, so an empty selection
172
+ * is never a meaningful "no constraint" state - same "no absent values"
173
+ * reasoning as `buildLiteralRegexControls`'s Value input); other callers
174
+ * (`regexpSearchType.js`'s Flags, `SpecialRealNumberSearchType.js`) leave it
175
+ * at the default `false`, since an empty selection there legitimately means
176
+ * "no constraint on this facet" alongside a widget that has other facets.
177
+ * @param {{
178
+ * name: string,
179
+ * options: (string|[value: string, title: string])[],
180
+ * required?: boolean
181
+ * }} cfg
182
+ * @returns {JamilihArray}
183
+ */
184
+ export function buildMultiSelect({ name, options, required }: {
185
+ name: string;
186
+ options: (string | [value: string, title: string])[];
187
+ required?: boolean;
188
+ }): JamilihArray;
189
+ /**
190
+ * Reads back a `buildMultiSelect` into the selected values, `[]` if none.
191
+ * @param {Element} el
192
+ * @returns {string[]}
193
+ */
194
+ export function readMultiSelect(el: Element): string[];
195
+ /**
196
+ * A tri-state "has property" control for one already-chosen property name
197
+ * (README: "Has property &lt;property pull-down&gt;", "avoid listing
198
+ * required"). `objectSearchType.js` supplies the additive pull-down that
199
+ * lets a user pick *which* property to add one of these for; this helper is
200
+ * only the fixed per-property toggle it adds each time, so the "any" state
201
+ * (no constraint entered) is distinguishable from an explicit "has"/
202
+ * "doesn't have" - matching `SearchTypeObject.getQuery`'s
203
+ * `undefined`-means-"no constraint" convention. Shares `readTriStateSelect`
204
+ * with `buildTriStateSelect` below - same three-value shape, just different
205
+ * option labels.
206
+ * @param {{name: string, propertyName: string}} cfg
207
+ * @returns {JamilihArray}
208
+ */
209
+ export function buildHasPropertyToggle({ name, propertyName }: {
210
+ name: string;
211
+ propertyName: string;
212
+ }): JamilihArray;
213
+ /**
214
+ * A generic "(any)"/true/false `<select>`, shared by every leaf whose only
215
+ * constraint is a plain boolean choice - `booleanSearchType.js`'s "true or
216
+ * false" (README) and `numberSearchType.js`'s "Is/Is Not Integer" both read
217
+ * back through this same three-way convention rather than each rolling
218
+ * their own.
219
+ *
220
+ * `key` distinguishes multiple tri-states *within one widget* (e.g.
221
+ * `dommatrixSearchType.js`'s "Is/Is not Readonly" and "Is/Is not 3d" side
222
+ * by side); see `buildRangeInputsPair`'s doc for why. Leave it at the
223
+ * default `''` for the common case of a widget with only one tri-state.
224
+ * `onChange`, when given, wires the select's own `change` event too (in
225
+ * addition to whatever the caller reads back via `readTriStateSelect` at
226
+ * `getQuery` time) - `dateSearchType.js`'s "Is valid/invalid date" tri-state
227
+ * uses it to disable the (otherwise irrelevant) From/To range while
228
+ * "Invalid date" is selected.
229
+ *
230
+ * `required`, when set, makes leaving the select at "(any)" invalid - the
231
+ * "(any)" option's `value: ''` below is exactly what native `required`
232
+ * treats as "nothing selected", the same trick `unionFamilySearchType.js`'s
233
+ * "Has type" select and `buildMultiSelect`'s `required` use.
234
+ * `booleanSearchType.js` passes this (a boolean widget has nothing else to
235
+ * constrain, so "(any)" is never a meaningful "no constraint" state - same
236
+ * "no absent values" reasoning as `buildLiteralRegexControls`'s Value
237
+ * input); other callers (`numberSearchType.js`'s "Is/Is Not Integer",
238
+ * `dommatrixSearchType.js`'s readonly/3d) leave it at the default `false`,
239
+ * since those are one of *several* facets in their own widget, where
240
+ * "(any)" legitimately means "no constraint on this facet".
241
+ * @param {{
242
+ * name: string, key?: string, trueLabel: string, falseLabel: string,
243
+ * onChange?: (this: HTMLElement) => void, required?: boolean
244
+ * }} cfg
245
+ * @returns {JamilihArray}
246
+ */
247
+ export function buildTriStateSelect({ name, key, trueLabel, falseLabel, onChange, required }: {
248
+ name: string;
249
+ key?: string;
250
+ trueLabel: string;
251
+ falseLabel: string;
252
+ onChange?: (this: HTMLElement) => void;
253
+ required?: boolean;
254
+ }): JamilihArray;
255
+ /**
256
+ * Reads back a `buildTriStateSelect`/`buildHasPropertyToggle` - pass the
257
+ * same `key` it was built with. `''` (any) maps to `undefined`.
258
+ * @param {Element} el
259
+ * @param {string} [key]
260
+ * @returns {boolean|undefined}
261
+ */
262
+ export function readTriStateSelect(el: Element, key?: string): boolean | undefined;
263
+ /**
264
+ * A single checkbox - the only search affordance the README grants
265
+ * `undefined`/`void`/`null`/`NaN` ("Require present"; they have "no
266
+ * variants to allow for distinct search", since existence only becomes a
267
+ * meaningful question once the path is optional or nested in a union), and
268
+ * also used by `recordSearchType.js`/`mapSearchType.js` for their "require
269
+ * same entry" toggle.
270
+ *
271
+ * `checked`, when set, pre-checks the checkbox; `disabled` locks it there,
272
+ * non-interactive. `makePresenceOnlySearchType` passes both: the checkbox
273
+ * is that leaf's *only* possible constraint, and its whole schema type has
274
+ * exactly one value ("no variants to allow for distinct search" above) -
275
+ * there is no second state worth offering a choice between, so this simply
276
+ * asserts the one meaningful thing outright rather than making the user
277
+ * pointlessly check a box that could only ever mean one thing. "require
278
+ * same entry" leaves both at their `false` defaults (interactive,
279
+ * unchecked), since that's one optional facet alongside a map/record's own
280
+ * key/value matches, not the whole widget's sole, single-valued constraint.
281
+ * @param {{name: string, label: string, checked?: boolean, disabled?: boolean}} cfg
282
+ * @returns {JamilihArray}
283
+ */
284
+ export function buildCheckbox({ name, label, checked, disabled }: {
285
+ name: string;
286
+ label: string;
287
+ checked?: boolean;
288
+ disabled?: boolean;
289
+ }): JamilihArray;
290
+ /**
291
+ * Reads back a `buildCheckbox`.
292
+ * @param {HTMLElement} el
293
+ * @returns {boolean}
294
+ */
295
+ export function readCheckbox(el: HTMLElement): boolean;
296
+ /**
297
+ * The mode selector for the README's "string, StringObject, Blob, File,
298
+ * regexp (source), symbol (description): OR literal or regex search/Does
299
+ * Not contain search" - one shared control (and reader, below) that
300
+ * `stringSearchType.js`, `symbolSearchType.js`, and `regexpSearchType.js`
301
+ * (for its source) each build their own custom element around, since the
302
+ * query semantics are identical and only the label/target facet differs.
303
+ *
304
+ * `key` distinguishes multiple literal/regex controls *within one widget*
305
+ * (e.g. `errorSearchType.js`'s `message`/`name`/`fileName`/`stack`); see
306
+ * `buildRangeInputsPair`'s doc for why. Leave it at the default `''` for
307
+ * the common case of a widget with only one such control.
308
+ *
309
+ * The Value input is `required`: unlike an untouched range/checkbox/select
310
+ * (whose empty/default state unambiguously means "no constraint"), a mode
311
+ * is always selected here (there is no "(any)" option), so an empty Value
312
+ * next to it is never a meaningful "no constraint" state - it just means
313
+ * the row was added and never finished. That leaves the whole form invalid
314
+ * from the moment such a row exists (`buildSearchChoices`'s `<form>`,
315
+ * `src/search/index.js`) until either a value is entered or (for an
316
+ * `objectSearchType.js` has-property row) the row is removed via its own
317
+ * "Remove" button.
318
+ *
319
+ * `onModeChange`, when given, wires the mode select's own `change` event
320
+ * too (in addition to whatever the caller reads back via
321
+ * `readLiteralRegexQuery` at `getQuery` time) - `regexpSearchType.js` uses
322
+ * it to show/hide its Flags multi-select, which only makes sense while
323
+ * "Matches regex" is the chosen mode.
324
+ *
325
+ * `flagOptions`, when given, adds a Flags multi-select (options passed in
326
+ * by the caller - `stringSearchType.js` passes `regexpType.js`'s own
327
+ * `allowedFlags`, the same list `regexpSearchType.js` uses for the actual
328
+ * regexp's own flags - kept out of this generic module to avoid it
329
+ * depending on a specific fundamental type), shown only while "Matches
330
+ * regex" is the chosen mode, the same `$options` a Mongo-flavored `$regex`
331
+ * accepts alongside it - a plain literal/substring match has no regex to
332
+ * apply flags to, so it stays hidden otherwise. Every other caller
333
+ * (`errorSearchType.js`'s props, `fileSearchType.js`'s name/type,
334
+ * `domexceptionSearchType.js`'s message) leaves this unset, matching the
335
+ * README's flags-for-regexp-only-plus-string bullet.
336
+ * @param {{
337
+ * name: string, key?: string, onModeChange?: (this: HTMLElement) => void,
338
+ * flagOptions?: string[]
339
+ * }} cfg
340
+ * @returns {JamilihArray}
341
+ */
342
+ export function buildLiteralRegexControls({ name, key, onModeChange, flagOptions }: {
343
+ name: string;
344
+ key?: string;
345
+ onModeChange?: (this: HTMLElement) => void;
346
+ flagOptions?: string[];
347
+ }): JamilihArray;
348
+ /**
349
+ * Reads back `buildLiteralRegexControls` into the corresponding
350
+ * `literalSet`/`regex`/`notContains` leaf - pass the same `key` it was
351
+ * built with. A `regex` leaf's `$options` is only ever populated when the
352
+ * caller built this with `flagOptions` (see that function's doc) and at
353
+ * least one flag is currently selected.
354
+ * @param {HTMLElement} el
355
+ * @param {string} path
356
+ * @param {string} [key]
357
+ * @returns {import('./queryTree.js').QueryLiteralSetLeaf|
358
+ * import('./queryTree.js').QueryRegexLeaf|
359
+ * import('./queryTree.js').QueryNotContainsLeaf|undefined}
360
+ */
361
+ export function readLiteralRegexQuery(el: HTMLElement, path: string, key?: string): import("./queryTree.js").QueryLiteralSetLeaf | import("./queryTree.js").QueryRegexLeaf | import("./queryTree.js").QueryNotContainsLeaf | undefined;
362
+ /**
363
+ * Has length/size of &lt;number&gt; (README; array/set/tuple-with-rest/
364
+ * filelist), + "Is/Is not sparse" for arrays only. Returns `[]` (no
365
+ * control) when the schema pins an exact length/size, since searching on a
366
+ * constant is uninteresting - the schema's `min`/`max` otherwise become the
367
+ * input's HTML `min`/`max` attributes.
368
+ * @param {{
369
+ * name: string,
370
+ * min?: number,
371
+ * max?: number,
372
+ * includeSparse?: boolean
373
+ * }} cfg
374
+ * @returns {JamilihArray[]}
375
+ */
376
+ export function buildLengthSizeControls({ name, min, max, includeSparse }: {
377
+ name: string;
378
+ min?: number;
379
+ max?: number;
380
+ includeSparse?: boolean;
381
+ }): JamilihArray[];
382
+ /**
383
+ * Reads back `buildLengthSizeControls` into one `lengthSize` leaf, or
384
+ * `undefined` if neither the size nor the sparse control was set.
385
+ * @param {Element} el
386
+ * @param {string} path
387
+ * @returns {import('./queryTree.js').QueryLengthSizeLeaf|undefined}
388
+ */
389
+ export function readLengthSizeQuery(el: Element, path: string): import("./queryTree.js").QueryLengthSizeLeaf | undefined;
390
+ /**
391
+ * Wraps arbitrary markup - a recursed child search widget's array, or a
392
+ * fixed facet's own controls (`buildLiteralRegexControls`'s output, say) -
393
+ * in an opt-in "Search on this" checkbox around a disabled `<fieldset>`.
394
+ * For a facet that's one of *several* independent, individually-optional
395
+ * constraints within a parent widget (array/set/tuple/filelist's element
396
+ * match(es); map/record's key/value; `fileSearchType.js`'s name/content-
397
+ * type), this keeps that facet's own `required` controls (if it has any)
398
+ * from forcing the *whole* form invalid just by the facet existing -
399
+ * generalizes `objectSearchType.js`'s original required-property row (see
400
+ * that file's history) into a shared helper once enough call sites needed
401
+ * the identical checkbox+fieldset shape.
402
+ *
403
+ * `key` distinguishes multiple opt-in fieldsets *within one widget* (e.g.
404
+ * `mapSearchType.js`'s "key" and "value"); see `buildRangeInputsPair`'s doc
405
+ * for why. Leave it at the default `''` for a widget with only one.
406
+ *
407
+ * The checkbox's own `name` attribute is `${name}-optIn`, not the bare
408
+ * `name` passed in: a caller's `name` is typically shared with (a prefix
409
+ * of) the wrapped content's own field names (`mapSearchType.js`'s "value"
410
+ * facet, say, names its checkbox from the same `name` its inner value
411
+ * widget builds its own `-value`-suffixed `<input>` from), and callers
412
+ * cannot always predict what suffix a given recursed `SearchTypeObject`
413
+ * will pick - the fixed `-optIn` suffix here guarantees no collision
414
+ * regardless, without every caller needing to reason about it.
415
+ *
416
+ * Call `wireOptInFieldset` once, right after this is built into real DOM
417
+ * (e.g. inside a `jml(...)` caller, same as `objectSearchType.js`'s rows
418
+ * do), to actually connect the checkbox to the fieldset's `disabled` state -
419
+ * this function only builds the static markup (default unchecked/disabled).
420
+ * @param {{
421
+ * name: string, key?: string, label: string, children: JamilihArray[]
422
+ * }} cfg
423
+ * @returns {JamilihArray[]}
424
+ */
425
+ export function buildOptInFieldset({ name, key, label, children }: {
426
+ name: string;
427
+ key?: string;
428
+ label: string;
429
+ children: JamilihArray[];
430
+ }): JamilihArray[];
431
+ /**
432
+ * Reads back a `buildOptInFieldset`'s checkbox - pass the same `key` it was
433
+ * built with.
434
+ * @param {Element} root
435
+ * @param {string} [key]
436
+ * @returns {boolean}
437
+ */
438
+ export function readOptInChecked(root: Element, key?: string): boolean;
439
+ /**
440
+ * Connects a `buildOptInFieldset`'s checkbox to toggle its own fieldset's
441
+ * `disabled` state - call once, synchronously, right after both are live
442
+ * DOM nodes (see that function's doc). Pass the same `key` it was built
443
+ * with.
444
+ *
445
+ * `onToggle`, when given, is called after each toggle (with the checkbox as
446
+ * `this`) - `mapSearchType.js`/`recordSearchType.js`/`fileSearchType.js`
447
+ * use it to re-run their own `syncAtLeastOneCheck` whenever one of their
448
+ * (exactly two) opt-in facets changes, since checking/unchecking either one
449
+ * can change whether "at least one" is satisfied.
450
+ * @param {Element} root
451
+ * @param {string} [key]
452
+ * @param {((this: HTMLInputElement) => void)} [onToggle]
453
+ * @returns {void}
454
+ */
455
+ export function wireOptInFieldset(root: Element, key?: string, onToggle?: ((this: HTMLInputElement) => void)): void;
456
+ /**
457
+ * A visually-hidden but still-rendered (and so still constraint-validation-
458
+ * eligible - see `jsoe.css`'s `.searchAtLeastOneSentinel`, the same
459
+ * "visually-hidden" pattern used for accessibility, which keeps an element
460
+ * off-screen without `display: none`/`hidden` triggering the Constraint
461
+ * Validation API's own "not rendered" exemption) sentinel control, for a
462
+ * widget with several independent optional facets where leaving *every one*
463
+ * unconfigured should be invalid even though no single facet is itself
464
+ * always required (`mapSearchType.js`/`recordSearchType.js`'s key/value,
465
+ * `fileSearchType.js`'s name/content-type). Pair with `syncAtLeastOneCheck`.
466
+ * @returns {JamilihArray}
467
+ */
468
+ export function buildAtLeastOneSentinel(): JamilihArray;
469
+ /**
470
+ * Sets a `buildAtLeastOneSentinel`'s custom validity from a live check -
471
+ * call once at `connectedCallback` time for the initial state (a freshly-
472
+ * built widget has satisfied none of its facets yet) and again whenever a
473
+ * facet that could change the answer does (an opt-in checkbox toggling, a
474
+ * recursed child's own `input`/`change`).
475
+ *
476
+ * Also relaxed, independently of `isSatisfied`, while
477
+ * `isExemptedByAncestorHasProperty` says an enclosing
478
+ * `objectSearchType.js` has-property row's own "Has"/"Doesn't have"
479
+ * already provides a complete constraint - the same relief
480
+ * `syncRangeValidity` and `dateSearchType.js`'s own range validator give
481
+ * their "at least one bound" rule, needed here too since a has-property
482
+ * row's own child could just as easily be an `array`/`map`/`file`/etc.
483
+ * whose *own* sole constraint is this same "at least one facet" sentinel
484
+ * rather than a plain `required` attribute or a range pair.
485
+ *
486
+ * Every call re-registers `isSatisfied` (keyed by `root` in a `WeakMap`, so
487
+ * it never leaks past the element's own lifetime) for `resyncAtLeastOne` to
488
+ * call later. This exists because not every "at least one" widget's own
489
+ * answer changes via a plain `input`/`change` event - `objectSearchType.js`
490
+ * itself is the reason: its sentinel changes when a row is added/removed
491
+ * (a button click, and a structural DOM change, not a value change on any
492
+ * control), which `revalidateDescendants`' blanket event-redispatch can
493
+ * never reach, unlike `array`/`map`/etc.'s own opt-in checkboxes and size
494
+ * inputs. `objectSearchType.js`'s `buildHasPropertyRow` calls
495
+ * `resyncAtLeastOne` directly instead, precisely because it can't rely on
496
+ * redispatched events reaching every possible child type.
497
+ * @param {Element} root
498
+ * @param {() => boolean} isSatisfied
499
+ * @returns {void}
500
+ */
501
+ export function syncAtLeastOneCheck(root: Element, isSatisfied: () => boolean): void;
502
+ /**
503
+ * Re-runs every `syncAtLeastOneCheck` registered anywhere within `root`
504
+ * (itself included) - see that function's doc for why this exists
505
+ * alongside `revalidateDescendants` rather than relying on it alone.
506
+ * @param {Element} root
507
+ * @returns {void}
508
+ */
509
+ export function resyncAtLeastOne(root: Element): void;
510
+ /**
511
+ * Toggles the native `required` attribute on every originally-`required`
512
+ * control inside `root`, leaving everything else (visibility, `disabled`)
513
+ * alone - unlike `buildOptInFieldset`'s `<fieldset disabled>`, this keeps
514
+ * the whole subtree fully interactive, for a case where an ancestor's own
515
+ * choice already provides a complete constraint on its own, but should
516
+ * still let the recursed child *optionally* add a further constraint on
517
+ * top rather than blocking interaction with it entirely.
518
+ * `objectSearchType.js`'s `buildHasPropertyRow` uses this for its "Has"/
519
+ * "Doesn't have" tri-state: once existence is explicitly asserted either
520
+ * way, the child's own required inputs (whatever type it turns out to be)
521
+ * should stop forcing it to be filled in, while a user who still wants to
522
+ * combine "Has property X" with "X matches Y" can keep typing into it -
523
+ * `dateSearchType.js`'s "Valid"/"Invalid date" tri-state needs the
524
+ * equivalent relaxation for its own (structurally different, so not built
525
+ * through this helper) range pair.
526
+ *
527
+ * Relaxing (`required: false`) marks each control it touches with
528
+ * `data-jsoe-was-required` before clearing the IDL `required` property -
529
+ * setting that property to `false` reflects back to *removing* the
530
+ * `required` content attribute entirely (standard boolean-attribute
531
+ * reflection), so a later call to restore it can't rely on `[required]`
532
+ * still matching that element; it looks for the marker instead.
533
+ *
534
+ * Skips any control inside a `buildOptInFieldset` fieldset
535
+ * (`jsoeSearchOptInFieldset--*`): that facet already has its own gate on
536
+ * whether it applies at all (the checkbox's `disabled` toggle exempts it
537
+ * from constraint validation while unchecked), so an enclosing "Has
538
+ * property" shouldn't also strip its `required` - a user who explicitly
539
+ * opts into e.g. `fileSearchType.js`'s "Name" facet under a "Has property"
540
+ * ancestor still needs to fill in the Value it requires, or uncheck "Name"
541
+ * again; only the widget's own `buildAtLeastOneSentinel` (which *is*
542
+ * exempted, via `isExemptedByAncestorHasProperty`) should be satisfied by
543
+ * "Has property" alone.
544
+ * @param {Element} root
545
+ * @param {boolean} required
546
+ * @returns {void}
547
+ */
548
+ export function setDescendantsRequired(root: Element, required: boolean): void;
549
+ export type JamilihArray = import("../types.js").JamilihArray;
550
+ //# sourceMappingURL=searchUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"searchUtils.d.ts","sourceRoot":"","sources":["../../src/search/searchUtils.js"],"names":[],"mappings":"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"}
@@ -0,0 +1,36 @@
1
+ export default blobHTMLSearchType;
2
+ export type SearchTypeObject = import("../searchDispatch.js").SearchTypeObject;
3
+ /**
4
+ * @typedef {import('../searchDispatch.js').SearchTypeObject} SearchTypeObject
5
+ */
6
+ /**
7
+ * Blob HTML: XPath, CSS selectors, full text search, regex search of raw
8
+ * HTML (README) - a mode `<select>` plus one value control, the same
9
+ * "pick a mode, give it one value" shape as `buildLiteralRegexControls`
10
+ * (`searchUtils.js`), but not built through it: the four modes and the
11
+ * `blobHTML` leaf kind they produce are specific to this one type, with no
12
+ * second caller to share the helper with. The value control is a single-line
13
+ * `<input>` for XPath/CSS-selector/regex, but swaps to a `<textarea>` for
14
+ * "Full text search" mode alone, since a search phrase in a body of text is
15
+ * the one mode actually expected to run to more than one line - both share
16
+ * the same class, so the mode `<select>`'s `change` handler (and `getQuery`)
17
+ * only need the tag name to tell them apart. Only the currently-visible one
18
+ * of the pair is ever `required` (toggled alongside `hidden` by the mode
19
+ * `change` handler): a `required` field that's merely hidden, rather than
20
+ * also un-required, still blocks the form's validity even though the user
21
+ * has no way to see or fill it.
22
+ *
23
+ * The `change` handler also checks `isExemptedByAncestorHasProperty` before
24
+ * (re-)asserting `required` on the now-visible control: nested as an
25
+ * optional object property's own child widget, an enclosing "Has property"
26
+ * already provides a complete constraint on its own (the same relief
27
+ * `setDescendantsRequired` gives other `required`-attribute controls), but
28
+ * that relief is a one-time toggle applied *before* `revalidateDescendants`
29
+ * re-dispatches a synthetic `change` on this very `<select>` - without this
30
+ * check, that synthetic event would immediately reassert `required` on
31
+ * whichever control the current mode makes visible, undoing the exemption
32
+ * `setDescendantsRequired` had just granted.
33
+ * @type {SearchTypeObject}
34
+ */
35
+ declare const blobHTMLSearchType: SearchTypeObject;
36
+ //# sourceMappingURL=blobHTMLSearchType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blobHTMLSearchType.d.ts","sourceRoot":"","sources":["../../../src/search/subTypes/blobHTMLSearchType.js"],"names":[],"mappings":";+BAOa,OAAO,sBAAsB,EAAE,gBAAgB;AAD5D;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,kCAFU,gBAAgB,CAkFxB"}
@@ -0,0 +1,18 @@
1
+ export default recordSearchType;
2
+ export type SearchTypeObject = import("../searchDispatch.js").SearchTypeObject;
3
+ /**
4
+ * Record search is "key-schema search AND/OR value-schema search,"
5
+ * structurally unlike object's additive "has property" (search plan §1) -
6
+ * recurses into both the `key` and `value` schemas' own search widgets
7
+ * (`*key`/`*value` path segments, `queryTree.js`), and lets the user say
8
+ * whether a match must come from the *same* entry ("has key 2-4 and value
9
+ * 7-9", README) via the "joint" toggle on the resulting `mapRecordJoint`
10
+ * leaf - also used for `looseRecord`, aliased to this same module in
11
+ * `searchDispatch.js` since the search semantics are identical. Key and
12
+ * value each get their own `buildOptInFieldset` (see `mapSearchType.js`'s
13
+ * matching doc for why), but leaving *both* unopted-in is itself invalid via
14
+ * `buildAtLeastOneSentinel`.
15
+ * @type {SearchTypeObject}
16
+ */
17
+ declare const recordSearchType: SearchTypeObject;
18
+ //# sourceMappingURL=recordSearchType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recordSearchType.d.ts","sourceRoot":"","sources":["../../../src/search/subTypes/recordSearchType.js"],"names":[],"mappings":";+BASa,OAAO,sBAAsB,EAAE,gBAAgB;AAa5D;;;;;;;;;;;;;GAaG;AACH,gCAFU,gBAAgB,CAoExB"}
@@ -0,0 +1,21 @@
1
+ export default tupleSearchType;
2
+ export type SearchTypeObject = import("../searchDispatch.js").SearchTypeObject;
3
+ /**
4
+ * Each fixed position gets its own control from `.items[i]`, not one
5
+ * control repeated per element (search plan §1 - unlike the value-editing
6
+ * side, this gets a dedicated module rather than delegating to
7
+ * `arraySearchType.js`, since positions aren't interchangeable). A tuple
8
+ * with no `rest` has an inherently fixed length (`items.length`), so - as
9
+ * with a fixed-length array - no length control is shown for it; "with rest
10
+ * has size search as with arrays" (README) applies once `rest` is present:
11
+ * total length becomes a variable-length `lengthSize` control (`min:
12
+ * items.length`, no sparse toggle - not applicable to a tuple), and the
13
+ * `rest` element itself recurses into its own search widget under the same
14
+ * `*` path-segment convention `arraySearchType.js` uses for its element.
15
+ * Leaving every position, the rest element, and (when present) the length
16
+ * unconfigured at once is invalid (`buildAtLeastOneSentinel`), the same as
17
+ * `arraySearchType.js`/`setSearchType.js`/`filelistSearchType.js`.
18
+ * @type {SearchTypeObject}
19
+ */
20
+ declare const tupleSearchType: SearchTypeObject;
21
+ //# sourceMappingURL=tupleSearchType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tupleSearchType.d.ts","sourceRoot":"","sources":["../../../src/search/subTypes/tupleSearchType.js"],"names":[],"mappings":";+BAUa,OAAO,sBAAsB,EAAE,gBAAgB;AAkB5D;;;;;;;;;;;;;;;;GAgBG;AACH,+BAFU,gBAAgB,CA0GxB"}
@@ -0,0 +1,14 @@
1
+ export default SpecialRealNumberSearchType;
2
+ export type SearchTypeObject = import("../searchDispatch.js").SearchTypeObject;
3
+ /**
4
+ * @typedef {import('../searchDispatch.js').SearchTypeObject} SearchTypeObject
5
+ */
6
+ /**
7
+ * Special number: multiple select of "Infinity", "-Infinity" (README;
8
+ * `NaN` is covered separately by `nanSearchType.js`'s presence-only
9
+ * control, since it's its own zodex schema type - `SpecialRealNumberType.js`
10
+ * itself covers exactly `Infinity`/`-Infinity`/`-0`, not `NaN`).
11
+ * @type {SearchTypeObject}
12
+ */
13
+ declare const SpecialRealNumberSearchType: SearchTypeObject;
14
+ //# sourceMappingURL=SpecialRealNumberSearchType.d.ts.map