1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | export declare var version: string;
|
12 | export declare var stores: any;
|
13 | export declare var sources: any[];
|
14 |
|
15 | export declare function clear(key: string, callback?: ICallbackFunction): any;
|
16 | export function get(key?: string, callback?: ICallbackFunction): any;
|
17 | export declare function merge(key: string, value: any, callback?: ICallbackFunction): any;
|
18 | export declare function set(key: string, value: any, callback?: ICallbackFunction): any;
|
19 | export declare function reset(callback?: ICallbackFunction): any;
|
20 | export declare function any(keys: string[], callback?: ICallbackFunction): any;
|
21 |
|
22 | export declare function load(callback?: ICallbackFunction): any;
|
23 | export declare function mergeSources(data: any): void;
|
24 | export declare function loadSources(): any;
|
25 | export declare function save(value: any, callback?: ICallbackFunction): any;
|
26 |
|
27 | export declare function add(name: string, options?: IOptions): Provider;
|
28 | export declare function argv(options?: IOptions): Provider;
|
29 | export declare function env(options?: IOptions): Provider;
|
30 | export declare function env(separator: string): Provider;
|
31 | export declare function file(name: string, options?: IFileOptions): Provider;
|
32 | export declare function file(name: string, filename: string): Provider;
|
33 | export declare function file(options: IFileOptions): Provider;
|
34 | export declare function use(name: string, options?: IOptions): Provider;
|
35 | export declare function defaults(options?: IOptions): Provider;
|
36 | export declare function init(options?: IOptions): void;
|
37 | export declare function overrides(options?: IOptions): Provider;
|
38 | export declare function remove(name: string): void;
|
39 | export declare function required(keys: string[]): Provider;
|
40 | export declare function create(name: string, options: IOptions): IStore;
|
41 |
|
42 | export declare function key(...values: any[]): string;
|
43 | export declare function path(key: any): any[];
|
44 | export declare function loadFiles(files: any, callback?: ICallbackFunction): void;
|
45 | export declare function loadFilesSync(files: any, callback?: ICallbackFunction): void;
|
46 |
|
47 | export interface IFormats {
|
48 | json: IFormat;
|
49 | ini: IFormat;
|
50 | }
|
51 | export declare var formats: IFormats;
|
52 |
|
53 | export interface IFormat {
|
54 | stringify: (obj: any, replacer: any, spacing?: any) => string;
|
55 | parse: (str: string) => any;
|
56 | }
|
57 |
|
58 | export interface IOptions {
|
59 | [index: string]: any;
|
60 | }
|
61 |
|
62 | export interface ISecureFileOptions {
|
63 | secret: string;
|
64 | alg?: string | undefined;
|
65 | }
|
66 |
|
67 | export interface IFileOptions {
|
68 | type?: string | undefined;
|
69 | file?: string | undefined;
|
70 | dir?: string | undefined;
|
71 | search?: boolean | undefined;
|
72 | format?: IFormat | undefined;
|
73 | json_spacing?: number | undefined;
|
74 | secure?: ISecureFileOptions | undefined;
|
75 | }
|
76 |
|
77 | export interface ICallbackFunction {
|
78 | (err: Error): void;
|
79 | }
|
80 |
|
81 | export declare class Provider {
|
82 | constructor(options?: IOptions);
|
83 |
|
84 | stores: any;
|
85 | sources: any[];
|
86 |
|
87 | clear(key: string, callback?: ICallbackFunction): any;
|
88 | get(key?: string, callback?: ICallbackFunction): any;
|
89 | merge(key: string, value: any, callback?: ICallbackFunction): any;
|
90 | set(key: string, value: any, callback?: ICallbackFunction): any;
|
91 | reset(callback?: ICallbackFunction): any;
|
92 | any(keys: string[], callback?: ICallbackFunction): any;
|
93 |
|
94 | load(callback?: ICallbackFunction): any;
|
95 | mergeSources(data: any): void;
|
96 | loadSources(): any;
|
97 | save(value: any, callback?: ICallbackFunction): any;
|
98 |
|
99 | add(name: string, options?: IOptions): Provider;
|
100 | argv(options?: IOptions): Provider;
|
101 | env(options?: IOptions): Provider;
|
102 | env(separator: string): Provider;
|
103 | file(name: string, options?: IFileOptions): Provider;
|
104 | file(name: string, filename: string): Provider;
|
105 | file(options: IFileOptions): Provider;
|
106 | use(name: string, options?: IOptions): Provider;
|
107 |
|
108 | defaults(options?: IOptions): Provider;
|
109 | init(options?: IOptions): void;
|
110 | overrides(options?: IOptions): Provider;
|
111 | remove(name: string): void;
|
112 | required(keys: string[]): Provider;
|
113 | create(name: string, options: IOptions): IStore;
|
114 | }
|
115 |
|
116 | export interface IStore {
|
117 | type: string;
|
118 | get(key: string): any;
|
119 | set(key: string, value: any): boolean;
|
120 | clear(key: string): boolean;
|
121 | merge(key: string, value: any): boolean;
|
122 | reset(callback?: ICallbackFunction): boolean;
|
123 | }
|