diff --git a/src/types.ts b/src/types.ts index 384bbdd8d..1d77ca71f 100644 --- a/src/types.ts +++ b/src/types.ts @@ -31,6 +31,10 @@ export interface IReturnStatus { msg?: string; } +type SuccessResult = { success: true; message?: string } & T; +type FailureResult = { success: false; message: string }; +export type Result = SuccessResult | FailureResult; + /** Defines the minimum and maximum values for a range. * It is up to the consumer if these values are inclusive or exclusive. * It is up to the implementor to ensure max > min. */