UNPKG

tweakpane4-image-list-plugin

Version:

Image input plugin for Tweakpane

45 lines (44 loc) 1.29 kB
/// <reference types="lodash" resolution-mode="require"/> import { Controller, TextProps, Value, ViewProps } from '@tweakpane/core'; import debounce from 'lodash.debounce'; import { PluginView } from './view.js'; interface Config { value: Value<Thumbnail | null>; valueOptions: Thumbnail[]; textValue: Value<string>; debounceDelay: number; textProps: TextProps<string>; viewProps: ViewProps; } export interface Thumbnail { value: string; src: string; path: string; offset?: { posX: number; posY: number; width: number; height: number; sizeX: number; sizeY: number; }; } export declare class PluginController implements Controller<PluginView> { readonly value: Value<Thumbnail | null>; readonly valueOptions: Thumbnail[]; readonly textValue: Value<string>; readonly debounceFilterOptions: ReturnType<typeof debounce>; readonly view: PluginView; readonly viewProps: ViewProps; constructor(doc: Document, config: Config); private filterOptions; private setValue; private onTextInput; private onOptionClick; private onDrop; private getValueFromDrag; private getThumbnailFromValue; private onDragOver; private onDragLeave; } export {};