Advertisement
Guest User

Untitled

a guest
Aug 27th, 2015
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. interface JQueryAtWhoOptions<T> {
  2. // key char for observing such as `@`
  3. at?: string;
  4. /*
  5. alias name of `at`
  6. it would be an id attribute of the popup view.
  7. */
  8. alias?: string;
  9. /*
  10. should be a plain object *Array* or a *URL*
  11. would save *Array* directly.
  12. would load and save remote JSON data by *URL*
  13. */
  14. data?: T[];
  15. /*
  16. would eval it and assign value of the key contained in `${}`
  17. key-value ( {'name'?: "one"} ) is an item in `data` Array.
  18. Alternatively, this can be a function accepting one data item as a parameter.
  19. */
  20. displayTpl?: string | ((T)=> string);
  21. /*
  22. It will be evaluated and inserted in the inputor.
  23. `atwho-at` is the `at` for runtime by default.
  24. You change it into anything you want.
  25. */
  26. insertTpl?: string;
  27. /*
  28. There are several data processors that can be overriden here such as `filter`.
  29. we will cover it later.
  30. */
  31. callbacks?: any,
  32. /*
  33. would matching item by test against the value of this `search_key` with query string.
  34. */
  35. searchKey?: string;
  36. /*
  37. limit number of items to show in popup list.
  38. */
  39. limit?: number;
  40. /*
  41. setting the max length of the string after `at` that would be matched
  42. It will stop matching if the query string is longer than `max_len`.
  43. */
  44. maxLen?: number;
  45. /*
  46. if `yes`, At.js will match the query with a spaaace before the `at`.
  47. */
  48. startWithSpace?: boolean,
  49. displayTimeout?: number;
  50. // highlight_first suggestion in popup menu
  51. highlightFirst?: boolean,
  52. // delay time trigger At.js while typing. For example?: delay?: 400
  53. delay?: number,
  54. // suffix for inserting string.
  55. suffix?: string;
  56. // don't show dropdown view without `suffix`
  57. hideWithoutSuffix?: boolean;
  58. }
  59.  
  60. interface JQueryAtWhoStatic {
  61.  
  62. }
  63.  
  64. interface JQueryStatic {
  65. atwho: JQueryAtWhoStatic;
  66. }
  67.  
  68. interface JQuery {
  69. atwho(method: "hide"): JQuery;
  70. atwho(method: "destroy"): JQuery;
  71. atwho(method: "run"): JQuery;
  72. atwho(method: string): JQuery;
  73. atwho<T>(options?: JQueryAtWhoOptions<T>): JQuery;
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement