@fileverse-dev/dsheet 2.1.2-dropIn-5 → 2.1.2-dropIn-mri-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,6 +1,6 @@
1
- import { C as s, a as t, b as o, S as r, d as l, i as n, T as S, e as d, f as i, g as c, h, j as m, k as C, l as u, n as p, o as E, p as F, q as g, r as x, s as R, t as f, u as A, v as I, w as L, x as w, z as T, A as b, B as v, D, E as M, F as k, G as V, H as z, I as P, J as U, K as X } from "./index-BDaOOD6V.js";
2
- import { bQ as y, bR as B, bS as G, ar as H, bh as O, e as j, f as q, h as J, a as K, cf as N, aq as Q, cm as Y } from "./executeStringFunction-CGbxAbbw.js";
3
- import { FLVURL as W } from "@fileverse-dev/formulajs";
1
+ import { C as s, a as t, b as o, S as r, d as l, i as n, T as d, e as i, f as S, g as c, h, j as m, k as C, l as u, n as p, o as E, p as F, q as g, r as x, s as R, t as f, u as A, v as I, w as L, x as w, z as T, A as b, B as v, D as k, E as D, F as M, G as V, H as X, I as z, J as P, K as U } from "./index-CNU6AKC2.js";
2
+ import { bV as y, bW as B, bX as G, ar as H, bh as O, e as j, f as q, h as J, a as K, ck as N, aq as W, cs as Y } from "./executeStringFunction-CXFEJvan.js";
3
+ import { FLVURL as Q } from "@fileverse-dev/formulajs";
4
4
  import { E as ee, S as ae } from "./constants-yStXQJiK.js";
