-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
50 lines (43 loc) · 1.51 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
/// <reference types="@types/zen-observable" />
import * as events from "events";
declare class Config<T> extends events.EventEmitter {
// Constructor
constructor(configFilePath: string, options?: Config.Options);
// Properties
public configFile: string;
public schemaFile: string;
public createOnNoEntry: boolean;
public writeOnSet: boolean;
public autoReload: boolean;
public autoReloadActivated: boolean;
public reloadDelay: number;
public configHasBeenRead: boolean;
public subscriptionObservers: Array<[string, ZenObservable.SubscriptionObserver<any>]>;
public payload: T;
public defaultSchema: object;
// Static properties
static DEFAULTSchema: object;
static STRINGIFY_SPACE: number;
static SUPPORTED_EXT: Set<string>;
static DEFAULT_EXTENSION: ".json" | ".toml";
// Methods
public read(defaultPayload?: T): Promise<this>;
public setupAutoReload(): boolean;
public get<H>(fieldPath: string, depth?: number): H;
public set<H>(fieldPath: string, fieldValue: H): void;
public observableOf<H>(fieldPath: string, depth?: number): ZenObservable.ObservableLike<H>;
public writeOnDisk(): Promise<void>;
public lazyWriteOnDisk(): void;
public close(): Promise<void>;
}
declare namespace Config {
interface Options {
createOnNoEntry?: boolean;
writeOnSet?: boolean;
autoReload?: boolean;
reloadDelay?: number;
defaultSchema?: object;
}
}
export as namespace Config;
export = Config;