UNPKG

filepond

Version:

FilePond, where files go to stretch their bits.

77 lines (74 loc) • 3.52 kB
import type { ExtensionFactory } from '../../core/extensionManager.ts'; import type { Locale, ReducedMotionPreference, SpringOptions } from '../../types/index.js'; import type { Bounds } from '../../utils/bounds.js'; import { FilePondInputElement } from '../FilePondInput/index.js'; import '../../extensions/entry-list-view.js'; import '../../extensions/source-list-view.js'; export interface FilePondElementEventMap { rectcompute: CustomEvent<Bounds>; rectchange: CustomEvent<Bounds>; } interface FilePondElementEvents { addEventListener<K extends keyof FilePondElementEventMap>(type: K, listener: (this: FilePondInputElement, event: FilePondElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void; } /** Ignore these files and directories */ export declare const IGNORED_ENTRY_PATTERNS: RegExp[]; /** * FilePondElement * * @event {CustomEvent<Bounds>} 'rectcompute' - Fired when the element rect has been computed * @event {CustomEvent<Bounds>} 'rectchange' - Fired when the element visual rect has been updated */ export declare class FilePondElement extends FilePondInputElement implements FilePondElementEvents { #private; /** Wraps `createFilePondExtensionSet` so we always set the default extension set */ set extensions(value: ExtensionFactory[]); /** Automatically passes value to child elements, for usage see `FilePondSvelteComponentElement` */ set springOptions(value: SpringOptions); /** Returns the current animation mode */ get reducedMotionPreference(): ReducedMotionPreference; /** Setting to toggle motion, automatically passes `reducedMotionPreference` setting to child elements, for usage see `FilePondSvelteComponentElement` */ set reducedMotionPreference(value: ReducedMotionPreference); /** Set to `true` to remove drop area */ set noDrop(value: boolean); /** Returns current nodrop state */ get noDrop(): boolean; /** A programmatic way to toggle the attribution link on/off. When set to `true` this property automatically adds the `noattribution` attribute to the `<file-pond>` element. ```js const element = document.querySelector('file-pond'); element.noAttribution = true; ``` */ set noAttribution(value: boolean); /** Returns current noattribution state */ get noAttribution(): boolean; /** Sets the locale on parent */ set locale(value: Locale); static get observedAttributes(): string[]; attributeChangedCallback(name: string, _: string, value: string | boolean): void; constructor(); connectedCallback(): void; /** Called each time the element is removed from the document. */ disconnectedCallback(): void; } export interface DefineFilePondOptions { /** Initial locale to use */ locale?: Locale; /** Initial extensions to load on top of default FilePond extensions */ extensions?: ExtensionFactory[]; /** Initial Spring configuration */ springOptions?: SpringOptions; /** Files and Directories to ignore */ ignoredEntryPatterns?: RegExp[]; /** Location of web workers */ workersURL?: URL; } /** * Registers the `<file-pond>` custom element, `initialOptions` passed will be assigned as props, * returns an array of `<file-pond>` components on the page at time of registration * @param initialOptions - The initial options to pass to the FilePond components */ export declare function defineFilePond(initialOptions?: DefineFilePondOptions): FilePondElement[]; export {};