rregex 1.0.5 → 1.0.7

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/lib/module.d.ts DELETED
@@ -1,512 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * @param {string} text
5
- * @returns {string}
6
- */
7
- export function escape(text: string): string;
8
-
9
- export type Hir = {
10
- '@type': 'struct'
11
- '@name': 'regex_syntax::hir::Hir'
12
- kind: HirKind
13
- }
14
-
15
-
16
-
17
- export type HirKind =
18
- | HirKindEmptyVariant
19
- | HirKindLiteralVariant
20
- | HirKindClassVariant
21
- | HirKindAnchorVariant
22
- | HirKindWordBoundaryVariant
23
- | HirKindRepetitionVariant
24
- | HirKindGroupVariant
25
- | HirKindConcatVariant
26
- | HirKindAlternationVariant
27
-
28
- export type HirKindEmptyVariant = {
29
- '@type': 'struct'
30
- '@name': 'regex_syntax::hir::HirKind'
31
- '@variant': 'Empty'
32
- }
33
-
34
- export type HirKindLiteralVariant = {
35
- '@type': 'struct'
36
- '@name': 'regex_syntax::hir::HirKind'
37
- '@variant': 'Literal'
38
- 'value': Literal
39
- }
40
-
41
- export type HirKindClassVariant = {
42
- '@type': 'struct'
43
- '@name': 'regex_syntax::hir::HirKind'
44
- '@variant': 'Class'
45
- 'value': Class
46
- }
47
-
48
- export type HirKindAnchorVariant = {
49
- '@type': 'struct'
50
- '@name': 'regex_syntax::hir::HirKind'
51
- '@variant': 'Anchor'
52
- 'value': Anchor
53
- }
54
-
55
- export type HirKindWordBoundaryVariant = {
56
- '@type': 'struct'
57
- '@name': 'regex_syntax::hir::HirKind'
58
- '@variant': 'WordBoundary'
59
- 'value': WordBoundary
60
- }
61
-
62
- export type HirKindRepetitionVariant = {
63
- '@type': 'struct'
64
- '@name': 'regex_syntax::hir::HirKind'
65
- '@variant': 'Repetition'
66
- 'value': Repetition
67
- }
68
-
69
- export type HirKindGroupVariant = {
70
- '@type': 'struct'
71
- '@name': 'regex_syntax::hir::HirKind'
72
- '@variant': 'Group'
73
- 'value': Group
74
- }
75
-
76
- export type HirKindConcatVariant = {
77
- '@type': 'struct'
78
- '@name': 'regex_syntax::hir::HirKind'
79
- '@variant': 'Concat'
80
- 'value': Hir[]
81
- }
82
-
83
- export type HirKindAlternationVariant = {
84
- '@type': 'struct'
85
- '@name': 'regex_syntax::hir::HirKind'
86
- '@variant': 'Alternation'
87
- 'value': Hir[]
88
- }
89
-
90
-
91
-
92
- export type Literal =
93
- | LiteralUnicodeVariant
94
- | LiteralByteVariant
95
-
96
- export type LiteralUnicodeVariant = {
97
- '@type': 'struct'
98
- '@name': 'regex_syntax::hir::Literal'
99
- '@variant': 'Unicode'
100
- 'value': string
101
- }
102
-
103
- export type LiteralByteVariant = {
104
- '@type': 'struct'
105
- '@name': 'regex_syntax::hir::Literal'
106
- '@variant': 'Byte'
107
- 'value': number
108
- }
109
-
110
-
111
-
112
- export type Class =
113
- | ClassUnicodeVariant
114
- | ClassByteVariant
115
-
116
- export type ClassUnicodeVariant = {
117
- '@type': 'struct'
118
- '@name': 'regex_syntax::hir::Class'
119
- '@variant': 'Unicode'
120
- 'value': ClassUnicode
121
- }
122
-
123
- export type ClassByteVariant = {
124
- '@type': 'struct'
125
- '@name': 'regex_syntax::hir::Class'
126
- '@variant': 'Bytes'
127
- 'value': ClassBytes
128
- }
129
-
130
-
131
-
132
- export type ClassUnicode = {
133
- '@type': 'struct'
134
- '@name': 'regex_syntax::hir::ClassUnicode'
135
- 'ranges': ClassUnicodeRange[]
136
- }
137
-
138
-
139
-
140
- export type ClassUnicodeRange = {
141
- '@type': 'struct'
142
- '@name': 'regex_syntax::hir::ClassUnicodeRange'
143
- start: string
144
- end: string
145
- }
146
-
147
-
148
-
149
- export type ClassBytes = {
150
- '@type': 'struct'
151
- '@name': 'regex_syntax::hir::ClassBytes'
152
- ranges: ClassBytesRange[]
153
- }
154
-
155
-
156
-
157
- export type ClassBytesRange = {
158
- '@type': 'struct'
159
- '@name': 'regex_syntax::hir::ClassBytesRange'
160
- start: number
161
- end: number
162
- }
163
-
164
-
165
-
166
- export type Anchor =
167
- | AnchorStartLineVariant
168
- | AnchorEndLineVariant
169
- | AnchorStartTextVariant
170
- | AnchorEndTextVariant
171
-
172
- export type AnchorStartLineVariant = {
173
- '@type': 'struct'
174
- '@name': 'regex_syntax::hir::Anchor'
175
- '@variant': 'StartLine'
176
- }
177
-
178
- export type AnchorEndLineVariant = {
179
- '@type': 'struct'
180
- '@name': 'regex_syntax::hir::Anchor'
181
- '@variant': 'EndLine'
182
- }
183
-
184
- export type AnchorStartTextVariant = {
185
- '@type': 'struct'
186
- '@name': 'regex_syntax::hir::Anchor'
187
- '@variant': 'StartText'
188
- }
189
-
190
- export type AnchorEndTextVariant = {
191
- '@type': 'struct'
192
- '@name': 'regex_syntax::hir::Anchor'
193
- '@variant': 'EndText'
194
- }
195
-
196
-
197
-
198
- export type WordBoundary =
199
- | WordBoundaryAsciiVariant
200
- | WordBoundaryAsciiNegateVariant
201
- | WordBoundaryUnicodeVariant
202
- | WordBoundaryUnicodeNegateVariant
203
-
204
- export type WordBoundaryAsciiVariant = {
205
- '@type': 'struct'
206
- '@name': 'regex_syntax::hir::WordBoundary'
207
- '@variant': 'Ascii'
208
- }
209
-
210
- export type WordBoundaryAsciiNegateVariant = {
211
- '@type': 'struct'
212
- '@name': 'regex_syntax::hir::WordBoundary'
213
- '@variant': 'AsciiNegate'
214
- }
215
-
216
- export type WordBoundaryUnicodeVariant = {
217
- '@type': 'struct'
218
- '@name': 'regex_syntax::hir::WordBoundary'
219
- '@variant': 'Unicode'
220
- }
221
-
222
- export type WordBoundaryUnicodeNegateVariant = {
223
- '@type': 'struct'
224
- '@name': 'regex_syntax::hir::WordBoundary'
225
- '@variant': 'UnicodeNegate'
226
- }
227
-
228
-
229
-
230
- export type Repetition = {
231
- '@type': 'struct'
232
- '@name': 'regex_syntax::hir::Repetition'
233
- greedy: boolean
234
- kind: RepetitionKind
235
- hir: Hir
236
- }
237
-
238
-
239
-
240
- export type RepetitionKind =
241
- | RepetitionKindZeroOrOneVariant
242
- | RepetitionKindZeroOrMoreVariant
243
- | RepetitionKindOneOrMoreVariant
244
- | RepetitionKindRangeVariant
245
-
246
- export type RepetitionKindZeroOrOneVariant = {
247
- '@type': 'struct'
248
- '@name': 'regex_syntax::hir::Repetition'
249
- '@variant': 'ZeroOrOne'
250
- }
251
-
252
- export type RepetitionKindZeroOrMoreVariant = {
253
- '@type': 'struct'
254
- '@name': 'regex_syntax::hir::Repetition'
255
- '@variant': 'ZeroOrMore'
256
- }
257
-
258
- export type RepetitionKindOneOrMoreVariant = {
259
- '@type': 'struct'
260
- '@name': 'regex_syntax::hir::Repetition'
261
- '@variant': 'OneOrMore'
262
- }
263
-
264
- export type RepetitionKindRangeVariant = {
265
- '@type': 'struct'
266
- '@name': 'regex_syntax::hir::Repetition'
267
- '@variant': 'Range'
268
- value: RepetitionRange
269
- }
270
-
271
-
272
-
273
- export type RepetitionRange =
274
- | RepetitionRangeExactlyVariant
275
- | RepetitionRangeAtLeastVariant
276
- | RepetitionRangeBoundedVariant
277
-
278
- export type RepetitionRangeExactlyVariant = {
279
- '@type': 'struct'
280
- '@name': 'regex_syntax::hir::RepetitionRange'
281
- '@variant': 'Exactly'
282
- value: number
283
- }
284
-
285
- export type RepetitionRangeAtLeastVariant = {
286
- '@type': 'struct'
287
- '@name': 'regex_syntax::hir::RepetitionRange'
288
- '@variant': 'AtLeast'
289
- value: number
290
- }
291
-
292
- export type RepetitionRangeBoundedVariant = {
293
- '@type': 'struct'
294
- '@name': 'regex_syntax::hir::RepetitionRange'
295
- '@variant': 'Bounded'
296
- value: [number, number]
297
- }
298
-
299
-
300
-
301
- export type Group = {
302
- '@type': 'struct'
303
- '@name': 'regex_syntax::hir::Group'
304
- kind: GroupKind
305
- hir: Hir
306
- }
307
-
308
-
309
-
310
- export type GroupKind =
311
- | GroupKindCaptureIndexVariant
312
- | GroupKindCaptureNameVariant
313
- | GroupKindNonCapturingVariant
314
-
315
- export type GroupKindCaptureIndexVariant = {
316
- '@type': 'struct'
317
- '@name': 'regex_syntax::hir::GroupKind'
318
- '@variant': 'CaptureIndex'
319
- index: number
320
- }
321
-
322
- export type GroupKindCaptureNameVariant = {
323
- '@type': 'struct'
324
- '@name': 'regex_syntax::hir::GroupKind'
325
- '@variant': 'CaptureName'
326
- index: number
327
- name: string
328
- }
329
-
330
- export type GroupKindNonCapturingVariant = {
331
- '@type': 'struct'
332
- '@name': 'regex_syntax::hir::GroupKind'
333
- '@variant': 'NonCapturing'
334
- }
335
-
336
-
337
-
338
- export type Match = {
339
- start: number
340
- end: number
341
- value: string
342
- }
343
-
344
-
345
- /**
346
- * A compiled regular expression for matching Unicode strings.
347
- * @see https://docs.rs/regex/latest/regex/
348
- */
349
- export class RRegex {
350
- free(): void;
351
- /**
352
- * Compiles a regular expression. Once compiled, it can be used repeatedly to search, split or replace text in a string.
353
- * If an invalid expression is given, then an error is returned.
354
- * @param {string} re
355
- */
356
- constructor(re: string);
357
- /**
358
- * Returns true if and only if there is a match for the regex in the string given.
359
- * It is recommended to use this method if all you need to do is test a match, since the underlying matching engine may be able to do less work.
360
- * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.is_match
361
- * @param {string} text
362
- * @returns {boolean}
363
- */
364
- isMatch(text: string): boolean;
365
- /**
366
- * Returns the same as is_match, but starts the search at the given offset.
367
- * The significance of the starting point is that it takes the surrounding context into consideration. For example, the `\A` anchor can only match when `start == 0`.
368
- * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.is_match_at
369
- * @param {string} text
370
- * @param {number} start
371
- * @returns {boolean}
372
- */
373
- isMatchAt(text: string, start: number): boolean;
374
- /**
375
- * Returns the start and end byte range of the leftmost-first match in `text`. If no match exists, then `undefined` is returned.
376
- * Note that this should only be used if you want to discover the position of the match. Testing the existence of a match is faster if you use `is_match`.
377
- * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.find
378
- * @param {string} text
379
- * @returns {any}
380
- */
381
- find(text: string): Match | undefined;
382
- /**
383
- * Returns the same as find, but starts the search at the given offset.
384
- * The significance of the starting point is that it takes the surrounding context into consideration. For example, the \A anchor can only match when `start == 0`.
385
- * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.find_at
386
- * @param {string} text
387
- * @param {number} start
388
- * @returns {any}
389
- */
390
- findAt(text: string, start: number): Match | undefined;
391
- /**
392
- * Returns an array for each successive non-overlapping match in text, returning the start and end byte indices with respect to text.
393
- * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.find_iter
394
- * @param {string} text
395
- * @returns {any}
396
- */
397
- findAll(text: string): Match[];
398
- /**
399
- * Replaces the leftmost-first match with the replacement provided.
400
- * The replacement can be a regular string (where `$N` and `$name` are expanded to match capture groups) or a function that takes the matches’ `Captures` and returns the replaced string.
401
- * If no match is found, then a copy of the string is returned unchanged.
402
- * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.replace
403
- * @param {string} text
404
- * @param {string} rep
405
- * @returns {string}
406
- */
407
- replace(text: string, rep: string): string;
408
- /**
409
- * Replaces at most `limit` non-overlapping matches in `text` with the replacement provided. If `limit` is 0, then all non-overlapping matches are replaced.
410
- * See the documentation for `replace` for details on how to access capturing group matches in the replacement string.
411
- * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.replacen
412
- * @param {string} text
413
- * @param {number} limit
414
- * @param {string} rep
415
- * @returns {string}
416
- */
417
- replacen(text: string, limit: number, rep: string): string;
418
- /**
419
- * Replaces all non-overlapping matches in `text` with the replacement provided. This is the same as calling `replacen` with `limit` set to `0`.
420
- * See the documentation for `replace` for details on how to access capturing group matches in the replacement string.
421
- * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.replace_all
422
- * @param {string} text
423
- * @param {string} rep
424
- * @returns {string}
425
- */
426
- replaceAll(text: string, rep: string): string;
427
- /**
428
- * Returns an iterator of substrings of `text` delimited by a match of the regular expression. Namely, each element of the iterator corresponds to text that isn’t matched by the regular expression.
429
- * This method will not copy the text given.
430
- * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.split
431
- * @param {string} text
432
- * @returns {any}
433
- */
434
- split(text: string): string[];
435
- /**
436
- * Returns an iterator of at most `limit` substrings of `text` delimited by a match of the regular expression. (A limit of 0 will return no substrings.) Namely, each element of the iterator corresponds to text that isn’t matched by the regular expression. The remainder of the string that is not split will be the last element in the iterator.
437
- * This method will not copy the text given.
438
- * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.splitn
439
- * @param {string} text
440
- * @param {number} limit
441
- * @returns {any}
442
- */
443
- splitn(text: string, limit: number): string[];
444
- /**
445
- * Returns the end location of a match in the text given.
446
- * This method may have the same performance characteristics as `is_match`, except it provides an end location for a match. In particular, the location returned may be shorter than the proper end of the leftmost-first match.
447
- * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.shortest_match
448
- * @param {string} text
449
- * @returns {number | undefined}
450
- */
451
- shortestMatch(text: string): number | undefined;
452
- /**
453
- * Returns the same as shortest_match, but starts the search at the given offset.
454
- * The significance of the starting point is that it takes the surrounding context into consideration. For example, the \A anchor can only match when `start == 0`.
455
- * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.shortest_match_at
456
- * @param {string} text
457
- * @param {number} limit
458
- * @returns {number | undefined}
459
- */
460
- shortestMatchAt(text: string, limit: number): number | undefined;
461
- /**
462
- * Return the Regex syntax object
463
- * @returns {any}
464
- */
465
- syntax(): Hir;
466
- /**
467
- * Returns a string representing the regular expression
468
- * @returns {string}
469
- */
470
- toString(): string;
471
- }
472
- /**
473
- * Match multiple (possibly overlapping) regular expressions in a single scan.
474
- * A regex set corresponds to the union of two or more regular expressions. That is, a regex set will match text where at least one of its constituent regular expressions matches. A regex set as its formulated here provides a touch more power: it will also report which regular expressions in the set match. Indeed, this is the key difference between regex sets and a single `Regex` with many alternates, since only one alternate can match at a time.
475
- * @see https://docs.rs/regex/latest/regex/struct.RegexSet.html#method.empty
476
- */
477
- export class RRegexSet {
478
- free(): void;
479
- /**
480
- * Create a new regex set with the given regular expressions.
481
- * @param {Array<any>} list
482
- */
483
- constructor(list: Array<any>);
484
- /**
485
- * Returns true if and only if one of the regexes in this set matches the text given.
486
- * This method should be preferred if you only need to test whether any of the regexes in the set should match, but don’t care about which regexes matched. This is because the underlying matching engine will quit immediately after seeing the first match instead of continuing to find all matches.
487
- * @see https://docs.rs/regex/latest/regex/struct.RegexSet.html#method.is_match
488
- * @param {string} text
489
- * @returns {boolean}
490
- */
491
- isMatch(text: string): boolean;
492
- /**
493
- * Returns the set of regular expressions that match in the given text.
494
- * The set returned contains the index of each regular expression that matches in the given text. The index is in correspondence with the order of regular expressions given to RegexSet’s constructor.
495
- * the set can also be used to iterate over the matched indices.
496
- * @param {string} text
497
- * @returns {any}
498
- */
499
- matches(text: string): any;
500
- }
501
-
502
- export const metadata: {
503
- "name": "rregex",
504
- "description": "Rust Regex binding for Javascript",
505
- "authors": [
506
- "Fede Ramirez <i@2fd.me>"
507
- ],
508
- "homepage": "https://2fd.github.io/rregex",
509
- "repository": "https://github.com/2fd/rregex",
510
- "regex": "1.0.6",
511
- "regex-syntax": "0.6.25"
512
- }