mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
pulltorefreshjs - Added missing function exports and properties to Options interface
This commit is contained in:
Vendored
+19
@@ -1,10 +1,15 @@
|
||||
// Type definitions for pulltorefreshjs 0.1
|
||||
// Project: https://github.com/BoxFactura/pulltorefresh.js
|
||||
// Definitions by: Daniel Rosenwasser <https://github.com/DanielRosenwasser>
|
||||
// Tamas Kinsztler <https://github.com/humpedli>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export function init(options?: Options): void;
|
||||
|
||||
export function destroyAll(): void;
|
||||
|
||||
export function setPassiveMode(isPassive: boolean): void;
|
||||
|
||||
export interface Options {
|
||||
/**
|
||||
* Minimum distance required to trigger the refresh.
|
||||
@@ -108,6 +113,20 @@ export interface Options {
|
||||
* Defaults to `t => Math.min(1, t / 2.5)`
|
||||
*/
|
||||
resistanceFunction?(input: number): number;
|
||||
|
||||
/**
|
||||
* Which condition should be met for pullToRefresh to trigger?
|
||||
*
|
||||
* Defaults to `!window.scrollY`
|
||||
*/
|
||||
shouldPullToRefresh?(): boolean;
|
||||
|
||||
/**
|
||||
* This value will be passed as `{ passive: true|false }` to `touchmove`
|
||||
* listeners if passive-handlers are supported.
|
||||
* (default: `false`)
|
||||
*/
|
||||
passive?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,3 +17,9 @@ PullToRefresh.init({
|
||||
mainElement: "body",
|
||||
onRefresh: () => Promise.resolve(),
|
||||
});
|
||||
|
||||
PullToRefresh.destroyAll();
|
||||
|
||||
PullToRefresh.setPassiveMode(true);
|
||||
|
||||
PullToRefresh.setPassiveMode(false);
|
||||
|
||||
Reference in New Issue
Block a user