forked from quoid/userscripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.d.ts
More file actions
43 lines (38 loc) · 1007 Bytes
/
Copy pathtypes.d.ts
File metadata and controls
43 lines (38 loc) · 1007 Bytes
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
declare namespace Types {
/** @see {@link https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/i18n/Locale-Specific_Message_reference} */
type I18nMessages = {
[x: string]: {
message: string;
description?: string;
placeholders?: Object;
};
};
type GetLang<T = string> = (
messageName: T,
substitutions?: string | string[],
) => string;
type SystemPlatform = "mac" | "ios";
type ExtensionStatus = "unknown" | "disabled" | "enabled" | "error";
type MessageBody =
| "INIT"
| "CHANGE_DIRECTORY"
| "OPEN_DIRECTORY"
| "SHOW_PREFERENCES"
| "EXPORT_LOG_FILES"
| "DISABLE_LOGGER"
| "DISMISS_LOGGER_PROMPT";
type MessageReply<T> = T extends "INIT"
? {
build: string;
version: string;
platform: SystemPlatform;
directory: string;
extStatus: ExtensionStatus;
useSettingsInsteadOfPreferences: boolean;
enableLogger: boolean;
promptLogger: boolean;
maxLogFileSize: number;
firstRunTime: number;
}
: void;
}