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
52 lines
1.2 KiB
TypeScript
52 lines
1.2 KiB
TypeScript
/// <reference path="./common.d.ts" />
|
|
|
|
declare namespace M {
|
|
class ScrollSpy extends Component<ScrollSpyOptions> {
|
|
/**
|
|
* Get Instance
|
|
*/
|
|
static getInstance(elem: Element): ScrollSpy;
|
|
|
|
/**
|
|
* Init ScrollSpy
|
|
*/
|
|
static init(els: Element, options?: Partial<ScrollSpyOptions>): ScrollSpy;
|
|
|
|
/**
|
|
* Init ScrollSpies
|
|
*/
|
|
static init(els: MElements, options?: Partial<ScrollSpyOptions>): ScrollSpy[];
|
|
}
|
|
|
|
interface ScrollSpyOptions {
|
|
/**
|
|
* Throttle of scroll handler
|
|
* @default 100
|
|
*/
|
|
throttle: number;
|
|
|
|
/**
|
|
* Offset for centering element when scrolled to
|
|
* @default 200
|
|
*/
|
|
scrollOffset: number;
|
|
|
|
/**
|
|
* Class applied to active elements
|
|
* @default 'active'
|
|
*/
|
|
activeClass: string;
|
|
|
|
/**
|
|
* Used to find active element
|
|
* @default id => 'a[href="#' + id + '"]'
|
|
*/
|
|
getActiveElement: (id: string) => string;
|
|
}
|
|
}
|
|
|
|
interface JQuery {
|
|
scrollSpy(options?: Partial<M.ScrollSpyOptions>): JQuery;
|
|
scrollSpy(method: keyof Pick<M.ScrollSpy, "destroy">): JQuery;
|
|
}
|