|
| 1 | +import Vue, { PluginObject } from "vue"; |
| 2 | + |
| 3 | +interface IntersectionObserverInit { |
| 4 | + root?: Element | null; |
| 5 | + rootMargin?: string; |
| 6 | + threshold?: number | number[]; |
| 7 | +} |
| 8 | + |
| 9 | +export interface LazyloadImage { |
| 10 | + src: string; |
| 11 | + error: string; |
| 12 | + loading: string; |
| 13 | +} |
| 14 | + |
| 15 | +export interface LazyOptions { |
| 16 | + lazyComponent?: boolean; |
| 17 | + preLoad?: number; |
| 18 | + error?: string; |
| 19 | + loading?: string; |
| 20 | + attempt?: number; |
| 21 | + listenEvents?: string[]; |
| 22 | + adapter?: any; |
| 23 | + filter?: any; |
| 24 | + dispatchEvent?: boolean; |
| 25 | + throttleWait?: number; |
| 26 | + observer?: boolean; |
| 27 | + observerOptions?: IntersectionObserverInit; |
| 28 | + silent?: boolean; |
| 29 | + preLoadTop?: number; |
| 30 | + scale?: number; |
| 31 | + hasbind?: boolean; |
| 32 | +} |
| 33 | + |
| 34 | +export interface ReactiveListener { |
| 35 | + el: Element; |
| 36 | + src: string; |
| 37 | + error: string; |
| 38 | + loading: string; |
| 39 | + bindType: string; |
| 40 | + attempt: number; |
| 41 | + naturalHeight: number; |
| 42 | + naturalWidth: number; |
| 43 | + options: LazyOptions; |
| 44 | + rect: DOMRect; |
| 45 | + $parent: Element |
| 46 | + elRenderer: Function; |
| 47 | + performanceData: { |
| 48 | + init: number, |
| 49 | + loadStart: number, |
| 50 | + loadEnd: number |
| 51 | + }; |
| 52 | +} |
| 53 | + |
| 54 | +export interface LazyloadHandler { |
| 55 | + $on (event: string, callback: Function): void; |
| 56 | + $once (event: string, callback: Function): void; |
| 57 | + $off (event: string, callback?: Function): void; |
| 58 | + lazyLoadHandler (): void; |
| 59 | +} |
| 60 | + |
| 61 | +export interface VueLazyLoad extends PluginObject<LazyOptions> {} |
0 commit comments