add type safety
This commit is contained in:
18
types.d.ts
vendored
18
types.d.ts
vendored
@@ -12,9 +12,19 @@ interface GCIResult {
|
|||||||
url: string;
|
url: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface APIResult {
|
interface APIError {
|
||||||
error?: boolean;
|
error: true;
|
||||||
payload: string;
|
errorMessage: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export { GCIAPIResult, APIResult };
|
interface APISuccess<T> {
|
||||||
|
error: false;
|
||||||
|
payload: T;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface APIQueryParams {
|
||||||
|
query: string;
|
||||||
|
lucky?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
type APIResult<T> = APIError | APISuccess<T>;
|
||||||
|
|||||||
Reference in New Issue
Block a user