File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ const SCROLL_OFFSET = 2;
1515
1616export type RenderProcessorOptions = {
1717 initialIndex ?: number ;
18+ initialCursor ?: number ;
19+ initialOffset ?: number ;
1820 height ?: number ;
1921 scrollOffset ?: number ;
2022} ;
@@ -27,9 +29,9 @@ export class RenderProcessor<T extends Detail> implements Disposable {
2729 #processing?: Promise < void > ;
2830 #reserved?: ( ) => void ;
2931 #items: DisplayItem < T > [ ] = [ ] ;
30- #itemCount: number = 0 ;
31- #cursor: number = 0 ;
32- #offset: number = 0 ;
32+ #itemCount = 0 ;
33+ #cursor: number ;
34+ #offset: number ;
3335
3436 constructor (
3537 renderers : readonly Renderer < T > [ ] ,
@@ -40,6 +42,8 @@ export class RenderProcessor<T extends Detail> implements Disposable {
4042 } ) ;
4143 this . #height = options . height ?? HEIGHT ;
4244 this . #scrollOffset = options . scrollOffset ?? SCROLL_OFFSET ;
45+ this . #cursor = options . initialCursor ?? 0 ;
46+ this . #offset = options . initialOffset ?? 0 ;
4347 }
4448
4549 get #renderer( ) : Renderer < T > | undefined {
@@ -61,7 +65,7 @@ export class RenderProcessor<T extends Detail> implements Disposable {
6165 this . renderers . index = index ;
6266 }
6367
64- get items ( ) {
68+ get items ( ) : readonly DisplayItem < T > [ ] {
6569 return this . #items;
6670 }
6771
You can’t perform that action at this time.
0 commit comments