open-grid 1.6.1 → 1.7.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.
Files changed (134) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/dist/ExportProgressView-BYPw8osg.cjs +2 -0
  3. package/dist/ExportProgressView-Bt5-z7rE.js +2 -0
  4. package/dist/LcpMergeOrderer-CeP6C6G1.cjs +2 -0
  5. package/dist/LcpMergeOrderer-Ebwuir-r.js +2 -0
  6. package/dist/OpenGrid-Bh1NMOcm.cjs +98 -0
  7. package/dist/OpenGrid-CeXt04ho.js +98 -0
  8. package/dist/Registry-CrT46EAO.js +2 -0
  9. package/dist/Registry-DpHOpU5V.cjs +2 -0
  10. package/dist/XlsxChannel-CuOZ3LQz.js +2 -0
  11. package/dist/XlsxChannel-DQHLGend.cjs +2 -0
  12. package/dist/XlsxWorkbookWriter-DixuNGtw.cjs +3 -0
  13. package/dist/XlsxWorkbookWriter-VgbibI0Z.js +3 -0
  14. package/dist/fflate-Cs3txMgg.js +2 -0
  15. package/dist/fflate-G9RAFEgF.cjs +2 -0
  16. package/dist/index-1OXjJmct.js +2 -0
  17. package/dist/index-B5V7e4Xc.js +2 -0
  18. package/dist/index-DbKDox8y.cjs +2 -0
  19. package/dist/index-HaDoF1HM.cjs +2 -0
  20. package/dist/open-grid-react.cjs +1 -27
  21. package/dist/open-grid-react.js +1 -30
  22. package/dist/open-grid-vue.cjs +1 -31
  23. package/dist/open-grid-vue.js +1 -33
  24. package/dist/open-grid.cjs +6 -275
  25. package/dist/open-grid.js +6 -293
  26. package/dist/sinks-BCZFMGQJ.cjs +2 -0
  27. package/dist/sinks-qkBJ5bKn.js +2 -0
  28. package/dist/types/core/CFRenderBridge.d.ts +5 -1
  29. package/dist/types/core/CellEditManager.d.ts +26 -2
  30. package/dist/types/core/CellEventHandler.d.ts +6 -2
  31. package/dist/types/core/ColumnLayout.d.ts +8 -0
  32. package/dist/types/core/DataLayer.d.ts +48 -1
  33. package/dist/types/core/DetailManager.d.ts +43 -2
  34. package/dist/types/core/ExportManager.d.ts +25 -0
  35. package/dist/types/core/FindBarManager.d.ts +6 -2
  36. package/dist/types/core/FlatRowModel.d.ts +61 -3
  37. package/dist/types/core/FooterManager.d.ts +43 -1
  38. package/dist/types/core/FormulaController.d.ts +4 -4
  39. package/dist/types/core/GridComposer.d.ts +11 -1
  40. package/dist/types/core/GridRenderer.d.ts +84 -19
  41. package/dist/types/core/GroupTreeManager.d.ts +6 -4
  42. package/dist/types/core/KeyboardManager.d.ts +3 -2
  43. package/dist/types/core/MutationService.d.ts +10 -8
  44. package/dist/types/core/OpenGrid.d.ts +7 -5
  45. package/dist/types/core/RangeSelectionManager.d.ts +23 -2
  46. package/dist/types/core/RenderController.d.ts +126 -8
  47. package/dist/types/core/SortFilterManager.d.ts +10 -2
  48. package/dist/types/core/VirtualScroll.d.ts +12 -0
  49. package/dist/types/core/coordinate/CellTextPolicy.d.ts +58 -0
  50. package/dist/types/core/coordinate/ColumnGeometry.d.ts +60 -0
  51. package/dist/types/core/coordinate/ColumnWindow.d.ts +40 -0
  52. package/dist/types/core/coordinate/ColumnWindowPolicy.d.ts +89 -0
  53. package/dist/types/core/coordinate/ExtraColumns.d.ts +39 -0
  54. package/dist/types/core/coordinate/RangeRectCalculator.d.ts +35 -0
  55. package/dist/types/core/coordinate/ViewportHeightJudge.d.ts +28 -0
  56. package/dist/types/core/coordinate/geometryPorts.d.ts +250 -0
  57. package/dist/types/core/coordinate/ports.d.ts +5 -0
  58. package/dist/types/core/domain/footer/FooterValues.d.ts +50 -0
  59. package/dist/types/core/domain/footer/ports.d.ts +31 -0
  60. package/dist/types/core/domain/render/RenderPlanner.d.ts +17 -0
  61. package/dist/types/core/domain/render/RenderRequest.d.ts +91 -0
  62. package/dist/types/core/domain/render/ports.d.ts +169 -0
  63. package/dist/types/core/domain/resize/ResizeGesture.d.ts +25 -0
  64. package/dist/types/core/domain/resize/ResizeHitZone.d.ts +23 -0
  65. package/dist/types/core/domain/resize/ports.d.ts +64 -0
  66. package/dist/types/core/domain/sort/ComparisonOrderer.d.ts +11 -0
  67. package/dist/types/core/domain/sort/LcpMergeOrderer.d.ts +15 -0
  68. package/dist/types/core/domain/sort/RankIndex.d.ts +74 -0
  69. package/dist/types/core/domain/sort/SortCostEstimate.d.ts +36 -0
  70. package/dist/types/core/domain/sort/SortKeyColumn.d.ts +89 -0
  71. package/dist/types/core/domain/sort/SortKeyStore.d.ts +34 -0
  72. package/dist/types/core/domain/sort/Sorter.d.ts +54 -0
  73. package/dist/types/core/domain/sort/SyncSortRunner.d.ts +9 -0
  74. package/dist/types/core/domain/sort/commonPrefix.d.ts +5 -0
  75. package/dist/types/core/domain/sort/ports.d.ts +140 -0
  76. package/dist/types/core/export/ExportProgressView.d.ts +28 -0
  77. package/dist/types/core/export/channels/XlsxChannel.d.ts +38 -1
  78. package/dist/types/core/export/channels/XlsxRichTextRun.d.ts +14 -0
  79. package/dist/types/core/export/channels/XlsxSheetXml.d.ts +19 -0
  80. package/dist/types/core/export/channels/XlsxStyleEntries.d.ts +80 -0
  81. package/dist/types/core/export/channels/XlsxStylesRegistry.d.ts +20 -0
  82. package/dist/types/core/export/channels/XlsxWorkbookWriter.d.ts +20 -0
  83. package/dist/types/core/export/channels/XlsxXml.d.ts +6 -0
  84. package/dist/types/core/export/index.d.ts +2 -0
  85. package/dist/types/core/export/sinks.d.ts +81 -0
  86. package/dist/types/core/export/types.d.ts +63 -0
  87. package/dist/types/core/host/archCheck.d.ts +16 -1
  88. package/dist/types/core/i18n/locales/en.d.ts +6 -0
  89. package/dist/types/core/i18n/locales/ko.d.ts +6 -0
  90. package/dist/types/core/i18n/types.d.ts +8 -0
  91. package/dist/types/core/render/FooterView.d.ts +121 -0
  92. package/dist/types/core/render/GeometryApplier.d.ts +55 -0
  93. package/dist/types/core/render/HorizontalReveal.d.ts +26 -0
  94. package/dist/types/core/render/RangeOverlayAdapter.d.ts +10 -0
  95. package/dist/types/core/render/RenderScheduler.d.ts +225 -0
  96. package/dist/types/core/render/ResizeSinkAdapter.d.ts +35 -0
  97. package/dist/types/core/render/ScrollFollower.d.ts +34 -0
  98. package/dist/types/core/render/ScrollObserver.d.ts +47 -0
  99. package/dist/types/core/render/ScrollbarGutter.d.ts +19 -0
  100. package/dist/types/core/render/body/BodyEventRouter.d.ts +58 -0
  101. package/dist/types/core/render/body/BodyRowSet.d.ts +28 -0
  102. package/dist/types/core/render/body/BodyView.d.ts +185 -0
  103. package/dist/types/core/render/body/CellLocator.d.ts +36 -0
  104. package/dist/types/core/render/body/CellRegistry.d.ts +24 -0
  105. package/dist/types/core/render/body/ColumnPaintPlan.d.ts +19 -0
  106. package/dist/types/core/render/body/ExtraCellPainters.d.ts +20 -0
  107. package/dist/types/core/render/body/rows/BodyRowContext.d.ts +138 -0
  108. package/dist/types/core/render/body/rows/DataRowPainter.d.ts +58 -0
  109. package/dist/types/core/render/body/rows/DetailRowPainter.d.ts +24 -0
  110. package/dist/types/core/render/body/rows/GroupRowPainter.d.ts +32 -0
  111. package/dist/types/core/render/body/rows/RowPainterTable.d.ts +24 -0
  112. package/dist/types/core/render/body/rows/WindowLayout.d.ts +38 -0
  113. package/dist/types/core/render/dom.d.ts +10 -0
  114. package/dist/types/core/render/header/HeaderSortIndicator.d.ts +39 -0
  115. package/dist/types/core/render/header/HeaderView.d.ts +84 -0
  116. package/dist/types/core/render/header/ResizeHandleBinder.d.ts +110 -0
  117. package/dist/types/core/render/ports.d.ts +218 -0
  118. package/dist/types/core/renderers/CellRenderer.d.ts +7 -0
  119. package/dist/types/core/types.d.ts +94 -0
  120. package/dist/types/index.d.ts +1 -0
  121. package/dist/types/vue/OpenGrid.vue.d.ts +1 -1
  122. package/dist/xlsx.min-CMvrM6b4.cjs +138 -0
  123. package/dist/xlsx.min-i_b-4PvU.js +138 -0
  124. package/package.json +3 -8
  125. package/dist/OpenGrid-CLk8Vt7j.cjs +0 -7459
  126. package/dist/OpenGrid-D6YxCsnV.js +0 -7472
  127. package/dist/Registry-CPJYOqCn.js +0 -74
  128. package/dist/Registry-D74ZmdDz.cjs +0 -71
  129. package/dist/index-CeJ-0-80.cjs +0 -260
  130. package/dist/index-D0DJtKYI.cjs +0 -452
  131. package/dist/index-DnarQ4eR.js +0 -266
  132. package/dist/index-VkKgQ506.js +0 -481
  133. package/dist/xlsx.min-BQ1o3sB6.cjs +0 -11793
  134. package/dist/xlsx.min-Bbz2ZypC.js +0 -11794
