From ef8dd1b6278b4268b6892876bb7f65d2353c6a75 Mon Sep 17 00:00:00 2001 From: lumix Date: Fri, 7 Feb 2025 16:44:33 +0800 Subject: [PATCH] chore: export fix (#4590) --- packages/core/src/index.ts | 2 +- packages/core/src/sheets/sheet-skeleton.ts | 20 ++++++++++++++++++-- packages/engine-render/src/basics/tools.ts | 3 ++- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 92978f4ae98..0d76eace4e3 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -193,6 +193,7 @@ export { DataValidationOperator } from './types/enum/data-validation-operator'; export { DataValidationRenderMode } from './types/enum/data-validation-render-mode'; export { DataValidationStatus } from './types/enum/data-validation-status'; export { DataValidationType } from './types/enum/data-validation-type'; +export { getCellCoordByIndexSimple, getCellPositionByIndexSimple, getCellWithCoordByIndexCore, SheetSkeleton } from './sheets/sheet-skeleton'; export * from './types/interfaces'; export type { ICellCustomRender, ICellRenderContext } from './types/interfaces/i-cell-custom-render'; export type { IDataValidationRule, IDataValidationRuleBase, IDataValidationRuleInfo, IDataValidationRuleOptions, ISheetDataValidationRule } from './types/interfaces/i-data-validation'; @@ -201,6 +202,5 @@ 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'; 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 diff --git a/packages/engine-render/src/basics/tools.ts b/packages/engine-render/src/basics/tools.ts index bcbb2a52230..e217fc5a3dd 100644 --- a/packages/engine-render/src/basics/tools.ts +++ b/packages/engine-render/src/basics/tools.ts @@ -523,6 +523,7 @@ export function getCellPositionByIndex( } /** + * @deprecated use same function in @univerjs/core * @description Get the cell position information of the specified row and column, including the position information of the cell and the merge information of the cell * @param {number} row The row index of the cell * @param {number} column The column index of the cell @@ -605,7 +606,7 @@ export function getCellWithCoordByIndexCore( } /** - * @deprecated please use getCellWithCoordByIndexCore instead + * @deprecated please use getCellWithCoordByIndexCore in @univerjs/core instead */ const getCellByIndexWithMergeInfo = getCellWithCoordByIndexCore; export { getCellByIndexWithMergeInfo };