import { Point } from "./util/ranges";
import rects from "./util/rects";
export declare type LogStringLevel = "error" | "warn" | "info" | "debug";
export declare namespace log {
    export enum LogLevel {
        error = 0,
        warn = 1,
        info = 2,
        debug = 3
    }
    export interface Log {
        message: string | Error;
        level: LogLevel;
        scopes?: string[];
    }
    export interface LogReporter {
        log(log: Log): void;
    }
    type LazyString = (() => string) | string;
    export class Logger {
        protected _reporter: LogReporter;
        protected _scopes: LazyString[];
        protected _level: LogLevel;
        debug(message: LazyString, scope?: LazyString): void;
        info(message: LazyString, scope?: LazyString): void;
        warn(message: LazyString, scope?: LazyString): void;
        error(message: LazyString, scope?: LazyString): void;
        levelFromString(level: LogStringLevel): number;
        setLevel(level: LogLevel | LogStringLevel): void;
        setReporter(reporter: LogReporter): void;
        addScope(scope: LazyString): void;
        removeScope(count?: number): void;
        log(level: LogLevel, message: LazyString | Error, scope?: LazyString): void;
    }
    export const defaultReporter: {
        log: (log: Log) => void;
    };
    export {};
}
export declare const logger: log.Logger;
export declare namespace dom {
    function id(element?: Element): string;
    function docInteractive(doc?: Document): Promise<void>;
    function docComplete(doc?: Document): Promise<void>;
    function isElement(object: any): object is Element;
}
export declare namespace str {
    function decamelize(string: string): string;
    function cssEscape(value: string): string;
    function cssUnescape(str: string): string;
}
export declare namespace io {
    type Options = {
        [key: string]: any;
    };
    export function parseOptionsFromElement<O extends Options = Options>(element: Element, defaultOptions: O): O;
    export function mergeOptions<O extends Options>(target: Partial<O>, ...optionsList: Partial<O>[]): O;
    export function load(url: string): Promise<string>;
    export function loadScript(url: string): Promise<void>;
    export {};
}
export declare namespace debug {
    function drawClientRects(rects: ClientRect[], doc?: Document): void;
    function drawClientRect(rect: ClientRect, doc?: Document): void;
    function drawScrollRect(rect: rects.Rect, doc?: Document): void;
    function drawPoint(point: Point): void;
    function logCaretPositionOnClick(doc: Document): void;
}
export declare namespace events {
    type Listener<K extends keyof Events, Events> = (event: Event<K, Events>, target: EventEmitter<Events>) => any;
    type Event<K extends keyof Events, Events> = {
        type: K;
    } & Events[K];
    class EventEmitter<Events = Record<string, unknown>> {
        listeners: {
            [K in keyof Events]: Listener<K, Events>[];
        };
        on: <K extends keyof Events>(eventType: K, listener: Listener<K, Events>) => this;
        addListener<K extends keyof Events>(eventType: K, listener: Listener<K, Events>): this;
        removeListener<K extends keyof Events>(eventType: K, callback: Listener<K, Events>): this;
        listenerCount(event: keyof Events): number;
        emit<K extends keyof Events>(event: Event<K, Events> | K, target?: EventEmitter<Events>): any;
    }
}
export { default as rects } from "./util/rects";
export { default as ranges } from "./util/ranges";
export { default as walk } from "./util/walk";
