@types/jquery-editable-select
TypeScript icon, indicating that this package has built-in type declarations

2.2.4 • Public • Published

Installation

npm install --save @types/jquery-editable-select

Summary

This package contains type definitions for jquery-editable-select (https://github.com/indrimuska/jquery-editable-select).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jquery-editable-select.

index.d.ts

/// <reference types="jquery"/>

declare namespace JQueryEditableSelect {
    interface EditableSelectOptions {
        /**
         * Filter (or not) items in list while typing.
         */
        filter?: boolean | undefined;
        /**
         * Easing used for showing and hiding the dropdown list.
         */
        effects?: "default" | "slide" | "fade" | undefined;
        /**
         * Duration of the easings (in milliseconds).
         */
        duration?: number | "fast" | "slow" | undefined;
        /**
         * Where to append the dropdown list in the DOM.
         */
        appendTo?: string | JQuery | undefined;
        /**
         * How dropdown list is triggered.
         */
        trigger?: "focus" | "manual" | undefined;
    }
}

interface JQuery {
    /**
     * Transforms the <select> into a typeahead field. Accepts an optional options object.
     *
     * @param options Options setting the editable select behavior
     */
    editableSelect(options?: JQueryEditableSelect.EditableSelectOptions): JQuery;
    /**
     * Manually shows/hide/filters/clears/destorys the dropdown list.
     *
     * @param action Action to apply
     */
    editableSelect(action: "show" | "hide" | "filter" | "clear" | "destroy"): void;
    /**
     * Manually sets the value of the text field to the value of the $element passed as parameter.
     *
     * @param action Action to apply, must be 'select'
     * @param element element to select (it must be one of the elements in the dropdown list)
     */
    editableSelect(action: "select", element: JQuery): void;
    /**
     * Adds a new option in the dropdown list
     *
     * @param action Action to apply, must be 'add'
     * @param text Test to be displayed
     * @param index position to insert the element at.
     * @param attrs optional attributes to add to the element
     * @param data optional data to add to the element
     */
    editableSelect(
        action: "add",
        text: string,
        index?: number,
        attrs?: Array<{ name: string; value: string }>,
        data?: string,
    ): void;
    /**
     * Removes an option in the dropdown list at the given index.
     *
     * @param action Action to apply, must be 'remove'
     * @param index position of the element to remove.
     */
    editableSelect(action: "remove", index: number): void;
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: @types/jquery

Credits

These definitions were written by Vincent Biret.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/jquery-editable-select

Weekly Downloads

60

Version

2.2.4

License

MIT

Unpacked Size

7.47 kB

Total Files

5

Last publish

Collaborators

  • types