1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | export = get;
|
9 |
|
10 | declare function get<T>(obj: T): T;
|
11 | declare function get(obj: object, key: string | string[], options?: get.Options): any;
|
12 |
|
13 | declare namespace get {
|
14 | interface Options {
|
15 | |
16 |
|
17 |
|
18 |
|
19 |
|
20 | default?: any;
|
21 | |
22 |
|
23 |
|
24 |
|
25 | isValid?: (<K extends string>(key: K, object: Record<K, any>) => boolean) | undefined;
|
26 | /**
|
27 | * Custom function to use for splitting the string into object path segments.
|
28 | *
|
29 | * default: `String.split`
|
30 | */
|
31 | split?: ((s: string) => string[]) | undefined;
|
32 | /**
|
33 | * The separator to use for spliting the string.
|
34 | * (this is probably not needed when `options.split` is used).
|
35 | *
|
36 | * default: `"."`
|
37 | */
|
38 | separator?: string | RegExp | undefined;
|
39 | /**
|
40 | * Customize how the object path is created when iterating over path segments.
|
41 | *
|
42 | * default: `Array.join`
|
43 | */
|
44 | join?: ((segs: string[]) => string) | undefined;
|
45 | /**
|
46 | * The character to use when re-joining the string to check for keys
|
47 | * with dots in them (this is probably not needed when `options.join` is used).
|
48 | * This can be a different value than the separator, since the separator can be a string or regex.
|
49 | *
|
50 | * default: `"."`
|
51 | */
|
52 | joinChar?: string | undefined;
|
53 | }
|
54 | }
|
55 |
|
\ | No newline at end of file |