From 5bbaf6b21b35c952f80499a0d0809aaee79c6b69 Mon Sep 17 00:00:00 2001 From: lumixraku Date: Fri, 7 Feb 2025 15:47:24 +0800 Subject: [PATCH] chore: better code --- packages/core/src/index.ts | 2 +- packages/core/src/sheets/sheet-skeleton.ts | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 92978f4ae98..06a09df691b 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -201,6 +201,6 @@ export { type BBox, type IRTreeItem, RBush, RTree } from './shared/r-tree'; export { type IUniverConfig, Univer } from './univer'; export { isNodeEnv } from './shared/tools'; export { Skeleton } from './skeleton.ts'; -export { getCellCoordByIndexSimple as getCellPositionByIndex, getCellWithCoordByIndexCore, SheetSkeleton } from './sheets/sheet-skeleton'; export type { IGetRowColByPosOptions } from './sheets/sheet-skeleton'; export type { IPosition } from './sheets/typedef.ts'; +export * from './sheets/sheet-skeleton'; diff --git a/packages/core/src/sheets/sheet-skeleton.ts b/packages/core/src/sheets/sheet-skeleton.ts index 8b4db1a3737..11c0db78893 100644 --- a/packages/core/src/sheets/sheet-skeleton.ts +++ b/packages/core/src/sheets/sheet-skeleton.ts @@ -1042,9 +1042,8 @@ export class SheetSkeleton extends Skeleton { } /** - * Only the coordinates of the corresponding cells in rows and columns are considered, without taking into account the merged data. + * Not same as getCellWithCoordByIndex, Only the coordinates of the corresponding cells in rows and columns are considered, without taking into account the merged data. * - * Original name: getCellPositionByIndexSimple * @param row * @param column * @param rowHeightAccumulation @@ -1081,6 +1080,23 @@ export function getCellCoordByIndexSimple( }; } +/** + * @deprecated use `getCellCoordByIndexSimple` instead. + * @param row + * @param column + * @param rowHeightAccumulation + * @param columnWidthAccumulation + * @returns + */ +export function getCellPositionByIndexSimple( + row: number, + column: number, + rowHeightAccumulation: number[], + columnWidthAccumulation: number[] +): IPosition { + return getCellCoordByIndexSimple(row, column, rowHeightAccumulation, columnWidthAccumulation); +} + /** * @description Get the cell position information of the specified row and column, including the position of the cell and the merge info * @param {number} row The row index of the cell