Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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