mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* 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
55 lines
1.3 KiB
TypeScript
55 lines
1.3 KiB
TypeScript
/// <reference path="./common.d.ts" />
|
|
|
|
declare namespace M {
|
|
class TapTarget extends Component<TapTargetOptions> {
|
|
/**
|
|
* Get Instance
|
|
*/
|
|
static getInstance(elem: Element): TapTarget;
|
|
|
|
/**
|
|
* Init TapTarget
|
|
*/
|
|
static init(els: Element, options?: Partial<TapTargetOptions>): TapTarget;
|
|
|
|
/**
|
|
* Init TapTargets
|
|
*/
|
|
static init(els: MElements, options?: Partial<TapTargetOptions>): TapTarget[];
|
|
|
|
/**
|
|
* If the tap target is open
|
|
*/
|
|
isOpen: boolean;
|
|
|
|
/**
|
|
* Open Tap Target
|
|
*/
|
|
open(): void;
|
|
|
|
/**
|
|
* Close Tap Target
|
|
*/
|
|
close(): void;
|
|
}
|
|
|
|
interface TapTargetOptions {
|
|
/**
|
|
* Callback function called when Tap Target is opened
|
|
* @default null
|
|
*/
|
|
onOpen: (this: TapTarget, origin: Element) => void;
|
|
|
|
/**
|
|
* Callback function called when Tap Target is closed
|
|
* @default null
|
|
*/
|
|
onClose: (this: TapTarget, origin: Element) => void;
|
|
}
|
|
}
|
|
|
|
interface JQuery {
|
|
tapTarget(method: keyof Pick<M.TapTarget, "open" | "close" | "destroy">): JQuery;
|
|
tapTarget(options?: Partial<M.TapTargetOptions>): JQuery;
|
|
}
|