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