Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- interface JQueryAtWhoOptions<T> {
- // key char for observing such as `@`
- at?: string;
- /*
- alias name of `at`
- it would be an id attribute of the popup view.
- */
- alias?: string;
- /*
- should be a plain object *Array* or a *URL*
- would save *Array* directly.
- would load and save remote JSON data by *URL*
- */
- data?: T[];
- /*
- would eval it and assign value of the key contained in `${}`
- key-value ( {'name'?: "one"} ) is an item in `data` Array.
- Alternatively, this can be a function accepting one data item as a parameter.
- */
- displayTpl?: string | ((T)=> string);
- /*
- It will be evaluated and inserted in the inputor.
- `atwho-at` is the `at` for runtime by default.
- You change it into anything you want.
- */
- insertTpl?: string;
- /*
- There are several data processors that can be overriden here such as `filter`.
- we will cover it later.
- */
- callbacks?: any,
- /*
- would matching item by test against the value of this `search_key` with query string.
- */
- searchKey?: string;
- /*
- limit number of items to show in popup list.
- */
- limit?: number;
- /*
- setting the max length of the string after `at` that would be matched
- It will stop matching if the query string is longer than `max_len`.
- */
- maxLen?: number;
- /*
- if `yes`, At.js will match the query with a spaaace before the `at`.
- */
- startWithSpace?: boolean,
- displayTimeout?: number;
- // highlight_first suggestion in popup menu
- highlightFirst?: boolean,
- // delay time trigger At.js while typing. For example?: delay?: 400
- delay?: number,
- // suffix for inserting string.
- suffix?: string;
- // don't show dropdown view without `suffix`
- hideWithoutSuffix?: boolean;
- }
- interface JQueryAtWhoStatic {
- }
- interface JQueryStatic {
- atwho: JQueryAtWhoStatic;
- }
- interface JQuery {
- atwho(method: "hide"): JQuery;
- atwho(method: "destroy"): JQuery;
- atwho(method: "run"): JQuery;
- atwho(method: string): JQuery;
- atwho<T>(options?: JQueryAtWhoOptions<T>): JQuery;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement