-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.d.ts
39 lines (36 loc) · 951 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
declare namespace bchRegex {
interface Options {
/**
Only match an exact string. By default, it matches any BCH addresses in a string. Useful with `RegExp#test()` to check if a string is an BCH address.
@default false
*/
readonly exact?: boolean;
}
/**
Available BCH formats.
*/
type Format = 'legacy' | 'cashaddr'
}
declare const bchRegex: {
/**
Returns a regex for matching specific BCH format addresses.
@example
```
import bchRegex = require('bitcoincash-regex')
bchRegex.format('cashaddr', {exact: true}).test('bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a')
//=> true
```
*/
format: (format: bchRegex.Format, options?: bchRegex.Options) => RegExp;
/**
Returns a regex for matching BCH addresses.
@example
```
import bchRegex = require('bitcoincash-regex')
bchRegex().test('nodejsrocks 19hZx234vNtLazfx5J2bxHsiWEmeYE8a7k')
//=> true
```
*/
(options?: bchRegex.Options): RegExp;
}
export = bchRegex