DefinitelyTyped/types/materialize-css/common.d.ts
Max a355d32369 materialize-css: Add missing declarations and tests (#25492)
* Restructure files and add missing declarations

* Add JQuery declarations

* Restructure tests

* Add carousel tests

* Add more tests and missing JQuery declarations

* Add waves declaration and a test

* Add static init methods and tests

* allow jquery and cash object to be passed to init

* Remove redundant reference

* Clean up

* Clean up

* Clean up and add tests

* Clean up and add tests
2018-05-07 11:00:18 -07:00

52 lines
1.2 KiB
TypeScript

/// <reference types="jquery"/>
/// <reference types="cash"/>
type MElements = NodeListOf<Element> | JQuery | Cash;
declare namespace M {
abstract class Component<TOptions> extends ComponentBase<TOptions> {
/**
* Construct component instance and set everything up
*/
constructor(elem: Element, options?: Partial<TOptions>);
/**
* Destroy plugin instance and teardown
*/
destroy(): void;
}
abstract class ComponentBase<TOptions> {
constructor(options?: Partial<TOptions>);
/**
* The DOM element the plugin was initialized with
*/
el: Element;
/**
* The options the instance was initialized with
*/
options: TOptions;
}
interface Openable {
isOpen: boolean;
open(): void;
close(): void;
}
interface InternationalizationOptions {
cancel: string;
clear: string;
done: string;
previousMonth: string;
nextMonth: string;
months: string[];
monthsShort: string;
weekdays: string[];
weekdaysShort: string[];
weekdaysAbbrev: string[];
}
}