mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
types(@vant/lazyload): add declaration (#8295)
This commit is contained in:
parent
4d17bced55
commit
273dc57077
@ -4,7 +4,7 @@
|
|||||||
"description": "This is a fork of vue-lazyload",
|
"description": "This is a fork of vue-lazyload",
|
||||||
"main": "dist/cjs/index.js",
|
"main": "dist/cjs/index.js",
|
||||||
"module": "dist/esm/index.js",
|
"module": "dist/esm/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "types/index.d.ts",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public",
|
"access": "public",
|
||||||
"registry": "https://registry.npmjs.org/"
|
"registry": "https://registry.npmjs.org/"
|
||||||
|
45
packages/vant-lazyload/types/index.d.ts
vendored
Normal file
45
packages/vant-lazyload/types/index.d.ts
vendored
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
import { App } from 'vue';
|
||||||
|
|
||||||
|
declare type ListenEvent =
|
||||||
|
| 'scroll'
|
||||||
|
| 'wheel'
|
||||||
|
| 'mousewheel'
|
||||||
|
| 'resize'
|
||||||
|
| 'animationend'
|
||||||
|
| 'transitionend'
|
||||||
|
| 'touchmove';
|
||||||
|
|
||||||
|
// eslint-disable-next-line
|
||||||
|
declare type Callback = (listener: any, options: LazyloadOptions) => void;
|
||||||
|
|
||||||
|
declare type Filter = {
|
||||||
|
webp?: Callback;
|
||||||
|
progressive?: Callback;
|
||||||
|
};
|
||||||
|
|
||||||
|
declare type Adapter = {
|
||||||
|
error?: Callback;
|
||||||
|
loaded?: Callback;
|
||||||
|
loading?: Callback;
|
||||||
|
};
|
||||||
|
|
||||||
|
export declare type LazyloadOptions = {
|
||||||
|
error?: string;
|
||||||
|
filter?: Filter;
|
||||||
|
silent?: boolean;
|
||||||
|
adapter?: Adapter;
|
||||||
|
loading?: string;
|
||||||
|
attempt?: number;
|
||||||
|
preLoad?: number;
|
||||||
|
observer?: boolean;
|
||||||
|
lazyImage?: boolean;
|
||||||
|
throttleWait?: number;
|
||||||
|
listenEvents?: ListenEvent[];
|
||||||
|
dispatchEvent?: boolean;
|
||||||
|
lazyComponent?: boolean;
|
||||||
|
observerOptions?: IntersectionObserverInit;
|
||||||
|
};
|
||||||
|
|
||||||
|
export declare const Lazyload: {
|
||||||
|
install(app: App, options?: LazyloadOptions): void;
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user