/
index.d.ts
99 lines (89 loc) · 3.56 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
declare namespace Module {
/* tslint:disable:no-unnecessary-generics */
function register<T>(
moduleName: string,
moduleProperties: ThisType<NonNullable<ModuleProperties<T>>> & Partial<ModuleProperties<T>>,
): void;
interface ModuleProperties<T> {
readonly name: string;
readonly identifier: string;
readonly hidden: boolean;
readonly data: { classes: string; file: string; path: string; header: string; position: string };
readonly lockStrings: string[];
config: T;
defaults: T;
requiresVersion: string;
// Subclassable methods
init: () => void;
loaded: (callback?: () => void) => void;
start: () => void;
getScripts: () => string[];
getStyles: () => string[];
getTranslations: () => { [key: string]: string };
getTemplate: () => string;
getTemplateData: () => any;
getDom: () => HTMLElement;
getHeader: () => string;
notificationReceived: (notification: string, payload: any, sender: ModuleProperties<any>) => void;
socketNotificationReceived: (notification: string, payload: any) => void;
suspend: () => void;
resume: () => void;
// Instance methods
readonly file: (filename: string) => string;
readonly updateDom: (speed?: number) => void;
readonly sendNotification: (notification: string, payload: any) => void;
readonly sendSocketNotification: (notification: string, payload: any) => void;
readonly hide: NonNullable<(speed?: number, callback?: () => void, options?: { lockString: string }) => void>;
readonly show: (
speed?: number,
callback?: () => void,
options?: { lockString?: string; force?: boolean; onError?: () => void },
) => void;
readonly translate: (identifier: string, variables?: any) => string;
[key: string]: any;
}
}
/* tslint:disable:no-single-declare-module */
declare module "node_helper" {
function create(object: ThisType<NonNullable<NodeHelperModule>> & Partial<NodeHelperModule>): void;
interface NodeHelperModule {
readonly name: string;
readonly path: string;
readonly expressApp: any;
readonly io: any;
readonly requiresVersion: string;
// Subclassable methods
init: () => void;
start: () => void;
stop: () => void;
socketNotificationReceived: (notification: string, payload: any) => void;
sendSocketNotification: (notification: string, payload: any) => void;
[key: string]: any;
}
}
declare module "logger" {
function debug(message?: any, ...optionalParams: any[]): void;
function info(message?: any, ...optionalParams: any[]): void;
function log(message?: any, ...optionalParams: any[]): void;
function error(message?: any, ...optionalParams: any[]): void;
function warn(message?: any, ...optionalParams: any[]): void;
function group(groupTitle?: string, ...optionalParams: any[]): void;
function groupCollapsed(groupTitle?: string, ...optionalParams: any[]): void;
function groupEnd(): void;
function time(timerName?: string): void;
function timeEnd(timerName?: string): void;
function timeStamp(timerName?: string): void;
}
declare const config: {
address: string;
customCss: string;
electronOptions: any;
ipWhitelist: string[];
language: string;
locale: string;
modules: any[];
port: number;
timeFormat: 12 | 24;
units: "metric" | "imperial";
zoom: number;
};