Skip to content

Instantly share code, notes, and snippets.

@Leechael
Created February 13, 2019 10:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Leechael/14d8d251d0ddeb694ab0c095961ecfe3 to your computer and use it in GitHub Desktop.
Save Leechael/14d8d251d0ddeb694ab0c095961ecfe3 to your computer and use it in GitHub Desktop.
import { Component } from '@tarojs/taro'
interface RecycleContext {
append(list: any[], callback: () => any)
splice(begin: number, count: number, list: any[], callback: () => any)
update(begin: number, list: any[], callback: () => any)
destroy()
forceUpdate(callback: () => any, reinitSlot: boolean)
getBoundingClientRect(index:number)
getScrollTop(): number
transformRpx(rpx:number):number
getViewportItems(inViewportPx: number): any
}
type RecycleViewItemSize = {
width: number
height: number
}
interface RecycleContextOptions {
id: string
dataKey: string
page: Component
itemSize: RecycleViewItemSize | Function
usingInPage: boolean
placeholderClass: any[]
}
declare function createRecycleContext(options: RecycleContextOptions): RecycleContext;
interface RecycleViewProps {
id: string
batch: "{{batchSetRecycleData}}"
height?: number
width?: number
enableBackToTop?: boolean
scrollTop?: number
scrollToIndex?: number
placeholderImage?: string
scrollWithAnimation?: boolean
lowerThreshold?: number
upperThreshold?: number
onScroll: (evt: Event) => any
onScrollToLower: (evt: Event) => any
onScrollToUpper: (evt: Event) => any
}
declare class RecycleView extends Component<RecycleViewProps, {}> {}
declare class RecycleViewItem extends Component<{}, {}> {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment