add type safety

This commit is contained in:
2026-02-14 00:03:14 +00:00
parent b783e399b9
commit da3b0c220d

18
types.d.ts vendored
View File

@@ -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>;