mirror of
https://github.com/zrwusa/data-structure-typed.git
synced 2024-11-28 06:54:04 +00:00
27 lines
535 B
TypeScript
27 lines
535 B
TypeScript
export type Comparator<T> = (a: T, b: T) => number;
|
|
|
|
export type DFSOrderPattern = 'pre' | 'in' | 'post';
|
|
|
|
export type BTNCallback<N, D = any> = (node: N) => D;
|
|
|
|
export enum CP {
|
|
lt = 'lt',
|
|
eq = 'eq',
|
|
gt = 'gt'
|
|
}
|
|
|
|
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>
|