Refactor: Move data-access code to Typescript w/ shared interface

This commit is contained in:
Scott Nonnenberg 2020-04-01 11:59:11 -07:00
parent 9ab54b9b83
commit 6b094e1514
35 changed files with 1695 additions and 598 deletions

11
ts/types/I18N.ts Normal file
View file

@ -0,0 +1,11 @@
export type LocaleMessagesType = {
[key: string]: {
message: string;
description?: string;
};
};
export type LocaleType = {
i18n: (key: string, placeholders: Array<string>) => string;
messages: LocaleMessagesType;
};

10
ts/types/Logging.ts Normal file
View file

@ -0,0 +1,10 @@
type LogFunction = (...args: Array<any>) => void;
export type LoggerType = {
fatal: LogFunction;
error: LogFunction;
warn: LogFunction;
info: LogFunction;
debug: LogFunction;
trace: LogFunction;
};