re2js 0.3.3 → 0.4.1

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.
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * A compiled representation of an RE2 regular expression
3
3
  *
4
- * <p>
5
4
  * The matching functions take {@code String} arguments instead of the more general Java
6
5
  * {@code CharSequence} since the latter doesn't provide UTF-16 decoding.
7
6
  *
@@ -34,10 +33,9 @@ export class RE2JS {
34
33
  /**
35
34
  * Returns a literal pattern string for the specified string.
36
35
  *
37
- * <p>
38
36
  * This method produces a string that can be used to create a <code>RE2JS</code> that would
39
37
  * match the string <code>s</code> as if it were a literal pattern.
40
- * </p>
38
+ *
41
39
  * Metacharacters or escape sequences in the input sequence will be given no special meaning.
42
40
  *
43
41
  * @param {string} str The string to be literalized
@@ -50,7 +48,7 @@ export class RE2JS {
50
48
  * @param {number} [flags=0]
51
49
  * @returns {RE2JS}
52
50
  */
53
- static compile(regex: string, ...args: any[]): RE2JS;
51
+ static compile(regex: string, flags?: number): RE2JS;
54
52
  /**
55
53
  * Matches a string against a regular expression.
56
54
  *
@@ -107,7 +105,6 @@ export class RE2JS {
107
105
  * Splits input around instances of the regular expression. It returns an array giving the strings
108
106
  * that occur before, between, and after instances of the regular expression.
109
107
  *
110
- * <p>
111
108
  * If {@code limit <= 0}, there is no limit on the size of the returned array. If
112
109
  * {@code limit == 0}, empty strings that would occur at the end of the array are omitted. If
113
110
  * {@code limit > 0}, at most limit strings are returned. The final string contains the remainder
@@ -117,7 +114,7 @@ export class RE2JS {
117
114
  * @param {number} [limit=0] the limit
118
115
  * @returns {string[]} the split strings
119
116
  */
120
- split(input: string, ...args: any[]): string[];
117
+ split(input: string, limit?: number): string[];
121
118
  /**
122
119
  *
123
120
  * @returns {string}
@@ -165,7 +162,7 @@ export class RE2JSGroupException extends RE2JSException {
165
162
  * An exception thrown by the parser if the pattern was invalid.
166
163
  */
167
164
  export class RE2JSSyntaxException extends RE2JSException {
168
- constructor(error: any, ...args: any[]);
165
+ constructor(error: any, input?: any);
169
166
  error: any;
170
167
  input: any;
171
168
  /**
@@ -180,7 +177,6 @@ export class RE2JSSyntaxException extends RE2JSException {
180
177
  /**
181
178
  * A stateful iterator that interprets a regex {@code RE2JS} on a specific input.
182
179
  *
183
- * <p>
184
180
  * Conceptually, a Matcher consists of four parts:
185
181
  * <ol>
186
182
  * <li>A compiled regular expression {@code RE2JS}, set at construction and fixed for the lifetime
@@ -247,20 +243,20 @@ declare class Matcher {
247
243
  * @param {string|number} [group=0]
248
244
  * @returns {string}
249
245
  */
250
- start(...args: any[]): string;
246
+ start(group?: string | number): string;
251
247
  /**
252
248
  * Returns the end of the named group of the most recent match, or -1 if the group was not
253
249
  * matched.
254
250
  * @param {string|number} [group=0]
255
251
  * @returns {string}
256
252
  */
257
- end(...args: any[]): string;
253
+ end(group?: string | number): string;
258
254
  /**
259
255
  * Returns the named group of the most recent match, or {@code null} if the group was not matched.
260
256
  * @param {string|number} [group=0]
261
257
  * @returns {string}
262
258
  */
263
- group(...args: any[]): string;
259
+ group(group?: string | number): string;
264
260
  /**
265
261
  * Returns the number of subgroups in this pattern.
266
262
  *
@@ -295,7 +291,7 @@ declare class Matcher {
295
291
  * @returns {boolean} if it finds a match
296
292
  * @throws IndexOutOfBoundsException if start is not a valid input position
297
293
  */
298
- find(...args: any[]): boolean;
294
+ find(start?: string | number): boolean;
299
295
  /**
300
296
  * Helper: does match starting at start, with RE2 anchor flag.
301
297
  * @param {number} startByte
@@ -322,12 +318,10 @@ declare class Matcher {
322
318
  * the form {@code $n}, where {@code n} is the group number in decimal. It advances the append
323
319
  * position to where the most recent match ended.
324
320
  *
325
- * <p>
326
321
  * To embed a literal {@code $}, use \$ (actually {@code "\\$"} with string escapes). The escape
327
322
  * is only necessary when {@code $} is followed by a digit, but it is always allowed. Only
328
323
  * {@code $} and {@code \} need escaping, but any character can be escaped.
329
324
  *
330
- * <p>
331
325
  * The group number {@code n} in {@code $n} is always at least one digit and expands to use more
332
326
  * digits as long as the resulting number is a valid group number for this pattern. To cut it off
333
327
  * earlier, escape the first digit that should not be used.
@@ -367,7 +361,7 @@ declare class Matcher {
367
361
  * @returns {string} the input string with the matches replaced
368
362
  * @throws IndexOutOfBoundsException if replacement refers to an invalid group and perlMode is false
369
363
  */
370
- replaceAll(replacement: string, ...args: any[]): string;
364
+ replaceAll(replacement: string, perlMode?: boolean): string;
371
365
  /**
372
366
  * Returns the input with the first match replaced by {@code replacement}, interpreted as for
373
367
  * {@code appendReplacement}.
@@ -377,7 +371,7 @@ declare class Matcher {
377
371
  * @returns {string} the input string with the first match replaced
378
372
  * @throws IndexOutOfBoundsException if replacement refers to an invalid group and perlMode is false
379
373
  */
380
- replaceFirst(replacement: string, ...args: any[]): string;
374
+ replaceFirst(replacement: string, perlMode?: boolean): string;
381
375
  /**
382
376
  * Helper: replaceAll/replaceFirst hybrid.
383
377
  * @param {string} replacement - the replacement string
@@ -389,7 +383,7 @@ declare class Matcher {
389
383
  private replace;
390
384
  }
391
385
  declare class Utf8MatcherInput extends MatcherInputBase {
392
- constructor(...args: any[]);
386
+ constructor(bytes?: any);
393
387
  bytes: any;
394
388
  getEncoding(): any;
395
389
  /**
@@ -409,7 +403,7 @@ declare class Utf8MatcherInput extends MatcherInputBase {
409
403
  length(): number;
410
404
  }
411
405
  declare class Utf16MatcherInput extends MatcherInputBase {
412
- constructor(...args: any[]);
406
+ constructor(charSequence?: any);
413
407
  charSequence: any;
414
408
  getEncoding(): any;
415
409
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.d.ts","sourceRoot":"","sources":["index.esm.js"],"names":[],"mappings":"AA27KA;;;;;;;;;;GAUG;AACH;IACE;;OAEG;IACH,gCAA4B;IAC5B;;OAEG;IACH,sBAAkB;IAClB;;;OAGG;IACH,yBAAqB;IACrB;;OAEG;IACH,sCAAkC;IAClC;;OAEG;IACH,6BAA0B;IAE1B;;;;;;;;;;;OAWG;IACH,kBAHW,MAAM,GAC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CAIlB;CACF;AA3FD;;GAEG;AACH;IACE,8BAAkD;IAClD,oBAEC;IAED;;;OAGG;IACH,kBAFa,OAAO,CAInB;IAED;;;OAGG;IACH,mBAFa,OAAO,CAInB;CACF"}
1
+ {"version":3,"file":"index.esm.d.ts","sourceRoot":"","sources":["index.esm.js"],"names":[],"mappings":"AAs4KA;;;;;;;;;GASG;AACH;IACE;;OAEG;IACH,gCAA4B;IAC5B;;OAEG;IACH,sBAAkB;IAClB;;;OAGG;IACH,yBAAqB;IACrB;;OAEG;IACH,sCAAkC;IAClC;;OAEG;IACH,6BAA0B;IAE1B;;;;;;;;;;OAUG;IACH,kBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;;;OAKG;IACH,sBAJW,MAAM,UACN,MAAM,GACJ,KAAK,CAwBjB;IAED;;;;;;;OAOG;IACH,sBALW,MAAM,SACN,MAAM,GAAC,MAAM,EAAE,GACb,OAAO,CAKnB;IAED;;;OAGG;IACH,wBAWC;IAED;;;;OAIG;IACH,qBAHW,MAAM,SACN,MAAM,EAOhB;IAHC,qBAA2B;IAE3B,mBAAuB;IAGzB;;;OAGG;IACH,cAEC;IAED;;;OAGG;IACH,SAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,WAFa,MAAM,CAIlB;IACD,WAEC;IAED;;;;;OAKG;IACH,eAHW,MAAM,GAAC,MAAM,EAAE,GACb,OAAO,CAInB;IAED;;;;;OAKG;IACH,eAHW,MAAM,GAAC,MAAM,EAAE,GACb,OAAO,CAOnB;IAED;;;;;;;;;;;;OAYG;IACH,aAJW,MAAM,UACN,MAAM,GACJ,MAAM,EAAE,CAgDpB;IAED;;;OAGG;IACH,YAFa,MAAM,CAIlB;IAED;;;;;OAKG;IACH,cAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,mBAEC;IAED;;;;OAIG;IACH,oBAFa,OAAO,CAUnB;CACF;AA90JD;;GAEG;AACH;CAKC;AA9CD;IACE,0BAGC;CACF;AAqDD;;GAEG;AACH;CAKC;A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