forked from trustwallet/assets
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinterface.ts
More file actions
26 lines (24 loc) · 855 Bytes
/
interface.ts
File metadata and controls
26 lines (24 loc) · 855 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
// A single check step
export interface CheckStepInterface {
getName(): string;
// return [errors, warnings]
check(): Promise<[string[], string[]]>;
}
// An action for a check, fix, or update, or a combination.
export interface ActionInterface {
getName(): string;
// return check steps for sanity check (0, 1, or more)
getSanityChecks(): CheckStepInterface[];
// return check steps for consistenct check (0, 1, or more)
getConsistencyChecks?(): CheckStepInterface[];
sanityFix?(): Promise<void>;
consistencyFix?(): Promise<void>;
updateAuto?(): Promise<void>; // For regular automatic updates (from external source)
updateManual?(): Promise<void>; // For occasional manual updates (from external source)
}
export enum FixCheckMode {
CheckSanityOnly = 1,
CheckAll,
FixSanityOnly,
FixAll
}