tweakpane4-image-list-plugin
Version:
Image input plugin for Tweakpane
43 lines (42 loc) • 1.36 kB
TypeScript
import { TextProps, TextView, Value, View, ViewProps } from '@tweakpane/core';
import { Thumbnail } from './controller.js';
interface Config {
textView: TextView<string>;
value: Value<Thumbnail | null>;
valueOptions: Thumbnail[];
textProps: TextProps<string>;
viewProps: ViewProps;
onTextInput: (event: Event) => void;
onOptionClick: (option: Thumbnail | null) => void;
}
export declare class PluginView implements View {
readonly element: HTMLElement;
private doc_;
private value_;
private valueOptions_;
private textView_;
private overlayEl_;
private selectEl_;
private selectThumbEl_;
private optionEls_;
private onOptionClick_;
constructor(doc: Document, config: Config);
private init_;
private createOptionEl;
/** Updates UI state after a value change. */
private refresh_;
/** Opens the overlay. */
open(event: MouseEvent): void;
/** Closes the overlay. */
close(): void;
/** Selects the thumbnail element clicked. */
private onSelect_;
/** Given a click event somewhere in an option, finds the nearest option element. */
private findOptionEl_;
/** Change handler. */
private onValueChange_;
private onTextInputClick;
updateOptions(options: Thumbnail[]): void;
changeDraggingState(state: boolean): void;
}
export {};