mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Initial cut * fix aos global reference * fix clearbladejs global references * fix cldr.js augmentations * fix codemirror compile errors (maybe) * fixup skipped files after merge * fix dwt/v13 * add missing references to adone * fix meteor (manually) * fix rangy * add missing file reference to react-blessed * fix react-dom? * bump codemirror to 3.2 * bump dwt to 3.2 * Add/remove OTHER_FILES.txt as needed. * bump react-codemirror to 3.2 * add references to slickgrid tests * add reference to strophe.js tests * add reference to strophe+fix types * add reference to waypoints test * Bump others to 3.9 * remove incorrectly added file * Use more explicit types reference paths * bump strophejs-plugin-roster TS version
84 lines
2.6 KiB
TypeScript
84 lines
2.6 KiB
TypeScript
// Type definitions for waypoints 4.x
|
|
// Project: https://github.com/imakewebthings/waypoints
|
|
// Definitions by: Dominik Bułaj <https://github.com/dominikbulaj>, Alexey Kolotovchenkov <https://github.com/Koloto>, Sergei Dorogin <https://github.com/evil-shrike>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
// TypeScript Version: 3.2
|
|
|
|
interface WaypointOptionsBase {
|
|
offset?: string|number|(() => number);
|
|
continuous?: boolean;
|
|
enabled?: boolean;
|
|
group?: string;
|
|
horizontal?: boolean;
|
|
}
|
|
interface WaypointOptions extends WaypointOptionsBase {
|
|
element: HTMLElement;
|
|
handler: (this: Waypoint, direction?: string) => void;
|
|
context?: HTMLElement;
|
|
}
|
|
|
|
declare class WaypointGroup {
|
|
first: () => Waypoint;
|
|
last: () => Waypoint;
|
|
name: string;
|
|
axis: string;
|
|
waypoints: Waypoint[];
|
|
}
|
|
|
|
declare class WaypointContext {
|
|
adapter: WaypointAdapter;
|
|
element: HTMLElement|Window;
|
|
waypoints: {horizontal: {}, vertical: {}}; // http://imakewebthings.com/waypoints/api/context/#waypoints-property
|
|
destroy: () => Waypoint;
|
|
refresh: () => Waypoint;
|
|
}
|
|
|
|
declare class WaypointAdapter {
|
|
constructor(element: HTMLElement);
|
|
innerHeight(): number;
|
|
innerWidth(): number;
|
|
off(event: string): undefined;
|
|
offset(): {top: number, left: number};
|
|
on(event: string, handler: () => void): undefined;
|
|
outerHeight(includeMargin: boolean): number;
|
|
outerWidth(includeMargin: boolean): number;
|
|
scrollLeft(): number;
|
|
scrollTop(): number;
|
|
static extend(...objects: any[]): any;
|
|
static inArray(value: any, array: any[], startIndex: number): number;
|
|
static isEmptyObject(object: any): boolean;
|
|
}
|
|
|
|
declare class Waypoint {
|
|
constructor(options: WaypointOptions);
|
|
// properties
|
|
adapter: WaypointAdapter;
|
|
context: WaypointContext;
|
|
element: HTMLElement;
|
|
group: WaypointGroup;
|
|
options: WaypointOptions;
|
|
triggerPoint: number;
|
|
|
|
// Instance Methods
|
|
destroy(): Waypoint;
|
|
disable(): Waypoint;
|
|
enable(): Waypoint;
|
|
next(): Waypoint | string; // actually `null` not string
|
|
previous(): Waypoint | string; // actually `null` not string
|
|
// Class Methods
|
|
static destroyAll(): void;
|
|
static disableAll(): void;
|
|
static enableAll(): void;
|
|
static refreshAll(): void;
|
|
static viewportHeight(): number;
|
|
static viewportWidth(): number;
|
|
static adapters: {
|
|
push: ({name: string, Adapter: WaypointAdapter})
|
|
};
|
|
static Adapter: WaypointAdapter;
|
|
// Waypoint.Context
|
|
static Context: {
|
|
findByElement(element: HTMLElement): WaypointContext|undefined;
|
|
};
|
|
}
|