@bcts/envelope-pattern 1.0.0-alpha.12
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/LICENSE +48 -0
- package/README.md +13 -0
- package/dist/index.cjs +6781 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2628 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +2628 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.iife.js +6781 -0
- package/dist/index.iife.js.map +1 -0
- package/dist/index.mjs +6545 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +77 -0
- package/src/error.ts +262 -0
- package/src/format.ts +375 -0
- package/src/index.ts +27 -0
- package/src/parse/index.ts +923 -0
- package/src/parse/token.ts +906 -0
- package/src/parse/utils.ts +339 -0
- package/src/pattern/index.ts +719 -0
- package/src/pattern/leaf/array-pattern.ts +273 -0
- package/src/pattern/leaf/bool-pattern.ts +140 -0
- package/src/pattern/leaf/byte-string-pattern.ts +172 -0
- package/src/pattern/leaf/cbor-pattern.ts +355 -0
- package/src/pattern/leaf/date-pattern.ts +178 -0
- package/src/pattern/leaf/index.ts +280 -0
- package/src/pattern/leaf/known-value-pattern.ts +192 -0
- package/src/pattern/leaf/map-pattern.ts +152 -0
- package/src/pattern/leaf/null-pattern.ts +110 -0
- package/src/pattern/leaf/number-pattern.ts +248 -0
- package/src/pattern/leaf/tagged-pattern.ts +228 -0
- package/src/pattern/leaf/text-pattern.ts +165 -0
- package/src/pattern/matcher.ts +88 -0
- package/src/pattern/meta/and-pattern.ts +109 -0
- package/src/pattern/meta/any-pattern.ts +81 -0
- package/src/pattern/meta/capture-pattern.ts +111 -0
- package/src/pattern/meta/group-pattern.ts +110 -0
- package/src/pattern/meta/index.ts +269 -0
- package/src/pattern/meta/not-pattern.ts +91 -0
- package/src/pattern/meta/or-pattern.ts +146 -0
- package/src/pattern/meta/search-pattern.ts +201 -0
- package/src/pattern/meta/traverse-pattern.ts +146 -0
- package/src/pattern/structure/assertions-pattern.ts +244 -0
- package/src/pattern/structure/digest-pattern.ts +225 -0
- package/src/pattern/structure/index.ts +272 -0
- package/src/pattern/structure/leaf-structure-pattern.ts +85 -0
- package/src/pattern/structure/node-pattern.ts +188 -0
- package/src/pattern/structure/object-pattern.ts +149 -0
- package/src/pattern/structure/obscured-pattern.ts +159 -0
- package/src/pattern/structure/predicate-pattern.ts +151 -0
- package/src/pattern/structure/subject-pattern.ts +152 -0
- package/src/pattern/structure/wrapped-pattern.ts +195 -0
- package/src/pattern/vm.ts +1021 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,2628 @@
|
|
|
1
|
+
import { BoolPattern as BoolPattern$1, ByteStringPattern as ByteStringPattern$1, DatePattern as DatePattern$1, Interval, Interval as Interval$1, KnownValuePattern as KnownValuePattern$1, NullPattern as NullPattern$1, NumberPattern as NumberPattern$1, Pattern as Pattern$1, Quantifier, Quantifier as Quantifier$1, Reluctance, Reluctance as Reluctance$1, TaggedPattern as TaggedPattern$1, TextPattern as TextPattern$1 } from "@bcts/dcbor-pattern";
|
|
2
|
+
import { Digest, Envelope } from "@bcts/envelope";
|
|
3
|
+
import { Cbor, CborDate, CborInput, Tag } from "@bcts/dcbor";
|
|
4
|
+
import { KnownValue } from "@bcts/known-values";
|
|
5
|
+
|
|
6
|
+
//#region src/parse/token.d.ts
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Token types for the Gordian Envelope pattern syntax.
|
|
10
|
+
*
|
|
11
|
+
* Corresponds to the Rust `Token` enum in token.rs
|
|
12
|
+
*/
|
|
13
|
+
type Token = {
|
|
14
|
+
readonly type: "And";
|
|
15
|
+
} | {
|
|
16
|
+
readonly type: "Or";
|
|
17
|
+
} | {
|
|
18
|
+
readonly type: "Not";
|
|
19
|
+
} | {
|
|
20
|
+
readonly type: "Traverse";
|
|
21
|
+
} | {
|
|
22
|
+
readonly type: "RepeatZeroOrMore";
|
|
23
|
+
} | {
|
|
24
|
+
readonly type: "RepeatZeroOrMoreLazy";
|
|
25
|
+
} | {
|
|
26
|
+
readonly type: "RepeatZeroOrMorePossessive";
|
|
27
|
+
} | {
|
|
28
|
+
readonly type: "RepeatOneOrMore";
|
|
29
|
+
} | {
|
|
30
|
+
readonly type: "RepeatOneOrMoreLazy";
|
|
31
|
+
} | {
|
|
32
|
+
readonly type: "RepeatOneOrMorePossessive";
|
|
33
|
+
} | {
|
|
34
|
+
readonly type: "RepeatZeroOrOne";
|
|
35
|
+
} | {
|
|
36
|
+
readonly type: "RepeatZeroOrOneLazy";
|
|
37
|
+
} | {
|
|
38
|
+
readonly type: "RepeatZeroOrOnePossessive";
|
|
39
|
+
} | {
|
|
40
|
+
readonly type: "Assertion";
|
|
41
|
+
} | {
|
|
42
|
+
readonly type: "AssertionPred";
|
|
43
|
+
} | {
|
|
44
|
+
readonly type: "AssertionObj";
|
|
45
|
+
} | {
|
|
46
|
+
readonly type: "Digest";
|
|
47
|
+
} | {
|
|
48
|
+
readonly type: "Node";
|
|
49
|
+
} | {
|
|
50
|
+
readonly type: "Obj";
|
|
51
|
+
} | {
|
|
52
|
+
readonly type: "Obscured";
|
|
53
|
+
} | {
|
|
54
|
+
readonly type: "Elided";
|
|
55
|
+
} | {
|
|
56
|
+
readonly type: "Encrypted";
|
|
57
|
+
} | {
|
|
58
|
+
readonly type: "Compressed";
|
|
59
|
+
} | {
|
|
60
|
+
readonly type: "Pred";
|
|
61
|
+
} | {
|
|
62
|
+
readonly type: "Subject";
|
|
63
|
+
} | {
|
|
64
|
+
readonly type: "Wrapped";
|
|
65
|
+
} | {
|
|
66
|
+
readonly type: "Unwrap";
|
|
67
|
+
} | {
|
|
68
|
+
readonly type: "Search";
|
|
69
|
+
} | {
|
|
70
|
+
readonly type: "ByteString";
|
|
71
|
+
} | {
|
|
72
|
+
readonly type: "Leaf";
|
|
73
|
+
} | {
|
|
74
|
+
readonly type: "Cbor";
|
|
75
|
+
} | {
|
|
76
|
+
readonly type: "DateKeyword";
|
|
77
|
+
} | {
|
|
78
|
+
readonly type: "Known";
|
|
79
|
+
} | {
|
|
80
|
+
readonly type: "Null";
|
|
81
|
+
} | {
|
|
82
|
+
readonly type: "NumberKeyword";
|
|
83
|
+
} | {
|
|
84
|
+
readonly type: "Tagged";
|
|
85
|
+
} | {
|
|
86
|
+
readonly type: "BoolKeyword";
|
|
87
|
+
} | {
|
|
88
|
+
readonly type: "BoolTrue";
|
|
89
|
+
} | {
|
|
90
|
+
readonly type: "BoolFalse";
|
|
91
|
+
} | {
|
|
92
|
+
readonly type: "TextKeyword";
|
|
93
|
+
} | {
|
|
94
|
+
readonly type: "NaN";
|
|
95
|
+
} | {
|
|
96
|
+
readonly type: "StringLiteral";
|
|
97
|
+
readonly value: Result<string>;
|
|
98
|
+
} | {
|
|
99
|
+
readonly type: "ParenOpen";
|
|
100
|
+
} | {
|
|
101
|
+
readonly type: "ParenClose";
|
|
102
|
+
} | {
|
|
103
|
+
readonly type: "BracketOpen";
|
|
104
|
+
} | {
|
|
105
|
+
readonly type: "BracketClose";
|
|
106
|
+
} | {
|
|
107
|
+
readonly type: "Comma";
|
|
108
|
+
} | {
|
|
109
|
+
readonly type: "Ellipsis";
|
|
110
|
+
} | {
|
|
111
|
+
readonly type: "GreaterThanOrEqual";
|
|
112
|
+
} | {
|
|
113
|
+
readonly type: "LessThanOrEqual";
|
|
114
|
+
} | {
|
|
115
|
+
readonly type: "GreaterThan";
|
|
116
|
+
} | {
|
|
117
|
+
readonly type: "LessThan";
|
|
118
|
+
} | {
|
|
119
|
+
readonly type: "Integer";
|
|
120
|
+
readonly value: Result<number>;
|
|
121
|
+
} | {
|
|
122
|
+
readonly type: "UnsignedInteger";
|
|
123
|
+
readonly value: Result<number>;
|
|
124
|
+
} | {
|
|
125
|
+
readonly type: "Float";
|
|
126
|
+
readonly value: Result<number>;
|
|
127
|
+
} | {
|
|
128
|
+
readonly type: "Infinity";
|
|
129
|
+
} | {
|
|
130
|
+
readonly type: "NegativeInfinity";
|
|
131
|
+
} | {
|
|
132
|
+
readonly type: "GroupName";
|
|
133
|
+
readonly name: string;
|
|
134
|
+
} | {
|
|
135
|
+
readonly type: "Regex";
|
|
136
|
+
readonly value: Result<string>;
|
|
137
|
+
} | {
|
|
138
|
+
readonly type: "HexPattern";
|
|
139
|
+
readonly value: Result<Uint8Array>;
|
|
140
|
+
} | {
|
|
141
|
+
readonly type: "HexBinaryRegex";
|
|
142
|
+
readonly value: Result<string>;
|
|
143
|
+
} | {
|
|
144
|
+
readonly type: "DatePattern";
|
|
145
|
+
readonly value: Result<string>;
|
|
146
|
+
} | {
|
|
147
|
+
readonly type: "Range";
|
|
148
|
+
readonly value: Result<Quantifier$1>;
|
|
149
|
+
} | {
|
|
150
|
+
readonly type: "SingleQuotedPattern";
|
|
151
|
+
readonly value: Result<string>;
|
|
152
|
+
} | {
|
|
153
|
+
readonly type: "SingleQuotedRegex";
|
|
154
|
+
readonly value: Result<string>;
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* Lexer for Gordian Envelope pattern syntax.
|
|
158
|
+
*/
|
|
159
|
+
declare class Lexer {
|
|
160
|
+
#private;
|
|
161
|
+
constructor(source: string);
|
|
162
|
+
/**
|
|
163
|
+
* Gets the current position in the source.
|
|
164
|
+
*/
|
|
165
|
+
get position(): number;
|
|
166
|
+
/**
|
|
167
|
+
* Peeks at the next token without consuming it.
|
|
168
|
+
*/
|
|
169
|
+
peekToken(): {
|
|
170
|
+
token: Token;
|
|
171
|
+
span: Span;
|
|
172
|
+
} | undefined;
|
|
173
|
+
/**
|
|
174
|
+
* Gets the current span (from token start to current position).
|
|
175
|
+
*/
|
|
176
|
+
span(): Span;
|
|
177
|
+
/**
|
|
178
|
+
* Gets the remaining source string.
|
|
179
|
+
*/
|
|
180
|
+
remainder(): string;
|
|
181
|
+
/**
|
|
182
|
+
* Peeks at the current character without consuming it.
|
|
183
|
+
*/
|
|
184
|
+
peek(): string | undefined;
|
|
185
|
+
/**
|
|
186
|
+
* Peeks at the next character without consuming current.
|
|
187
|
+
*/
|
|
188
|
+
peekNext(): string | undefined;
|
|
189
|
+
/**
|
|
190
|
+
* Advances the position by n characters.
|
|
191
|
+
*/
|
|
192
|
+
bump(n?: number): void;
|
|
193
|
+
/**
|
|
194
|
+
* Gets the next token from the input.
|
|
195
|
+
*/
|
|
196
|
+
next(): {
|
|
197
|
+
token: Token;
|
|
198
|
+
span: Span;
|
|
199
|
+
} | undefined;
|
|
200
|
+
/**
|
|
201
|
+
* Iterates over all tokens.
|
|
202
|
+
*/
|
|
203
|
+
[Symbol.iterator](): Iterator<{
|
|
204
|
+
token: Token;
|
|
205
|
+
span: Span;
|
|
206
|
+
} | {
|
|
207
|
+
error: EnvelopePatternError;
|
|
208
|
+
span: Span;
|
|
209
|
+
}>;
|
|
210
|
+
}
|
|
211
|
+
//#endregion
|
|
212
|
+
//#region src/error.d.ts
|
|
213
|
+
/**
|
|
214
|
+
* Span represents a range in the source input.
|
|
215
|
+
*/
|
|
216
|
+
interface Span {
|
|
217
|
+
readonly start: number;
|
|
218
|
+
readonly end: number;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Error types that can occur during parsing of Envelope patterns.
|
|
222
|
+
*
|
|
223
|
+
* Corresponds to the Rust `Error` enum in error.rs
|
|
224
|
+
*/
|
|
225
|
+
type EnvelopePatternError = {
|
|
226
|
+
readonly type: "EmptyInput";
|
|
227
|
+
} | {
|
|
228
|
+
readonly type: "UnexpectedEndOfInput";
|
|
229
|
+
} | {
|
|
230
|
+
readonly type: "ExtraData";
|
|
231
|
+
readonly span: Span;
|
|
232
|
+
} | {
|
|
233
|
+
readonly type: "UnexpectedToken";
|
|
234
|
+
readonly token: Token;
|
|
235
|
+
readonly span: Span;
|
|
236
|
+
} | {
|
|
237
|
+
readonly type: "UnrecognizedToken";
|
|
238
|
+
readonly span: Span;
|
|
239
|
+
} | {
|
|
240
|
+
readonly type: "InvalidRegex";
|
|
241
|
+
readonly span: Span;
|
|
242
|
+
} | {
|
|
243
|
+
readonly type: "UnterminatedRegex";
|
|
244
|
+
readonly span: Span;
|
|
245
|
+
} | {
|
|
246
|
+
readonly type: "InvalidRange";
|
|
247
|
+
readonly span: Span;
|
|
248
|
+
} | {
|
|
249
|
+
readonly type: "InvalidHexString";
|
|
250
|
+
readonly span: Span;
|
|
251
|
+
} | {
|
|
252
|
+
readonly type: "InvalidDateFormat";
|
|
253
|
+
readonly span: Span;
|
|
254
|
+
} | {
|
|
255
|
+
readonly type: "InvalidNumberFormat";
|
|
256
|
+
readonly span: Span;
|
|
257
|
+
} | {
|
|
258
|
+
readonly type: "InvalidUr";
|
|
259
|
+
readonly message: string;
|
|
260
|
+
readonly span: Span;
|
|
261
|
+
} | {
|
|
262
|
+
readonly type: "ExpectedOpenParen";
|
|
263
|
+
readonly span: Span;
|
|
264
|
+
} | {
|
|
265
|
+
readonly type: "ExpectedCloseParen";
|
|
266
|
+
readonly span: Span;
|
|
267
|
+
} | {
|
|
268
|
+
readonly type: "ExpectedOpenBracket";
|
|
269
|
+
readonly span: Span;
|
|
270
|
+
} | {
|
|
271
|
+
readonly type: "ExpectedCloseBracket";
|
|
272
|
+
readonly span: Span;
|
|
273
|
+
} | {
|
|
274
|
+
readonly type: "ExpectedPattern";
|
|
275
|
+
readonly span: Span;
|
|
276
|
+
} | {
|
|
277
|
+
readonly type: "UnmatchedParentheses";
|
|
278
|
+
readonly span: Span;
|
|
279
|
+
} | {
|
|
280
|
+
readonly type: "UnmatchedBraces";
|
|
281
|
+
readonly span: Span;
|
|
282
|
+
} | {
|
|
283
|
+
readonly type: "InvalidCaptureGroupName";
|
|
284
|
+
readonly name: string;
|
|
285
|
+
readonly span: Span;
|
|
286
|
+
} | {
|
|
287
|
+
readonly type: "InvalidPattern";
|
|
288
|
+
readonly span: Span;
|
|
289
|
+
} | {
|
|
290
|
+
readonly type: "Unknown";
|
|
291
|
+
} | {
|
|
292
|
+
readonly type: "DCBORPatternError";
|
|
293
|
+
readonly error: unknown;
|
|
294
|
+
};
|
|
295
|
+
/**
|
|
296
|
+
* Result type specialized for envelope pattern parsing.
|
|
297
|
+
*/
|
|
298
|
+
type Result<T> = {
|
|
299
|
+
readonly ok: true;
|
|
300
|
+
readonly value: T;
|
|
301
|
+
} | {
|
|
302
|
+
readonly ok: false;
|
|
303
|
+
readonly error: EnvelopePatternError;
|
|
304
|
+
};
|
|
305
|
+
/**
|
|
306
|
+
* Creates a successful result.
|
|
307
|
+
*/
|
|
308
|
+
declare function ok<T>(value: T): Result<T>;
|
|
309
|
+
/**
|
|
310
|
+
* Creates a failed result.
|
|
311
|
+
*/
|
|
312
|
+
declare function err<T>(error: EnvelopePatternError): Result<T>;
|
|
313
|
+
/**
|
|
314
|
+
* Type guard for successful results.
|
|
315
|
+
*/
|
|
316
|
+
declare function isOk<T>(result: Result<T>): result is {
|
|
317
|
+
readonly ok: true;
|
|
318
|
+
readonly value: T;
|
|
319
|
+
};
|
|
320
|
+
/**
|
|
321
|
+
* Type guard for failed results.
|
|
322
|
+
*/
|
|
323
|
+
declare function isErr<T>(result: Result<T>): result is {
|
|
324
|
+
readonly ok: false;
|
|
325
|
+
readonly error: EnvelopePatternError;
|
|
326
|
+
};
|
|
327
|
+
/**
|
|
328
|
+
* Unwraps a successful result or throws the error.
|
|
329
|
+
*/
|
|
330
|
+
declare function unwrap<T>(result: Result<T>): T;
|
|
331
|
+
/**
|
|
332
|
+
* Unwraps a successful result or returns a default value.
|
|
333
|
+
*/
|
|
334
|
+
declare function unwrapOr<T>(result: Result<T>, defaultValue: T): T;
|
|
335
|
+
/**
|
|
336
|
+
* Maps a successful result value.
|
|
337
|
+
*/
|
|
338
|
+
declare function map<T, U>(result: Result<T>, fn: (value: T) => U): Result<U>;
|
|
339
|
+
/**
|
|
340
|
+
* Formats an error for display.
|
|
341
|
+
*/
|
|
342
|
+
declare function formatError(error: EnvelopePatternError): string;
|
|
343
|
+
declare function emptyInput(): EnvelopePatternError;
|
|
344
|
+
declare function unexpectedEndOfInput(): EnvelopePatternError;
|
|
345
|
+
declare function extraData(span: Span): EnvelopePatternError;
|
|
346
|
+
declare function unexpectedToken(token: Token, span: Span): EnvelopePatternError;
|
|
347
|
+
declare function unrecognizedToken(span: Span): EnvelopePatternError;
|
|
348
|
+
declare function invalidRegex(span: Span): EnvelopePatternError;
|
|
349
|
+
declare function unterminatedRegex(span: Span): EnvelopePatternError;
|
|
350
|
+
declare function invalidRange(span: Span): EnvelopePatternError;
|
|
351
|
+
declare function invalidHexString(span: Span): EnvelopePatternError;
|
|
352
|
+
declare function invalidDateFormat(span: Span): EnvelopePatternError;
|
|
353
|
+
declare function invalidNumberFormat(span: Span): EnvelopePatternError;
|
|
354
|
+
declare function invalidUr(message: string, span: Span): EnvelopePatternError;
|
|
355
|
+
declare function expectedOpenParen(span: Span): EnvelopePatternError;
|
|
356
|
+
declare function expectedCloseParen(span: Span): EnvelopePatternError;
|
|
357
|
+
declare function expectedOpenBracket(span: Span): EnvelopePatternError;
|
|
358
|
+
declare function expectedCloseBracket(span: Span): EnvelopePatternError;
|
|
359
|
+
declare function expectedPattern(span: Span): EnvelopePatternError;
|
|
360
|
+
declare function unmatchedParentheses(span: Span): EnvelopePatternError;
|
|
361
|
+
declare function unmatchedBraces(span: Span): EnvelopePatternError;
|
|
362
|
+
declare function invalidCaptureGroupName(name: string, span: Span): EnvelopePatternError;
|
|
363
|
+
declare function invalidPattern(span: Span): EnvelopePatternError;
|
|
364
|
+
declare function unknown(): EnvelopePatternError;
|
|
365
|
+
declare function dcborPatternError(error: unknown): EnvelopePatternError;
|
|
366
|
+
//#endregion
|
|
367
|
+
//#region src/format.d.ts
|
|
368
|
+
/**
|
|
369
|
+
* A path is a sequence of envelopes from root to a matched element.
|
|
370
|
+
*/
|
|
371
|
+
type Path = Envelope[];
|
|
372
|
+
/**
|
|
373
|
+
* Format options for each path element.
|
|
374
|
+
*
|
|
375
|
+
* Corresponds to the Rust `PathElementFormat` enum in format.rs
|
|
376
|
+
*/
|
|
377
|
+
type PathElementFormat = {
|
|
378
|
+
readonly type: "Summary";
|
|
379
|
+
readonly maxLength?: number;
|
|
380
|
+
} | {
|
|
381
|
+
readonly type: "EnvelopeUR";
|
|
382
|
+
} | {
|
|
383
|
+
readonly type: "DigestUR";
|
|
384
|
+
};
|
|
385
|
+
/**
|
|
386
|
+
* Creates a Summary format.
|
|
387
|
+
*/
|
|
388
|
+
declare function summaryFormat(maxLength?: number): PathElementFormat;
|
|
389
|
+
/**
|
|
390
|
+
* Creates an EnvelopeUR format.
|
|
391
|
+
*/
|
|
392
|
+
declare function envelopeURFormat(): PathElementFormat;
|
|
393
|
+
/**
|
|
394
|
+
* Creates a DigestUR format.
|
|
395
|
+
*/
|
|
396
|
+
declare function digestURFormat(): PathElementFormat;
|
|
397
|
+
/**
|
|
398
|
+
* Default path element format.
|
|
399
|
+
*/
|
|
400
|
+
declare function defaultPathElementFormat(): PathElementFormat;
|
|
401
|
+
/**
|
|
402
|
+
* Options for formatting paths.
|
|
403
|
+
*
|
|
404
|
+
* Corresponds to the Rust `FormatPathsOpts` struct in format.rs
|
|
405
|
+
*/
|
|
406
|
+
interface FormatPathsOpts {
|
|
407
|
+
/**
|
|
408
|
+
* Whether to indent each path element.
|
|
409
|
+
* If true, each element will be indented by 4 spaces per level.
|
|
410
|
+
* Default: true
|
|
411
|
+
*/
|
|
412
|
+
readonly indent: boolean;
|
|
413
|
+
/**
|
|
414
|
+
* Format for each path element.
|
|
415
|
+
* Default: Summary(None)
|
|
416
|
+
*/
|
|
417
|
+
readonly elementFormat: PathElementFormat;
|
|
418
|
+
/**
|
|
419
|
+
* If true, only the last element of each path will be formatted.
|
|
420
|
+
* This is useful for displaying only the final destination of a path.
|
|
421
|
+
* If false, all elements will be formatted.
|
|
422
|
+
* Default: false
|
|
423
|
+
*/
|
|
424
|
+
readonly lastElementOnly: boolean;
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Creates default formatting options.
|
|
428
|
+
*/
|
|
429
|
+
declare function defaultFormatPathsOpts(): FormatPathsOpts;
|
|
430
|
+
/**
|
|
431
|
+
* Builder for FormatPathsOpts.
|
|
432
|
+
*/
|
|
433
|
+
declare class FormatPathsOptsBuilder {
|
|
434
|
+
#private;
|
|
435
|
+
/**
|
|
436
|
+
* Sets whether to indent each path element.
|
|
437
|
+
*/
|
|
438
|
+
indent(indent: boolean): this;
|
|
439
|
+
/**
|
|
440
|
+
* Sets the format for each path element.
|
|
441
|
+
*/
|
|
442
|
+
elementFormat(format: PathElementFormat): this;
|
|
443
|
+
/**
|
|
444
|
+
* Sets whether to format only the last element of each path.
|
|
445
|
+
*/
|
|
446
|
+
lastElementOnly(lastElementOnly: boolean): this;
|
|
447
|
+
/**
|
|
448
|
+
* Builds the FormatPathsOpts.
|
|
449
|
+
*/
|
|
450
|
+
build(): FormatPathsOpts;
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Creates a new FormatPathsOptsBuilder.
|
|
454
|
+
*/
|
|
455
|
+
declare function formatPathsOpts(): FormatPathsOptsBuilder;
|
|
456
|
+
/**
|
|
457
|
+
* Gets a summary of an envelope for display.
|
|
458
|
+
*
|
|
459
|
+
* @param env - The envelope to summarize
|
|
460
|
+
* @returns A string summary of the envelope
|
|
461
|
+
*/
|
|
462
|
+
declare function envelopeSummary(env: Envelope): string;
|
|
463
|
+
/**
|
|
464
|
+
* Format a single path element on its own line with custom options.
|
|
465
|
+
*
|
|
466
|
+
* @param path - The path to format
|
|
467
|
+
* @param opts - Formatting options
|
|
468
|
+
* @returns The formatted path string
|
|
469
|
+
*/
|
|
470
|
+
declare function formatPathOpt(path: Path, opts?: FormatPathsOpts): string;
|
|
471
|
+
/**
|
|
472
|
+
* Format a single path with default options.
|
|
473
|
+
*
|
|
474
|
+
* @param path - The path to format
|
|
475
|
+
* @returns The formatted path string
|
|
476
|
+
*/
|
|
477
|
+
declare function formatPath(path: Path): string;
|
|
478
|
+
/**
|
|
479
|
+
* Format multiple paths with captures and custom options.
|
|
480
|
+
*
|
|
481
|
+
* Captures come first, sorted lexicographically by name, with their name
|
|
482
|
+
* prefixed by '@'. Regular paths follow after all captures.
|
|
483
|
+
*
|
|
484
|
+
* @param paths - The paths to format
|
|
485
|
+
* @param captures - Map of capture name to captured paths
|
|
486
|
+
* @param opts - Formatting options
|
|
487
|
+
* @returns The formatted string
|
|
488
|
+
*/
|
|
489
|
+
declare function formatPathsWithCapturesOpt(paths: Path[], captures: Map<string, Path[]>, opts?: FormatPathsOpts): string;
|
|
490
|
+
/**
|
|
491
|
+
* Format multiple paths with captures using default options.
|
|
492
|
+
*
|
|
493
|
+
* @param paths - The paths to format
|
|
494
|
+
* @param captures - Map of capture name to captured paths
|
|
495
|
+
* @returns The formatted string
|
|
496
|
+
*/
|
|
497
|
+
declare function formatPathsWithCaptures(paths: Path[], captures: Map<string, Path[]>): string;
|
|
498
|
+
/**
|
|
499
|
+
* Format multiple paths with custom options.
|
|
500
|
+
*
|
|
501
|
+
* @param paths - The paths to format
|
|
502
|
+
* @param opts - Formatting options
|
|
503
|
+
* @returns The formatted string
|
|
504
|
+
*/
|
|
505
|
+
declare function formatPathsOpt(paths: Path[], opts?: FormatPathsOpts): string;
|
|
506
|
+
/**
|
|
507
|
+
* Format multiple paths with default options.
|
|
508
|
+
*
|
|
509
|
+
* @param paths - The paths to format
|
|
510
|
+
* @returns The formatted string
|
|
511
|
+
*/
|
|
512
|
+
declare function formatPaths(paths: Path[]): string;
|
|
513
|
+
//#endregion
|
|
514
|
+
//#region src/pattern/vm.d.ts
|
|
515
|
+
/**
|
|
516
|
+
* Register the pattern matching functions to resolve circular dependencies.
|
|
517
|
+
*/
|
|
518
|
+
declare function registerVMPatternFunctions(pathsWithCaptures: (pattern: Pattern, env: Envelope) => [Path[], Map<string, Path[]>], matches: (pattern: Pattern, env: Envelope) => boolean, paths: (pattern: Pattern, env: Envelope) => Path[]): void;
|
|
519
|
+
/**
|
|
520
|
+
* Axis for envelope traversal.
|
|
521
|
+
*
|
|
522
|
+
* Corresponds to the Rust `Axis` enum in vm.rs
|
|
523
|
+
*/
|
|
524
|
+
type Axis = "Subject" | "Assertion" | "Predicate" | "Object" | "Wrapped";
|
|
525
|
+
/**
|
|
526
|
+
* Edge type for envelope traversal.
|
|
527
|
+
*/
|
|
528
|
+
type EdgeType = "Subject" | "Assertion" | "Predicate" | "Object" | "Content";
|
|
529
|
+
/**
|
|
530
|
+
* Returns (child, EdgeType) pairs reachable from env via this axis.
|
|
531
|
+
*/
|
|
532
|
+
declare function axisChildren(axis: Axis, env: Envelope): [Envelope, EdgeType][];
|
|
533
|
+
/**
|
|
534
|
+
* VM instructions for pattern matching.
|
|
535
|
+
*
|
|
536
|
+
* Corresponds to the Rust `Instr` enum in vm.rs
|
|
537
|
+
*/
|
|
538
|
+
type Instr = {
|
|
539
|
+
readonly type: "MatchPredicate";
|
|
540
|
+
readonly literalIndex: number;
|
|
541
|
+
} | {
|
|
542
|
+
readonly type: "MatchStructure";
|
|
543
|
+
readonly literalIndex: number;
|
|
544
|
+
} | {
|
|
545
|
+
readonly type: "Split";
|
|
546
|
+
readonly a: number;
|
|
547
|
+
readonly b: number;
|
|
548
|
+
} | {
|
|
549
|
+
readonly type: "Jump";
|
|
550
|
+
readonly address: number;
|
|
551
|
+
} | {
|
|
552
|
+
readonly type: "PushAxis";
|
|
553
|
+
readonly axis: Axis;
|
|
554
|
+
} | {
|
|
555
|
+
readonly type: "Pop";
|
|
556
|
+
} | {
|
|
557
|
+
readonly type: "Save";
|
|
558
|
+
} | {
|
|
559
|
+
readonly type: "Accept";
|
|
560
|
+
} | {
|
|
561
|
+
readonly type: "Search";
|
|
562
|
+
readonly patternIndex: number;
|
|
563
|
+
readonly captureMap: [string, number][];
|
|
564
|
+
} | {
|
|
565
|
+
readonly type: "ExtendTraversal";
|
|
566
|
+
} | {
|
|
567
|
+
readonly type: "CombineTraversal";
|
|
568
|
+
} | {
|
|
569
|
+
readonly type: "NavigateSubject";
|
|
570
|
+
} | {
|
|
571
|
+
readonly type: "NotMatch";
|
|
572
|
+
readonly patternIndex: number;
|
|
573
|
+
} | {
|
|
574
|
+
readonly type: "Repeat";
|
|
575
|
+
readonly patternIndex: number;
|
|
576
|
+
readonly quantifier: Quantifier$1;
|
|
577
|
+
} | {
|
|
578
|
+
readonly type: "CaptureStart";
|
|
579
|
+
readonly captureIndex: number;
|
|
580
|
+
} | {
|
|
581
|
+
readonly type: "CaptureEnd";
|
|
582
|
+
readonly captureIndex: number;
|
|
583
|
+
};
|
|
584
|
+
/**
|
|
585
|
+
* Compiled program for the VM.
|
|
586
|
+
*/
|
|
587
|
+
interface Program {
|
|
588
|
+
readonly code: Instr[];
|
|
589
|
+
readonly literals: Pattern[];
|
|
590
|
+
readonly captureNames: string[];
|
|
591
|
+
}
|
|
592
|
+
/**
|
|
593
|
+
* Execute prog starting at root.
|
|
594
|
+
* Every time SAVE or ACCEPT executes, the current path is pushed into the result.
|
|
595
|
+
*/
|
|
596
|
+
declare function run(prog: Program, root: Envelope): [Path, Map<string, Path[]>][];
|
|
597
|
+
/**
|
|
598
|
+
* Compile a pattern to bytecode program.
|
|
599
|
+
*/
|
|
600
|
+
declare function compile(pattern: Pattern): Program;
|
|
601
|
+
//#endregion
|
|
602
|
+
//#region src/pattern/matcher.d.ts
|
|
603
|
+
/**
|
|
604
|
+
* Matcher interface for pattern matching against envelopes.
|
|
605
|
+
*
|
|
606
|
+
* Corresponds to the Rust `Matcher` trait in matcher.rs
|
|
607
|
+
*/
|
|
608
|
+
interface Matcher {
|
|
609
|
+
/**
|
|
610
|
+
* Return all matching paths along with any named captures.
|
|
611
|
+
*/
|
|
612
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
613
|
+
/**
|
|
614
|
+
* Return only the matching paths, discarding any captures.
|
|
615
|
+
*/
|
|
616
|
+
paths(haystack: Envelope): Path[];
|
|
617
|
+
/**
|
|
618
|
+
* Returns true if the pattern matches the haystack.
|
|
619
|
+
*/
|
|
620
|
+
matches(haystack: Envelope): boolean;
|
|
621
|
+
/**
|
|
622
|
+
* Compile this pattern to bytecode.
|
|
623
|
+
*/
|
|
624
|
+
compile(code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
625
|
+
/**
|
|
626
|
+
* Returns true if the Display of the matcher is complex,
|
|
627
|
+
* i.e. contains nested patterns or other complex structures
|
|
628
|
+
* that require its text rendering to be surrounded by grouping
|
|
629
|
+
* parentheses.
|
|
630
|
+
*/
|
|
631
|
+
isComplex(): boolean;
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* Default implementations for Matcher methods.
|
|
635
|
+
*/
|
|
636
|
+
declare const MatcherDefaults: {
|
|
637
|
+
/**
|
|
638
|
+
* Default implementation of paths() - calls pathsWithCaptures and discards captures.
|
|
639
|
+
*/
|
|
640
|
+
paths(matcher: Matcher, haystack: Envelope): Path[];
|
|
641
|
+
/**
|
|
642
|
+
* Default implementation of matches() - checks if paths() returns any results.
|
|
643
|
+
*/
|
|
644
|
+
matches(matcher: Matcher, haystack: Envelope): boolean;
|
|
645
|
+
/**
|
|
646
|
+
* Default implementation of isComplex() - returns false.
|
|
647
|
+
*/
|
|
648
|
+
isComplex(): boolean;
|
|
649
|
+
};
|
|
650
|
+
/**
|
|
651
|
+
* Helper to compile a pattern as an atomic predicate match.
|
|
652
|
+
* Pushes the pattern into literals and emits a single MatchPredicate instruction.
|
|
653
|
+
*/
|
|
654
|
+
declare function compileAsAtomic(pat: Pattern, code: Instr[], literals: Pattern[], _captures: string[]): void;
|
|
655
|
+
//#endregion
|
|
656
|
+
//#region src/pattern/leaf/bool-pattern.d.ts
|
|
657
|
+
declare function registerBoolPatternFactory(factory: (pattern: BoolPattern) => Pattern): void;
|
|
658
|
+
/**
|
|
659
|
+
* Pattern for matching boolean values.
|
|
660
|
+
*
|
|
661
|
+
* This is a wrapper around dcbor_pattern::BoolPattern that provides
|
|
662
|
+
* envelope-specific integration.
|
|
663
|
+
*
|
|
664
|
+
* Corresponds to the Rust `BoolPattern` struct in bool_pattern.rs
|
|
665
|
+
*/
|
|
666
|
+
declare class BoolPattern implements Matcher {
|
|
667
|
+
#private;
|
|
668
|
+
private constructor();
|
|
669
|
+
/**
|
|
670
|
+
* Creates a new BoolPattern that matches any boolean value.
|
|
671
|
+
*/
|
|
672
|
+
static any(): BoolPattern;
|
|
673
|
+
/**
|
|
674
|
+
* Creates a new BoolPattern that matches the specific boolean value.
|
|
675
|
+
*/
|
|
676
|
+
static value(value: boolean): BoolPattern;
|
|
677
|
+
/**
|
|
678
|
+
* Creates a new BoolPattern from a dcbor-pattern BoolPattern.
|
|
679
|
+
*/
|
|
680
|
+
static fromDcborPattern(dcborPattern: BoolPattern$1): BoolPattern;
|
|
681
|
+
/**
|
|
682
|
+
* Gets the underlying dcbor-pattern BoolPattern.
|
|
683
|
+
*/
|
|
684
|
+
get inner(): BoolPattern$1;
|
|
685
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
686
|
+
paths(haystack: Envelope): Path[];
|
|
687
|
+
matches(haystack: Envelope): boolean;
|
|
688
|
+
compile(code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
689
|
+
isComplex(): boolean;
|
|
690
|
+
toString(): string;
|
|
691
|
+
/**
|
|
692
|
+
* Equality comparison.
|
|
693
|
+
*/
|
|
694
|
+
equals(other: BoolPattern): boolean;
|
|
695
|
+
/**
|
|
696
|
+
* Hash code for use in Maps/Sets.
|
|
697
|
+
*/
|
|
698
|
+
hashCode(): number;
|
|
699
|
+
}
|
|
700
|
+
//#endregion
|
|
701
|
+
//#region src/pattern/leaf/null-pattern.d.ts
|
|
702
|
+
declare function registerNullPatternFactory(factory: (pattern: NullPattern) => Pattern): void;
|
|
703
|
+
/**
|
|
704
|
+
* Pattern for matching null values.
|
|
705
|
+
*
|
|
706
|
+
* This is a wrapper around dcbor_pattern::NullPattern that provides
|
|
707
|
+
* envelope-specific functionality.
|
|
708
|
+
*
|
|
709
|
+
* Corresponds to the Rust `NullPattern` struct in null_pattern.rs
|
|
710
|
+
*/
|
|
711
|
+
declare class NullPattern implements Matcher {
|
|
712
|
+
#private;
|
|
713
|
+
private constructor();
|
|
714
|
+
/**
|
|
715
|
+
* Creates a new NullPattern (returns singleton).
|
|
716
|
+
*/
|
|
717
|
+
static new(): NullPattern;
|
|
718
|
+
/**
|
|
719
|
+
* Gets the underlying dcbor-pattern NullPattern.
|
|
720
|
+
*/
|
|
721
|
+
get inner(): NullPattern$1;
|
|
722
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
723
|
+
paths(haystack: Envelope): Path[];
|
|
724
|
+
matches(haystack: Envelope): boolean;
|
|
725
|
+
compile(code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
726
|
+
isComplex(): boolean;
|
|
727
|
+
toString(): string;
|
|
728
|
+
/**
|
|
729
|
+
* Equality comparison.
|
|
730
|
+
*/
|
|
731
|
+
equals(other: NullPattern): boolean;
|
|
732
|
+
/**
|
|
733
|
+
* Hash code for use in Maps/Sets.
|
|
734
|
+
*/
|
|
735
|
+
hashCode(): number;
|
|
736
|
+
}
|
|
737
|
+
//#endregion
|
|
738
|
+
//#region src/pattern/leaf/number-pattern.d.ts
|
|
739
|
+
declare function registerNumberPatternFactory(factory: (pattern: NumberPattern) => Pattern): void;
|
|
740
|
+
/**
|
|
741
|
+
* Pattern for matching number values.
|
|
742
|
+
*
|
|
743
|
+
* This is a wrapper around dcbor_pattern::NumberPattern that provides
|
|
744
|
+
* envelope-specific integration.
|
|
745
|
+
*
|
|
746
|
+
* Corresponds to the Rust `NumberPattern` struct in number_pattern.rs
|
|
747
|
+
*/
|
|
748
|
+
declare class NumberPattern implements Matcher {
|
|
749
|
+
#private;
|
|
750
|
+
private constructor();
|
|
751
|
+
/**
|
|
752
|
+
* Creates a new NumberPattern that matches any number.
|
|
753
|
+
*/
|
|
754
|
+
static any(): NumberPattern;
|
|
755
|
+
/**
|
|
756
|
+
* Creates a new NumberPattern that matches the exact number.
|
|
757
|
+
*/
|
|
758
|
+
static exact(value: number): NumberPattern;
|
|
759
|
+
/**
|
|
760
|
+
* Creates a new NumberPattern that matches numbers within the specified range.
|
|
761
|
+
*/
|
|
762
|
+
static range(min: number, max: number): NumberPattern;
|
|
763
|
+
/**
|
|
764
|
+
* Creates a new NumberPattern that matches numbers greater than the specified value.
|
|
765
|
+
*/
|
|
766
|
+
static greaterThan(value: number): NumberPattern;
|
|
767
|
+
/**
|
|
768
|
+
* Creates a new NumberPattern that matches numbers greater than or equal to the specified value.
|
|
769
|
+
*/
|
|
770
|
+
static greaterThanOrEqual(value: number): NumberPattern;
|
|
771
|
+
/**
|
|
772
|
+
* Creates a new NumberPattern that matches numbers less than the specified value.
|
|
773
|
+
*/
|
|
774
|
+
static lessThan(value: number): NumberPattern;
|
|
775
|
+
/**
|
|
776
|
+
* Creates a new NumberPattern that matches numbers less than or equal to the specified value.
|
|
777
|
+
*/
|
|
778
|
+
static lessThanOrEqual(value: number): NumberPattern;
|
|
779
|
+
/**
|
|
780
|
+
* Creates a new NumberPattern that matches NaN values.
|
|
781
|
+
*/
|
|
782
|
+
static nan(): NumberPattern;
|
|
783
|
+
/**
|
|
784
|
+
* Creates a new NumberPattern that matches positive infinity.
|
|
785
|
+
*/
|
|
786
|
+
static infinity(): NumberPattern;
|
|
787
|
+
/**
|
|
788
|
+
* Creates a new NumberPattern that matches negative infinity.
|
|
789
|
+
*/
|
|
790
|
+
static negInfinity(): NumberPattern;
|
|
791
|
+
/**
|
|
792
|
+
* Creates a new NumberPattern from a dcbor-pattern NumberPattern.
|
|
793
|
+
*/
|
|
794
|
+
static fromDcborPattern(dcborPattern: NumberPattern$1): NumberPattern;
|
|
795
|
+
/**
|
|
796
|
+
* Gets the underlying dcbor-pattern NumberPattern.
|
|
797
|
+
*/
|
|
798
|
+
get inner(): NumberPattern$1;
|
|
799
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
800
|
+
paths(haystack: Envelope): Path[];
|
|
801
|
+
matches(haystack: Envelope): boolean;
|
|
802
|
+
compile(code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
803
|
+
isComplex(): boolean;
|
|
804
|
+
toString(): string;
|
|
805
|
+
/**
|
|
806
|
+
* Equality comparison.
|
|
807
|
+
*/
|
|
808
|
+
equals(other: NumberPattern): boolean;
|
|
809
|
+
/**
|
|
810
|
+
* Hash code for use in Maps/Sets.
|
|
811
|
+
*/
|
|
812
|
+
hashCode(): number;
|
|
813
|
+
}
|
|
814
|
+
//#endregion
|
|
815
|
+
//#region src/pattern/leaf/text-pattern.d.ts
|
|
816
|
+
declare function registerTextPatternFactory(factory: (pattern: TextPattern) => Pattern): void;
|
|
817
|
+
/**
|
|
818
|
+
* Pattern for matching text values.
|
|
819
|
+
*
|
|
820
|
+
* This is a wrapper around dcbor_pattern::TextPattern that provides
|
|
821
|
+
* envelope-specific integration.
|
|
822
|
+
*
|
|
823
|
+
* Corresponds to the Rust `TextPattern` struct in text_pattern.rs
|
|
824
|
+
*/
|
|
825
|
+
declare class TextPattern implements Matcher {
|
|
826
|
+
#private;
|
|
827
|
+
private constructor();
|
|
828
|
+
/**
|
|
829
|
+
* Creates a new TextPattern that matches any text.
|
|
830
|
+
*/
|
|
831
|
+
static any(): TextPattern;
|
|
832
|
+
/**
|
|
833
|
+
* Creates a new TextPattern that matches the specific text.
|
|
834
|
+
*/
|
|
835
|
+
static value(value: string): TextPattern;
|
|
836
|
+
/**
|
|
837
|
+
* Creates a new TextPattern that matches text matching the regex.
|
|
838
|
+
*/
|
|
839
|
+
static regex(pattern: RegExp): TextPattern;
|
|
840
|
+
/**
|
|
841
|
+
* Creates a new TextPattern from a dcbor-pattern TextPattern.
|
|
842
|
+
*/
|
|
843
|
+
static fromDcborPattern(dcborPattern: TextPattern$1): TextPattern;
|
|
844
|
+
/**
|
|
845
|
+
* Gets the underlying dcbor-pattern TextPattern.
|
|
846
|
+
*/
|
|
847
|
+
get inner(): TextPattern$1;
|
|
848
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
849
|
+
paths(haystack: Envelope): Path[];
|
|
850
|
+
matches(haystack: Envelope): boolean;
|
|
851
|
+
compile(code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
852
|
+
isComplex(): boolean;
|
|
853
|
+
toString(): string;
|
|
854
|
+
/**
|
|
855
|
+
* Equality comparison.
|
|
856
|
+
*/
|
|
857
|
+
equals(other: TextPattern): boolean;
|
|
858
|
+
/**
|
|
859
|
+
* Hash code for use in Maps/Sets.
|
|
860
|
+
*/
|
|
861
|
+
hashCode(): number;
|
|
862
|
+
}
|
|
863
|
+
//#endregion
|
|
864
|
+
//#region src/pattern/leaf/byte-string-pattern.d.ts
|
|
865
|
+
declare function registerByteStringPatternFactory(factory: (pattern: ByteStringPattern) => Pattern): void;
|
|
866
|
+
/**
|
|
867
|
+
* Pattern for matching byte string values.
|
|
868
|
+
*
|
|
869
|
+
* This is a wrapper around dcbor_pattern::ByteStringPattern that provides
|
|
870
|
+
* envelope-specific integration.
|
|
871
|
+
*
|
|
872
|
+
* Corresponds to the Rust `ByteStringPattern` struct in byte_string_pattern.rs
|
|
873
|
+
*/
|
|
874
|
+
declare class ByteStringPattern implements Matcher {
|
|
875
|
+
#private;
|
|
876
|
+
private constructor();
|
|
877
|
+
/**
|
|
878
|
+
* Creates a new ByteStringPattern that matches any byte string.
|
|
879
|
+
*/
|
|
880
|
+
static any(): ByteStringPattern;
|
|
881
|
+
/**
|
|
882
|
+
* Creates a new ByteStringPattern that matches the specific byte string.
|
|
883
|
+
*/
|
|
884
|
+
static value(value: Uint8Array): ByteStringPattern;
|
|
885
|
+
/**
|
|
886
|
+
* Creates a new ByteStringPattern that matches byte strings matching the binary regex.
|
|
887
|
+
*/
|
|
888
|
+
static regex(pattern: RegExp): ByteStringPattern;
|
|
889
|
+
/**
|
|
890
|
+
* Creates a new ByteStringPattern from a dcbor-pattern ByteStringPattern.
|
|
891
|
+
*/
|
|
892
|
+
static fromDcborPattern(dcborPattern: ByteStringPattern$1): ByteStringPattern;
|
|
893
|
+
/**
|
|
894
|
+
* Gets the underlying dcbor-pattern ByteStringPattern.
|
|
895
|
+
*/
|
|
896
|
+
get inner(): ByteStringPattern$1;
|
|
897
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
898
|
+
paths(haystack: Envelope): Path[];
|
|
899
|
+
matches(haystack: Envelope): boolean;
|
|
900
|
+
compile(code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
901
|
+
isComplex(): boolean;
|
|
902
|
+
toString(): string;
|
|
903
|
+
/**
|
|
904
|
+
* Equality comparison.
|
|
905
|
+
*/
|
|
906
|
+
equals(other: ByteStringPattern): boolean;
|
|
907
|
+
/**
|
|
908
|
+
* Hash code for use in Maps/Sets.
|
|
909
|
+
*/
|
|
910
|
+
hashCode(): number;
|
|
911
|
+
}
|
|
912
|
+
//#endregion
|
|
913
|
+
//#region src/pattern/leaf/date-pattern.d.ts
|
|
914
|
+
declare function registerDatePatternFactory(factory: (pattern: DatePattern) => Pattern): void;
|
|
915
|
+
/**
|
|
916
|
+
* Pattern for matching date values.
|
|
917
|
+
*
|
|
918
|
+
* This is a wrapper around dcbor_pattern::DatePattern that provides
|
|
919
|
+
* envelope-specific integration.
|
|
920
|
+
*
|
|
921
|
+
* Corresponds to the Rust `DatePattern` struct in date_pattern.rs
|
|
922
|
+
*/
|
|
923
|
+
declare class DatePattern implements Matcher {
|
|
924
|
+
#private;
|
|
925
|
+
private constructor();
|
|
926
|
+
/**
|
|
927
|
+
* Creates a new DatePattern that matches any date.
|
|
928
|
+
*/
|
|
929
|
+
static any(): DatePattern;
|
|
930
|
+
/**
|
|
931
|
+
* Creates a new DatePattern that matches the specific date.
|
|
932
|
+
*/
|
|
933
|
+
static value(date: CborDate): DatePattern;
|
|
934
|
+
/**
|
|
935
|
+
* Creates a new DatePattern that matches dates within a range (inclusive).
|
|
936
|
+
*/
|
|
937
|
+
static range(start: CborDate, end: CborDate): DatePattern;
|
|
938
|
+
/**
|
|
939
|
+
* Creates a new DatePattern that matches dates on or after the specified date.
|
|
940
|
+
*/
|
|
941
|
+
static earliest(date: CborDate): DatePattern;
|
|
942
|
+
/**
|
|
943
|
+
* Creates a new DatePattern that matches dates on or before the specified date.
|
|
944
|
+
*/
|
|
945
|
+
static latest(date: CborDate): DatePattern;
|
|
946
|
+
/**
|
|
947
|
+
* Creates a new DatePattern that matches dates by their ISO-8601 string representation.
|
|
948
|
+
*/
|
|
949
|
+
static string(isoString: string): DatePattern;
|
|
950
|
+
/**
|
|
951
|
+
* Creates a new DatePattern that matches dates whose ISO-8601 string representation
|
|
952
|
+
* matches the given regular expression.
|
|
953
|
+
*/
|
|
954
|
+
static regex(pattern: RegExp): DatePattern;
|
|
955
|
+
/**
|
|
956
|
+
* Creates a new DatePattern from a dcbor-pattern DatePattern.
|
|
957
|
+
*/
|
|
958
|
+
static fromDcborPattern(dcborPattern: DatePattern$1): DatePattern;
|
|
959
|
+
/**
|
|
960
|
+
* Gets the underlying dcbor-pattern DatePattern.
|
|
961
|
+
*/
|
|
962
|
+
get inner(): DatePattern$1;
|
|
963
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
964
|
+
paths(haystack: Envelope): Path[];
|
|
965
|
+
matches(haystack: Envelope): boolean;
|
|
966
|
+
compile(code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
967
|
+
isComplex(): boolean;
|
|
968
|
+
toString(): string;
|
|
969
|
+
/**
|
|
970
|
+
* Equality comparison.
|
|
971
|
+
*/
|
|
972
|
+
equals(other: DatePattern): boolean;
|
|
973
|
+
/**
|
|
974
|
+
* Hash code for use in Maps/Sets.
|
|
975
|
+
*/
|
|
976
|
+
hashCode(): number;
|
|
977
|
+
}
|
|
978
|
+
//#endregion
|
|
979
|
+
//#region src/pattern/leaf/array-pattern.d.ts
|
|
980
|
+
declare function registerArrayPatternFactory(factory: (pattern: ArrayPattern) => Pattern): void;
|
|
981
|
+
/**
|
|
982
|
+
* Pattern for matching array values.
|
|
983
|
+
*
|
|
984
|
+
* Corresponds to the Rust `ArrayPattern` enum in array_pattern.rs
|
|
985
|
+
*/
|
|
986
|
+
type ArrayPatternType = {
|
|
987
|
+
readonly type: "Any";
|
|
988
|
+
} | {
|
|
989
|
+
readonly type: "Interval";
|
|
990
|
+
readonly interval: Interval$1;
|
|
991
|
+
} | {
|
|
992
|
+
readonly type: "DCBORPattern";
|
|
993
|
+
readonly pattern: Pattern$1;
|
|
994
|
+
} | {
|
|
995
|
+
readonly type: "WithPatterns";
|
|
996
|
+
readonly patterns: Pattern[];
|
|
997
|
+
};
|
|
998
|
+
/**
|
|
999
|
+
* Pattern for matching array values in envelope leaf nodes.
|
|
1000
|
+
*
|
|
1001
|
+
* Corresponds to the Rust `ArrayPattern` struct in array_pattern.rs
|
|
1002
|
+
*/
|
|
1003
|
+
declare class ArrayPattern implements Matcher {
|
|
1004
|
+
#private;
|
|
1005
|
+
private constructor();
|
|
1006
|
+
/**
|
|
1007
|
+
* Creates a new ArrayPattern that matches any array.
|
|
1008
|
+
*/
|
|
1009
|
+
static any(): ArrayPattern;
|
|
1010
|
+
/**
|
|
1011
|
+
* Creates a new ArrayPattern that matches arrays with a specific length.
|
|
1012
|
+
*/
|
|
1013
|
+
static count(count: number): ArrayPattern;
|
|
1014
|
+
/**
|
|
1015
|
+
* Creates a new ArrayPattern that matches arrays within a length range.
|
|
1016
|
+
*/
|
|
1017
|
+
static interval(min: number, max?: number): ArrayPattern;
|
|
1018
|
+
/**
|
|
1019
|
+
* Creates a new ArrayPattern from a dcbor-pattern.
|
|
1020
|
+
*/
|
|
1021
|
+
static fromDcborPattern(dcborPattern: Pattern$1): ArrayPattern;
|
|
1022
|
+
/**
|
|
1023
|
+
* Creates a new ArrayPattern with envelope patterns for element matching.
|
|
1024
|
+
*/
|
|
1025
|
+
static withPatterns(patterns: Pattern[]): ArrayPattern;
|
|
1026
|
+
/**
|
|
1027
|
+
* Gets the pattern type.
|
|
1028
|
+
*/
|
|
1029
|
+
get pattern(): ArrayPatternType;
|
|
1030
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
1031
|
+
paths(haystack: Envelope): Path[];
|
|
1032
|
+
matches(haystack: Envelope): boolean;
|
|
1033
|
+
compile(code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
1034
|
+
isComplex(): boolean;
|
|
1035
|
+
toString(): string;
|
|
1036
|
+
/**
|
|
1037
|
+
* Equality comparison.
|
|
1038
|
+
*/
|
|
1039
|
+
equals(other: ArrayPattern): boolean;
|
|
1040
|
+
/**
|
|
1041
|
+
* Hash code for use in Maps/Sets.
|
|
1042
|
+
*/
|
|
1043
|
+
hashCode(): number;
|
|
1044
|
+
}
|
|
1045
|
+
//#endregion
|
|
1046
|
+
//#region src/pattern/leaf/map-pattern.d.ts
|
|
1047
|
+
declare function registerMapPatternFactory(factory: (pattern: MapPattern) => Pattern): void;
|
|
1048
|
+
/**
|
|
1049
|
+
* Pattern for matching map values.
|
|
1050
|
+
*
|
|
1051
|
+
* Corresponds to the Rust `MapPattern` enum in map_pattern.rs
|
|
1052
|
+
*/
|
|
1053
|
+
type MapPatternType = {
|
|
1054
|
+
readonly type: "Any";
|
|
1055
|
+
} | {
|
|
1056
|
+
readonly type: "Interval";
|
|
1057
|
+
readonly interval: Interval$1;
|
|
1058
|
+
};
|
|
1059
|
+
/**
|
|
1060
|
+
* Pattern for matching map values in envelope leaf nodes.
|
|
1061
|
+
*
|
|
1062
|
+
* Corresponds to the Rust `MapPattern` struct in map_pattern.rs
|
|
1063
|
+
*/
|
|
1064
|
+
declare class MapPattern implements Matcher {
|
|
1065
|
+
#private;
|
|
1066
|
+
private constructor();
|
|
1067
|
+
/**
|
|
1068
|
+
* Creates a new MapPattern that matches any map.
|
|
1069
|
+
*/
|
|
1070
|
+
static any(): MapPattern;
|
|
1071
|
+
/**
|
|
1072
|
+
* Creates a new MapPattern that matches maps within a size range.
|
|
1073
|
+
*/
|
|
1074
|
+
static interval(min: number, max?: number): MapPattern;
|
|
1075
|
+
/**
|
|
1076
|
+
* Gets the pattern type.
|
|
1077
|
+
*/
|
|
1078
|
+
get pattern(): MapPatternType;
|
|
1079
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
1080
|
+
paths(haystack: Envelope): Path[];
|
|
1081
|
+
matches(haystack: Envelope): boolean;
|
|
1082
|
+
compile(code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
1083
|
+
isComplex(): boolean;
|
|
1084
|
+
toString(): string;
|
|
1085
|
+
/**
|
|
1086
|
+
* Equality comparison.
|
|
1087
|
+
*/
|
|
1088
|
+
equals(other: MapPattern): boolean;
|
|
1089
|
+
/**
|
|
1090
|
+
* Hash code for use in Maps/Sets.
|
|
1091
|
+
*/
|
|
1092
|
+
hashCode(): number;
|
|
1093
|
+
}
|
|
1094
|
+
//#endregion
|
|
1095
|
+
//#region src/pattern/leaf/known-value-pattern.d.ts
|
|
1096
|
+
declare function registerKnownValuePatternFactory(factory: (pattern: KnownValuePattern) => Pattern): void;
|
|
1097
|
+
/**
|
|
1098
|
+
* Pattern for matching known values.
|
|
1099
|
+
*
|
|
1100
|
+
* This is a wrapper around dcbor_pattern::KnownValuePattern that provides
|
|
1101
|
+
* envelope-specific integration.
|
|
1102
|
+
*
|
|
1103
|
+
* Corresponds to the Rust `KnownValuePattern` struct in known_value_pattern.rs
|
|
1104
|
+
*/
|
|
1105
|
+
declare class KnownValuePattern implements Matcher {
|
|
1106
|
+
#private;
|
|
1107
|
+
private constructor();
|
|
1108
|
+
/**
|
|
1109
|
+
* Creates a new KnownValuePattern that matches any known value.
|
|
1110
|
+
*/
|
|
1111
|
+
static any(): KnownValuePattern;
|
|
1112
|
+
/**
|
|
1113
|
+
* Creates a new KnownValuePattern that matches the specific known value.
|
|
1114
|
+
*/
|
|
1115
|
+
static value(value: KnownValue): KnownValuePattern;
|
|
1116
|
+
/**
|
|
1117
|
+
* Creates a new KnownValuePattern that matches known values by name.
|
|
1118
|
+
*/
|
|
1119
|
+
static named(name: string): KnownValuePattern;
|
|
1120
|
+
/**
|
|
1121
|
+
* Creates a new KnownValuePattern that matches known values by regex on their name.
|
|
1122
|
+
*/
|
|
1123
|
+
static regex(regex: RegExp): KnownValuePattern;
|
|
1124
|
+
/**
|
|
1125
|
+
* Creates a new KnownValuePattern from a dcbor-pattern KnownValuePattern.
|
|
1126
|
+
*/
|
|
1127
|
+
static fromDcborPattern(dcborPattern: KnownValuePattern$1): KnownValuePattern;
|
|
1128
|
+
/**
|
|
1129
|
+
* Gets the underlying dcbor-pattern KnownValuePattern.
|
|
1130
|
+
*/
|
|
1131
|
+
get inner(): KnownValuePattern$1;
|
|
1132
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
1133
|
+
paths(haystack: Envelope): Path[];
|
|
1134
|
+
matches(haystack: Envelope): boolean;
|
|
1135
|
+
compile(code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
1136
|
+
isComplex(): boolean;
|
|
1137
|
+
toString(): string;
|
|
1138
|
+
/**
|
|
1139
|
+
* Equality comparison.
|
|
1140
|
+
*/
|
|
1141
|
+
equals(other: KnownValuePattern): boolean;
|
|
1142
|
+
/**
|
|
1143
|
+
* Hash code for use in Maps/Sets.
|
|
1144
|
+
*/
|
|
1145
|
+
hashCode(): number;
|
|
1146
|
+
}
|
|
1147
|
+
//#endregion
|
|
1148
|
+
//#region src/pattern/leaf/tagged-pattern.d.ts
|
|
1149
|
+
declare function registerTaggedPatternFactory(factory: (pattern: TaggedPattern) => Pattern): void;
|
|
1150
|
+
/**
|
|
1151
|
+
* Pattern for matching tagged CBOR values.
|
|
1152
|
+
*
|
|
1153
|
+
* This is a wrapper around dcbor_pattern::TaggedPattern that provides
|
|
1154
|
+
* envelope-specific integration.
|
|
1155
|
+
*
|
|
1156
|
+
* Corresponds to the Rust `TaggedPattern` struct in tagged_pattern.rs
|
|
1157
|
+
*/
|
|
1158
|
+
declare class TaggedPattern implements Matcher {
|
|
1159
|
+
#private;
|
|
1160
|
+
private constructor();
|
|
1161
|
+
/**
|
|
1162
|
+
* Creates a new TaggedPattern that matches any tagged value.
|
|
1163
|
+
*/
|
|
1164
|
+
static any(): TaggedPattern;
|
|
1165
|
+
/**
|
|
1166
|
+
* Creates a new TaggedPattern with a specific tag and content pattern.
|
|
1167
|
+
*/
|
|
1168
|
+
static withTag(tag: Tag, pattern: Pattern$1): TaggedPattern;
|
|
1169
|
+
/**
|
|
1170
|
+
* Creates a new TaggedPattern with a specific tag name and content pattern.
|
|
1171
|
+
*/
|
|
1172
|
+
static withName(name: string, pattern: Pattern$1): TaggedPattern;
|
|
1173
|
+
/**
|
|
1174
|
+
* Creates a new TaggedPattern with a tag name matching regex and content pattern.
|
|
1175
|
+
*/
|
|
1176
|
+
static withRegex(regex: RegExp, pattern: Pattern$1): TaggedPattern;
|
|
1177
|
+
/**
|
|
1178
|
+
* Creates a new TaggedPattern from a dcbor-pattern TaggedPattern.
|
|
1179
|
+
*/
|
|
1180
|
+
static fromDcborPattern(dcborPattern: TaggedPattern$1): TaggedPattern;
|
|
1181
|
+
/**
|
|
1182
|
+
* Gets the underlying dcbor-pattern TaggedPattern.
|
|
1183
|
+
*/
|
|
1184
|
+
get inner(): TaggedPattern$1;
|
|
1185
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
1186
|
+
paths(haystack: Envelope): Path[];
|
|
1187
|
+
matches(haystack: Envelope): boolean;
|
|
1188
|
+
compile(code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
1189
|
+
isComplex(): boolean;
|
|
1190
|
+
toString(): string;
|
|
1191
|
+
/**
|
|
1192
|
+
* Equality comparison.
|
|
1193
|
+
*/
|
|
1194
|
+
equals(other: TaggedPattern): boolean;
|
|
1195
|
+
/**
|
|
1196
|
+
* Hash code for use in Maps/Sets.
|
|
1197
|
+
*/
|
|
1198
|
+
hashCode(): number;
|
|
1199
|
+
}
|
|
1200
|
+
//#endregion
|
|
1201
|
+
//#region src/pattern/leaf/cbor-pattern.d.ts
|
|
1202
|
+
declare function registerCBORPatternFactory(factory: (pattern: CBORPattern) => Pattern): void;
|
|
1203
|
+
/**
|
|
1204
|
+
* Pattern type for CBOR pattern matching.
|
|
1205
|
+
*
|
|
1206
|
+
* Corresponds to the Rust `CBORPattern` enum in cbor_pattern.rs
|
|
1207
|
+
*/
|
|
1208
|
+
type CBORPatternType = {
|
|
1209
|
+
readonly type: "Any";
|
|
1210
|
+
} | {
|
|
1211
|
+
readonly type: "Value";
|
|
1212
|
+
readonly cbor: Cbor;
|
|
1213
|
+
} | {
|
|
1214
|
+
readonly type: "Pattern";
|
|
1215
|
+
readonly pattern: Pattern$1;
|
|
1216
|
+
};
|
|
1217
|
+
/**
|
|
1218
|
+
* Pattern for matching CBOR values with support for exact values and advanced pattern matching.
|
|
1219
|
+
*
|
|
1220
|
+
* Corresponds to the Rust `CBORPattern` enum in cbor_pattern.rs
|
|
1221
|
+
*/
|
|
1222
|
+
declare class CBORPattern implements Matcher {
|
|
1223
|
+
#private;
|
|
1224
|
+
private constructor();
|
|
1225
|
+
/**
|
|
1226
|
+
* Creates a new CBORPattern that matches any CBOR value.
|
|
1227
|
+
*/
|
|
1228
|
+
static any(): CBORPattern;
|
|
1229
|
+
/**
|
|
1230
|
+
* Creates a new CBORPattern that matches a specific CBOR value.
|
|
1231
|
+
*/
|
|
1232
|
+
static value(value: CborInput): CBORPattern;
|
|
1233
|
+
/**
|
|
1234
|
+
* Creates a new CBORPattern that matches CBOR values using dcbor-pattern expressions.
|
|
1235
|
+
*/
|
|
1236
|
+
static pattern(dcborPattern: Pattern$1): CBORPattern;
|
|
1237
|
+
/**
|
|
1238
|
+
* Creates a new CBORPattern from a dcbor-pattern Pattern.
|
|
1239
|
+
*/
|
|
1240
|
+
static fromDcborPattern(dcborPattern: Pattern$1): CBORPattern;
|
|
1241
|
+
/**
|
|
1242
|
+
* Gets the pattern type.
|
|
1243
|
+
*/
|
|
1244
|
+
get pattern(): CBORPatternType;
|
|
1245
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
1246
|
+
paths(haystack: Envelope): Path[];
|
|
1247
|
+
matches(haystack: Envelope): boolean;
|
|
1248
|
+
compile(code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
1249
|
+
isComplex(): boolean;
|
|
1250
|
+
toString(): string;
|
|
1251
|
+
/**
|
|
1252
|
+
* Equality comparison.
|
|
1253
|
+
*/
|
|
1254
|
+
equals(other: CBORPattern): boolean;
|
|
1255
|
+
/**
|
|
1256
|
+
* Hash code for use in Maps/Sets.
|
|
1257
|
+
*/
|
|
1258
|
+
hashCode(): number;
|
|
1259
|
+
}
|
|
1260
|
+
//#endregion
|
|
1261
|
+
//#region src/pattern/leaf/index.d.ts
|
|
1262
|
+
/**
|
|
1263
|
+
* Union type for all leaf patterns.
|
|
1264
|
+
*
|
|
1265
|
+
* Corresponds to the Rust `LeafPattern` enum in pattern/leaf/mod.rs
|
|
1266
|
+
*/
|
|
1267
|
+
type LeafPattern = {
|
|
1268
|
+
readonly type: "Cbor";
|
|
1269
|
+
readonly pattern: CBORPattern;
|
|
1270
|
+
} | {
|
|
1271
|
+
readonly type: "Number";
|
|
1272
|
+
readonly pattern: NumberPattern;
|
|
1273
|
+
} | {
|
|
1274
|
+
readonly type: "Text";
|
|
1275
|
+
readonly pattern: TextPattern;
|
|
1276
|
+
} | {
|
|
1277
|
+
readonly type: "ByteString";
|
|
1278
|
+
readonly pattern: ByteStringPattern;
|
|
1279
|
+
} | {
|
|
1280
|
+
readonly type: "Tag";
|
|
1281
|
+
readonly pattern: TaggedPattern;
|
|
1282
|
+
} | {
|
|
1283
|
+
readonly type: "Array";
|
|
1284
|
+
readonly pattern: ArrayPattern;
|
|
1285
|
+
} | {
|
|
1286
|
+
readonly type: "Map";
|
|
1287
|
+
readonly pattern: MapPattern;
|
|
1288
|
+
} | {
|
|
1289
|
+
readonly type: "Bool";
|
|
1290
|
+
readonly pattern: BoolPattern;
|
|
1291
|
+
} | {
|
|
1292
|
+
readonly type: "Null";
|
|
1293
|
+
readonly pattern: NullPattern;
|
|
1294
|
+
} | {
|
|
1295
|
+
readonly type: "Date";
|
|
1296
|
+
readonly pattern: DatePattern;
|
|
1297
|
+
} | {
|
|
1298
|
+
readonly type: "KnownValue";
|
|
1299
|
+
readonly pattern: KnownValuePattern;
|
|
1300
|
+
};
|
|
1301
|
+
/**
|
|
1302
|
+
* Creates a CBOR leaf pattern.
|
|
1303
|
+
*/
|
|
1304
|
+
declare function leafCbor(pattern: CBORPattern): LeafPattern;
|
|
1305
|
+
/**
|
|
1306
|
+
* Creates a Number leaf pattern.
|
|
1307
|
+
*/
|
|
1308
|
+
declare function leafNumber(pattern: NumberPattern): LeafPattern;
|
|
1309
|
+
/**
|
|
1310
|
+
* Creates a Text leaf pattern.
|
|
1311
|
+
*/
|
|
1312
|
+
declare function leafText(pattern: TextPattern): LeafPattern;
|
|
1313
|
+
/**
|
|
1314
|
+
* Creates a ByteString leaf pattern.
|
|
1315
|
+
*/
|
|
1316
|
+
declare function leafByteString(pattern: ByteStringPattern): LeafPattern;
|
|
1317
|
+
/**
|
|
1318
|
+
* Creates a Tag leaf pattern.
|
|
1319
|
+
*/
|
|
1320
|
+
declare function leafTag(pattern: TaggedPattern): LeafPattern;
|
|
1321
|
+
/**
|
|
1322
|
+
* Creates an Array leaf pattern.
|
|
1323
|
+
*/
|
|
1324
|
+
declare function leafArray(pattern: ArrayPattern): LeafPattern;
|
|
1325
|
+
/**
|
|
1326
|
+
* Creates a Map leaf pattern.
|
|
1327
|
+
*/
|
|
1328
|
+
declare function leafMap(pattern: MapPattern): LeafPattern;
|
|
1329
|
+
/**
|
|
1330
|
+
* Creates a Bool leaf pattern.
|
|
1331
|
+
*/
|
|
1332
|
+
declare function leafBool(pattern: BoolPattern): LeafPattern;
|
|
1333
|
+
/**
|
|
1334
|
+
* Creates a Null leaf pattern.
|
|
1335
|
+
*/
|
|
1336
|
+
declare function leafNull(pattern: NullPattern): LeafPattern;
|
|
1337
|
+
/**
|
|
1338
|
+
* Creates a Date leaf pattern.
|
|
1339
|
+
*/
|
|
1340
|
+
declare function leafDate(pattern: DatePattern): LeafPattern;
|
|
1341
|
+
/**
|
|
1342
|
+
* Creates a KnownValue leaf pattern.
|
|
1343
|
+
*/
|
|
1344
|
+
declare function leafKnownValue(pattern: KnownValuePattern): LeafPattern;
|
|
1345
|
+
/**
|
|
1346
|
+
* Gets paths with captures for a leaf pattern.
|
|
1347
|
+
*/
|
|
1348
|
+
declare function leafPatternPathsWithCaptures(pattern: LeafPattern, haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
1349
|
+
/**
|
|
1350
|
+
* Gets paths for a leaf pattern.
|
|
1351
|
+
*/
|
|
1352
|
+
declare function leafPatternPaths(pattern: LeafPattern, haystack: Envelope): Path[];
|
|
1353
|
+
/**
|
|
1354
|
+
* Compiles a leaf pattern to bytecode.
|
|
1355
|
+
*/
|
|
1356
|
+
declare function leafPatternCompile(pattern: LeafPattern, code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
1357
|
+
/**
|
|
1358
|
+
* Checks if a leaf pattern is complex.
|
|
1359
|
+
*/
|
|
1360
|
+
declare function leafPatternIsComplex(pattern: LeafPattern): boolean;
|
|
1361
|
+
/**
|
|
1362
|
+
* Converts a leaf pattern to string.
|
|
1363
|
+
*/
|
|
1364
|
+
declare function leafPatternToString(pattern: LeafPattern): string;
|
|
1365
|
+
//#endregion
|
|
1366
|
+
//#region src/pattern/structure/leaf-structure-pattern.d.ts
|
|
1367
|
+
declare function registerLeafStructurePatternFactory(factory: (pattern: LeafStructurePattern) => Pattern): void;
|
|
1368
|
+
/**
|
|
1369
|
+
* Pattern for matching leaf envelopes (terminal nodes in the envelope tree).
|
|
1370
|
+
*
|
|
1371
|
+
* Corresponds to the Rust `LeafStructurePattern` struct in leaf_structure_pattern.rs
|
|
1372
|
+
*/
|
|
1373
|
+
declare class LeafStructurePattern implements Matcher {
|
|
1374
|
+
private constructor();
|
|
1375
|
+
/**
|
|
1376
|
+
* Creates a new LeafStructurePattern.
|
|
1377
|
+
*/
|
|
1378
|
+
static new(): LeafStructurePattern;
|
|
1379
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
1380
|
+
paths(haystack: Envelope): Path[];
|
|
1381
|
+
matches(haystack: Envelope): boolean;
|
|
1382
|
+
compile(code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
1383
|
+
isComplex(): boolean;
|
|
1384
|
+
toString(): string;
|
|
1385
|
+
/**
|
|
1386
|
+
* Equality comparison.
|
|
1387
|
+
*/
|
|
1388
|
+
equals(_other: LeafStructurePattern): boolean;
|
|
1389
|
+
/**
|
|
1390
|
+
* Hash code for use in Maps/Sets.
|
|
1391
|
+
*/
|
|
1392
|
+
hashCode(): number;
|
|
1393
|
+
}
|
|
1394
|
+
//#endregion
|
|
1395
|
+
//#region src/pattern/structure/subject-pattern.d.ts
|
|
1396
|
+
declare function registerSubjectPatternFactory(factory: (pattern: SubjectPattern) => Pattern): void;
|
|
1397
|
+
/**
|
|
1398
|
+
* Pattern type for subject pattern matching.
|
|
1399
|
+
*
|
|
1400
|
+
* Corresponds to the Rust `SubjectPattern` enum in subject_pattern.rs
|
|
1401
|
+
*/
|
|
1402
|
+
type SubjectPatternType = {
|
|
1403
|
+
readonly type: "Any";
|
|
1404
|
+
} | {
|
|
1405
|
+
readonly type: "Pattern";
|
|
1406
|
+
readonly pattern: Pattern;
|
|
1407
|
+
};
|
|
1408
|
+
/**
|
|
1409
|
+
* Pattern for matching subjects in envelopes.
|
|
1410
|
+
*
|
|
1411
|
+
* Corresponds to the Rust `SubjectPattern` enum in subject_pattern.rs
|
|
1412
|
+
*/
|
|
1413
|
+
declare class SubjectPattern implements Matcher {
|
|
1414
|
+
#private;
|
|
1415
|
+
private constructor();
|
|
1416
|
+
/**
|
|
1417
|
+
* Creates a new SubjectPattern that matches any subject.
|
|
1418
|
+
*/
|
|
1419
|
+
static any(): SubjectPattern;
|
|
1420
|
+
/**
|
|
1421
|
+
* Creates a new SubjectPattern that matches subjects matching the given pattern.
|
|
1422
|
+
*/
|
|
1423
|
+
static pattern(pattern: Pattern): SubjectPattern;
|
|
1424
|
+
/**
|
|
1425
|
+
* Gets the pattern type.
|
|
1426
|
+
*/
|
|
1427
|
+
get patternType(): SubjectPatternType;
|
|
1428
|
+
/**
|
|
1429
|
+
* Gets the inner pattern if this is a Pattern type, undefined otherwise.
|
|
1430
|
+
*/
|
|
1431
|
+
innerPattern(): Pattern | undefined;
|
|
1432
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
1433
|
+
paths(haystack: Envelope): Path[];
|
|
1434
|
+
matches(haystack: Envelope): boolean;
|
|
1435
|
+
compile(code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
1436
|
+
isComplex(): boolean;
|
|
1437
|
+
toString(): string;
|
|
1438
|
+
/**
|
|
1439
|
+
* Equality comparison.
|
|
1440
|
+
*/
|
|
1441
|
+
equals(other: SubjectPattern): boolean;
|
|
1442
|
+
/**
|
|
1443
|
+
* Hash code for use in Maps/Sets.
|
|
1444
|
+
*/
|
|
1445
|
+
hashCode(): number;
|
|
1446
|
+
}
|
|
1447
|
+
//#endregion
|
|
1448
|
+
//#region src/pattern/structure/predicate-pattern.d.ts
|
|
1449
|
+
declare function registerPredicatePatternFactory(factory: (pattern: PredicatePattern) => Pattern): void;
|
|
1450
|
+
/**
|
|
1451
|
+
* Pattern type for predicate pattern matching.
|
|
1452
|
+
*
|
|
1453
|
+
* Corresponds to the Rust `PredicatePattern` enum in predicate_pattern.rs
|
|
1454
|
+
*/
|
|
1455
|
+
type PredicatePatternType = {
|
|
1456
|
+
readonly type: "Any";
|
|
1457
|
+
} | {
|
|
1458
|
+
readonly type: "Pattern";
|
|
1459
|
+
readonly pattern: Pattern;
|
|
1460
|
+
};
|
|
1461
|
+
/**
|
|
1462
|
+
* Pattern for matching predicates in envelopes.
|
|
1463
|
+
*
|
|
1464
|
+
* Corresponds to the Rust `PredicatePattern` enum in predicate_pattern.rs
|
|
1465
|
+
*/
|
|
1466
|
+
declare class PredicatePattern implements Matcher {
|
|
1467
|
+
#private;
|
|
1468
|
+
private constructor();
|
|
1469
|
+
/**
|
|
1470
|
+
* Creates a new PredicatePattern that matches any predicate.
|
|
1471
|
+
*/
|
|
1472
|
+
static any(): PredicatePattern;
|
|
1473
|
+
/**
|
|
1474
|
+
* Creates a new PredicatePattern that matches predicates matching the given pattern.
|
|
1475
|
+
*/
|
|
1476
|
+
static pattern(pattern: Pattern): PredicatePattern;
|
|
1477
|
+
/**
|
|
1478
|
+
* Gets the pattern type.
|
|
1479
|
+
*/
|
|
1480
|
+
get patternType(): PredicatePatternType;
|
|
1481
|
+
/**
|
|
1482
|
+
* Gets the inner pattern if this is a Pattern type, undefined otherwise.
|
|
1483
|
+
*/
|
|
1484
|
+
innerPattern(): Pattern | undefined;
|
|
1485
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
1486
|
+
paths(haystack: Envelope): Path[];
|
|
1487
|
+
matches(haystack: Envelope): boolean;
|
|
1488
|
+
compile(code: Instr[], literals: Pattern[], _captures: string[]): void;
|
|
1489
|
+
isComplex(): boolean;
|
|
1490
|
+
toString(): string;
|
|
1491
|
+
/**
|
|
1492
|
+
* Equality comparison.
|
|
1493
|
+
*/
|
|
1494
|
+
equals(other: PredicatePattern): boolean;
|
|
1495
|
+
/**
|
|
1496
|
+
* Hash code for use in Maps/Sets.
|
|
1497
|
+
*/
|
|
1498
|
+
hashCode(): number;
|
|
1499
|
+
}
|
|
1500
|
+
//#endregion
|
|
1501
|
+
//#region src/pattern/structure/object-pattern.d.ts
|
|
1502
|
+
declare function registerObjectPatternFactory(factory: (pattern: ObjectPattern) => Pattern): void;
|
|
1503
|
+
/**
|
|
1504
|
+
* Pattern type for object pattern matching.
|
|
1505
|
+
*
|
|
1506
|
+
* Corresponds to the Rust `ObjectPattern` enum in object_pattern.rs
|
|
1507
|
+
*/
|
|
1508
|
+
type ObjectPatternType = {
|
|
1509
|
+
readonly type: "Any";
|
|
1510
|
+
} | {
|
|
1511
|
+
readonly type: "Pattern";
|
|
1512
|
+
readonly pattern: Pattern;
|
|
1513
|
+
};
|
|
1514
|
+
/**
|
|
1515
|
+
* Pattern for matching objects in envelopes.
|
|
1516
|
+
*
|
|
1517
|
+
* Corresponds to the Rust `ObjectPattern` enum in object_pattern.rs
|
|
1518
|
+
*/
|
|
1519
|
+
declare class ObjectPattern implements Matcher {
|
|
1520
|
+
#private;
|
|
1521
|
+
private constructor();
|
|
1522
|
+
/**
|
|
1523
|
+
* Creates a new ObjectPattern that matches any object.
|
|
1524
|
+
*/
|
|
1525
|
+
static any(): ObjectPattern;
|
|
1526
|
+
/**
|
|
1527
|
+
* Creates a new ObjectPattern that matches objects matching the given pattern.
|
|
1528
|
+
*/
|
|
1529
|
+
static pattern(pattern: Pattern): ObjectPattern;
|
|
1530
|
+
/**
|
|
1531
|
+
* Gets the pattern type.
|
|
1532
|
+
*/
|
|
1533
|
+
get patternType(): ObjectPatternType;
|
|
1534
|
+
/**
|
|
1535
|
+
* Gets the inner pattern if this is a Pattern type, undefined otherwise.
|
|
1536
|
+
*/
|
|
1537
|
+
innerPattern(): Pattern | undefined;
|
|
1538
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
1539
|
+
paths(haystack: Envelope): Path[];
|
|
1540
|
+
matches(haystack: Envelope): boolean;
|
|
1541
|
+
compile(code: Instr[], literals: Pattern[], _captures: string[]): void;
|
|
1542
|
+
isComplex(): boolean;
|
|
1543
|
+
toString(): string;
|
|
1544
|
+
/**
|
|
1545
|
+
* Equality comparison.
|
|
1546
|
+
*/
|
|
1547
|
+
equals(other: ObjectPattern): boolean;
|
|
1548
|
+
/**
|
|
1549
|
+
* Hash code for use in Maps/Sets.
|
|
1550
|
+
*/
|
|
1551
|
+
hashCode(): number;
|
|
1552
|
+
}
|
|
1553
|
+
//#endregion
|
|
1554
|
+
//#region src/pattern/structure/assertions-pattern.d.ts
|
|
1555
|
+
declare function registerAssertionsPatternFactory(factory: (pattern: AssertionsPattern) => Pattern): void;
|
|
1556
|
+
/**
|
|
1557
|
+
* Pattern type for assertions pattern matching.
|
|
1558
|
+
*
|
|
1559
|
+
* Corresponds to the Rust `AssertionsPattern` enum in assertions_pattern.rs
|
|
1560
|
+
*/
|
|
1561
|
+
type AssertionsPatternType = {
|
|
1562
|
+
readonly type: "Any";
|
|
1563
|
+
} | {
|
|
1564
|
+
readonly type: "WithPredicate";
|
|
1565
|
+
readonly pattern: Pattern;
|
|
1566
|
+
} | {
|
|
1567
|
+
readonly type: "WithObject";
|
|
1568
|
+
readonly pattern: Pattern;
|
|
1569
|
+
} | {
|
|
1570
|
+
readonly type: "WithBoth";
|
|
1571
|
+
readonly predicatePattern: Pattern;
|
|
1572
|
+
readonly objectPattern: Pattern;
|
|
1573
|
+
};
|
|
1574
|
+
/**
|
|
1575
|
+
* Pattern for matching assertions in envelopes.
|
|
1576
|
+
*
|
|
1577
|
+
* Corresponds to the Rust `AssertionsPattern` enum in assertions_pattern.rs
|
|
1578
|
+
*/
|
|
1579
|
+
declare class AssertionsPattern implements Matcher {
|
|
1580
|
+
#private;
|
|
1581
|
+
private constructor();
|
|
1582
|
+
/**
|
|
1583
|
+
* Creates a new AssertionsPattern that matches any assertion.
|
|
1584
|
+
*/
|
|
1585
|
+
static any(): AssertionsPattern;
|
|
1586
|
+
/**
|
|
1587
|
+
* Creates a new AssertionsPattern that matches assertions with predicates
|
|
1588
|
+
* that match a specific pattern.
|
|
1589
|
+
*/
|
|
1590
|
+
static withPredicate(pattern: Pattern): AssertionsPattern;
|
|
1591
|
+
/**
|
|
1592
|
+
* Creates a new AssertionsPattern that matches assertions with objects
|
|
1593
|
+
* that match a specific pattern.
|
|
1594
|
+
*/
|
|
1595
|
+
static withObject(pattern: Pattern): AssertionsPattern;
|
|
1596
|
+
/**
|
|
1597
|
+
* Creates a new AssertionsPattern that matches assertions with both
|
|
1598
|
+
* predicate and object patterns.
|
|
1599
|
+
*/
|
|
1600
|
+
static withBoth(predicatePattern: Pattern, objectPattern: Pattern): AssertionsPattern;
|
|
1601
|
+
/**
|
|
1602
|
+
* Gets the pattern type.
|
|
1603
|
+
*/
|
|
1604
|
+
get patternType(): AssertionsPatternType;
|
|
1605
|
+
/**
|
|
1606
|
+
* Gets the predicate pattern if this has one, undefined otherwise.
|
|
1607
|
+
*/
|
|
1608
|
+
predicatePattern(): Pattern | undefined;
|
|
1609
|
+
/**
|
|
1610
|
+
* Gets the object pattern if this has one, undefined otherwise.
|
|
1611
|
+
*/
|
|
1612
|
+
objectPattern(): Pattern | undefined;
|
|
1613
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
1614
|
+
paths(haystack: Envelope): Path[];
|
|
1615
|
+
matches(haystack: Envelope): boolean;
|
|
1616
|
+
compile(code: Instr[], literals: Pattern[], _captures: string[]): void;
|
|
1617
|
+
isComplex(): boolean;
|
|
1618
|
+
toString(): string;
|
|
1619
|
+
/**
|
|
1620
|
+
* Equality comparison.
|
|
1621
|
+
*/
|
|
1622
|
+
equals(other: AssertionsPattern): boolean;
|
|
1623
|
+
/**
|
|
1624
|
+
* Hash code for use in Maps/Sets.
|
|
1625
|
+
*/
|
|
1626
|
+
hashCode(): number;
|
|
1627
|
+
}
|
|
1628
|
+
//#endregion
|
|
1629
|
+
//#region src/pattern/structure/digest-pattern.d.ts
|
|
1630
|
+
declare function registerDigestPatternFactory(factory: (pattern: DigestPattern) => Pattern): void;
|
|
1631
|
+
/**
|
|
1632
|
+
* Pattern type for digest pattern matching.
|
|
1633
|
+
*
|
|
1634
|
+
* Corresponds to the Rust `DigestPattern` enum in digest_pattern.rs
|
|
1635
|
+
*/
|
|
1636
|
+
type DigestPatternType = {
|
|
1637
|
+
readonly type: "Any";
|
|
1638
|
+
} | {
|
|
1639
|
+
readonly type: "Digest";
|
|
1640
|
+
readonly digest: Digest;
|
|
1641
|
+
} | {
|
|
1642
|
+
readonly type: "Prefix";
|
|
1643
|
+
readonly prefix: Uint8Array;
|
|
1644
|
+
} | {
|
|
1645
|
+
readonly type: "BinaryRegex";
|
|
1646
|
+
readonly regex: RegExp;
|
|
1647
|
+
};
|
|
1648
|
+
/**
|
|
1649
|
+
* Pattern for matching envelopes by their digest.
|
|
1650
|
+
*
|
|
1651
|
+
* Corresponds to the Rust `DigestPattern` enum in digest_pattern.rs
|
|
1652
|
+
*/
|
|
1653
|
+
declare class DigestPattern implements Matcher {
|
|
1654
|
+
#private;
|
|
1655
|
+
private constructor();
|
|
1656
|
+
/**
|
|
1657
|
+
* Creates a new DigestPattern that matches any digest.
|
|
1658
|
+
*/
|
|
1659
|
+
static any(): DigestPattern;
|
|
1660
|
+
/**
|
|
1661
|
+
* Creates a new DigestPattern that matches the exact digest.
|
|
1662
|
+
*/
|
|
1663
|
+
static digest(digest: Digest): DigestPattern;
|
|
1664
|
+
/**
|
|
1665
|
+
* Creates a new DigestPattern that matches the prefix of a digest.
|
|
1666
|
+
*/
|
|
1667
|
+
static prefix(prefix: Uint8Array): DigestPattern;
|
|
1668
|
+
/**
|
|
1669
|
+
* Creates a new DigestPattern that matches the binary regex for a digest.
|
|
1670
|
+
*/
|
|
1671
|
+
static binaryRegex(regex: RegExp): DigestPattern;
|
|
1672
|
+
/**
|
|
1673
|
+
* Gets the pattern type.
|
|
1674
|
+
*/
|
|
1675
|
+
get patternType(): DigestPatternType;
|
|
1676
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
1677
|
+
paths(haystack: Envelope): Path[];
|
|
1678
|
+
matches(haystack: Envelope): boolean;
|
|
1679
|
+
compile(code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
1680
|
+
isComplex(): boolean;
|
|
1681
|
+
toString(): string;
|
|
1682
|
+
/**
|
|
1683
|
+
* Equality comparison.
|
|
1684
|
+
*/
|
|
1685
|
+
equals(other: DigestPattern): boolean;
|
|
1686
|
+
/**
|
|
1687
|
+
* Hash code for use in Maps/Sets.
|
|
1688
|
+
*/
|
|
1689
|
+
hashCode(): number;
|
|
1690
|
+
}
|
|
1691
|
+
//#endregion
|
|
1692
|
+
//#region src/pattern/structure/node-pattern.d.ts
|
|
1693
|
+
declare function registerNodePatternFactory(factory: (pattern: NodePattern) => Pattern): void;
|
|
1694
|
+
/**
|
|
1695
|
+
* Pattern type for node pattern matching.
|
|
1696
|
+
*
|
|
1697
|
+
* Corresponds to the Rust `NodePattern` enum in node_pattern.rs
|
|
1698
|
+
*/
|
|
1699
|
+
type NodePatternType = {
|
|
1700
|
+
readonly type: "Any";
|
|
1701
|
+
} | {
|
|
1702
|
+
readonly type: "AssertionsInterval";
|
|
1703
|
+
readonly interval: Interval$1;
|
|
1704
|
+
} | {
|
|
1705
|
+
readonly type: "WithSubject";
|
|
1706
|
+
readonly subjectPattern: Pattern;
|
|
1707
|
+
};
|
|
1708
|
+
/**
|
|
1709
|
+
* Pattern for matching node envelopes.
|
|
1710
|
+
*
|
|
1711
|
+
* Corresponds to the Rust `NodePattern` enum in node_pattern.rs
|
|
1712
|
+
*/
|
|
1713
|
+
declare class NodePattern implements Matcher {
|
|
1714
|
+
#private;
|
|
1715
|
+
private constructor();
|
|
1716
|
+
/**
|
|
1717
|
+
* Creates a new NodePattern that matches any node.
|
|
1718
|
+
*/
|
|
1719
|
+
static any(): NodePattern;
|
|
1720
|
+
/**
|
|
1721
|
+
* Creates a new NodePattern that matches a node with the specified count of assertions.
|
|
1722
|
+
*/
|
|
1723
|
+
static interval(min: number, max?: number): NodePattern;
|
|
1724
|
+
/**
|
|
1725
|
+
* Creates a new NodePattern from an Interval.
|
|
1726
|
+
*/
|
|
1727
|
+
static fromInterval(interval: Interval$1): NodePattern;
|
|
1728
|
+
/**
|
|
1729
|
+
* Creates a new NodePattern with a subject pattern constraint.
|
|
1730
|
+
*/
|
|
1731
|
+
static withSubject(subjectPattern: Pattern): NodePattern;
|
|
1732
|
+
/**
|
|
1733
|
+
* Gets the pattern type.
|
|
1734
|
+
*/
|
|
1735
|
+
get patternType(): NodePatternType;
|
|
1736
|
+
/**
|
|
1737
|
+
* Gets the subject pattern if this is a WithSubject type, undefined otherwise.
|
|
1738
|
+
*/
|
|
1739
|
+
subjectPattern(): Pattern | undefined;
|
|
1740
|
+
/**
|
|
1741
|
+
* Gets the assertion patterns (empty array if none).
|
|
1742
|
+
*/
|
|
1743
|
+
assertionPatterns(): Pattern[];
|
|
1744
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
1745
|
+
paths(haystack: Envelope): Path[];
|
|
1746
|
+
matches(haystack: Envelope): boolean;
|
|
1747
|
+
compile(code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
1748
|
+
isComplex(): boolean;
|
|
1749
|
+
toString(): string;
|
|
1750
|
+
/**
|
|
1751
|
+
* Equality comparison.
|
|
1752
|
+
*/
|
|
1753
|
+
equals(other: NodePattern): boolean;
|
|
1754
|
+
/**
|
|
1755
|
+
* Hash code for use in Maps/Sets.
|
|
1756
|
+
*/
|
|
1757
|
+
hashCode(): number;
|
|
1758
|
+
}
|
|
1759
|
+
//#endregion
|
|
1760
|
+
//#region src/pattern/structure/obscured-pattern.d.ts
|
|
1761
|
+
declare function registerObscuredPatternFactory(factory: (pattern: ObscuredPattern) => Pattern): void;
|
|
1762
|
+
/**
|
|
1763
|
+
* Pattern type for obscured pattern matching.
|
|
1764
|
+
*
|
|
1765
|
+
* Corresponds to the Rust `ObscuredPattern` enum in obscured_pattern.rs
|
|
1766
|
+
*/
|
|
1767
|
+
type ObscuredPatternType = {
|
|
1768
|
+
readonly type: "Any";
|
|
1769
|
+
} | {
|
|
1770
|
+
readonly type: "Elided";
|
|
1771
|
+
} | {
|
|
1772
|
+
readonly type: "Encrypted";
|
|
1773
|
+
} | {
|
|
1774
|
+
readonly type: "Compressed";
|
|
1775
|
+
};
|
|
1776
|
+
/**
|
|
1777
|
+
* Pattern for matching obscured elements.
|
|
1778
|
+
*
|
|
1779
|
+
* Corresponds to the Rust `ObscuredPattern` enum in obscured_pattern.rs
|
|
1780
|
+
*/
|
|
1781
|
+
declare class ObscuredPattern implements Matcher {
|
|
1782
|
+
#private;
|
|
1783
|
+
private constructor();
|
|
1784
|
+
/**
|
|
1785
|
+
* Creates a new ObscuredPattern that matches any obscured element.
|
|
1786
|
+
*/
|
|
1787
|
+
static any(): ObscuredPattern;
|
|
1788
|
+
/**
|
|
1789
|
+
* Creates a new ObscuredPattern that matches any elided element.
|
|
1790
|
+
*/
|
|
1791
|
+
static elided(): ObscuredPattern;
|
|
1792
|
+
/**
|
|
1793
|
+
* Creates a new ObscuredPattern that matches any encrypted element.
|
|
1794
|
+
*/
|
|
1795
|
+
static encrypted(): ObscuredPattern;
|
|
1796
|
+
/**
|
|
1797
|
+
* Creates a new ObscuredPattern that matches any compressed element.
|
|
1798
|
+
*/
|
|
1799
|
+
static compressed(): ObscuredPattern;
|
|
1800
|
+
/**
|
|
1801
|
+
* Gets the pattern type.
|
|
1802
|
+
*/
|
|
1803
|
+
get patternType(): ObscuredPatternType;
|
|
1804
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
1805
|
+
paths(haystack: Envelope): Path[];
|
|
1806
|
+
matches(haystack: Envelope): boolean;
|
|
1807
|
+
compile(code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
1808
|
+
isComplex(): boolean;
|
|
1809
|
+
toString(): string;
|
|
1810
|
+
/**
|
|
1811
|
+
* Equality comparison.
|
|
1812
|
+
*/
|
|
1813
|
+
equals(other: ObscuredPattern): boolean;
|
|
1814
|
+
/**
|
|
1815
|
+
* Hash code for use in Maps/Sets.
|
|
1816
|
+
*/
|
|
1817
|
+
hashCode(): number;
|
|
1818
|
+
}
|
|
1819
|
+
//#endregion
|
|
1820
|
+
//#region src/pattern/structure/wrapped-pattern.d.ts
|
|
1821
|
+
declare function registerWrappedPatternFactory(factory: (pattern: WrappedPattern) => Pattern): void;
|
|
1822
|
+
/**
|
|
1823
|
+
* Pattern type for wrapped pattern matching.
|
|
1824
|
+
*
|
|
1825
|
+
* Corresponds to the Rust `WrappedPattern` enum in wrapped_pattern.rs
|
|
1826
|
+
*/
|
|
1827
|
+
type WrappedPatternType = {
|
|
1828
|
+
readonly type: "Any";
|
|
1829
|
+
} | {
|
|
1830
|
+
readonly type: "Unwrap";
|
|
1831
|
+
readonly pattern: Pattern;
|
|
1832
|
+
};
|
|
1833
|
+
/**
|
|
1834
|
+
* Represents patterns for matching wrapped envelopes.
|
|
1835
|
+
*
|
|
1836
|
+
* Corresponds to the Rust `WrappedPattern` enum in wrapped_pattern.rs
|
|
1837
|
+
*/
|
|
1838
|
+
declare class WrappedPattern implements Matcher {
|
|
1839
|
+
#private;
|
|
1840
|
+
private constructor();
|
|
1841
|
+
/**
|
|
1842
|
+
* Creates a new WrappedPattern that matches any wrapped envelope without descending.
|
|
1843
|
+
*/
|
|
1844
|
+
static new(): WrappedPattern;
|
|
1845
|
+
/**
|
|
1846
|
+
* Creates a new WrappedPattern that matches a wrapped envelope and also matches
|
|
1847
|
+
* on its unwrapped content.
|
|
1848
|
+
*/
|
|
1849
|
+
static unwrapMatching(pattern: Pattern): WrappedPattern;
|
|
1850
|
+
/**
|
|
1851
|
+
* Creates a new WrappedPattern that matches any wrapped envelope and descends into it.
|
|
1852
|
+
* Note: This requires Pattern.any() to be available, so it's set up during registration.
|
|
1853
|
+
*/
|
|
1854
|
+
static unwrap(): WrappedPattern;
|
|
1855
|
+
/**
|
|
1856
|
+
* Gets the pattern type.
|
|
1857
|
+
*/
|
|
1858
|
+
get patternType(): WrappedPatternType;
|
|
1859
|
+
/**
|
|
1860
|
+
* Gets the inner pattern if this is an Unwrap type, undefined otherwise.
|
|
1861
|
+
*/
|
|
1862
|
+
innerPattern(): Pattern | undefined;
|
|
1863
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
1864
|
+
paths(haystack: Envelope): Path[];
|
|
1865
|
+
matches(haystack: Envelope): boolean;
|
|
1866
|
+
compile(code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
1867
|
+
isComplex(): boolean;
|
|
1868
|
+
toString(): string;
|
|
1869
|
+
/**
|
|
1870
|
+
* Equality comparison.
|
|
1871
|
+
*/
|
|
1872
|
+
equals(other: WrappedPattern): boolean;
|
|
1873
|
+
/**
|
|
1874
|
+
* Hash code for use in Maps/Sets.
|
|
1875
|
+
*/
|
|
1876
|
+
hashCode(): number;
|
|
1877
|
+
}
|
|
1878
|
+
//#endregion
|
|
1879
|
+
//#region src/pattern/structure/index.d.ts
|
|
1880
|
+
/**
|
|
1881
|
+
* Union type for all structure patterns.
|
|
1882
|
+
*
|
|
1883
|
+
* Corresponds to the Rust `StructurePattern` enum in pattern/structure/mod.rs
|
|
1884
|
+
*/
|
|
1885
|
+
type StructurePattern = {
|
|
1886
|
+
readonly type: "Leaf";
|
|
1887
|
+
readonly pattern: LeafStructurePattern;
|
|
1888
|
+
} | {
|
|
1889
|
+
readonly type: "Subject";
|
|
1890
|
+
readonly pattern: SubjectPattern;
|
|
1891
|
+
} | {
|
|
1892
|
+
readonly type: "Predicate";
|
|
1893
|
+
readonly pattern: PredicatePattern;
|
|
1894
|
+
} | {
|
|
1895
|
+
readonly type: "Object";
|
|
1896
|
+
readonly pattern: ObjectPattern;
|
|
1897
|
+
} | {
|
|
1898
|
+
readonly type: "Assertions";
|
|
1899
|
+
readonly pattern: AssertionsPattern;
|
|
1900
|
+
} | {
|
|
1901
|
+
readonly type: "Digest";
|
|
1902
|
+
readonly pattern: DigestPattern;
|
|
1903
|
+
} | {
|
|
1904
|
+
readonly type: "Node";
|
|
1905
|
+
readonly pattern: NodePattern;
|
|
1906
|
+
} | {
|
|
1907
|
+
readonly type: "Obscured";
|
|
1908
|
+
readonly pattern: ObscuredPattern;
|
|
1909
|
+
} | {
|
|
1910
|
+
readonly type: "Wrapped";
|
|
1911
|
+
readonly pattern: WrappedPattern;
|
|
1912
|
+
};
|
|
1913
|
+
/**
|
|
1914
|
+
* Creates a Leaf structure pattern.
|
|
1915
|
+
*/
|
|
1916
|
+
declare function structureLeaf(pattern: LeafStructurePattern): StructurePattern;
|
|
1917
|
+
/**
|
|
1918
|
+
* Creates a Subject structure pattern.
|
|
1919
|
+
*/
|
|
1920
|
+
declare function structureSubject(pattern: SubjectPattern): StructurePattern;
|
|
1921
|
+
/**
|
|
1922
|
+
* Creates a Predicate structure pattern.
|
|
1923
|
+
*/
|
|
1924
|
+
declare function structurePredicate(pattern: PredicatePattern): StructurePattern;
|
|
1925
|
+
/**
|
|
1926
|
+
* Creates an Object structure pattern.
|
|
1927
|
+
*/
|
|
1928
|
+
declare function structureObject(pattern: ObjectPattern): StructurePattern;
|
|
1929
|
+
/**
|
|
1930
|
+
* Creates an Assertions structure pattern.
|
|
1931
|
+
*/
|
|
1932
|
+
declare function structureAssertions(pattern: AssertionsPattern): StructurePattern;
|
|
1933
|
+
/**
|
|
1934
|
+
* Creates a Digest structure pattern.
|
|
1935
|
+
*/
|
|
1936
|
+
declare function structureDigest(pattern: DigestPattern): StructurePattern;
|
|
1937
|
+
/**
|
|
1938
|
+
* Creates a Node structure pattern.
|
|
1939
|
+
*/
|
|
1940
|
+
declare function structureNode(pattern: NodePattern): StructurePattern;
|
|
1941
|
+
/**
|
|
1942
|
+
* Creates an Obscured structure pattern.
|
|
1943
|
+
*/
|
|
1944
|
+
declare function structureObscured(pattern: ObscuredPattern): StructurePattern;
|
|
1945
|
+
/**
|
|
1946
|
+
* Creates a Wrapped structure pattern.
|
|
1947
|
+
*/
|
|
1948
|
+
declare function structureWrapped(pattern: WrappedPattern): StructurePattern;
|
|
1949
|
+
/**
|
|
1950
|
+
* Gets paths with captures for a structure pattern.
|
|
1951
|
+
*/
|
|
1952
|
+
declare function structurePatternPathsWithCaptures(pattern: StructurePattern, haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
1953
|
+
/**
|
|
1954
|
+
* Gets paths for a structure pattern.
|
|
1955
|
+
*/
|
|
1956
|
+
declare function structurePatternPaths(pattern: StructurePattern, haystack: Envelope): Path[];
|
|
1957
|
+
/**
|
|
1958
|
+
* Compiles a structure pattern to bytecode.
|
|
1959
|
+
*/
|
|
1960
|
+
declare function structurePatternCompile(pattern: StructurePattern, code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
1961
|
+
/**
|
|
1962
|
+
* Checks if a structure pattern is complex.
|
|
1963
|
+
*/
|
|
1964
|
+
declare function structurePatternIsComplex(pattern: StructurePattern): boolean;
|
|
1965
|
+
/**
|
|
1966
|
+
* Converts a structure pattern to string.
|
|
1967
|
+
*/
|
|
1968
|
+
declare function structurePatternToString(pattern: StructurePattern): string;
|
|
1969
|
+
//#endregion
|
|
1970
|
+
//#region src/pattern/meta/any-pattern.d.ts
|
|
1971
|
+
declare function registerAnyPatternFactory(factory: (pattern: AnyPattern) => Pattern): void;
|
|
1972
|
+
/**
|
|
1973
|
+
* A pattern that matches any element.
|
|
1974
|
+
*
|
|
1975
|
+
* Corresponds to the Rust `AnyPattern` struct in any_pattern.rs
|
|
1976
|
+
*/
|
|
1977
|
+
declare class AnyPattern implements Matcher {
|
|
1978
|
+
private constructor();
|
|
1979
|
+
/**
|
|
1980
|
+
* Creates a new AnyPattern.
|
|
1981
|
+
*/
|
|
1982
|
+
static new(): AnyPattern;
|
|
1983
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
1984
|
+
paths(haystack: Envelope): Path[];
|
|
1985
|
+
matches(_haystack: Envelope): boolean;
|
|
1986
|
+
compile(code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
1987
|
+
isComplex(): boolean;
|
|
1988
|
+
toString(): string;
|
|
1989
|
+
/**
|
|
1990
|
+
* Equality comparison.
|
|
1991
|
+
*/
|
|
1992
|
+
equals(_other: AnyPattern): boolean;
|
|
1993
|
+
/**
|
|
1994
|
+
* Hash code for use in Maps/Sets.
|
|
1995
|
+
*/
|
|
1996
|
+
hashCode(): number;
|
|
1997
|
+
}
|
|
1998
|
+
//#endregion
|
|
1999
|
+
//#region src/pattern/meta/and-pattern.d.ts
|
|
2000
|
+
declare function registerAndPatternFactory(factory: (pattern: AndPattern) => Pattern): void;
|
|
2001
|
+
/**
|
|
2002
|
+
* A pattern that matches if all contained patterns match.
|
|
2003
|
+
*
|
|
2004
|
+
* Corresponds to the Rust `AndPattern` struct in and_pattern.rs
|
|
2005
|
+
*/
|
|
2006
|
+
declare class AndPattern implements Matcher {
|
|
2007
|
+
#private;
|
|
2008
|
+
private constructor();
|
|
2009
|
+
/**
|
|
2010
|
+
* Creates a new AndPattern with the given patterns.
|
|
2011
|
+
*/
|
|
2012
|
+
static new(patterns: Pattern[]): AndPattern;
|
|
2013
|
+
/**
|
|
2014
|
+
* Gets the patterns.
|
|
2015
|
+
*/
|
|
2016
|
+
patterns(): Pattern[];
|
|
2017
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
2018
|
+
paths(haystack: Envelope): Path[];
|
|
2019
|
+
matches(haystack: Envelope): boolean;
|
|
2020
|
+
compile(code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
2021
|
+
isComplex(): boolean;
|
|
2022
|
+
toString(): string;
|
|
2023
|
+
/**
|
|
2024
|
+
* Equality comparison.
|
|
2025
|
+
*/
|
|
2026
|
+
equals(other: AndPattern): boolean;
|
|
2027
|
+
/**
|
|
2028
|
+
* Hash code for use in Maps/Sets.
|
|
2029
|
+
*/
|
|
2030
|
+
hashCode(): number;
|
|
2031
|
+
}
|
|
2032
|
+
//#endregion
|
|
2033
|
+
//#region src/pattern/meta/or-pattern.d.ts
|
|
2034
|
+
declare function registerOrPatternFactory(factory: (pattern: OrPattern) => Pattern): void;
|
|
2035
|
+
/**
|
|
2036
|
+
* A pattern that matches if any contained pattern matches.
|
|
2037
|
+
*
|
|
2038
|
+
* Corresponds to the Rust `OrPattern` struct in or_pattern.rs
|
|
2039
|
+
*/
|
|
2040
|
+
declare class OrPattern implements Matcher {
|
|
2041
|
+
#private;
|
|
2042
|
+
private constructor();
|
|
2043
|
+
/**
|
|
2044
|
+
* Creates a new OrPattern with the given patterns.
|
|
2045
|
+
*/
|
|
2046
|
+
static new(patterns: Pattern[]): OrPattern;
|
|
2047
|
+
/**
|
|
2048
|
+
* Gets the patterns.
|
|
2049
|
+
*/
|
|
2050
|
+
patterns(): Pattern[];
|
|
2051
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
2052
|
+
paths(haystack: Envelope): Path[];
|
|
2053
|
+
matches(haystack: Envelope): boolean;
|
|
2054
|
+
compile(code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
2055
|
+
isComplex(): boolean;
|
|
2056
|
+
toString(): string;
|
|
2057
|
+
/**
|
|
2058
|
+
* Equality comparison.
|
|
2059
|
+
*/
|
|
2060
|
+
equals(other: OrPattern): boolean;
|
|
2061
|
+
/**
|
|
2062
|
+
* Hash code for use in Maps/Sets.
|
|
2063
|
+
*/
|
|
2064
|
+
hashCode(): number;
|
|
2065
|
+
}
|
|
2066
|
+
//#endregion
|
|
2067
|
+
//#region src/pattern/meta/not-pattern.d.ts
|
|
2068
|
+
declare function registerNotPatternFactory(factory: (pattern: NotPattern) => Pattern): void;
|
|
2069
|
+
/**
|
|
2070
|
+
* A pattern that negates another pattern; matches when the inner pattern does not match.
|
|
2071
|
+
*
|
|
2072
|
+
* Corresponds to the Rust `NotPattern` struct in not_pattern.rs
|
|
2073
|
+
*/
|
|
2074
|
+
declare class NotPattern implements Matcher {
|
|
2075
|
+
#private;
|
|
2076
|
+
private constructor();
|
|
2077
|
+
/**
|
|
2078
|
+
* Creates a new NotPattern with the given pattern.
|
|
2079
|
+
*/
|
|
2080
|
+
static new(pattern: Pattern): NotPattern;
|
|
2081
|
+
/**
|
|
2082
|
+
* Gets the inner pattern.
|
|
2083
|
+
*/
|
|
2084
|
+
pattern(): Pattern;
|
|
2085
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
2086
|
+
paths(haystack: Envelope): Path[];
|
|
2087
|
+
matches(haystack: Envelope): boolean;
|
|
2088
|
+
compile(code: Instr[], literals: Pattern[], _captures: string[]): void;
|
|
2089
|
+
isComplex(): boolean;
|
|
2090
|
+
toString(): string;
|
|
2091
|
+
/**
|
|
2092
|
+
* Equality comparison.
|
|
2093
|
+
*/
|
|
2094
|
+
equals(other: NotPattern): boolean;
|
|
2095
|
+
/**
|
|
2096
|
+
* Hash code for use in Maps/Sets.
|
|
2097
|
+
*/
|
|
2098
|
+
hashCode(): number;
|
|
2099
|
+
}
|
|
2100
|
+
//#endregion
|
|
2101
|
+
//#region src/pattern/meta/capture-pattern.d.ts
|
|
2102
|
+
declare function registerCapturePatternFactory(factory: (pattern: CapturePattern) => Pattern): void;
|
|
2103
|
+
/**
|
|
2104
|
+
* A pattern that captures a match with a name.
|
|
2105
|
+
*
|
|
2106
|
+
* Corresponds to the Rust `CapturePattern` struct in capture_pattern.rs
|
|
2107
|
+
*/
|
|
2108
|
+
declare class CapturePattern implements Matcher {
|
|
2109
|
+
#private;
|
|
2110
|
+
private constructor();
|
|
2111
|
+
/**
|
|
2112
|
+
* Creates a new CapturePattern with the given name and pattern.
|
|
2113
|
+
*/
|
|
2114
|
+
static new(name: string, pattern: Pattern): CapturePattern;
|
|
2115
|
+
/**
|
|
2116
|
+
* Gets the name of the capture.
|
|
2117
|
+
*/
|
|
2118
|
+
name(): string;
|
|
2119
|
+
/**
|
|
2120
|
+
* Gets the inner pattern.
|
|
2121
|
+
*/
|
|
2122
|
+
pattern(): Pattern;
|
|
2123
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
2124
|
+
paths(haystack: Envelope): Path[];
|
|
2125
|
+
matches(haystack: Envelope): boolean;
|
|
2126
|
+
compile(code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
2127
|
+
isComplex(): boolean;
|
|
2128
|
+
toString(): string;
|
|
2129
|
+
/**
|
|
2130
|
+
* Equality comparison.
|
|
2131
|
+
*/
|
|
2132
|
+
equals(other: CapturePattern): boolean;
|
|
2133
|
+
/**
|
|
2134
|
+
* Hash code for use in Maps/Sets.
|
|
2135
|
+
*/
|
|
2136
|
+
hashCode(): number;
|
|
2137
|
+
}
|
|
2138
|
+
//#endregion
|
|
2139
|
+
//#region src/pattern/meta/search-pattern.d.ts
|
|
2140
|
+
declare function registerSearchPatternFactory(factory: (pattern: SearchPattern) => Pattern): void;
|
|
2141
|
+
/**
|
|
2142
|
+
* A pattern that searches the entire envelope tree for matches.
|
|
2143
|
+
*
|
|
2144
|
+
* Corresponds to the Rust `SearchPattern` struct in search_pattern.rs
|
|
2145
|
+
*/
|
|
2146
|
+
declare class SearchPattern implements Matcher {
|
|
2147
|
+
#private;
|
|
2148
|
+
private constructor();
|
|
2149
|
+
/**
|
|
2150
|
+
* Creates a new SearchPattern with the given pattern.
|
|
2151
|
+
*/
|
|
2152
|
+
static new(pattern: Pattern): SearchPattern;
|
|
2153
|
+
/**
|
|
2154
|
+
* Gets the inner pattern.
|
|
2155
|
+
*/
|
|
2156
|
+
pattern(): Pattern;
|
|
2157
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
2158
|
+
paths(haystack: Envelope): Path[];
|
|
2159
|
+
matches(haystack: Envelope): boolean;
|
|
2160
|
+
compile(code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
2161
|
+
isComplex(): boolean;
|
|
2162
|
+
toString(): string;
|
|
2163
|
+
/**
|
|
2164
|
+
* Equality comparison.
|
|
2165
|
+
*/
|
|
2166
|
+
equals(other: SearchPattern): boolean;
|
|
2167
|
+
/**
|
|
2168
|
+
* Hash code for use in Maps/Sets.
|
|
2169
|
+
*/
|
|
2170
|
+
hashCode(): number;
|
|
2171
|
+
}
|
|
2172
|
+
//#endregion
|
|
2173
|
+
//#region src/pattern/meta/traverse-pattern.d.ts
|
|
2174
|
+
declare function registerTraversePatternFactory(factory: (pattern: TraversePattern) => Pattern): void;
|
|
2175
|
+
/**
|
|
2176
|
+
* A pattern that matches a traversal order of patterns.
|
|
2177
|
+
*
|
|
2178
|
+
* Corresponds to the Rust `TraversePattern` struct in traverse_pattern.rs
|
|
2179
|
+
*/
|
|
2180
|
+
declare class TraversePattern implements Matcher {
|
|
2181
|
+
#private;
|
|
2182
|
+
private constructor();
|
|
2183
|
+
/**
|
|
2184
|
+
* Creates a new TraversePattern with the given patterns.
|
|
2185
|
+
*/
|
|
2186
|
+
static new(patterns: Pattern[]): TraversePattern;
|
|
2187
|
+
/**
|
|
2188
|
+
* Gets all patterns in this traversal.
|
|
2189
|
+
*/
|
|
2190
|
+
patterns(): Pattern[];
|
|
2191
|
+
pathsWithCaptures(haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
2192
|
+
paths(haystack: Envelope): Path[];
|
|
2193
|
+
matches(haystack: Envelope): boolean;
|
|
2194
|
+
compile(code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
2195
|
+
isComplex(): boolean;
|
|
2196
|
+
toString(): string;
|
|
2197
|
+
/**
|
|
2198
|
+
* Equality comparison.
|
|
2199
|
+
*/
|
|
2200
|
+
equals(other: TraversePattern): boolean;
|
|
2201
|
+
/**
|
|
2202
|
+
* Hash code for use in Maps/Sets.
|
|
2203
|
+
*/
|
|
2204
|
+
hashCode(): number;
|
|
2205
|
+
}
|
|
2206
|
+
//#endregion
|
|
2207
|
+
//#region src/pattern/meta/group-pattern.d.ts
|
|
2208
|
+
declare function registerGroupPatternFactory(factory: (pattern: GroupPattern) => Pattern): void;
|
|
2209
|
+
/**
|
|
2210
|
+
* A pattern that matches with repetition.
|
|
2211
|
+
*
|
|
2212
|
+
* Corresponds to the Rust `GroupPattern` struct in repeat_pattern.rs
|
|
2213
|
+
*/
|
|
2214
|
+
declare class GroupPattern implements Matcher {
|
|
2215
|
+
#private;
|
|
2216
|
+
private constructor();
|
|
2217
|
+
/**
|
|
2218
|
+
* Creates a new GroupPattern with the specified sub-pattern and quantifier.
|
|
2219
|
+
*/
|
|
2220
|
+
static repeat(pattern: Pattern, quantifier: Quantifier$1): GroupPattern;
|
|
2221
|
+
/**
|
|
2222
|
+
* Creates a new GroupPattern with a quantifier that matches exactly once.
|
|
2223
|
+
*/
|
|
2224
|
+
static new(pattern: Pattern): GroupPattern;
|
|
2225
|
+
/**
|
|
2226
|
+
* Gets the sub-pattern of this group pattern.
|
|
2227
|
+
*/
|
|
2228
|
+
pattern(): Pattern;
|
|
2229
|
+
/**
|
|
2230
|
+
* Gets the quantifier of this group pattern.
|
|
2231
|
+
*/
|
|
2232
|
+
quantifier(): Quantifier$1;
|
|
2233
|
+
pathsWithCaptures(_haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
2234
|
+
paths(haystack: Envelope): Path[];
|
|
2235
|
+
matches(haystack: Envelope): boolean;
|
|
2236
|
+
compile(code: Instr[], literals: Pattern[], _captures: string[]): void;
|
|
2237
|
+
isComplex(): boolean;
|
|
2238
|
+
toString(): string;
|
|
2239
|
+
/**
|
|
2240
|
+
* Equality comparison.
|
|
2241
|
+
*/
|
|
2242
|
+
equals(other: GroupPattern): boolean;
|
|
2243
|
+
/**
|
|
2244
|
+
* Hash code for use in Maps/Sets.
|
|
2245
|
+
*/
|
|
2246
|
+
hashCode(): number;
|
|
2247
|
+
}
|
|
2248
|
+
//#endregion
|
|
2249
|
+
//#region src/pattern/meta/index.d.ts
|
|
2250
|
+
/**
|
|
2251
|
+
* Union type for all meta patterns.
|
|
2252
|
+
*
|
|
2253
|
+
* Corresponds to the Rust `MetaPattern` enum in pattern/meta/mod.rs
|
|
2254
|
+
*/
|
|
2255
|
+
type MetaPattern = {
|
|
2256
|
+
readonly type: "Any";
|
|
2257
|
+
readonly pattern: AnyPattern;
|
|
2258
|
+
} | {
|
|
2259
|
+
readonly type: "And";
|
|
2260
|
+
readonly pattern: AndPattern;
|
|
2261
|
+
} | {
|
|
2262
|
+
readonly type: "Or";
|
|
2263
|
+
readonly pattern: OrPattern;
|
|
2264
|
+
} | {
|
|
2265
|
+
readonly type: "Not";
|
|
2266
|
+
readonly pattern: NotPattern;
|
|
2267
|
+
} | {
|
|
2268
|
+
readonly type: "Capture";
|
|
2269
|
+
readonly pattern: CapturePattern;
|
|
2270
|
+
} | {
|
|
2271
|
+
readonly type: "Search";
|
|
2272
|
+
readonly pattern: SearchPattern;
|
|
2273
|
+
} | {
|
|
2274
|
+
readonly type: "Traverse";
|
|
2275
|
+
readonly pattern: TraversePattern;
|
|
2276
|
+
} | {
|
|
2277
|
+
readonly type: "Group";
|
|
2278
|
+
readonly pattern: GroupPattern;
|
|
2279
|
+
};
|
|
2280
|
+
/**
|
|
2281
|
+
* Creates an Any meta pattern.
|
|
2282
|
+
*/
|
|
2283
|
+
declare function metaAny(pattern: AnyPattern): MetaPattern;
|
|
2284
|
+
/**
|
|
2285
|
+
* Creates an And meta pattern.
|
|
2286
|
+
*/
|
|
2287
|
+
declare function metaAnd(pattern: AndPattern): MetaPattern;
|
|
2288
|
+
/**
|
|
2289
|
+
* Creates an Or meta pattern.
|
|
2290
|
+
*/
|
|
2291
|
+
declare function metaOr(pattern: OrPattern): MetaPattern;
|
|
2292
|
+
/**
|
|
2293
|
+
* Creates a Not meta pattern.
|
|
2294
|
+
*/
|
|
2295
|
+
declare function metaNot(pattern: NotPattern): MetaPattern;
|
|
2296
|
+
/**
|
|
2297
|
+
* Creates a Capture meta pattern.
|
|
2298
|
+
*/
|
|
2299
|
+
declare function metaCapture(pattern: CapturePattern): MetaPattern;
|
|
2300
|
+
/**
|
|
2301
|
+
* Creates a Search meta pattern.
|
|
2302
|
+
*/
|
|
2303
|
+
declare function metaSearch(pattern: SearchPattern): MetaPattern;
|
|
2304
|
+
/**
|
|
2305
|
+
* Creates a Traverse meta pattern.
|
|
2306
|
+
*/
|
|
2307
|
+
declare function metaTraverse(pattern: TraversePattern): MetaPattern;
|
|
2308
|
+
/**
|
|
2309
|
+
* Creates a Group meta pattern.
|
|
2310
|
+
*/
|
|
2311
|
+
declare function metaGroup(pattern: GroupPattern): MetaPattern;
|
|
2312
|
+
/**
|
|
2313
|
+
* Gets paths with captures for a meta pattern.
|
|
2314
|
+
*/
|
|
2315
|
+
declare function metaPatternPathsWithCaptures(pattern: MetaPattern, haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
2316
|
+
/**
|
|
2317
|
+
* Compiles a meta pattern to bytecode.
|
|
2318
|
+
*/
|
|
2319
|
+
declare function metaPatternCompile(pattern: MetaPattern, code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
2320
|
+
/**
|
|
2321
|
+
* Checks if a meta pattern is complex.
|
|
2322
|
+
*/
|
|
2323
|
+
declare function metaPatternIsComplex(pattern: MetaPattern): boolean;
|
|
2324
|
+
/**
|
|
2325
|
+
* Converts a meta pattern to string.
|
|
2326
|
+
*/
|
|
2327
|
+
declare function metaPatternToString(pattern: MetaPattern): string;
|
|
2328
|
+
/**
|
|
2329
|
+
* Collects capture names from a meta pattern.
|
|
2330
|
+
*/
|
|
2331
|
+
declare function metaPatternCollectCaptureNames(pattern: MetaPattern, out: string[]): void;
|
|
2332
|
+
//#endregion
|
|
2333
|
+
//#region src/pattern/index.d.ts
|
|
2334
|
+
/**
|
|
2335
|
+
* The main pattern type used for matching envelopes.
|
|
2336
|
+
*
|
|
2337
|
+
* Corresponds to the Rust `Pattern` enum in pattern/mod.rs
|
|
2338
|
+
*/
|
|
2339
|
+
type Pattern = {
|
|
2340
|
+
readonly type: "Leaf";
|
|
2341
|
+
readonly pattern: LeafPattern;
|
|
2342
|
+
} | {
|
|
2343
|
+
readonly type: "Structure";
|
|
2344
|
+
readonly pattern: StructurePattern;
|
|
2345
|
+
} | {
|
|
2346
|
+
readonly type: "Meta";
|
|
2347
|
+
readonly pattern: MetaPattern;
|
|
2348
|
+
};
|
|
2349
|
+
/**
|
|
2350
|
+
* Creates a Leaf pattern.
|
|
2351
|
+
*/
|
|
2352
|
+
declare function patternLeaf(leaf: LeafPattern): Pattern;
|
|
2353
|
+
/**
|
|
2354
|
+
* Creates a Structure pattern.
|
|
2355
|
+
*/
|
|
2356
|
+
declare function patternStructure(structure: StructurePattern): Pattern;
|
|
2357
|
+
/**
|
|
2358
|
+
* Creates a Meta pattern.
|
|
2359
|
+
*/
|
|
2360
|
+
declare function patternMeta(meta: MetaPattern): Pattern;
|
|
2361
|
+
/**
|
|
2362
|
+
* Gets paths with captures for a pattern.
|
|
2363
|
+
*/
|
|
2364
|
+
declare function patternPathsWithCaptures(pattern: Pattern, haystack: Envelope): [Path[], Map<string, Path[]>];
|
|
2365
|
+
/**
|
|
2366
|
+
* Gets paths for a pattern.
|
|
2367
|
+
*/
|
|
2368
|
+
declare function patternPaths(pattern: Pattern, haystack: Envelope): Path[];
|
|
2369
|
+
/**
|
|
2370
|
+
* Checks if a pattern matches.
|
|
2371
|
+
*/
|
|
2372
|
+
declare function patternMatches(pattern: Pattern, haystack: Envelope): boolean;
|
|
2373
|
+
/**
|
|
2374
|
+
* Checks if a pattern is complex.
|
|
2375
|
+
*/
|
|
2376
|
+
declare function patternIsComplex(pattern: Pattern): boolean;
|
|
2377
|
+
/**
|
|
2378
|
+
* Compiles a pattern to bytecode.
|
|
2379
|
+
*/
|
|
2380
|
+
declare function patternCompile(pattern: Pattern, code: Instr[], literals: Pattern[], captures: string[]): void;
|
|
2381
|
+
/**
|
|
2382
|
+
* Converts a pattern to string.
|
|
2383
|
+
*/
|
|
2384
|
+
declare function patternToString(pattern: Pattern): string;
|
|
2385
|
+
/**
|
|
2386
|
+
* Collects capture names from a pattern.
|
|
2387
|
+
*/
|
|
2388
|
+
declare function patternCollectCaptureNames(pattern: Pattern, out: string[]): void;
|
|
2389
|
+
/**
|
|
2390
|
+
* Creates a new Pattern that matches any CBOR value.
|
|
2391
|
+
*/
|
|
2392
|
+
declare function anyCbor(): Pattern;
|
|
2393
|
+
/**
|
|
2394
|
+
* Creates a new Pattern that matches a specific CBOR value.
|
|
2395
|
+
*/
|
|
2396
|
+
declare function cborValue(value: CborInput): Pattern;
|
|
2397
|
+
/**
|
|
2398
|
+
* Creates a new Pattern that matches CBOR values using dcbor-pattern expressions.
|
|
2399
|
+
*/
|
|
2400
|
+
declare function cborPattern(pattern: Pattern$1): Pattern;
|
|
2401
|
+
/**
|
|
2402
|
+
* Creates a new Pattern that matches any boolean value.
|
|
2403
|
+
*/
|
|
2404
|
+
declare function anyBool(): Pattern;
|
|
2405
|
+
/**
|
|
2406
|
+
* Creates a new Pattern that matches a specific boolean value.
|
|
2407
|
+
*/
|
|
2408
|
+
declare function bool(b: boolean): Pattern;
|
|
2409
|
+
/**
|
|
2410
|
+
* Creates a new Pattern that matches any text value.
|
|
2411
|
+
*/
|
|
2412
|
+
declare function anyText(): Pattern;
|
|
2413
|
+
/**
|
|
2414
|
+
* Creates a new Pattern that matches a specific text value.
|
|
2415
|
+
*/
|
|
2416
|
+
declare function text(value: string): Pattern;
|
|
2417
|
+
/**
|
|
2418
|
+
* Creates a new Pattern that matches text values that match the given regex.
|
|
2419
|
+
*/
|
|
2420
|
+
declare function textRegex(regex: RegExp): Pattern;
|
|
2421
|
+
/**
|
|
2422
|
+
* Creates a new Pattern that matches any Date value.
|
|
2423
|
+
*/
|
|
2424
|
+
declare function anyDate(): Pattern;
|
|
2425
|
+
/**
|
|
2426
|
+
* Creates a new Pattern that matches a specific Date value.
|
|
2427
|
+
*/
|
|
2428
|
+
declare function date(d: CborDate): Pattern;
|
|
2429
|
+
/**
|
|
2430
|
+
* Creates a new Pattern that matches Date values within a specified range.
|
|
2431
|
+
*/
|
|
2432
|
+
declare function dateRange(earliest: CborDate, latest: CborDate): Pattern;
|
|
2433
|
+
/**
|
|
2434
|
+
* Creates a new Pattern that matches any number value.
|
|
2435
|
+
*/
|
|
2436
|
+
declare function anyNumber(): Pattern;
|
|
2437
|
+
/**
|
|
2438
|
+
* Creates a new Pattern that matches a specific number value.
|
|
2439
|
+
*/
|
|
2440
|
+
declare function number(value: number): Pattern;
|
|
2441
|
+
/**
|
|
2442
|
+
* Creates a new Pattern that matches number values within a range.
|
|
2443
|
+
*/
|
|
2444
|
+
declare function numberRange(min: number, max: number): Pattern;
|
|
2445
|
+
/**
|
|
2446
|
+
* Creates a new Pattern that matches number values greater than the specified value.
|
|
2447
|
+
*/
|
|
2448
|
+
declare function numberGreaterThan(value: number): Pattern;
|
|
2449
|
+
/**
|
|
2450
|
+
* Creates a new Pattern that matches number values less than the specified value.
|
|
2451
|
+
*/
|
|
2452
|
+
declare function numberLessThan(value: number): Pattern;
|
|
2453
|
+
/**
|
|
2454
|
+
* Creates a new Pattern that matches any byte string value.
|
|
2455
|
+
*/
|
|
2456
|
+
declare function anyByteString(): Pattern;
|
|
2457
|
+
/**
|
|
2458
|
+
* Creates a new Pattern that matches a specific byte string value.
|
|
2459
|
+
*/
|
|
2460
|
+
declare function byteString(value: Uint8Array): Pattern;
|
|
2461
|
+
/**
|
|
2462
|
+
* Creates a new Pattern that matches any known value.
|
|
2463
|
+
*/
|
|
2464
|
+
declare function anyKnownValue(): Pattern;
|
|
2465
|
+
/**
|
|
2466
|
+
* Creates a new Pattern that matches a specific known value.
|
|
2467
|
+
*/
|
|
2468
|
+
declare function knownValue(value: KnownValue): Pattern;
|
|
2469
|
+
/**
|
|
2470
|
+
* Creates a new Pattern that matches the unit known value.
|
|
2471
|
+
*/
|
|
2472
|
+
declare function unit(): Pattern;
|
|
2473
|
+
/**
|
|
2474
|
+
* Creates a new Pattern that matches any array.
|
|
2475
|
+
*/
|
|
2476
|
+
declare function anyArray(): Pattern;
|
|
2477
|
+
/**
|
|
2478
|
+
* Creates a new Pattern that matches any map.
|
|
2479
|
+
*/
|
|
2480
|
+
declare function anyMap(): Pattern;
|
|
2481
|
+
/**
|
|
2482
|
+
* Creates a new Pattern that matches null.
|
|
2483
|
+
*/
|
|
2484
|
+
declare function nullPattern(): Pattern;
|
|
2485
|
+
/**
|
|
2486
|
+
* Creates a new Pattern that matches any tagged value.
|
|
2487
|
+
*/
|
|
2488
|
+
declare function anyTag(): Pattern;
|
|
2489
|
+
/**
|
|
2490
|
+
* Creates a new Pattern that matches a specific tagged value.
|
|
2491
|
+
*/
|
|
2492
|
+
declare function tagged(tag: Tag, pattern: Pattern$1): Pattern;
|
|
2493
|
+
/**
|
|
2494
|
+
* Creates a new Pattern that matches leaf envelopes.
|
|
2495
|
+
*/
|
|
2496
|
+
declare function leaf(): Pattern;
|
|
2497
|
+
/**
|
|
2498
|
+
* Creates a new Pattern that matches any assertion.
|
|
2499
|
+
*/
|
|
2500
|
+
declare function anyAssertion(): Pattern;
|
|
2501
|
+
/**
|
|
2502
|
+
* Creates a new Pattern that matches assertions with predicates matching pattern.
|
|
2503
|
+
*/
|
|
2504
|
+
declare function assertionWithPredicate(pattern: Pattern): Pattern;
|
|
2505
|
+
/**
|
|
2506
|
+
* Creates a new Pattern that matches assertions with objects matching pattern.
|
|
2507
|
+
*/
|
|
2508
|
+
declare function assertionWithObject(pattern: Pattern): Pattern;
|
|
2509
|
+
/**
|
|
2510
|
+
* Creates a new Pattern that matches any subject.
|
|
2511
|
+
*/
|
|
2512
|
+
declare function anySubject(): Pattern;
|
|
2513
|
+
/**
|
|
2514
|
+
* Creates a new Pattern that matches subjects matching pattern.
|
|
2515
|
+
*/
|
|
2516
|
+
declare function subject(pattern: Pattern): Pattern;
|
|
2517
|
+
/**
|
|
2518
|
+
* Creates a new Pattern that matches any predicate.
|
|
2519
|
+
*/
|
|
2520
|
+
declare function anyPredicate(): Pattern;
|
|
2521
|
+
/**
|
|
2522
|
+
* Creates a new Pattern that matches predicates matching pattern.
|
|
2523
|
+
*/
|
|
2524
|
+
declare function predicate(pattern: Pattern): Pattern;
|
|
2525
|
+
/**
|
|
2526
|
+
* Creates a new Pattern that matches any object.
|
|
2527
|
+
*/
|
|
2528
|
+
declare function anyObject(): Pattern;
|
|
2529
|
+
/**
|
|
2530
|
+
* Creates a new Pattern that matches objects matching pattern.
|
|
2531
|
+
*/
|
|
2532
|
+
declare function object(pattern: Pattern): Pattern;
|
|
2533
|
+
/**
|
|
2534
|
+
* Creates a new Pattern that matches a specific digest.
|
|
2535
|
+
*/
|
|
2536
|
+
declare function digest(d: Digest): Pattern;
|
|
2537
|
+
/**
|
|
2538
|
+
* Creates a new Pattern that matches digests with a prefix.
|
|
2539
|
+
*/
|
|
2540
|
+
declare function digestPrefix(prefix: Uint8Array): Pattern;
|
|
2541
|
+
/**
|
|
2542
|
+
* Creates a new Pattern that matches any node.
|
|
2543
|
+
*/
|
|
2544
|
+
declare function anyNode(): Pattern;
|
|
2545
|
+
/**
|
|
2546
|
+
* Creates a new Pattern that matches any obscured element.
|
|
2547
|
+
*/
|
|
2548
|
+
declare function obscured(): Pattern;
|
|
2549
|
+
/**
|
|
2550
|
+
* Creates a new Pattern that matches elided elements.
|
|
2551
|
+
*/
|
|
2552
|
+
declare function elided(): Pattern;
|
|
2553
|
+
/**
|
|
2554
|
+
* Creates a new Pattern that matches encrypted elements.
|
|
2555
|
+
*/
|
|
2556
|
+
declare function encrypted(): Pattern;
|
|
2557
|
+
/**
|
|
2558
|
+
* Creates a new Pattern that matches compressed elements.
|
|
2559
|
+
*/
|
|
2560
|
+
declare function compressed(): Pattern;
|
|
2561
|
+
/**
|
|
2562
|
+
* Creates a new Pattern that matches wrapped envelopes.
|
|
2563
|
+
*/
|
|
2564
|
+
declare function wrapped(): Pattern;
|
|
2565
|
+
/**
|
|
2566
|
+
* Creates a new Pattern that matches wrapped envelopes and descends.
|
|
2567
|
+
* Named `unwrapEnvelope` to avoid conflict with Result.unwrap.
|
|
2568
|
+
*/
|
|
2569
|
+
declare function unwrapEnvelope(): Pattern;
|
|
2570
|
+
/**
|
|
2571
|
+
* Creates a new Pattern that matches wrapped envelopes matching pattern.
|
|
2572
|
+
*/
|
|
2573
|
+
declare function unwrapMatching(pattern: Pattern): Pattern;
|
|
2574
|
+
/**
|
|
2575
|
+
* Creates a new Pattern that matches any element.
|
|
2576
|
+
*/
|
|
2577
|
+
declare function any(): Pattern;
|
|
2578
|
+
/**
|
|
2579
|
+
* Creates a new Pattern that matches if all patterns match.
|
|
2580
|
+
*/
|
|
2581
|
+
declare function and(patterns: Pattern[]): Pattern;
|
|
2582
|
+
/**
|
|
2583
|
+
* Creates a new Pattern that matches if any pattern matches.
|
|
2584
|
+
*/
|
|
2585
|
+
declare function or(patterns: Pattern[]): Pattern;
|
|
2586
|
+
/**
|
|
2587
|
+
* Creates a new Pattern that matches if the pattern does not match.
|
|
2588
|
+
*/
|
|
2589
|
+
declare function notMatching(pattern: Pattern): Pattern;
|
|
2590
|
+
/**
|
|
2591
|
+
* Creates a new Pattern that captures a match with a name.
|
|
2592
|
+
*/
|
|
2593
|
+
declare function capture(name: string, pattern: Pattern): Pattern;
|
|
2594
|
+
/**
|
|
2595
|
+
* Creates a new Pattern that searches for matches in the envelope tree.
|
|
2596
|
+
*/
|
|
2597
|
+
declare function search(pattern: Pattern): Pattern;
|
|
2598
|
+
/**
|
|
2599
|
+
* Creates a new Pattern that matches a traversal order of patterns.
|
|
2600
|
+
*/
|
|
2601
|
+
declare function traverse(patterns: Pattern[]): Pattern;
|
|
2602
|
+
/**
|
|
2603
|
+
* Creates a new Pattern that matches with repetition.
|
|
2604
|
+
*/
|
|
2605
|
+
declare function repeat(pattern: Pattern, min: number, max?: number, reluctance?: Reluctance$1): Pattern;
|
|
2606
|
+
/**
|
|
2607
|
+
* Creates a new Pattern for grouping.
|
|
2608
|
+
*/
|
|
2609
|
+
declare function group(pattern: Pattern): Pattern;
|
|
2610
|
+
//#endregion
|
|
2611
|
+
//#region src/parse/index.d.ts
|
|
2612
|
+
/**
|
|
2613
|
+
* Parse a pattern expression string into a Pattern.
|
|
2614
|
+
*/
|
|
2615
|
+
declare function parse(input: string): Result<Pattern>;
|
|
2616
|
+
/**
|
|
2617
|
+
* Parse a pattern, allowing extra data after the pattern.
|
|
2618
|
+
*/
|
|
2619
|
+
declare function parsePartial(input: string): Result<[Pattern, number]>;
|
|
2620
|
+
//#endregion
|
|
2621
|
+
//#region src/index.d.ts
|
|
2622
|
+
/**
|
|
2623
|
+
* Package version.
|
|
2624
|
+
*/
|
|
2625
|
+
declare const VERSION = "1.0.0-alpha.11";
|
|
2626
|
+
//#endregion
|
|
2627
|
+
export { AndPattern, AnyPattern, ArrayPattern, type ArrayPatternType, AssertionsPattern, type AssertionsPatternType, Axis, BoolPattern, ByteStringPattern, CBORPattern, type CBORPatternType, CapturePattern, DatePattern, DigestPattern, type DigestPatternType, EdgeType, EnvelopePatternError, FormatPathsOpts, FormatPathsOptsBuilder, GroupPattern, Instr, Interval, KnownValuePattern, LeafPattern, LeafStructurePattern, Lexer, MapPattern, type MapPatternType, Matcher, MatcherDefaults, MetaPattern, NodePattern, type NodePatternType, NotPattern, NullPattern, NumberPattern, ObjectPattern, type ObjectPatternType, ObscuredPattern, type ObscuredPatternType, OrPattern, Path, PathElementFormat, Pattern, PredicatePattern, type PredicatePatternType, Program, Quantifier, Reluctance, Result, SearchPattern, Span, StructurePattern, SubjectPattern, type SubjectPatternType, TaggedPattern, TextPattern, type Token, TraversePattern, VERSION, WrappedPattern, type WrappedPatternType, and, any, anyArray, anyAssertion, anyBool, anyByteString, anyCbor, anyDate, anyKnownValue, anyMap, anyNode, anyNumber, anyObject, anyPredicate, anySubject, anyTag, anyText, assertionWithObject, assertionWithPredicate, axisChildren, bool, byteString, capture, cborPattern, cborValue, compile, compileAsAtomic, compressed, date, dateRange, dcborPatternError, defaultFormatPathsOpts, defaultPathElementFormat, digest, digestPrefix, digestURFormat, elided, emptyInput, encrypted, envelopeSummary, envelopeURFormat, err, expectedCloseBracket, expectedCloseParen, expectedOpenBracket, expectedOpenParen, expectedPattern, extraData, formatError, formatPath, formatPathOpt, formatPaths, formatPathsOpt, formatPathsOpts, formatPathsWithCaptures, formatPathsWithCapturesOpt, group, invalidCaptureGroupName, invalidDateFormat, invalidHexString, invalidNumberFormat, invalidPattern, invalidRange, invalidRegex, invalidUr, isErr, isOk, knownValue, leaf, leafArray, leafBool, leafByteString, leafCbor, leafDate, leafKnownValue, leafMap, leafNull, leafNumber, leafPatternCompile, leafPatternIsComplex, leafPatternPaths, leafPatternPathsWithCaptures, leafPatternToString, leafTag, leafText, map, metaAnd, metaAny, metaCapture, metaGroup, metaNot, metaOr, metaPatternCollectCaptureNames, metaPatternCompile, metaPatternIsComplex, metaPatternPathsWithCaptures, metaPatternToString, metaSearch, metaTraverse, notMatching, nullPattern, number, numberGreaterThan, numberLessThan, numberRange, object, obscured, ok, or, parse, parsePartial, patternCollectCaptureNames, patternCompile, patternIsComplex, patternLeaf, patternMatches, patternMeta, patternPaths, patternPathsWithCaptures, patternStructure, patternToString, predicate, registerAndPatternFactory, registerAnyPatternFactory, registerArrayPatternFactory, registerAssertionsPatternFactory, registerBoolPatternFactory, registerByteStringPatternFactory, registerCBORPatternFactory, registerCapturePatternFactory, registerDatePatternFactory, registerDigestPatternFactory, registerGroupPatternFactory, registerKnownValuePatternFactory, registerLeafStructurePatternFactory, registerMapPatternFactory, registerNodePatternFactory, registerNotPatternFactory, registerNullPatternFactory, registerNumberPatternFactory, registerObjectPatternFactory, registerObscuredPatternFactory, registerOrPatternFactory, registerPredicatePatternFactory, registerSearchPatternFactory, registerSubjectPatternFactory, registerTaggedPatternFactory, registerTextPatternFactory, registerTraversePatternFactory, registerVMPatternFunctions, registerWrappedPatternFactory, repeat, run, search, structureAssertions, structureDigest, structureLeaf, structureNode, structureObject, structureObscured, structurePatternCompile, structurePatternIsComplex, structurePatternPaths, structurePatternPathsWithCaptures, structurePatternToString, structurePredicate, structureSubject, structureWrapped, subject, summaryFormat, tagged, text, textRegex, traverse, unexpectedEndOfInput, unexpectedToken, unit, unknown, unmatchedBraces, unmatchedParentheses, unrecognizedToken, unterminatedRegex, unwrap, unwrapEnvelope, unwrapMatching, unwrapOr, wrapped };
|
|
2628
|
+
//# sourceMappingURL=index.d.cts.map
|