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: {
1111 libs: typeof libs;
1212};
1313
14-// Jquery plugins
14+declare global {
15-interface JQuery {
15+ // Jquery plugins
16- nanogallery2(options?: any): JQuery;
16+ interface JQuery {
1717 nanogallery2(method: string, options?: any): JQuery;
18- pagination(method: 'getCurrentPageNum'): number;
18+ nanogallery2(method: string, options?: any): JQuery;
1919 pagination(method: string, options?: any'getCurrentPageNum'): JQuerynumber;
2020 pagination(method: string, options?: any): JQuery;
2121 transition pagination(options?: any, complete?: function): JQuery;
2222 autocomplete transition(options?: any, complete?: function): JQuery;
2323 autocomplete(method: string, options?: any): JQuery;
2424 slider autocomplete(method: string, options?: any): JQuery;
2525 slider(method: string, func: string, options?: any): JQuery;
2626 cropper slider(method: string, func: string, options?: any): JQuery;
2727 izoomify cropper(options?: any): JQuery;
28-
28+ izoomify(options?: any): JQuery;
29- //#region select2
29+
30-
30+ //#region select2
31- /**
31+
32- * Initializes or modifies a select2 instance with provided options
32+ /**
33- *
33+ * Initializes or modifies a select2 instance with provided options
34- * @param options - Configuration options for the select2 instance
34+ *
3535 * @returnsparam Theoptions jQuery- objectConfiguration options for chainingthe select2 instance
36- */
36+ * @returns The jQuery object for chaining
37- select2(options?: Select2Options): JQuery;
37+ */
38-
38+ select2(options?: Select2Options): JQuery;
39- /**
39+
40- * Retrieves data currently selected in the select2 instance
40+ /**
41- *
41+ * Retrieves data currently selected in the select2 instance
42- * @param field - A string specifying the 'data' method
42+ *
43- * @returns An array of selected items
43+ * @param field - A string specifying the 'data' method
44- */
44+ * @returns An array of selected items
45- select2(field: 'data'): any[];
45+ */
46-
46+ select2(field: 'data'): any[];
47- /**
47+
48- * Calls the specified select2 method
48+ /**
49- *
49+ * Calls the specified select2 method
50- * @param method - The name of the select2 method to invoke
50+ *
51- * @returns The jQuery object for chaining
51+ * @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+ */
54-
54+ select2(method: 'open' | 'close' | 'destroy' | 'focus' | 'val', value?: any): JQuery;
55- //#endregion
55+
56-
56+ //#endregion
57- //#region sortable
57+
58-
58+ //#region sortable
59- /**
59+
60- * Initializes or updates a sortable instance with the provided options
60+ /**
61- *
61+ * Initializes or updates a sortable instance with the provided options
62- * @param options - Configuration options for the sortable instance
62+ *
6363 * @returnsparam Theoptions jQuery- objectConfiguration options for chainingthe sortable instance
64- */
64+ * @returns The jQuery object for chaining
65- sortable(options?: SortableOptions): JQuery;
65+ */
66-
66+ sortable(options?: SortableOptions): JQuery;
67- /**
67+
68- * Calls a sortable method to perform actions on the instance
68+ /**
69- *
69+ * Calls a sortable method to perform actions on the instance
70- * @param method - The name of the sortable method to invoke
70+ *
71- * @returns The jQuery object for chaining
71+ * @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+ */
74-
74+ 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 object
78+ *
79- */
79+ * @returns The instance of the sortable object
80- sortable(method: 'instance'): object;
80+ */
81-
81+ sortable(method: 'instance'): object;
82- /**
82+
83- * Retrieves the current option value for the specified option
83+ /**
84- *
84+ * Retrieves the current option value for the specified option
85- * @param method - The string 'option' to retrieve an option value
85+ *
8686 * @param optionNamemethod - The name of thestring 'option' to retrieve an option value
8787 * @returnsparam optionName - The valuename of the specified option to retrieve
88- */
88+ * @returns The value of the specified option
89- sortable(method: 'option', optionName: string): any;
89+ */
90-
90+ sortable(method: 'option', optionName: string): any;
91- /**
91+
92- * Sets the value of the specified option
92+ /**
93- *
93+ * Sets the value of the specified option
94- * @param method - The string 'option' to set an option value
94+ *
9595 * @param optionNamemethod - The name of thestring 'option' to set an option value
9696 * @param valueoptionName - The value to assignname toof the option to set
97- * @returns The jQuery object for chaining
97+ * @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+ */
100-
100+ sortable(method: 'option', optionName: string, value: any): JQuery;
101- /**
101+
102- * Sets multiple options using an object
102+ /**
103- *
103+ * Sets multiple options using an object
104- * @param method - The string 'option' to set options
104+ *
105105 * @param optionsmethod - An object containingThe multiplestring 'option' key-valueto pairsset options
106- * @returns The jQuery object for chaining
106+ * @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+ */
109-
109+ sortable(method: 'option', options: SortableOptions): JQuery;
110- //#endregion
110+
111+ //#endregion
112+ }
111113}
112114
113115//#region select2