export declare type Constructor = new (...args: any[]) => T; /** * callback function with no arguments */ export declare type VoidCallback = () => void; /** * callback function with no arguments */ export declare type AsyncVoidCallback = () => Promise; /** * callback function with one parameter */ export declare type ValueCallback = (val: T) => void; /** * Usually called before destroying the object, this function should not throw any exception, otherwise the behavior will be unknown */ export declare type DeleteCallback = (val: T) => void; /** * Is the return value valid? */ export declare type ValidCallback = (val: T) => boolean; /** * How to transform data */ export declare type MapCallback = (data: TF) => TO; /** * How to copy data */ export declare type CloneCallback = (data: T) => T; /** * How to compare element sizes * * @example * ``` * return l == r ? 0 : ( l < r ? -1 : 1) * ``` */ export declare type CompareCallback = (l: T, r: T) => number; export declare function compare(l: T, r: T, c?: CompareCallback): number; export interface Comparable { compareTo(o: Comparable): number; } export interface Swappable { swap(o: Swappable): void; } export declare class Pair implements Comparable>, Swappable> { first: T0; second: T1; private c0_?; private c1_?; constructor(first: T0, second: T1, compareFirst?: CompareCallback, compareSecond?: CompareCallback); compareTo(o: Pair): number; swap(o: Pair): void; } export declare type ReturnValue = undefined | T; export declare type ReturnValueRaw = [undefined, false] | [T, true];