interface ClassOptions { [s: string]: boolean; } interface AttributeOptions { [s: string]: string | number | boolean | undefined; } interface PropertyOptions { [s: string]: any; } interface ElementOptions { type?: string; class?: string | ClassOptions | undefined; attr?: AttributeOptions | undefined; prop?: PropertyOptions | undefined; children?: Array | undefined; api?: T; } declare class Selection { element: HTMLElement; constructor(element: HTMLElement); static isSelection(value: any): value is Selection; add(selection: Selection | Array): this; remove(selection: Selection | Array): this; set(selection: Selection | Array): this; removeAll(): this; removeSelf(): this; text(): string; text(text: string): this; class(): string; class(cls: string | ClassOptions): this; hasClass(cls: string): boolean; attr(key: string): string | undefined; attr(options: AttributeOptions): this; attr(key: string, value: string | number | boolean | undefined): this; prop(key: string): any; prop(options: PropertyOptions): this; prop(key: string, value: any | undefined): this; api(): T | undefined; api(api: T): this; api(name: string): T | undefined; api(name: string, api: T): this; on(name: string | Array, handler: (evt: Event) => void): this; off(name: string | Array, handler?: (evt: Event) => void): this; } declare function select(selector: string | HTMLElement | Selection): Selection; declare function selectAll(selector: string): Array; declare function element(options?: ElementOptions): Selection; export { Selection, select, selectAll, element };