dropflow
Version:
A small CSS2 document renderer built from specifications
49 lines (48 loc) • 1.51 kB
TypeScript
import type { Style } from './style.js';
/**
* Binary search that returns the position `x` should be in
*/
export declare function binarySearch(a: number[], x: number): number;
/**
* Binary search that returns the position `x` should be in, using the `end`
* property of objects in the `a` array
*/
export declare function binarySearchOf<T>(a: T[], x: number, end: (item: T) => number): number;
/**
* Binary search that returns the position `x` should be in, using the second
* value in a tuple in the `a` array
*/
export declare function binarySearchTuple<T>(a: [T, number][], x: number): number;
export declare function id(): string;
export declare function uuid(): string;
export declare function loggableText(text: string): string;
export declare function basename(url: URL): string;
export interface TreeLogOptions {
containingBlocks?: boolean;
css?: keyof Style;
paragraphText?: string;
bits?: boolean;
}
export declare class Logger {
string: string;
formats: string[];
indent: string[];
lineIsEmpty: boolean;
constructor();
bold(): void;
underline(): void;
dim(): void;
reset(): void;
flush(): void;
text(str: string | number): void;
glyphs(glyphs: Int32Array): void;
pushIndent(indent?: string): void;
popIndent(): void;
}
export declare class Deferred<T> {
status: 'unresolved' | 'resolved' | 'rejected';
promise: Promise<T>;
resolve: (v: T) => void;
reject: (e?: unknown) => void;
constructor();
}