mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-18 13:05:50 +00:00
bd7bd75569
Lift the mists of confusion by checking that all JavaScript types align. No ignores! This is the JavaScript equivalent to Phan. This patch adds the necessary infrastructure for verifying typing and fixes the few flaws found. Bug: T239262 Change-Id: I2557471421196ea46cd13dfb786a52968fbfcc97
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
interface JQueryStatic {
|
|
collapsibleTabs: CollapsibleTabsStatic;
|
|
}
|
|
|
|
interface JQuery {
|
|
collapsibleTabs(options: Partial<CollapsibleTabsOptions>): void;
|
|
}
|
|
|
|
/** A jQuery plugin that makes collapsible tabs for the Vector skin. */
|
|
interface CollapsibleTabsOptions {
|
|
/** Optional tab selector. Defaults to `#p-views ul`. */
|
|
expandedContainer: string;
|
|
/** Optional menu item selector. Defaults to `#p-cactions ul`. */
|
|
collapsedContainer: string;
|
|
/** Optional selector for tabs that are collapsible. Defaults to `li.collapsible`. */
|
|
collapsible: string;
|
|
shifting: boolean;
|
|
expandedWidth: number;
|
|
expandCondition(eleWidth: number): boolean;
|
|
collapseCondition(): boolean;
|
|
}
|
|
|
|
interface CollapsibleTabsStatic {
|
|
defaults: CollapsibleTabsOptions;
|
|
instances: JQuery[];
|
|
addData($collapsible: JQuery): void;
|
|
getSettings($collapsible: JQuery): CollapsibleTabsOptions;
|
|
handleResize(): void;
|
|
moveToCollapsed($moving: JQuery): void;
|
|
moveToExpanded($moving: JQuery): void;
|
|
calculateTabDistance(): number;
|
|
}
|
|
|
|
interface CollapsibleTabs extends CollapsibleTabsStatic, CollapsibleTabsOptions {}
|