Skip to content

Commit 5aee397

Browse files
authored
fix(types): allow JQueryAjaxSettings objects for modules using apiSettings
Following Fomantic's documentation, apiSettings can also accept a JQueryAjaxSettings object as parameter. So this PR enable correct type checking for modules that includes apiSettings as a parameter: dropdown, search and tab as well as the api module itself
1 parent 40a7aee commit 5aee397

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

types/fomantic-ui-api.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ declare namespace FomanticUI {
107107
*/
108108
(behavior: 'destroy'): JQuery;
109109

110-
<K extends keyof AccordionSettings>(behavior: 'setting', name: K, value?: undefined, ): Partial<Pick<AccordionSettings, keyof AccordionSettings>>;
111-
<K extends keyof AccordionSettings>(behavior: 'setting', name: K, value: AccordionSettings[K]): JQuery;
112-
(behavior: 'setting', value: Partial<Pick<AccordionSettings, keyof AccordionSettings>>): JQuery;
113-
(settings?: Partial<Pick<AccordionSettings, keyof AccordionSettings>>): JQuery;
110+
<K extends keyof APISettings | JQueryAjaxSettings>(behavior: 'setting', name: K, value?: undefined, ): Partial<Pick<APISettings, keyof APISettings>> | Partial<Pick<JQueryAjaxSettings, keyof JQueryAjaxSettings>>;
111+
<K extends keyof APISettings>(behavior: 'setting', name: K, value: APISettings[K]): JQuery;
112+
(behavior: 'setting', value: Partial<Pick<APISettings, keyof APISettings>> | Partial<Pick<JQueryAjaxSettings, keyof JQueryAjaxSettings>>): JQuery;
113+
(settings?: Partial<Pick<APISettings, keyof APISettings>> | Partial<Pick<JQueryAjaxSettings, keyof JQueryAjaxSettings>>): JQuery;
114114
}
115115

116116
/**

types/fomantic-ui-dropdown.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ declare namespace FomanticUI {
265265
* @see {@link https://fomantic-ui.com/behaviors/api.html#/settings}
266266
* @default false
267267
*/
268-
apiSettings: false | APISettings;
268+
apiSettings: false | APISettings | JQueryAjaxSettings;
269269

270270
/**
271271
* Whether dropdown should select new option when using keyboard shortcuts.

types/fomantic-ui-search.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ declare namespace FomanticUI {
124124
* @see {@link https://fomantic-ui.com/behaviors/api.html#/settings}
125125
* @default {}
126126
*/
127-
apiSettings: APISettings;
127+
apiSettings: APISettings | JQueryAjaxSettings;
128128

129129
/**
130130
* Minimum characters to query for results.

types/fomantic-ui-tab.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ declare namespace FomanticUI {
128128
* @see {@link https://fomantic-ui.com/behaviors/api.html#/settings}
129129
* @default false
130130
*/
131-
apiSettings: false | FomanticUI.APISettings;
131+
apiSettings: false | FomanticUI.APISettings | JQueryAjaxSettings;
132132

133133
/**
134134
* Can be set to 'hash' or 'state'.

0 commit comments

Comments
 (0)