export type Comparator = (a: T, b: T) => number; export type DFSOrderPattern = 'pre' | 'in' | 'post'; export type BTNCallback = (node: N) => D; export enum CP { lt = 'lt', eq = 'eq', gt = 'gt' } export const enum IterateDirection { DEFAULT = 0, REVERSE = 1 } export interface IterableWithSize extends Iterable { size: number; } export interface IterableWithLength extends Iterable { length: number; } export type IterableWithSizeOrLength = IterableWithSize | IterableWithLength