trustwallet-assets/script/generic/interface.ts
Adam R 76ccac3437
[Internal] Info type files: accept both casing, in fix make it uppercase (#5762)
* Info type files: accept both casing, in fix make it uppercase.

* Minor, to re-trigger CI

Co-authored-by: Catenocrypt <catenocrypt@users.noreply.github.com>
2021-03-01 15:46:10 +01:00

27 lines
855 B
TypeScript

// 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
}