diff --git a/types/pulltorefreshjs/index.d.ts b/types/pulltorefreshjs/index.d.ts index 2eab5b6741..133d3d19c0 100644 --- a/types/pulltorefreshjs/index.d.ts +++ b/types/pulltorefreshjs/index.d.ts @@ -1,10 +1,15 @@ // Type definitions for pulltorefreshjs 0.1 // Project: https://github.com/BoxFactura/pulltorefresh.js // Definitions by: Daniel Rosenwasser +// Tamas Kinsztler // 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; } /** diff --git a/types/pulltorefreshjs/pulltorefreshjs-tests.ts b/types/pulltorefreshjs/pulltorefreshjs-tests.ts index 47ca43a2e9..aa95cc3380 100644 --- a/types/pulltorefreshjs/pulltorefreshjs-tests.ts +++ b/types/pulltorefreshjs/pulltorefreshjs-tests.ts @@ -17,3 +17,9 @@ PullToRefresh.init({ mainElement: "body", onRefresh: () => Promise.resolve(), }); + +PullToRefresh.destroyAll(); + +PullToRefresh.setPassiveMode(true); + +PullToRefresh.setPassiveMode(false);