js: declare scroll to item with top offset api

This commit is contained in:
王劲鹏
2023-08-03 18:58:28 +08:00
committed by osborn
parent e3ca9ae5d4
commit c4eee8ad4a
11 changed files with 990 additions and 574 deletions

View File

@@ -54,8 +54,12 @@ export declare class List extends Superview {
onDragging?: (from: number, to: number) => void;
onDragged?: (from: number, to: number) => void;
preloadItemCount?: number;
/**
* @param {number} config.topOffset - 目标位置cell的顶部偏移量
*/
scrollToItem(context: BridgeContext, index: number, config?: {
animated?: boolean;
topOffset?: number;
}): Promise<any>;
/**
* @param context

View File

@@ -50,9 +50,13 @@ export class List extends Superview {
}
return ret;
}
/**
* @param {number} config.topOffset - 目标位置cell的顶部偏移量
*/
scrollToItem(context, index, config) {
const animated = config === null || config === void 0 ? void 0 : config.animated;
return this.nativeChannel(context, 'scrollToItem')({ index, animated, });
const topOffset = config === null || config === void 0 ? void 0 : config.topOffset;
return this.nativeChannel(context, 'scrollToItem')({ index, animated, topOffset });
}
/**
* @param context