2023-10-20 03:43:26 +00:00
|
|
|
export type Comparator<T> = (a: T, b: T) => number;
|
|
|
|
|
|
|
|
export type DFSOrderPattern = 'pre' | 'in' | 'post';
|
2023-10-25 01:57:04 +00:00
|
|
|
|
2023-10-30 03:14:41 +00:00
|
|
|
export type BTNCallback<N, D = any> = (node: N) => D;
|
2023-10-25 01:57:04 +00:00
|
|
|
|
2023-10-25 03:19:03 +00:00
|
|
|
export enum CP {
|
|
|
|
lt = 'lt',
|
|
|
|
eq = 'eq',
|
|
|
|
gt = 'gt'
|
|
|
|
}
|
2023-11-17 14:37:35 +00:00
|
|
|
|
|
|
|
export const enum IterateDirection {
|
|
|
|
DEFAULT = 0,
|
|
|
|
REVERSE = 1
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IterableWithSize<T> extends Iterable<T> {
|
|
|
|
size: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IterableWithLength<T> extends Iterable<T> {
|
|
|
|
length: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type IterableWithSizeOrLength<T> = IterableWithSize<T> | IterableWithLength<T>
|