diff --git a/api/@internal/component/ets/list.d.ts b/api/@internal/component/ets/list.d.ts index 640cfb35d4ec09fab801d601b980cc956a8afb0e..a27e4c02105925844982a00d569dbcdb02e0afc1 100644 --- a/api/@internal/component/ets/list.d.ts +++ b/api/@internal/component/ets/list.d.ts @@ -1928,6 +1928,23 @@ declare class ListAttribute extends ScrollableCommonMethod { */ cachedCount(count: number, show: boolean): ListAttribute; + /** + * Sets the number of list items or list item groups to be cached (preloaded) and specifies whether to display the preloaded nodes. + * + * @param { number | CacheCountInfo } count - If the parameter type is number, it indicates number of list items to be preloaded. + * If the parameter type is CacheCountInfo, it indicates the range of list items to be preloaded. + *
Default value: number of nodes visible on the screen, with the maximum value of 16 + *
Value range for number type: [0, +∞) + * @param { boolean } show - Whether to display the preloaded list items.
Default value: false + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 22 + */ + cachedCount(count: number | CacheCountInfo, show: boolean): ListAttribute; + /** * Called when setting whether to enable chain linkage dynamic effect. * diff --git a/api/@internal/component/ets/units.d.ts b/api/@internal/component/ets/units.d.ts index 97d157a81483aa3aefc897f7b2ca1d73333fefa6..db12680b68e8635795b770cb4e4a9fc93cf58f35 100644 --- a/api/@internal/component/ets/units.d.ts +++ b/api/@internal/component/ets/units.d.ts @@ -3978,4 +3978,33 @@ declare interface ScrollBarMargin { * @since 20 */ end?: LengthMetrics; +} + +/** + * Define cache count information. + * + * @interface CacheCountInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 22 + */ +declare interface CacheCountInfo { + /** + * min cache count. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 22 + */ + minCount: number; + /** + * max cache count. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 22 + */ + maxCount: number; } \ No newline at end of file