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 interface IterableWithSize extends Iterable { size: number | ((...args: any[]) => number); } export interface IterableWithLength extends Iterable { length: number | ((...args: any[]) => number); } export type IterableWithSizeOrLength = IterableWithSize | IterableWithLength export type BinaryTreePrintOptions = { isShowUndefined?: boolean, isShowNull?: boolean, isShowRedBlackNIL?: boolean }