From 0b2b9ae1ac3a299f63ae5a67e3dbc891638a9b93 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 30 Dec 2024 11:36:37 +0100 Subject: [PATCH] Initial viewport conversion --- .../grid/stores/{viewport.js => viewport.ts} | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) rename packages/frontend-core/src/components/grid/stores/{viewport.js => viewport.ts} (87%) diff --git a/packages/frontend-core/src/components/grid/stores/viewport.js b/packages/frontend-core/src/components/grid/stores/viewport.ts similarity index 87% rename from packages/frontend-core/src/components/grid/stores/viewport.js rename to packages/frontend-core/src/components/grid/stores/viewport.ts index 0797f38b55..3cc5c11000 100644 --- a/packages/frontend-core/src/components/grid/stores/viewport.js +++ b/packages/frontend-core/src/components/grid/stores/viewport.ts @@ -1,7 +1,15 @@ -import { derived } from "svelte/store" +import { derived, Readable } from "svelte/store" import { MinColumnWidth } from "../lib/constants" +import { Store as StoreContext } from "." -export const deriveStores = context => { +interface ViewportDerivedStore { + scrolledRowCount: Readable + visualRowCapacity: Readable + renderedRows: Readable + columnRenderMap: Readable +} + +export const deriveStores = (context: StoreContext): ViewportDerivedStore => { const { rowHeight, scrollableColumns,