Created
August 25, 2019 07:42
-
-
Save beerose/0d00d17212095b82f22085ad8c647d31 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type ApiError = { | |
error: string; | |
error_details?: string; | |
}; | |
export interface TypedResponse<T = ApiError> extends Response { | |
status: (status: number) => TypedResponse<T | ApiError>; | |
send: (body: T | ApiError) => TypedResponse<T | ApiError>; | |
} | |
export const list = ( | |
req: Request, | |
res: TypedResponse<ItemDTO[]> | |
) => { | |
// implementation | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment