Fix jquery plugins typedef

5fe1bc46e65a656cfa98b1ca92bbda800c7f6e76

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +99 -97Ignore whitespace
public/global.d.ts+99 -97
@@ -11,103 +11,105 @@ declare var SillyTavern: {
11 libs: typeof libs;11 libs: typeof libs;
12};12};
1313
14// Jquery plugins14declare global {
15interface JQuery {15 // Jquery plugins
16 nanogallery2(options?: any): JQuery;16 interface JQuery {
17 nanogallery2(method: string, options?: any): JQuery;17 nanogallery2(options?: any): JQuery;
18 pagination(method: 'getCurrentPageNum'): number;18 nanogallery2(method: string, options?: any): JQuery;
19 pagination(method: string, options?: any): JQuery;19 pagination(method: 'getCurrentPageNum'): number;
20 pagination(options?: any): JQuery;20 pagination(method: string, options?: any): JQuery;
21 transition(options?: any, complete?: function): JQuery;21 pagination(options?: any): JQuery;
22 autocomplete(options?: any): JQuery;22 transition(options?: any, complete?: function): JQuery;
23 autocomplete(method: string, options?: any): JQuery;23 autocomplete(options?: any): JQuery;
24 slider(options?: any): JQuery;24 autocomplete(method: string, options?: any): JQuery;
25 slider(method: string, func: string, options?: any): JQuery;25 slider(options?: any): JQuery;
26 cropper(options?: any): JQuery;26 slider(method: string, func: string, options?: any): JQuery;
27 izoomify(options?: any): JQuery;27 cropper(options?: any): JQuery;
2828 izoomify(options?: any): JQuery;
29 //#region select229
3030 //#region select2
31 /**31
32 * Initializes or modifies a select2 instance with provided options32 /**
33 *33 * Initializes or modifies a select2 instance with provided options
34 * @param options - Configuration options for the select2 instance34 *
35 * @returns The jQuery object for chaining35 * @param options - Configuration options for the select2 instance
36 */36 * @returns The jQuery object for chaining
37 select2(options?: Select2Options): JQuery;37 */
3838 select2(options?: Select2Options): JQuery;
39 /**39
40 * Retrieves data currently selected in the select2 instance40 /**
41 *41 * Retrieves data currently selected in the select2 instance
42 * @param field - A string specifying the 'data' method42 *
43 * @returns An array of selected items43 * @param field - A string specifying the 'data' method
44 */44 * @returns An array of selected items
45 select2(field: 'data'): any[];45 */
4646 select2(field: 'data'): any[];
47 /**47
48 * Calls the specified select2 method48 /**
49 *49 * Calls the specified select2 method
50 * @param method - The name of the select2 method to invoke50 *
51 * @returns The jQuery object for chaining51 * @param method - The name of the select2 method to invoke
52 */52 * @returns The jQuery object for chaining
53 select2(method: 'open' | 'close' | 'destroy' | 'focus' | 'val', value?: any): JQuery;53 */
5454 select2(method: 'open' | 'close' | 'destroy' | 'focus' | 'val', value?: any): JQuery;
55 //#endregion55
5656 //#endregion
57 //#region sortable57
5858 //#region sortable
59 /**59
60 * Initializes or updates a sortable instance with the provided options60 /**
61 *61 * Initializes or updates a sortable instance with the provided options
62 * @param options - Configuration options for the sortable instance62 *
63 * @returns The jQuery object for chaining63 * @param options - Configuration options for the sortable instance
64 */64 * @returns The jQuery object for chaining
65 sortable(options?: SortableOptions): JQuery;65 */
6666 sortable(options?: SortableOptions): JQuery;
67 /**67
68 * Calls a sortable method to perform actions on the instance68 /**
69 *69 * Calls a sortable method to perform actions on the instance
70 * @param method - The name of the sortable method to invoke70 *
71 * @returns The jQuery object for chaining71 * @param method - The name of the sortable method to invoke
72 */72 * @returns The jQuery object for chaining
73 sortable(method: 'destroy' | 'disable' | 'enable' | 'refresh' | 'toArray'): JQuery;73 */
7474 sortable(method: 'destroy' | 'disable' | 'enable' | 'refresh' | 'toArray'): JQuery;
75 /**75
76 * Retrieves the sortable's instance object. If the element does not have an associated instance, undefined is returned.76 /**
77 *77 * Retrieves the sortable's instance object. If the element does not have an associated instance, undefined is returned.
78 * @returns The instance of the sortable object78 *
79 */79 * @returns The instance of the sortable object
80 sortable(method: 'instance'): object;80 */
8181 sortable(method: 'instance'): object;
82 /**82
83 * Retrieves the current option value for the specified option83 /**
84 *84 * Retrieves the current option value for the specified option
85 * @param method - The string 'option' to retrieve an option value85 *
86 * @param optionName - The name of the option to retrieve86 * @param method - The string 'option' to retrieve an option value
87 * @returns The value of the specified option87 * @param optionName - The name of the option to retrieve
88 */88 * @returns The value of the specified option
89 sortable(method: 'option', optionName: string): any;89 */
9090 sortable(method: 'option', optionName: string): any;
91 /**91
92 * Sets the value of the specified option92 /**
93 *93 * Sets the value of the specified option
94 * @param method - The string 'option' to set an option value94 *
95 * @param optionName - The name of the option to set95 * @param method - The string 'option' to set an option value
96 * @param value - The value to assign to the option96 * @param optionName - The name of the option to set
97 * @returns The jQuery object for chaining97 * @param value - The value to assign to the option
98 */98 * @returns The jQuery object for chaining
99 sortable(method: 'option', optionName: string, value: any): JQuery;99 */
100100 sortable(method: 'option', optionName: string, value: any): JQuery;
101 /**101
102 * Sets multiple options using an object102 /**
103 *103 * Sets multiple options using an object
104 * @param method - The string 'option' to set options104 *
105 * @param options - An object containing multiple option key-value pairs105 * @param method - The string 'option' to set options
106 * @returns The jQuery object for chaining106 * @param options - An object containing multiple option key-value pairs
107 */107 * @returns The jQuery object for chaining
108 sortable(method: 'option', options: SortableOptions): JQuery;108 */
109109 sortable(method: 'option', options: SortableOptions): JQuery;
110 //#endregion110
111 //#endregion
112 }
111}113}
112114
113//#region select2115//#region select2