import type { HTML } from '../types'; import { Buffer } from '../modules/buffer'; interface FileContents extends Omit { content: Buffer; lastModified: Date; } type ScrollToOptions = { /** * Whether focus should be applied automatically to the element * after the scroll animation completes * @default true */ autoFocus: boolean; /** * The offset to scroll to in addition to the element's offset * Note: to scroll higher than the element, supply a negative value * @default 0 */ offset: number | Partial<{ top: number; left: number; }>; /** * The scroll behavior to use * @default auto */ behavior: 'smooth' | 'instant' | 'auto'; /** * The direction in which to scroll * @default both */ direction: 'vertical' | 'horizontal' | 'both'; /** * Callback method that is called when the animation is complete */ callback: () => void; /** * Whether the method should silently discard errors * @default true */ noThrow: boolean; }; declare global { interface JQuery { /** * Disables the element */ disable(): JQuery; /** * Fetches the HTML DOM Object */ element(): T; /** * Enables the element */ enable(): JQuery; /** * Reads a file from a file input field and returns the file as a Buffer * * @param idx */ fileContents(idx: number): Promise; /** * Returns the number of files selected in a file input field */ fileCount(): number; /** * Retrieve the full HTML for the specified element, including the element itself */ fullHTML(): string; /** * Returns the element ID; or, if one is not set, assigns a random UUID to it * and returns it */ id(): string; /** * Sets the readonly property/attribute of the element */ lock(): JQuery; /** * Returns the full selector path of the element * * @param type */ path(type?: 'id' | 'tagName'): string; /** * Scrolls to the element * * @param options */ scrollTo(options?: Partial): JQuery; /** * Returns the element type */ type(): string; /** * Unsets the readonly property/attribute of the element */ unlock(): JQuery; } interface JQueryStatic { /** * Create a form floating element set with a label * @param options */ createFloatingInput(options?: Partial): JQuery; /** * Creates a form floating input group with a label * * @param options */ createFloatingInputGroup(options?: Partial): JQuery; /** * Creates an input group element */ createInputGroup(): JQuery; /** * Creates a new JQuery HTML Media Element with the properties set as defined in the options * * Note: if autoplay is enabled, muted will be set to true * @param src * @param options */ createMedia(src?: string, options?: Partial): JQuery; /** * Returns if the document has the specified class available * * @param className */ hasClass(className: string): boolean; /** * Generates a random ID * * @param size */ nanoid(size?: number): string; /** * Gets or sets the theme mode of the document * * Order of preference is: * * 1) specified value * 2) already set via the HTML tag * 3) browser preference * 4) light mode * * @param mode */ theme(mode?: 'light' | 'dark'): 'light' | 'dark'; } } export {};