DefinitelyTyped/types/materialize-css/collapsible.d.ts
Leonard Thieu c3cbb348e2 [jquery] Add includeMargin parameter to .outerHeight() and .outerWidth() setters. (#29756)
* [jquery] Add `includeMargin` parameter to `.outerHeight()` and `.outerWidth()` setters.

See 354f6036f2/test/unit/dimensions.js (L477-L484).

* [jquery-awesome-cursor] Add missing `dom` lib target.

* [jquery-toast-plugin] Add missing `dom` lib target.

* [jquery.growl] Add missing `dom` lib target.

* [materialize-css] Disable `unified-signatures` rule for plugin overloads.

These overloads follow the jQuery plugin pattern and are effectively separate methods.

* [ng-cordova] Update promise types to be compatible with changes from `ng.IPromise`.

Ref: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/23115

* [ng-tags-input] Add missing `dom` lib target.

* [p-loading] Add missing `dom` lib target.

* [summernote] Add missing `dom` lib target.

* [swig-email-templates] Add missing `dom` lib target.

* [materialize-css] Unify signatures according to feedback.

See https://github.com/DefinitelyTyped/DefinitelyTyped/pull/29756#pullrequestreview-165249412.
2018-10-16 10:15:06 -07:00

83 lines
2.1 KiB
TypeScript

/// <reference path="./common.d.ts" />
declare namespace M {
class Collapsible extends Component<CollapsibleOptions> {
/**
* Get Instance
*/
static getInstance(elem: Element): Collapsible;
/**
* Init Collapsible
*/
static init(els: Element, options?: Partial<CollapsibleOptions>): Collapsible;
/**
* Init Collapsibles
*/
static init(els: MElements, options?: Partial<CollapsibleOptions>): Collapsible[];
/**
* Open collapsible section
* @param n Nth section to open
*/
open(n: number): void;
/**
* Close collapsible section
* @param n Nth section to close
*/
close(n: number): void;
}
interface CollapsibleOptions {
/**
* If accordion versus collapsible
* @default true
*/
accordion: boolean;
/**
* Transition in duration in milliseconds.
* @default 300
*/
inDuration: number;
/**
* Transition out duration in milliseconds.
* @default 300
*/
outDuration: number;
/**
* Callback function called before modal is opened
* @default null
*/
onOpenStart: (this: Collapsible, el: Element) => void;
/**
* Callback function called after modal is opened
* @default null
*/
onOpenEnd: (this: Collapsible, el: Element) => void;
/**
* Callback function called before modal is closed
* @default null
*/
onCloseStart: (this: Collapsible, el: Element) => void;
/**
* Callback function called after modal is closed
* @default null
*/
onCloseEnd: (this: Collapsible, el: Element) => void;
}
}
interface JQuery {
collapsible(method: keyof Pick<M.Collapsible, "destroy">): JQuery;
collapsible(method: keyof Pick<M.Collapsible, "open"> | keyof Pick<M.Collapsible, "close">, n: number): JQuery;
collapsible(options?: Partial<M.CollapsibleOptions>): JQuery;
}