Package breakdown. Commit v1.0.0 of services-common stuff
This commit is contained in:
7
lib/types/ApiResponse.ts
Normal file
7
lib/types/ApiResponse.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { Payload } from './Payload';
|
||||
|
||||
export interface ApiResponse<T = Payload> {
|
||||
data?: T;
|
||||
error?: Error | string | number;
|
||||
success: boolean;
|
||||
}
|
||||
7
lib/types/Payload.ts
Normal file
7
lib/types/Payload.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
type PayloadPrimitives = boolean | null | number | string;
|
||||
type PayloadArray = (PayloadPrimitives | Payload)[];
|
||||
type PayloadValid = PayloadPrimitives | PayloadArray | Payload;
|
||||
|
||||
export interface Payload<T = object> {
|
||||
[key: string]: PayloadValid | T;
|
||||
}
|
||||
Reference in New Issue
Block a user