import Vnmf from '../../index' declare module '../../index' { namespace pageScrollTo { interface Option { /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Scroll Animation Time,Units ms */ duration?: number /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Scroll to the target position of page,Units px */ scrollTop?: number /** Selector, css selector */ selector?: string /** Offset distance,Needs and requirements selector Parameter Matching Use,Scroll to selector Offset position,Units px */ offsetTop?: number /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } } /** Enhancement ScrollView Example,Through [Vnmf.createSelectorQuery](/docs/apis/wxml/createSelectorQuery) It's... it's... [NodesRef.node](/docs/apis/wxml/NodesRef#node) Method acquisition。 Just... `scroll-view` Component enabled. `enhanced` Entry into force after attribute。 * @supported weapp * @example * ```tsx * Vnmf.createSelectorQuery() * .select('#scrollview') * .node() * .exec((res) => { * const scrollView = res[0].node; * scrollView.scrollEnabled = false; * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/ScrollViewContext.html */ interface ScrollViewContext { /** Scroll Switch */ scrollEnabled: boolean /** Set scroll boundary elasticity (Just... iOS Next entry into force) */ bounces: boolean /** Sets whether scrollbars should be displayed */ showScrollbar: boolean /** Slide Switch by Page */ pagingEnabled: boolean /** Set a rolling deceleration rate */ fastDeceleration: boolean /** Unroll Inertity (Just... iOS Next entry into force) */ decelerationDisabled: boolean /** Scroll to Specified Location * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/ScrollViewContext.scrollTo.html */ scrollTo(object: ScrollViewContext.scrollTo.Option): void /** Scroll to Specified Location * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/ScrollViewContext.scrollIntoView.html */ scrollIntoView( /** Element Selector */ selector: string ): void } namespace ScrollViewContext { namespace scrollTo { interface Option { /** Top Distance */ top?: number /** Left boundary distance */ left?: number /** Initial Speed */ velocity?: number /** Scroll Animation Time */ duration?: number /** Whether or not to enable rolling animations */ animated?: boolean } } } interface VnmfStatic { /** Scroll page to target position,Support selection and rolling distance for positioning in both ways * * **selector Syntax:** * selectorKind of. CSS Selector,But only the following grammars are supported:。 * * - IDSelector:#the-id * - classSelector(You can specify multiples of them on a continuous basis.):.a-class.another-class * - Subelement Selector:.the-parent > .the-child * - Progeny Selector:.the-ancestor .the-descendant * - Progeny Selector for Cross-Definitioned Components:.the-ancestor >>> .the-descendant * - Multi-selecter Convergence:#a-node, .some-other-nodes * @supported weapp, h5, rn, tt * @example * ```tsx * Vnmf.pageScrollTo({ * scrollTop: 0, * duration: 300 * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/wx.pageScrollTo.html */ pageScrollTo(option: pageScrollTo.Option): Promise } }