@book000/pixivts
Version:
pixiv Unofficial API Library for TypeScript
19 lines • 825 B
TypeScript
export type CheckFunction<T> = (data: T) => boolean;
export type CheckFunctions<T> = Record<string, CheckFunction<T>>;
export declare abstract class BaseSimpleCheck<T> {
abstract checks(): CheckFunctions<T>;
getFailedChecks(data: T, reThrow?: boolean): string[];
is(data: T): data is T;
throwIfFailed(data: T): boolean;
}
export declare abstract class BaseMultipleCheck<T, U> {
abstract requestChecks(): CheckFunctions<T>;
abstract responseChecks(): CheckFunctions<U>;
getFailureRequestChecks(data: T, reThrow?: boolean): string[];
isRequest(data: T): data is T;
throwIfRequestFailed(data: T): boolean;
getFailedResponseChecks(data: U, reThrow?: boolean): string[];
isResponse(data: U): data is U;
throwIfResponseFailed(data: U): boolean;
}
//# sourceMappingURL=checks.d.ts.map