Skip to content

Commit

Permalink
chore: better code
Browse files Browse the repository at this point in the history
  • Loading branch information
lumixraku committed Feb 7, 2025
1 parent 303c0b2 commit 5bbaf6b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
20 changes: 18 additions & 2 deletions packages/core/src/sheets/sheet-skeleton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5bbaf6b

Please sign in to comment.