@@ -0,0 +1,50 @@
1
+ import { FooterDefLike, FooterResultLike, FooterSource, FooterValue, IFooterValues } from './ports.js';
2
+ /** 푸터 정의 한 줄(옵션 `footer` 의 원소 꼴 — 계약 꼴에 그리는 쪽이 읽는 맞춤을 더함). / One footer definition. */
3
+ export interface FooterDef extends FooterDefLike {
4
+ readonly align?: string;
5
+ }
6
+ /** 정의 하나의 계산 결과. 필드 이름은 공개 `getFooterData()` 가 돌려주는 모양 그대로. / Result shape exposed by `getFooterData()`. */
7
+ export interface FooterResult extends FooterResultLike {
8
+ _field: string;
9
+ _value: FooterValue;
10
+ _formatted: string;
11
+ }
12
+ /** 사용자 집계 전략: 숫자를 돌려주면 그 값, null 이면 기본 집계. / User aggregate: a number wins, null falls back. */
13
+ export type SummaryOpFn = (op: string, nums: any[], field: string) => number | null;
14
+ /** 확장 지점 조회(그리드의 전략 조회와 같은 꼴). / Strategy lookup, same shape as the grid's. */
15
+ export type StrategyLookup = <F extends Function>(slot: string, fallback: F) => F;
16
+ export interface FooterValuesOptions {
17
+ /** `summaryOp` 슬롯을 찾는 곳. 없으면 사용자 전략 없음. / Where the `summaryOp` slot is resolved. */
18
+ getStrategy?: StrategyLookup;
19
+ }
20
+ /**
21
+ * 푸터 합계 값 계산의 유일한 주인. 상태가 없고 캐시도 없다 — 같은 입력이면 같은 결과, 부를 때마다 다시 셈한다.
22
+ *
23
+ * Sole owner of footer summary values. Stateless and uncached.
24
+ */
25
+ export declare class FooterValues implements IFooterValues {
26
+ private readonly _strategy;
27
+ constructor(opts?: FooterValuesOptions);
28
+ /**
29
+ * 정의마다 결과 하나(field 와 op 가 둘 다 있는 정의만, 정의 순서대로). 정의가 없으면 원천을 읽지 않고 [].
30
+ * 원천은 계산 한 번에 한 번 읽는다.
31
+ *
32
+ * One result per definition that has both field and op, in order. Reads the source once.
33
+ */
34
+ compute(defs: readonly FooterDefLike[] | null | undefined, src: FooterSource): FooterResult[];
35
+ /**
36
+ * 숫자를 표시 글자로. 서식이 없으면 반올림 후 한국 로캘 구분 기호. 서식이 있으면 숫자 토큰 앞뒤의 접두·접미
37
+ * (통화 기호 등)를 떼고, `#`·`,` 가 있으면 천 단위 구분 기호, 소수부 자릿수로 반올림 자리를 정한다.
38
+ *
39
+ * Formats a number for display. No format: rounded, ko-KR separators. With a format: prefix/suffix
40
+ * around the numeric token are kept, `#`/`,` turn on thousands separators, decimals set precision.
41
+ */
42
+ format(value: number, fmt?: string): string;
43
+ /**
44
+ * 정의 하나. 순서를 지금 계산과 같게 둔다: 값 모으기 → 사용자 전략 찾기·부르기 → 개수 → 기본 집계.
45
+ * 순서가 같아야 예외가 나는 자리와 사용자 전략이 받는 값이 같다.
46
+ *
47
+ * One definition, in the same order as before so exceptions and strategy inputs match.
48
+ */
49
+ private _computeOne;
50
+ }
@@ -0,0 +1,31 @@
1
+ /** 합계 계산 입력. */
2
+ export interface FooterSource {
3
+ /** 합계 대상 행(표시 순서 — 순서는 합계에 무관). */
4
+ rows(): readonly unknown[];
5
+ }
6
+ /**
7
+ * 푸터 정의 한 줄 — 옵션 `footer` 의 원소(`types.ts` 의 `FooterDef`)를 구조로 받는다.
8
+ * 집계 칸은 `field`·`op` 가 둘 다 있는 정의뿐이다(어느 하나가 없으면 결과에 나오지 않는다 — 지금 동작).
9
+ */
10
+ export interface FooterDefLike {
11
+ readonly field?: string;
12
+ readonly op?: string;
13
+ readonly format?: string;
14
+ readonly label?: string;
15
+ readonly colspan?: number;
16
+ }
17
+ /** 집계 값(값 없음은 null). */
18
+ export type FooterValue = number | null;
19
+ /** 정의 하나의 결과. 모양은 지금 `FooterManager.computeValues()`·공개 `getFooterData()` 가 돌려주는 그대로. */
20
+ export interface FooterResultLike {
21
+ readonly _field: string;
22
+ readonly _value: FooterValue;
23
+ readonly _formatted: string;
24
+ }
25
+ /**
26
+ * 푸터 합계 값 계산의 유일한 주인(순수 함수 객체). 값은 지금 FooterManager.computeValues 와 같다.
27
+ * 결과는 집계 칸 정의 순서대로 하나씩(정의가 없거나 비면 원천을 읽지 않고 빈 배열). summaryOp 사용자 전략도 지금처럼 매번 부른다.
28
+ */
29
+ export interface IFooterValues {
30
+ compute(defs: readonly FooterDefLike[] | null | undefined, src: FooterSource): readonly FooterResultLike[];
31
+ }
@@ -0,0 +1,17 @@
1
+ import { DrawnState, IRenderPlan, IRenderPlanner, IRenderRequest, NextState, PlannerFeatures } from './ports.js';
2
+ /**
3
+ * 계획을 내는 유일한 곳. 상태를 들지 않는다 — 같은 입력이면 늘 같은 계획(입력은 고치지 않음).
4
+ * 규칙 묶음(`features`)을 하나씩 켜서 빠른 길을 연다. 기본값은 전부 꺼짐 = 모든 요청이 통째(지금 그리는 횟수 그대로).
5
+ * 실행 순서는 계획 계약대로 기하 → 행 → 창 → 다시 채우기 → 나머지.
6
+ *
7
+ * Stateless planner. Features open fast paths one by one; the default (all off) answers every request with a full rebuild.
8
+ */
9
+ export declare class RenderPlanner implements IRenderPlanner {
10
+ private readonly _ratio;
11
+ private readonly _features;
12
+ constructor(opts?: {
13
+ diffMaxRatio?: number;
14
+ features?: Partial<PlannerFeatures>;
15
+ });
16
+ plan(req: IRenderRequest, drawn: DrawnState, next: NextState): IRenderPlan;
17
+ }
@@ -0,0 +1,91 @@
1
+ import { ChangeMask, IRenderRequest, RequestDetail } from './ports.js';
2
+ /**
3
+ * 「무엇이 바뀌었나」 비트 묶음 + 세부. 상태 변경 한 번에 하나 만들고, 스케줄러가 한 프레임 동안 합친다.
4
+ * merge — 교환·결합: changes(OR) · cells(합집합) · widthChangedFrom(작은 쪽) · sync(OR).
5
+ * 나중이 이김: rows · focusTo (null 은 상대를 이기지 못함).
6
+ *
7
+ * Bit set of what changed plus details. merge is commutative/associative except for rows/focusTo (last non-null wins).
8
+ */
9
+ export declare class RenderRequest implements IRenderRequest {
10
+ /** 할 일 없는 요청(합치기의 항등원). / The no-op request (identity of merge). */
11
+ static readonly NONE: RenderRequest;
12
+ /**
13
+ * 보이는 범위를 그 자리에서 통째로 다시 그리라는 요청 — 불변 값이라 하나를 나눠 쓴다(부를 때마다 새로 만들지 않음).
14
+ *
15
+ * Sync full repaint of the visible range; immutable, so one shared value.
16
+ */
17
+ static readonly REPAINT_VISIBLE: RenderRequest;
18
+ /**
19
+ * 본문을 비우라는 요청(자료를 모두 지운 뒤) — 하나를 나눠 쓴다.
20
+ *
21
+ * Sync request that empties the body (after all data is cleared); one shared value.
22
+ */
23
+ static readonly REPAINT_CLEAR: RenderRequest;
24
+ /**
25
+ * 행 선택·체크 상태만 바뀌었다는 요청(값은 그대로) — 하나를 나눠 쓴다. 푸터 값 같은 내용 일은 계획이 거른다.
26
+ *
27
+ * Sync request saying only row selection/check state changed (values unchanged); one shared value. Content work such as footer values is filtered by the plan.
28
+ */
29
+ static readonly ROW_STATE: RenderRequest;
30
+ /**
31
+ * 세로 창 쪽 요청 둘(sync 아님 — 다음 프레임에 하나로 합쳐짐, 범위는 그릴 때 세로 창에 물음):
32
+ * `SCROLLED` 는 스크롤 위치만 바뀜(푸터 값 같은 내용 일은 계획이 거름), `WINDOW_CHANGED` 는 행 수·행 높이·보이는 높이가 바뀜.
33
+ *
34
+ * Two vertical-window requests (not sync — merged into the next frame; the range is asked at paint time):
35
+ * `SCROLLED` = only the scroll position changed, `WINDOW_CHANGED` = row count / row height / viewport height changed.
36
+ */
37
+ static readonly SCROLLED: RenderRequest;
38
+ static readonly WINDOW_CHANGED: RenderRequest;
39
+ readonly changes: ChangeMask;
40
+ readonly detail: Readonly<RequestDetail>;
41
+ private constructor();
42
+ /**
43
+ * 요청을 만든다. 모르는 비트(정의 밖·음수·정수 아님)는 RangeError — 조용히 버리면 그 원인으로는 아무것도 안 그려진다.
44
+ * 세부에 넘긴 배열·객체는 얼린 사본으로 든다.
45
+ *
46
+ * Unknown bits throw RangeError; detail arrays/objects are copied and frozen.
47
+ */
48
+ static of(changes: ChangeMask, detail?: Partial<RequestDetail>): RenderRequest;
49
+ /**
50
+ * 행 범위 [start, endInclusive] 를 그 자리에서 통째로 다시 그리라는 요청. 끝을 포함하는 옛 그리기 범위(묶음 펼침의
51
+ * 전 행 `0..n−1` 등)를 반열림으로 바꿔 담는다 — 값을 자르지 않으므로 `(0, −1)`·`start > end` 도 그대로 지나간다.
52
+ *
53
+ * Sync full repaint of rows [start, endInclusive]; converts the inclusive end to half-open without clamping.
54
+ */
55
+ static rowsInclusive(start: number, endInclusive: number): RenderRequest;
56
+ /** 비트 가운데 하나라도 있나. / True if any of the given bits is set. */
57
+ has(mask: ChangeMask): boolean;
58
+ /** 합치기 규칙은 누적기 하나가 안다 — 값 둘을 합치는 것도 누적기에 차례로 더해 얼린다. / Merging delegates to the accumulator. */
59
+ merge(other: IRenderRequest): RenderRequest;
60
+ }
61
+ /**
62
+ * 요청 합치기 규칙의 유일한 주인 — 고칠 수 있는 누적기. 한 프레임 동안 들어오는 요청을 새 값 없이 더해 두었다가
63
+ * `freeze()` 로 요청 하나를 얼린다(스케줄러가 프레임마다 하나 들고 쓴다; `RenderRequest.merge` 도 이것을 쓴다).
64
+ * 규칙: 비트 OR · 칸 합집합 · `widthChangedFrom` 작은 쪽 · `sync` OR(교환·결합) / `rows`·`focusTo` 는 null 아닌 마지막.
65
+ * 칸: 정규형 배열 둘까지는 그대로 들고 있다가 선형 병합, 셋째부터는 (행, 필드) 열쇠 Map 에 모아 얼릴 때 한 번 정렬 —
66
+ * 값 둘 합치기는 정렬 0, 한 프레임 칸 요청 수천 개도 더하기마다 O(1).
67
+ *
68
+ * Sole owner of the merge rules: a mutable accumulator that adds requests without allocating per add and
69
+ * freezes one request at the end. Up to two canonical cell arrays are linearly merged; beyond that a keyed Map is used.
70
+ */
71
+ export declare class RenderRequestAccumulator {
72
+ private _mask;
73
+ private _focusTo;
74
+ private _widthFrom;
75
+ private _rows;
76
+ private _sync;
77
+ private _pending;
78
+ private _cellsA;
79
+ private _cellsB;
80
+ private _map;
81
+ /** 더한 요청이 하나라도 있나(비트가 0 인 요청도 「있음」). / Whether anything was added since the last freeze. */
82
+ get pending(): boolean;
83
+ add(req: IRenderRequest): this;
84
+ /** 쌓인 것을 요청 하나로 얼리고 비운다. / Freezes the accumulated request and resets. */
85
+ freeze(): RenderRequest;
86
+ /** 버린다(그리드를 지울 때). / Drops everything accumulated. */
87
+ clear(): void;
88
+ private _addCells;
89
+ private _put;
90
+ private _frozenCells;
91
+ }
@@ -0,0 +1,169 @@
1
+ import { IColumnWindow, RowSpan } from '../../coordinate/geometryPorts.js';
2
+ /**
3
+ * 「무엇이 바뀌었나」 비트. 내는 쪽은 자기가 바꾼 것만 말한다. 무엇을 다시 그릴지는 RenderPlanner 혼자 정한다.
4
+ * 처음에는 모든 호출처가 All 로 시작하고 원인별로 하나씩 좁힌다.
5
+ */
6
+ export declare const Change: {
7
+ /** 세로 위치만(행 집합·내용 그대로). */
8
+ readonly RowsScrolled: number;
9
+ /** 가로 위치만. */
10
+ readonly ColsScrolled: number;
11
+ /** 컬럼 폭(끄는 중·놓음·API). 끄는 동안의 쓰기도 이 요청으로 스케줄러를 거친다. */
12
+ readonly ColWidth: number;
13
+ /** 보이는 행의 「무엇」이 바뀜: setData·필터·행 추가/삭제/이동·묶음 펼침. */
14
+ readonly RowSet: number;
15
+ /** 행 집합은 같고 순서만(정렬). 푸터 합계는 안 바뀐다. */
16
+ readonly RowOrder: number;
17
+ /** 선택·체크·행 상태 — 내용 그대로. */
18
+ readonly RowState: number;
19
+ /** 포커스 칸 이동. */
20
+ readonly Focus: number;
21
+ /** 칸 몇 개의 값. */
22
+ readonly CellValue: number;
23
+ /** 범위 선택 면. */
24
+ readonly Range: number;
25
+ /** 컬럼 구성: 숨김·보임·고정·순서·시트 전환·병합 지정. */
26
+ readonly Columns: number;
27
+ /** 컨테이너 크기. */
28
+ readonly Viewport: number;
29
+ /** 테마·스킨·밀도·로케일·마스킹 토글. */
30
+ readonly Appearance: number;
31
+ /** 정렬 표시만(머리글 화살표·aria-sort·눌림/진행). */
32
+ readonly SortIndicator: number;
33
+ /** 지금처럼 통째로(원인을 모를 때의 출발점). */
34
+ readonly All: number;
35
+ };
36
+ export type ChangeMask = number;
37
+ export interface CellPos {
38
+ readonly ri: number;
39
+ readonly ci: number;
40
+ }
41
+ export interface CellKey {
42
+ readonly ri: number;
43
+ readonly field: string;
44
+ }
45
+ /**
46
+ * 명시 행 범위. 지금 코드의 세 갈래를 그대로 표현한다:
47
+ * - null : 보이는 범위(VirtualScroll.getVisibleRange — 지금의 `_doRender(...this._visRange())`)
48
+ * - RowSpan : 그 범위 그대로(지금의 묶음·나무·디테일 `doRenderFull(n) => _doRender(0, n−1)` — 전 행)
49
+ * - 'clear' : 본문을 비우고 끝냄(지금의 MutationService `doRenderFull: () => _doRender(0, −1)`)
50
+ * 동작을 바꾸지 않는 옮기기는 이 뜻을 바꾸지 않는다 — 「.og-row 수 = 지금」이 증거.
51
+ */
52
+ export type ExplicitRows = RowSpan | 'clear' | null;
53
+ export interface RequestDetail {
54
+ /** CellValue 일 때. */
55
+ readonly cells: readonly CellKey[];
56
+ /**
57
+ * Focus 일 때 새 포커스 칸만. 옛 칸은 요청에 싣지 않는다 — 플래너가 DrawnState.focus(그려 둔 포커스 칸)에서 얻는다.
58
+ * 그래서 여러 Focus 요청을 합쳐도 「마지막 칸」 하나면 된다.
59
+ */
60
+ readonly focusTo: CellPos | null;
61
+ /** ColWidth 일 때 바뀐 가장 왼쪽 잎. 진단용 — 계획·반영은 기하의 변화 몫(changesSince)을 쓴다. */
62
+ readonly widthChangedFrom: number | null;
63
+ /** 명시 행 범위(위). 여러 요청을 합치면 null 이 아닌 쪽, 둘 다면 뒤 요청. */
64
+ readonly rows: ExplicitRows;
65
+ /** true = 이 호출이 끝날 때 DOM 이 맞아 있어야 함(공개 API 의 동기 계약 — 그 자리에서 flush). */
66
+ readonly sync: boolean;
67
+ }
68
+ /**
69
+ * 불변 값 객체. changes === 0 이면 할 일 없음.
70
+ * merge 규칙: **교환·결합** = changes(OR) · cells(합집합) · widthChangedFrom(작은 쪽) · sync(OR).
71
+ * **나중 요청이 이김**(순서 있음 — 스케줄러는 제출 순서대로 합침) = rows(단 null 은 상대를 이기지 못함) · focusTo(null 은 상대를 이기지 못함).
72
+ * / Immutable request value; merge is commutative for changes/cells/widthChangedFrom/sync, last-wins for rows/focusTo.
73
+ */
74
+ export interface IRenderRequest {
75
+ readonly changes: ChangeMask;
76
+ readonly detail: Readonly<RequestDetail>;
77
+ has(mask: ChangeMask): boolean;
78
+ merge(other: IRenderRequest): IRenderRequest;
79
+ }
80
+ /** 지금 그려져 있는 상태(BodyView 가 유일하게 앎 — 읽기 전용 스냅숏). */
81
+ export interface DrawnState {
82
+ /** null = 아직 안 그림. 'clear' = 비워 둔 상태. */
83
+ readonly rows: RowSpan | 'clear' | null;
84
+ readonly columns: IColumnWindow | null;
85
+ readonly pinned: {
86
+ readonly editRow: number | null;
87
+ readonly editCol: number | null;
88
+ readonly focusRow: number | null;
89
+ };
90
+ /** 지금 그려 둔 포커스 칸(없으면 null) — Focus 계획의 from. */
91
+ readonly focus: CellPos | null;
92
+ /** 그려진 행 종류에 세로 병합·묶음·나무·디테일·autoHeight 가 있나(행 차분 불가). */
93
+ readonly diffBlocked: boolean;
94
+ /**
95
+ * 컬럼별 「잘린 칸 글자가 말줄임을 지켜 주는 최대 폭」(잘린 칸이 없으면 Infinity).
96
+ * 다시 채우기를 정하는 곳은 RenderPlanner 하나 — 너비 조절 binder 는 묻지 않는다.
97
+ */
98
+ readonly coverWidths: readonly number[];
99
+ }
100
+ /** 이번 프레임에 그려야 할 상태 — RenderScheduler 가 VirtualScroll·ColumnWindowPolicy·ColumnGeometry 에 물어 만든다. */
101
+ export interface NextState {
102
+ readonly rows: RowSpan | 'clear';
103
+ readonly columns: IColumnWindow;
104
+ /** 기하 폭(읽기 전용 뷰 — 사본 아님). 다시 채우기 판정용. */
105
+ readonly columnWidths: readonly number[];
106
+ /** 이 기하 판 이후 바뀐 것을 반영해야 함(스케줄러가 마지막으로 반영한 판). */
107
+ readonly geometryVersion: number;
108
+ readonly appliedGeometryVersion: number;
109
+ }
110
+ /** 행 축 일. */
111
+ export type RowWork = 'none' | 'diff' | 'rebuild' | 'clear';
112
+ /** 창(가로) 축 일. 대각선 스크롤(가로+세로 같은 프레임)은 rows:'diff' + cols:'shift' 둘 다. */
113
+ export type ColWork = 'none' | 'shift';
114
+ export type HeaderWork = 'none' | 'sortIndicator' | 'rebuild';
115
+ /** 푸터: 캐시하지 않는다. 부르는 때를 계획 표가 줄인다 — RowSet·CellValue·All 에서만 'values'. */
116
+ export type FooterWork = 'none' | 'values' | 'rebuild';
117
+ /**
118
+ * 한 프레임에 할 최소 일(불변 값). 실행 순서: geometry → rows → cols → refill → 나머지.
119
+ * rows:'rebuild'|'clear' 면 cols 는 'none'(새로 그릴 때 이미 새 창으로).
120
+ * 불변: 실행 결과 화면 = 같은 자료로 통째로 다시 그린 화면(대조 시험 — 대각선 스크롤 포함).
121
+ */
122
+ export interface IRenderPlan {
123
+ readonly rows: RowWork;
124
+ readonly cols: ColWork;
125
+ readonly header: HeaderWork;
126
+ readonly footer: FooterWork;
127
+ /** 기하 투영 반영(GeometryApplier.applyChange(geometry.changesSince(applied))). */
128
+ readonly geometry: boolean;
129
+ /** 잘린 칸 글자 다시 채우기가 필요한 컬럼 = next.columnWidths[ci] > drawn.coverWidths[ci] 인 창 안 컬럼. */
130
+ readonly refillColumns: readonly number[];
131
+ /** 선택·체크 배경만 다시 칠할 행. */
132
+ readonly rowStateRows: readonly number[];
133
+ /** 포커스 옮김. to 가 null 이면 지울 칸(from)만 있다(새 포커스 칸 없음). */
134
+ readonly focus: {
135
+ readonly from: CellPos | null;
136
+ readonly to: CellPos | null;
137
+ } | null;
138
+ readonly cells: readonly CellKey[];
139
+ /** 범위 덧그림(좌표 계산) 다시. */
140
+ readonly overlay: boolean;
141
+ readonly next: NextState;
142
+ /** 할 일이 하나도 없으면 true(프레임을 그냥 넘김). */
143
+ readonly empty: boolean;
144
+ }
145
+ /**
146
+ * 플래너가 켜고 끄는 규칙 묶음. 꺼진 규칙의 요청은 「통째(rows:'rebuild')」로 떨어진다(안전한 쪽).
147
+ * 처음에는 전부 false(= 지금처럼 통째)이고, 빠른 길을 하나씩 켤 때 배선에서 생성자 인자로 켠다.
148
+ * / Planner feature switches; a disabled rule falls back to a full rebuild (the safe side).
149
+ */
150
+ export interface PlannerFeatures {
151
+ /** SortIndicator·RowOrder 를 머리글 정렬 표시만·창 다시 1번으로(머리글 다시 만들기 0). */
152
+ readonly sortIndicatorOnly: boolean;
153
+ /** 푸터 값을 RowSet·CellValue·All 에서만. */
154
+ readonly footerGating: boolean;
155
+ /** 스크롤 요청에서 그려 둔 범위가 그대로면 할 일 0. */
156
+ readonly scrollSkip: boolean;
157
+ /** ColWidth 를 기하 반영만(+다시 채우기). */
158
+ readonly geometryOnly: boolean;
159
+ /** 가로 창(cols:'shift'). */
160
+ readonly columnWindow: boolean;
161
+ /** 세로 행 차분(rows:'diff'). 검증이 끝나기 전에는 false. */
162
+ readonly rowDiff: boolean;
163
+ /** RowState·Focus·CellValue·Range 를 작은 갱신으로. */
164
+ readonly smallUpdates: boolean;
165
+ }
166
+ /** 요청 + 그려 둔 상태 + 다음 상태 → 최소 계획. 규칙은 표(데이터)로 둔다. DOM 없음. / Request + drawn + next → minimal plan. */
167
+ export interface IRenderPlanner {
168
+ plan(req: IRenderRequest, drawn: DrawnState, next: NextState): IRenderPlan;
169
+ }
@@ -0,0 +1,25 @@
1
+ import { IResizeGesture, ResizeBounds, ResizePhase, ResizeResult } from './ports.js';
2
+ /**
3
+ * 너비 조절 한 번의 상태와 폭 계산의 유일한 주인. DOM·시계를 쓰지 않는다.
4
+ * 불변: dragging 밖에서 move 는 null · move·release·lose 가 내는 폭은 [min, max] — cancel 은 시작 폭(되돌리기라
5
+ * 한계 밖일 수 있음) · 한 제스처에 확정(release|lose)은 많아야 한 번 · 시작 폭은 부르는 쪽이 기하에서 받아 넘긴다 ·
6
+ * 유한수가 아닌 x 는 폭을 바꾸지 않는다(유한수가 아닌 x·시작 폭의 press 는 받지 않음).
7
+ * 폭은 소수 그대로 낸다 — 정수로 드는 일은 기하(ColumnGeometry.resize)가 맡는다.
8
+ *
9
+ * Sole owner of one resize gesture's state and width math; no DOM, no clock.
10
+ */
11
+ export declare class ResizeGesture implements IResizeGesture {
12
+ private _state;
13
+ private readonly _m;
14
+ constructor();
15
+ get phase(): ResizePhase;
16
+ /** 쉼 상태에서는 −1. / −1 while idle. */
17
+ get column(): number;
18
+ press(ci: number, startWidth: number, clientX: number, bounds: ResizeBounds): void;
19
+ move(clientX: number): number | null;
20
+ release(clientX: number): ResizeResult | null;
21
+ cancel(): ResizeResult | null;
22
+ lose(): ResizeResult | null;
23
+ consumeClick(): boolean;
24
+ expireSwallow(): void;
25
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * 경계에서 이 px 안쪽까지(양 끝 포함)를 손잡이로 친다.
3
+ *
4
+ * Points within this many px of a boundary (inclusive) count as the grip.
5
+ */
6
+ export declare const RESIZE_HIT_HALF_PX = 6;
7
+ /**
8
+ * 머리글 잎 칸 안의 한 점이 어느 컬럼의 손잡이에 드는지 판정한다(불변 값 — 칸마다 객체를 만들지 않으려고 그리드당 하나).
9
+ *
10
+ * Decides which column's grip a point inside a header leaf cell falls on (one immutable instance per grid).
11
+ */
12
+ export declare class ResizeHitZone {
13
+ private readonly _half;
14
+ constructor(_half?: number);
15
+ /**
16
+ * @param x 칸 왼쪽 끝에서 잰 점의 x(px) / x of the point from the cell's left edge
17
+ * @param width 칸 폭(px) / cell width
18
+ * @param leaf 칸의 잎 컬럼 번호 / leaf column index of the cell
19
+ * @param canResize 그 컬럼을 끌 수 있나(손잡이가 있는 잎) / whether a column is resizable
20
+ * @returns 끌 컬럼 번호, 손잡이가 아니면 −1 / column to resize, or −1
21
+ */
22
+ columnFor(x: number, width: number, leaf: number, canResize: (ci: number) => boolean): number;
23
+ }
@@ -0,0 +1,64 @@
1
+ /**
2
+ * 상태: idle → pressed → dragging → (release|cancel|lose) → swallowing → idle.
3
+ * swallowing: 놓은 뒤(또는 손잡이 구역에서 누른 뒤) 따라오는 click 한 번을 정렬로 넘기지 않는 상태.
4
+ */
5
+ export type ResizePhase = 'idle' | 'pressed' | 'dragging' | 'swallowing';
6
+ /**
7
+ * 지금은 {min: 40, max: Infinity} 고정 — 지금 너비 조절의 `Math.max(40, …)` 그대로(col.minWidth 를 안 읽음).
8
+ * col.minWidth/maxWidth 반영은 동작을 바꾸는 일이라 따로 한다.
9
+ */
10
+ export interface ResizeBounds {
11
+ readonly min: number;
12
+ readonly max: number;
13
+ }
14
+ export interface ResizeResult {
15
+ readonly ci: number;
16
+ readonly width: number;
17
+ }
18
+ /**
19
+ * 너비 조절 한 번의 상태와 폭 계산의 유일한 주인. DOM·시계 없음(jsdom 없이 시험).
20
+ * 불변: dragging 밖에서 move 는 null · move·release·lose 가 내는 폭은 늘 [min, max](cancel 은 시작 폭 — 한계 밖일 수 있음) · 한 제스처에 commit(release|lose) 은 많아야 한 번 ·
21
+ * 시작 폭은 기하에서 받는다(DOM offsetWidth 안 읽음).
22
+ * 입력은 「x 좌표」라 마우스·펜·터치가 같은 길을 쓰고, 나중에 키보드 조절도 같은 상태 기계에 들어온다.
23
+ * 입력 규칙(DOM 쪽 ResizeHandleBinder 가 지킴): 포인터 이벤트가 있으면 포인터만 듣고,
24
+ * 진행 중 pointerId 가 있으면 합성 mousedown/mousemove/mouseup 은 무시한다(누름 두 번 방지).
25
+ * 포인터 이벤트가 없는 환경(jsdom)은 마우스 이벤트로 같은 상태 기계를 몬다. 손잡이에 touch-action 은 두지 않는다(터치 끌기는 발주자 결정 항목 — 기본 머리글 DOM 이 바뀜).
26
+ * / Sole owner of one resize gesture's state and width math; no DOM, no clock.
27
+ */
28
+ export interface IResizeGesture {
29
+ readonly phase: ResizePhase;
30
+ readonly column: number;
31
+ press(ci: number, startWidth: number, clientX: number, bounds: ResizeBounds): void;
32
+ /** 새 폭(바뀌었을 때만), 아니면 null. */
33
+ move(clientX: number): number | null;
34
+ /** 놓음 → 확정할 폭. 그 뒤 phase = swallowing. 폭이 안 바뀌었으면 null(정렬은 그래도 안 부름). */
35
+ release(clientX: number): ResizeResult | null;
36
+ /** Esc → 시작 폭으로 되돌릴 값(한계로 자르지 않음). */
37
+ cancel(): ResizeResult | null;
38
+ /** 포인터 잃음·창 blur → 그 순간 폭으로 확정(Esc 만 되돌린다). */
39
+ lose(): ResizeResult | null;
40
+ /** 머리글 click 처리기가 묻는다: 이 click 을 삼켜야 하나(삼키면 phase = idle — 단 끄는 중이면 끌기를 잇는다). */
41
+ consumeClick(): boolean;
42
+ /**
43
+ * 「놓음」(swallowing)을 끝낸다 — click 이 끝내 안 오는 경우(창 밖에서 놓음·포인터 잃음)에 상태가 남지 않게.
44
+ * binder 가 놓은 뒤 **다음 rAF** 에 부른다(click 은 pointerup/mouseup 과 같은 작업 안에서 그 전에 온다). 다음 press 도 swallowing 을 끝낸다.
45
+ * pressed 에서 cancel/lose → null 을 돌려주고 idle(폭 변화 0, 삼킬 click 없음). dragging 에서 cancel/lose → 결과를 돌려주고 swallowing.
46
+ */
47
+ expireSwallow(): void;
48
+ }
49
+ /**
50
+ * 놓을 때 바깥에 알리는 포트. 다시 그리기를 부르지 않는다.
51
+ * 구현은 OpenGrid 가 아니라 GridComposer 가 만드는 작은 어댑터 `ResizeSinkAdapter` — OpenGrid 에 책임을 더 얹지 않는다.
52
+ * / Port notified on release; never triggers a redraw.
53
+ */
54
+ export interface IResizeSink {
55
+ boundsOf(ci: number): ResizeBounds;
56
+ /** 사용자 폭 기억(_userWidths 저장 — 지금 OpenGrid._handleColResize 의 저장부와 같은 뜻). */
57
+ commit(ci: number, width: number): void;
58
+ /**
59
+ * 줄바꿈 머리글이 있을 때만 true → **놓을 때 한 번** remeasureHeader. 끄는 프레임마다의 머리글 높이 맞춤은
60
+ * RenderScheduler 가 IHeaderView.height() 로 한다.
61
+ */
62
+ needsHeaderRemeasure(): boolean;
63
+ remeasureHeader(): void;
64
+ }
@@ -0,0 +1,11 @@
1
+ import { ISortKeyColumn, ISortOrderer, SortDir } from './ports.js';
2
+ /**
3
+ * 안정 비교 정렬. 어떤 키 열이든 받는 기본 순서 매기기다(다른 전략이 거절할 때 늘 남는 자리).
4
+ *
5
+ * Stable comparison sort; the default orderer that accepts every key column.
6
+ */
7
+ export declare class ComparisonOrderer implements ISortOrderer {
8
+ readonly id = "comparison";
9
+ accepts(_keys: readonly ISortKeyColumn[], _rowCount: number): boolean;
10
+ order(start: readonly number[], keys: readonly ISortKeyColumn[], dirs: readonly SortDir[]): Int32Array;
11
+ }
@@ -0,0 +1,15 @@
1
+ import { ISortKeyColumn, ISortOrderer, SortDir } from './ports.js';
2
+ export { SortCostEstimate } from './SortCostEstimate.js';
3
+ /**
4
+ * 문자열 키 하나로 정렬하는 안정 병합 정렬. 이웃 공통 머리말 배열(H)을 들고 아래→위로 병합한다.
5
+ *
6
+ * Stable merge sort on a single string key; merges bottom-up while carrying the neighbour LCP array.
7
+ */
8
+ export declare class LcpMergeOrderer implements ISortOrderer {
9
+ readonly id = "lcpMerge";
10
+ /** 문자열 키 열 하나일 때만(숫자·섞인 열·등수·여러 키는 비교 정렬). */
11
+ accepts(keys: readonly ISortKeyColumn[], _rowCount: number): boolean;
12
+ order(start: readonly number[], keys: readonly ISortKeyColumn[], dirs: readonly SortDir[]): Int32Array;
13
+ /** text 의 자리 번호를 정렬해 돌려준다(같은 글은 자리 순서). / Sorts positions of text; ties keep position order. */
14
+ private _sort;
15
+ }
@@ -0,0 +1,74 @@
1
+ import { IRankIndex, ISortKeyColumn, SortDir } from './ports.js';
2
+ /**
3
+ * 한 컬럼에서 읽어 둔 원시값과 「읽은 행」 표시. 낡음 검사의 유일한 기준이다.
4
+ *
5
+ * The primitives read from one column plus which rows were read; the sole baseline for staleness checks.
6
+ */
7
+ export declare class ValueSnapshot {
8
+ readonly field: string;
9
+ readonly values: readonly unknown[];
10
+ private readonly _covered;
11
+ /**
12
+ * @param field 필드 이름 / field name
13
+ * @param values 행 번호 자리의 값(읽은 행만 의미가 있음) / values by row index (meaningful for read rows only)
14
+ * @param read 값을 읽은 행 번호들 / row indexes that were read
15
+ */
16
+ constructor(field: string, values: readonly unknown[], read: ArrayLike<number>);
17
+ /** 행 번호들이 모두 읽은 행인가. / Whether every given row was read. */
18
+ covers(rows: ArrayLike<number>): boolean;
19
+ /**
20
+ * O(n) 낡음 검사: 행 수가 같고, 볼 행(start — 생략하면 읽은 행 전부)이 모두 읽은 행이며,
21
+ * 그 자리의 지금 값이 보관값과 === 인가. 행마다 이 필드를 한 번만 읽는다.
22
+ *
23
+ * O(n) freshness: same row count, every row to check (start, or all read rows when omitted) was read,
24
+ * and its current value is === the stored one. Reads this field once per row.
25
+ */
26
+ isFreshFor(rows: readonly unknown[], start?: ArrayLike<number>): boolean;
27
+ }
28
+ /**
29
+ * 등수 보관(값 객체 — 만든 뒤 바뀌지 않는다). 같은 값 = 같은 등수, 작은 값 = 작은 등수.
30
+ * 등수를 매긴 행 밖의 행은 등수가 없으므로, 정렬할 행이 하나라도 그 밖이면 낡은 것으로 본다.
31
+ *
32
+ * Immutable rank holder: equal values share a rank, smaller values get smaller ranks. Rows outside the
33
+ * ranked set have no rank, so any row to be sorted outside it makes the index stale.
34
+ */
35
+ export declare class RankIndex implements IRankIndex {
36
+ readonly field: string;
37
+ private readonly _ranks;
38
+ private readonly _snapshot;
39
+ private constructor();
40
+ /**
41
+ * 정렬이 끝난 순서에서 등수를 매긴다 — 이웃끼리 한 번씩만 비교하므로 O(n).
42
+ * sorted 는 key 의 오름(dir 'asc')·내림(그 밖 — 옛 고리처럼 'asc' 가 아니면 뒤집힌 것) 순서로 놓인 행 번호여야 한다
43
+ * (같은 값끼리는 붙어 있다). values 는 key 를 만들 때 읽은 원시값(행 번호 자리) — 낡음 검사의 기준이다.
44
+ *
45
+ * Ranks rows from a finished sort order with one comparison per neighbour (O(n)). sorted must list row
46
+ * indexes in ascending ('asc') or descending (anything else) key order; values are the primitives read when
47
+ * key was built, indexed by row, and are the baseline for staleness checks.
48
+ */
49
+ static fromSorted(field: string, key: ISortKeyColumn, sorted: ArrayLike<number>, dir: SortDir | undefined, values: readonly unknown[]): RankIndex;
50
+ compare(i: number, j: number): number;
51
+ /** 행 번호들이 모두 등수를 가졌나. / Whether every given row has a rank. */
52
+ covers(rows: ArrayLike<number>): boolean;
53
+ /**
54
+ * O(n) 낡음 검사 — 행 수 · 등수 가진 행 · 값 === (ValueSnapshot.isFreshFor 와 같음).
55
+ * O(n) staleness check — row count, ranked rows, values === (same as ValueSnapshot.isFreshFor).
56
+ */
57
+ isFreshFor(rows: readonly unknown[], start?: ArrayLike<number>): boolean;
58
+ }
59
+ /**
60
+ * 등수로 비교하는 키 열. 등수가 원래 키 열과 같은 차례를 지키므로 순서 매기기 결과도 같다.
61
+ * 비교가 정수라 글자 키를 내주지 않는다(머리말 기억 정렬이 필요 없다).
62
+ *
63
+ * Key column that compares by rank; ranks keep the original column's order, so orderings are identical.
64
+ * Comparisons are integers, so no string key is exposed (prefix-aware orderers are unnecessary).
65
+ */
66
+ export declare class RankedKeyColumn implements ISortKeyColumn {
67
+ private readonly _index;
68
+ readonly kind: "ranked";
69
+ readonly cacheable = true;
70
+ constructor(_index: RankIndex);
71
+ get field(): string;
72
+ compare(i: number, j: number): number;
73
+ stringKeyAt(_i: number): string | null;
74
+ }
@@ -0,0 +1,36 @@
1
+ import { ISortCostEstimate, ISortKeyColumn, ISortOrderer } from './ports.js';
2
+ /**
3
+ * 정렬 시간 어림(값 객체). 만들 때 한 번 셈하고 바뀌지 않는다.
4
+ *
5
+ * Immutable sort-time estimate, computed once at construction.
6
+ */
7
+ export declare class SortCostEstimate implements ISortCostEstimate {
8
+ readonly expectedMs: number;
9
+ private constructor();
10
+ /**
11
+ * @param rowCount 정렬할 행 수 / rows to sort
12
+ * @param keys 키 열(우선순위 순) / key columns in priority order
13
+ * @param fresh 보관된 등수를 쓸 수 있는가 / whether retained ranks can be used
14
+ */
15
+ static of(rowCount: number, keys: readonly ISortKeyColumn[], fresh: boolean): SortCostEstimate;
16
+ prefersSlicing(thresholdMs?: number): boolean;
17
+ /**
18
+ * 문자열 키의 「표본을 정렬한 뒤 이웃끼리의 평균 공통 머리말 길이」. 무작위 두 글만 견주면 긴 머리말 묶음이
19
+ * 여럿인 자료(묶음마다 다른 머리말)를 놓치므로, 표본을 먼저 정렬해 이웃을 본다.
20
+ * 표본은 출발 순서를 1,024 칸으로 나눠 칸마다 하나(칸 안 자리는 고정 씨앗) — 같은 자료면 늘 같은 값이고,
21
+ * 키를 읽는 횟수는 행 수와 무관하게 많아야 1,024 번이다. 빈 값은 건너뛴다.
22
+ *
23
+ * Mean common prefix of sorted-sample neighbours for a string key. Comparing random pairs misses data with
24
+ * several long-prefix groups, so the sample is sorted first. One row per 1,024 equal slices of the start order
25
+ * (fixed-seed offset inside each slice): deterministic, and at most 1,024 key reads whatever the row count.
26
+ */
27
+ static meanCommonPrefix(key: ISortKeyColumn, start: readonly number[]): number;
28
+ /**
29
+ * 순서 매기기 고르기: 받아 주는 것들 가운데 머리말 기억 정렬은 행이 표본 수 이상이고 표본 이웃 평균 공통 머리말이
30
+ * 문턱(64자)을 넘을 때만, 아니면 그 밖의 첫 전략. 후보 목록의 차례와 무관하게 같은 것을 고른다.
31
+ *
32
+ * Orderer choice: the prefix-aware orderer only when there are at least sample-size rows and the sampled mean
33
+ * neighbour prefix exceeds 64; otherwise the first other accepting orderer. Independent of candidate order.
34
+ */
35
+ static pickOrderer(orderers: readonly ISortOrderer[], keys: readonly ISortKeyColumn[], start: readonly number[]): ISortOrderer;
36
+ }