import type { Abortable } from './Abortable';
export type AbortableCreator<T, U> = (a: T) => Abortable<U>;
type ExtractGeneric<Type> = Type extends Abortable<infer X> ? X : never;
export type Tail<T extends readonly any[]> = T extends [ignore: any, ...toReturn: infer R] ? R : never;
export type Head<T extends readonly ((...args: any[]) => any)[]> = T extends [toReturn: infer R, ...ignore: any] ? R : any;
export type Last<T extends readonly ((...args: any[]) => any)[]> = T extends [...ignore: any, toReturn: infer R] ? R : any;
export type CheckChained<T extends readonly ((...params: any) => any)[]> = {
    [K in keyof T]: K extends keyof Tail<T> ? [T[K], Tail<T>[K]] extends [(arg: infer AA) => infer RA, (arg: infer AB) => any] ? [ExtractGeneric<RA>] extends [AB] ? T[K] : (arg: AA) => ExtractGeneric<RA> : never : T[K];
};
export {};
