multi-downloader-nx/@types/messageHandler.d.ts
2022-01-23 20:26:38 +01:00

16 lines
No EOL
357 B
TypeScript

export interface MessageHandler {
auth: (data: AuthData) => Promise<AuthResponse>;
}
export type AuthData = { username: string, password: string };
export type AuthResponse = ResponseBase<undefined>;
export type ResponseBase<T> = ({
isOk: true,
value: T
} | {
isOk: false,
reason: Error
});
export type PossibleMessanges = keyof ServiceHandler;