5
5
  export {
6
6
  s as CommentAction,
@@ -9,13 +9,13 @@ export {
9
9
  r as DSheetEditor,
10
10
  l as DSheetSkeleton,
11
11
  ee as ERROR_MESSAGES_FLAG,
12
- W as FLVURL,
12
+ Q as FLVURL,
13
13
  n as FortuneCore,
14
14
  ae as SERVICES_API_KEY,
15
- S as TEMPLATES,
16
- d as api,
15
+ d as TEMPLATES,
16
+ i as api,
17
17
  y as clearColumnsCellsFormat,
18
- i as clearFilter,
18
+ S as clearFilter,
19
19
  B as clearRowsCellsFormat,
20
20
  G as clearSelectedCellFormat,
21
21
  c as createFilter,
@@ -44,14 +44,14 @@ export {
44
44
  N as insertRowCol,
45
45
  b as isBrowserZoomShortcut,
46
46
  v as isFormulaListShortcut,
47
- D as isOpenShortcutsModalShortcut,
48
- Q as jfrefreshgrid,
47
+ k as isOpenShortcutsModalShortcut,
48
+ W as jfrefreshgrid,
49
49
  Y as loadLocale,
50
- M as removeActiveImage,
51
- k as removeDuplicates,
50
+ D as removeActiveImage,
51
+ M as removeDuplicates,
52
52
  V as showImgChooser,
53
- z as toolbarItemClickHandler,
54
- P as updateFormat,
55
- U as useEnsStatus,
56
- X as useXLSXImport
53
+ X as toolbarItemClickHandler,
54
+ z as updateFormat,
55
+ P as useEnsStatus,
56
+ U as useXLSXImport
57
57
  };
@@ -1,5 +1,6 @@
1
1
  import { SheetConfig, Sheet, Selection, Cell, CommentBox, Rect, Image, Presence, LinkCardProps, FilterOptions, RangeDialogProps, DataRegulationProps, ConditionRulesProps, GlobalCache, CellError } from './types';
2
2
  import { FormulaCache } from './modules';
3
+ import { FormulaAsyncEvalJob } from './modules/formula-async-eval';
3
4
  import { DateBaseLocale, Hooks } from './settings';
4
5
 
5
6
  interface MutableRefObject<T> {
@@ -239,6 +240,10 @@ export type Context = {
239
240
  luckysheetPaintSingle: boolean;
240
241
  defaultCell: Cell;
241
242
  groupValuesRefreshData: any[];
243
+ /** Chunked async formula recalc queue (Step 1 perf). Cleared when job completes. */
244
+ formulaAsyncEval?: FormulaAsyncEvalJob | null;
245
+ /** True while `formulaAsyncEval` is draining on the main thread in chunks. */
246
+ isFormulaCalculating?: boolean;
242
247
  /**
243
248
  * Incremented when formula `func_selectedrange` moves via keyboard (`rangeOfFormula`)
244
249
  * so React re-renders — `FormulaCache` is a class and Immer does not track it.
@@ -7,7 +7,7 @@ export { defaultSettings } from './settings';
7
7
  export type { Settings, Hooks, DateBaseLocale } from './settings';
8
8
  export { handleCopy, handleGlobalKeyDown, handlePaste, handlePasteByClick, fixPositionOnFrozenCells, handleCellAreaMouseDown, handleCellAreaDoubleClick, handleContextMenu, mouseRender, handleOverlayMouseMove, handleOverlayMouseUp, handleRowHeaderMouseDown, handleColumnHeaderMouseDown, handleColSizeHandleMouseDown, handleColSizeHandleDoubleClick, handleRowSizeHandleMouseDown, handleColFreezeHandleMouseDown, handleRowFreezeHandleMouseDown, describeMatchedShortcut, isBrowserZoomShortcut, isOpenShortcutsModalShortcut, isFormulaListShortcut, } from './events';
9
9
  export * from './locale';
10
- export { getBorderInfoComputeRange, getBorderInfoCompute, normalizedCellAttr, normalizedAttr, getCellValue, setCellValue, getRealCellValue, mergeBorder, cancelNormalSelected, updateCell, getRangetxt, getRangeByTxt, isValidRangeText, getInlineStringHTML, applyLinkToSelection, getHyperlinksFromInlineSegments, getUniformLinkFromWindowSelectionInEditor, getHyperlinkAtCaretInContentEditable, getStyleByCell, clearSelectedCellFormat, clearRowsCellsFormat, clearColumnsCellsFormat, clipboard, moveToEnd, getRangeRectsByCharacterOffset, getDateBaseLocale, getCanonicalDateEditFormat, getDateEditFormatForCell, isUsDateBaseLocale, normalizeDateBaseLocale, shouldPreserveDateFormatForEdit, setDateBaseLocale, update, is_date, valueShowEs, isTypedCurrencyDisplayFormat, isCurrencyLikeNumberFormat, buildFiatCurrencyFormat, quoteSsfLiteral, FormulaCache, groupValuesRefresh, execFunctionGroup, setCaretPosition, getrangeseleciton, getFormulaEditorOwner, rangeHightlightselected, handleFormulaInput, israngeseleciton, createRangeHightlight, maybeRecoverDirtyRangeSelection, getFormulaRangeIndexAtCaret, isCaretAtValidFormulaRangeInsertionPoint, isLegacyFormulaRangeMode, markRangeSelectionDirty, setFormulaEditorOwner, functionHTMLGenerate, suppressFormulaRangeSelectionForInitialEdit, rangeSetValue, getFormulaRangeIndexForKeyboardSync, createFormulaRangeSelect, isFormulaReferenceInputMode, seedFormulaFuncSelectedRangeFromLastSelection, initFreeze, isInlineStringCell, getInlineStringNoStyle, rowLocation, rowLocationByIndex, colLocation, colLocationByIndex, insertRowCol, deleteRowCol, hideSelected, showSelected, isShowHidenCR, getFilterHiddenRowsUnionFromFilterMap, getFilterHiddenRowsUnion, ensureManualHiddenInitialized, rebuildRowHiddenUnion, scrollToHighlightCell, selectTitlesMap, selectTitlesRange, defaultLuckysheetSelectRanges, normalizeSelection, syncPrimaryCellActiveFromSelection, selectionIsExactlyOneMergeBlock, setPrimaryCellActive, advancePrimaryCellInLastMultiSelection, snapSheetSelectionFocusToCellPreserveMultiRange, moveHighlightCell, deleteSelectedCellText, selectAll, fixRowStyleOverflowInFreeze, fixColumnStyleOverflowInFreeze, calcSelectionInfo, addSheet, deleteSheet, editSheetName, changeSheet, updateFormat, autoSelectionFormula, handleBold, handleItalic, handleStrikeThrough, handleUnderline, handleHorizontalAlign, handleVerticalAlign, handleTextColor, handleTextBackground, handleBorder, handleMerge, mergeSelectionHasValues, handleSort, getRemoveDuplicatesPreview, removeDuplicates, getRemoveDuplicatesErrorMessage, handleFreeze, handleTextSize, handleSum, handleLink, captureLinkEditorOpenSnapshot, isHyperlinkCreationBlocked, toolbarItemClickHandler, toolbarItemSelectedFunc, handleScreenShot, insertImage, showImgChooser, drawArrow, setEditingComment, removeEditingComment, removeOverShowComment, newComment, editComment, deleteComment, showComments, showHideComment, showHideAllComments, onCommentBoxMoveStart, removeActiveImage, cancelActiveImgItem, onImageMoveStart, onImageResizeStart, createDropCellRange, sortSelection, sortSheetBySelectedColumn, searchAll, searchNext, replace, replaceAll, replaceAllScoped, getSearchIndexArr, getSearchIndexArrAsync, getFindRangeOnCurrentSheet, getQuickSearchIndexArr, getQuickSearchHiddenConfig, getCellHyperlinks, getHyperlinkDisplayTextInCell, getInlineLinkPlainRange, getUniformLinkCoveringPlainRange, getUniformLinkAtPlainOffset, removeHyperlinkForLink, updateHyperlinkForLink, syncLinkCardAfterHyperlinkChange, expandCellRectForMerge, shouldQuickSearchUseAsync, runQuickSearchIndexArrAsync, QUICK_SEARCH_ASYNC_ROW_THRESHOLD, parseRangeText, getCellRowColumn, getCellHyperlink, saveHyperlink, removeHyperlink, showLinkCard, goToLink, isLinkValid, createFilterOptions, clearFilter, clearFilterForColumn, toggleViewerFilter, createFilter, applySheetFilterState, getFilterColumnValues, getFilterColumnColors, orderbydatafiler, saveFilter, onCellsMoveStart, cfSplitRange, updateMoreCell, getRegStr, getDataArr, applyLocation, getOptionValue, getSelectRange, getDropdownList, setDropdownValue, confirmMessage, setConditionRules, CF_DATE_DEFAULT_FORMAT, parseCfDateConditionForUi, formatCfDatePresetSnapshot, parseDdMmYyyyToSerial, handleOverlayTouchStart, handleOverlayTouchEnd, MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, jfrefreshgrid, sanitizeDuneUrl, insertDuneChart, onIframeMoveStart, onIframeResizeStart, onIframeMove, onIframeMoveEnd, onIframeResize, onIframeResizeEnd, setCellError, clearCellError, detectDateFormat, isdatatypemulti, diff, isdatetime, isRealNull, isRealNum, isNumericCellType, iscelldata, getcellrange, cancelFunctionrangeSelected, seletedHighlistByindex, spillSortResult, execfunction, insertUpdateFunctionGroup, remapFormulaReferencesByMap, checkCF, getComputeMap, cancelPaintModel, hideCRCount, getdatabyselection, } from './modules';
10
+ export { getBorderInfoComputeRange, getBorderInfoCompute, normalizedCellAttr, normalizedAttr, getCellValue, setCellValue, getRealCellValue, mergeBorder, cancelNormalSelected, updateCell, getRangetxt, getRangeByTxt, isValidRangeText, getInlineStringHTML, applyLinkToSelection, getHyperlinksFromInlineSegments, getUniformLinkFromWindowSelectionInEditor, getHyperlinkAtCaretInContentEditable, getStyleByCell, clearSelectedCellFormat, clearRowsCellsFormat, clearColumnsCellsFormat, clipboard, moveToEnd, getRangeRectsByCharacterOffset, getDateBaseLocale, getCanonicalDateEditFormat, getDateEditFormatForCell, isUsDateBaseLocale, normalizeDateBaseLocale, shouldPreserveDateFormatForEdit, setDateBaseLocale, update, is_date, valueShowEs, isTypedCurrencyDisplayFormat, isCurrencyLikeNumberFormat, buildFiatCurrencyFormat, quoteSsfLiteral, FormulaCache, groupValuesRefresh, execFunctionGroup, runFormulaEvalChunk, applyWorkerFormulaChunkResults, isFormulaEvalPending, FORMULA_ASYNC_CHUNK_SIZE, FORMULA_ASYNC_EVAL_THRESHOLD, FORMULA_WORKER_CHUNK_SIZE, FORMULA_WORKER_THRESHOLD, setCaretPosition, getrangeseleciton, getFormulaEditorOwner, rangeHightlightselected, handleFormulaInput, israngeseleciton, createRangeHightlight, maybeRecoverDirtyRangeSelection, getFormulaRangeIndexAtCaret, isCaretAtValidFormulaRangeInsertionPoint, isLegacyFormulaRangeMode, markRangeSelectionDirty, setFormulaEditorOwner, functionHTMLGenerate, suppressFormulaRangeSelectionForInitialEdit, rangeSetValue, getFormulaRangeIndexForKeyboardSync, createFormulaRangeSelect, isFormulaReferenceInputMode, seedFormulaFuncSelectedRangeFromLastSelection, initFreeze, isInlineStringCell, getInlineStringNoStyle, rowLocation, rowLocationByIndex, colLocation, colLocationByIndex, insertRowCol, deleteRowCol, hideSelected, showSelected, isShowHidenCR, getFilterHiddenRowsUnionFromFilterMap, getFilterHiddenRowsUnion, ensureManualHiddenInitialized, rebuildRowHiddenUnion, scrollToHighlightCell, selectTitlesMap, selectTitlesRange, defaultLuckysheetSelectRanges, normalizeSelection, syncPrimaryCellActiveFromSelection, selectionIsExactlyOneMergeBlock, setPrimaryCellActive, advancePrimaryCellInLastMultiSelection, snapSheetSelectionFocusToCellPreserveMultiRange, moveHighlightCell, deleteSelectedCellText, selectAll, fixRowStyleOverflowInFreeze, fixColumnStyleOverflowInFreeze, calcSelectionInfo, addSheet, deleteSheet, editSheetName, changeSheet, updateFormat, autoSelectionFormula, handleBold, handleItalic, handleStrikeThrough, handleUnderline, handleHorizontalAlign, handleVerticalAlign, handleTextColor, handleTextBackground, handleBorder, handleMerge, mergeSelectionHasValues, handleSort, getRemoveDuplicatesPreview, removeDuplicates, getRemoveDuplicatesErrorMessage, handleFreeze, handleTextSize, handleSum, handleLink, captureLinkEditorOpenSnapshot, isHyperlinkCreationBlocked, toolbarItemClickHandler, toolbarItemSelectedFunc, handleScreenShot, insertImage, showImgChooser, drawArrow, setEditingComment, removeEditingComment, removeOverShowComment, newComment, editComment, deleteComment, showComments, showHideComment, showHideAllComments, onCommentBoxMoveStart, removeActiveImage, cancelActiveImgItem, onImageMoveStart, onImageResizeStart, createDropCellRange, sortSelection, sortSheetBySelectedColumn, searchAll, searchNext, replace, replaceAll, replaceAllScoped, getSearchIndexArr, getSearchIndexArrAsync, getFindRangeOnCurrentSheet, getQuickSearchIndexArr, getQuickSearchHiddenConfig, getCellHyperlinks, getHyperlinkDisplayTextInCell, getInlineLinkPlainRange, getUniformLinkCoveringPlainRange, getUniformLinkAtPlainOffset, removeHyperlinkForLink, updateHyperlinkForLink, syncLinkCardAfterHyperlinkChange, expandCellRectForMerge, shouldQuickSearchUseAsync, runQuickSearchIndexArrAsync, QUICK_SEARCH_ASYNC_ROW_THRESHOLD, parseRangeText, getCellRowColumn, getCellHyperlink, saveHyperlink, removeHyperlink, showLinkCard, goToLink, isLinkValid, createFilterOptions, clearFilter, clearFilterForColumn, toggleViewerFilter, createFilter, applySheetFilterState, getFilterColumnValues, getFilterColumnColors, orderbydatafiler, saveFilter, onCellsMoveStart, cfSplitRange, updateMoreCell, getRegStr, getDataArr, applyLocation, getOptionValue, getSelectRange, getDropdownList, setDropdownValue, confirmMessage, setConditionRules, CF_DATE_DEFAULT_FORMAT, parseCfDateConditionForUi, formatCfDatePresetSnapshot, parseDdMmYyyyToSerial, handleOverlayTouchStart, handleOverlayTouchEnd, MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, jfrefreshgrid, sanitizeDuneUrl, insertDuneChart, onIframeMoveStart, onIframeResizeStart, onIframeMove, onIframeMoveEnd, onIframeResize, onIframeResizeEnd, setCellError, clearCellError, detectDateFormat, isdatatypemulti, diff, isdatetime, isRealNull, isRealNum, isNumericCellType, iscelldata, getcellrange, cancelFunctionrangeSelected, seletedHighlistByindex, spillSortResult, execfunction, insertUpdateFunctionGroup, remapFormulaReferencesByMap, checkCF, getComputeMap, cancelPaintModel, hideCRCount, getdatabyselection, } from './modules';
11
11
  export type { FilterDate, FilterValue, FilterColor } from './modules';
12
12
  export { getFreezeState, toggleFreeze, indexToColumnChar, escapeScriptTag, escapeHTMLTag, getSheetIndex, replaceHtml, isAllowEdit, isAllowEditReadOnly, filterPatch, patchToOp, opToPatch, inverseRowColOptions, } from './utils';
13
13
  export type { PatchOptions, ChangedSheet } from './utils';
@@ -0,0 +1,26 @@
1
+ /** Minimum formula count before deferring eval to chunked async (Step 1). */
2
+ export declare const FORMULA_ASYNC_EVAL_THRESHOLD = 15;
3
+ /** Formulas evaluated per animation frame during async recalc. */
4
+ export declare const FORMULA_ASYNC_CHUNK_SIZE = 20;
5
+ /** Use a Web Worker when the async job has at least this many formulas. */
6
+ export declare const FORMULA_WORKER_THRESHOLD = 100;
7
+ /** Formulas evaluated per worker message (larger — runs off main thread). */
8
+ export declare const FORMULA_WORKER_CHUNK_SIZE = 150;
9
+ export type FormulaAsyncEvalJob = {
10
+ formulaRunList: Array<{
11
+ r: number;
12
+ c: number;
13
+ id: string;
14
+ calc_funcStr: string;
15
+ level?: number;
16
+ }>;
17
+ calcChainKeys: string[];
18
+ impactedByCircular: string[];
19
+ cycleNodes: string[];
20
+ nextIndex: number;
21
+ total: number;
22
+ };
23
+ export declare function isFormulaEvalPending(ctx: {
24
+ isFormulaCalculating?: boolean;
25
+ formulaAsyncEval?: FormulaAsyncEvalJob | null;
26
+ }): boolean;
@@ -0,0 +1,20 @@
1
+ export type RangePassCacheEntry = {
2
+ fragment: any[][];
3
+ cryptoDenomination: string;
4
+ cryptoDecimal: number;
5
+ globalDataKeysFingerprint: string;
6
+ };
7
+ export declare function makeRangePassCacheKey(sheetId: string, startRow: number, endRow: number, startCol: number, endCol: number): string;
8
+ export declare function collectGlobalDataKeysInRange(execFunctionGlobalData: Record<string, unknown>, sheetId: string, startRow: number, endRow: number, startCol: number, endCol: number): string;
9
+ /** Remove the formula origin cell from a full rectangular range fragment. */
10
+ export declare function sliceRangeFragmentForOrigin(full: any[][], startRow: number, startCol: number, originRow: number | null | undefined, originCol: number | null | undefined): any[][];
11
+ type RangeCacheHost = {
12
+ rangeValuePassCache?: Map<string, RangePassCacheEntry>;
13
+ rangeValuePassCacheStats?: {
14
+ hits: number;
15
+ misses: number;
16
+ };
17
+ };
18
+ export declare function beginRangeValuePassCache(cache: RangeCacheHost): void;
19
+ export declare function clearRangeValuePassCache(cache: RangeCacheHost): void;
20
+ export {};
@@ -0,0 +1,40 @@
1
+ import { CellMatrix } from '../types';
2
+
3
+ export type SnapshotSheet = {
4
+ id: string;
5
+ name: string;
6
+ data: CellMatrix | null | undefined;
7
+ };
8
+ export type SnapshotFormulaCell = {
9
+ r: number;
10
+ c: number;
11
+ id: string;
12
+ calc_funcStr: string;
13
+ };
14
+ export type SnapshotFormulaResult = {
15
+ r: number;
16
+ c: number;
17
+ id: string;
18
+ v: unknown;
19
+ f: string;
20
+ spe?: unknown;
21
+ deps: string[];
22
+ isError: boolean;
23
+ };
24
+ export type SnapshotEvalInput = {
25
+ sheets: SnapshotSheet[];
26
+ execFunctionGlobalData: Record<string, {
27
+ v: unknown;
28
+ f: unknown;
29
+ }>;
30
+ formulas: SnapshotFormulaCell[];
31
+ };
32
+ export type SnapshotEvalOutput = {
33
+ execFunctionGlobalData: Record<string, {
34
+ v: unknown;
35
+ f: unknown;
36
+ }>;
37
+ results: SnapshotFormulaResult[];
38
+ };
39
+ /** Worker-safe formula evaluation against plain sheet snapshots (no React/immer). */
40
+ export declare function evalFormulasInSnapshot(input: SnapshotEvalInput): SnapshotEvalOutput;
@@ -0,0 +1,7 @@
1
+ /** Cell / formula key format used in depsByCell and revDepsByCell. */
2
+ export declare function toFormulaDepCellKey(sheetId: string, r: number, c: number): string;
3
+ /**
4
+ * Walk revDepsByCell from a changed cell to collect every formula cell that
5
+ * must recalculate (direct + transitive dependents).
6
+ */
7
+ export declare function collectTransitiveFormulaDependents(originCellKey: string, revDepsByCell: Map<string, Set<string>>): Set<string>;
@@ -0,0 +1,13 @@
1
+ import { Context } from '../context';
2
+ import { SnapshotEvalInput, SnapshotEvalOutput, SnapshotFormulaCell } from './formula-snapshot-eval';
3
+ import { FORMULA_WORKER_CHUNK_SIZE } from './formula-async-eval';
4
+
5
+ export declare function buildSnapshotEvalInput(ctx: Context, formulas: SnapshotFormulaCell[]): SnapshotEvalInput;
6
+ /**
7
+ * Evaluate a formula chunk off the critical UI path when possible.
8
+ * Uses an inline Web Worker; falls back to main-thread snapshot eval.
9
+ */
10
+ export declare function evalFormulasInBackground(input: SnapshotEvalInput): Promise<SnapshotEvalOutput>;
11
+ /** @deprecated Use evalFormulasInBackground */
12
+ export declare const evalFormulasInWorker: typeof evalFormulasInBackground;
13
+ export { FORMULA_WORKER_CHUNK_SIZE };
@@ -0,0 +1,17 @@
1
+ import { SnapshotEvalInput, SnapshotEvalOutput } from './formula-snapshot-eval';
2
+
3
+ export type WorkerEvalRequest = {
4
+ type: 'eval';
5
+ requestId: number;
6
+ input: SnapshotEvalInput;
7
+ };
8
+ export type WorkerEvalResponse = {
9
+ type: 'eval-result';
10
+ requestId: number;
11
+ output: SnapshotEvalOutput;
12
+ };
13
+ export type WorkerEvalError = {
14
+ type: 'eval-error';
15
+ requestId: number;
16
+ message: string;
17
+ };
@@ -1,5 +1,8 @@
1
- import { Cell, Rect, Selection } from '../types';
1
+ import { Cell, CellMatrix, Rect, Selection } from '../types';
2
2
  import { Context } from '../context';
3
+ import { FormulaAsyncEvalJob } from './formula-async-eval';
4
+ import { RangePassCacheEntry } from './formula-range-cache';
5
+ import { SnapshotEvalOutput } from './formula-snapshot-eval';
3
6
 
4
7
  /** True when the formula is only numeric ops on TODAY()/NOW() (incl. unary +/−); used to display serials as dates. */
5
8
  export declare function isTodayNowPureArithmeticDateResult(formula: string, value: number): boolean;
@@ -45,7 +48,18 @@ export declare class FormulaCache {
45
48
  originKey: string;
46
49
  deps: Set<string>;
47
50
  };
51
+ /** Step 2: per execFunctionGroup pass cache for materialized range reads. */
52
+ rangeValuePassCache?: Map<string, RangePassCacheEntry>;
53
+ rangeValuePassCacheStats?: {
54
+ hits: number;
55
+ misses: number;
56
+ };
48
57
  constructor();
58
+ materializeFullRangeFragment(context: Context, sheetId: string, flowdata: CellMatrix | null | undefined, startRow: number, endRow: number, startCol: number, endCol: number): {
59
+ fragment: any[][];
60
+ cryptoDenomination: string;
61
+ cryptoDecimal: number;
62
+ };
49
63
  tryGetCellAsNumber(cell: Cell): string | number | boolean | undefined;
50
64
  }
51
65
  export declare function iscelldata(txt: string): boolean;
@@ -55,6 +69,10 @@ export declare function delFunctionGroup(ctx: Context, r: number, c: number, id?
55
69
  export declare function insertUpdateFunctionGroup(ctx: Context, r: number, c: number, id?: string, calcChainSet?: Set<string>): void;
56
70
  export declare function execfunction(ctx: Context, txt: string, r: number, c: number, id?: string, calcChainSet?: Set<string>, isrefresh?: boolean, notInsertFunc?: boolean): any[];
57
71
  export declare function groupValuesRefresh(ctx: Context): void;
72
+ /** Apply worker chunk output onto the live context (main thread only). */
73
+ export declare function applyWorkerFormulaChunkResults(ctx: Context, output: SnapshotEvalOutput, impactedByCircular: Set<string>, cycleNodes: Set<string>): void;
74
+ /** Run up to `chunkSize` formulas from an async job. Returns true when job is complete. */
75
+ export declare function runFormulaEvalChunk(ctx: Context, job: FormulaAsyncEvalJob, chunkSize?: number): boolean;
58
76
  export declare function execFunctionGroup(ctx: Context, origin_r: number, origin_c: number, value: any, id?: string, data?: any, isForce?: boolean): void;
59
77
  /**
60
78
  * Before the first `moveHighlightCell/Range(..., "rangeOfFormula")` while editing
@@ -5,6 +5,8 @@ export { moveToEnd, getRangeRectsByCharacterOffset } from './cursor';
5
5
  export { getDateBaseLocale, getCanonicalDateEditFormat, getDateEditFormatForCell, isUsDateBaseLocale, normalizeDateBaseLocale, shouldPreserveDateFormatForEdit, setDateBaseLocale, } from './date-base-locale';
6
6
  export { update, is_date, valueShowEs, isTypedCurrencyDisplayFormat, isCurrencyLikeNumberFormat, buildFiatCurrencyFormat, quoteSsfLiteral, } from './format';
7
7
  export { FormulaCache, groupValuesRefresh, setCaretPosition, getrangeseleciton, getFormulaEditorOwner, rangeHightlightselected, handleFormulaInput, israngeseleciton, createRangeHightlight, createFormulaRangeSelect, maybeRecoverDirtyRangeSelection, delFunctionGroup, functionHTMLGenerate, onFormulaRangeDragEnd, rangeDrag, rangeSetValue, remapFormulaReferencesByMap, getFormulaRangeIndexAtCaret, isCaretAtValidFormulaRangeInsertionPoint, isLegacyFormulaRangeMode, markRangeSelectionDirty, getFormulaRangeIndexForKeyboardSync, isFormulaReferenceInputMode, seedFormulaFuncSelectedRangeFromLastSelection, functionStrChange, setFormulaEditorOwner, getAllFunctionGroup, suppressFormulaRangeSelectionForInitialEdit, } from './formula';
8
+ export { FORMULA_ASYNC_CHUNK_SIZE, FORMULA_ASYNC_EVAL_THRESHOLD, FORMULA_WORKER_CHUNK_SIZE, FORMULA_WORKER_THRESHOLD, isFormulaEvalPending, } from './formula-async-eval';
9
+ export type { FormulaAsyncEvalJob } from './formula-async-eval';
8
10
  export { initFreeze } from './freeze';
9
11
  export { isInlineStringCell, getInlineStringNoStyle, applyLinkToSelection, getHyperlinksFromInlineSegments, getUniformLinkFromWindowSelectionInEditor, getHyperlinkAtCaretInContentEditable, } from './inline-string';
10
12
  export { rowLocation, rowLocationByIndex, colLocation, colLocationByIndex, } from './location';
@@ -40,6 +42,6 @@ export { sanitizeDuneUrl, insertDuneChart, onIframeMoveStart, onIframeResizeStar
40
42
  export { setCellError, clearCellError, overShowError, } from './error-state-helpers';
41
43
  export { checkCellIsLocked } from './protection';
42
44
  export { detectDateFormat, isdatatypemulti, diff, isdatetime, isRealNull, isRealNum, isNumericCellType, } from './validation';
43
- export { iscelldata, getcellrange, execfunction, execFunctionGroup, insertUpdateFunctionGroup, functionCopy, } from './formula';
45
+ export { iscelldata, getcellrange, execfunction, execFunctionGroup, runFormulaEvalChunk, applyWorkerFormulaChunkResults, insertUpdateFunctionGroup, functionCopy, } from './formula';
44
46
  export { checkCF, getComputeMap } from './ConditionFormat';
45
47
  export { getdatabyselection, getQKBorder } from './cell';