@univerjs/engine-render 0.4.1 → 0.4.2

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.
@@ -1,14 +1,14 @@
1
1
  import { IKeyValue, ITransformState, Nullable, Disposable, EventSubject } from '@univerjs/core';
2
- import { CURSOR_TYPE, RENDER_CLASS_TYPE } from './basics/const';
3
2
  import { IDragEvent, IMouseEvent, IPointerEvent, IWheelEvent } from './basics/i-events';
4
3
  import { IObjectFullState, ITransformChangeState } from './basics/interfaces';
5
- import { Transform } from './basics/transform';
4
+ import { ITransformerConfig } from './basics/transformer-config';
6
5
  import { IViewportInfo, Vector2 } from './basics/vector2';
7
6
  import { UniverRenderingContext } from './context';
7
+ import { Engine } from './engine';
8
8
  import { Layer } from './layer';
9
- import { ITransformerConfig } from './basics/transformer-config';
10
9
  import { Scene } from './scene';
11
- import { Engine } from './engine';
10
+ import { CURSOR_TYPE, RENDER_CLASS_TYPE } from './basics/const';
11
+ import { Transform } from './basics/transform';
12
12
  export declare const BASE_OBJECT_ARRAY: string[];
13
13
  export declare enum ObjectType {
14
14
  UNKNOWN = 0,
@@ -16,7 +16,8 @@ export declare enum ObjectType {
16
16
  SHAPE = 2,
17
17
  IMAGE = 3,
18
18
  RECT = 4,
19
- CIRCLE = 5
19
+ CIRCLE = 5,
20
+ CHART = 6
20
21
  }
21
22
  export declare abstract class BaseObject extends Disposable {
22
23
  groupKey?: string;
@@ -117,6 +117,7 @@ export declare enum RENDER_CLASS_TYPE {
117
117
  TEXT = "Text"
118
118
  }
119
119
  export declare const MAXIMUM_ROW_HEIGHT = 2000;
120
+ export declare const MAXIMUM_COL_WIDTH = 2000;
120
121
  export declare const FIX_ONE_PIXEL_BLUR_OFFSET = 0.5;
121
122
  export declare const DRAWING_OBJECT_LOWER_LAYER_INDEX = 3;
122
123
  export declare const DRAWING_OBJECT_LAYER_INDEX = 4;
@@ -19,8 +19,6 @@ export interface IDocumentOffsetConfig extends IPageMarginLayout {
19
19
  export declare class Documents extends DocComponent {
20
20
  private readonly _pageRender$;
21
21
  readonly pageRender$: import('rxjs').Observable<IPageRenderConfig>;
22
- docsLeft: number;
23
- docsTop: number;
24
22
  private _drawLiquid;
25
23
  constructor(oKey: string, documentSkeleton?: DocumentSkeleton, config?: IDocumentsConfig);
26
24
  static create(oKey: string, documentSkeleton?: DocumentSkeleton, config?: IDocumentsConfig): Documents;
@@ -2,8 +2,8 @@ import { Nullable } from '@univerjs/core';
2
2
  import { IViewportInfo, Vector2 } from '../../basics/vector2';
3
3
  import { UniverRenderingContext } from '../../context';
4
4
  import { ColumnHeaderLayout, IColumnsHeaderCfgParam } from './extensions/column-header-layout';
5
- import { SpreadsheetHeader } from './sheet-component';
6
5
  import { SpreadsheetSkeleton } from './sheet-skeleton';
6
+ import { SpreadsheetHeader } from './sheet-component';
7
7
  export declare class SpreadsheetColumnHeader extends SpreadsheetHeader {
8
8
  getDocuments(): void;
9
9
  getNoMergeCellPositionByIndex(rowIndex: number, columnIndex: number): Nullable<{
@@ -1,20 +1,8 @@
1
- /**
2
- * Copyright 2023-present DreamNum Inc.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
1
+ import { SHEET_VIEWPORT_KEY } from './interfaces';
16
2
  export declare const BORDER_Z_INDEX = 50;
17
3
  export declare const FONT_EXTENSION_Z_INDEX = 45;
18
4
  export declare const BG_Z_INDEX = 21;
19
5
  export declare const PRINTING_BG_Z_INDEX = 21;
20
6
  export declare const EXPAND_SIZE_FOR_RENDER_OVERFLOW = 20;
7
+ export declare const sheetContentViewportKeys: SHEET_VIEWPORT_KEY[];
8
+ export declare const sheetHeaderViewportKeys: SHEET_VIEWPORT_KEY[];
@@ -1,8 +1,8 @@
1
1
  import { IScale } from '@univerjs/core';
2
- import { SheetExtension } from './sheet-extension';
3
2
  import { UniverRenderingContext } from '../../../context';
4
3
  import { IARowCfg, IARowCfgObj, IColumnStyleCfg, IRowStyleCfg } from '../interfaces';
5
4
  import { SpreadsheetSkeleton } from '../sheet-skeleton';
5
+ import { SheetExtension } from './sheet-extension';
6
6
  export interface IRowsHeaderCfgParam {
7
7
  headerStyle?: Partial<IRowStyleCfg>;
8
8
  rowsCfg?: IARowCfg[];
@@ -1,9 +1,9 @@
1
1
  import { Nullable } from '@univerjs/core';
2
- import { SpreadsheetHeader } from './sheet-component';
3
2
  import { IViewportInfo, Vector2 } from '../../basics/vector2';
4
3
  import { UniverRenderingContext } from '../../context';
5
4
  import { IRowsHeaderCfgParam, RowHeaderLayout } from './extensions/row-header-layout';
6
5
  import { SpreadsheetSkeleton } from './sheet-skeleton';
6
+ import { SpreadsheetHeader } from './sheet-component';
7
7
  export declare class SpreadsheetRowHeader extends SpreadsheetHeader {
8
8
  getDocuments(): void;
9
9
  getNoMergeCellPositionByIndex(rowIndex: number, columnIndex: number): Nullable<{
@@ -1,9 +1,9 @@
1
1
  import { IRange, Nullable } from '@univerjs/core';
2
2
  import { IViewportInfo, Vector2 } from '../../basics/vector2';
3
3
  import { UniverRenderingContext } from '../../context';
4
- import { RenderComponent } from '../component';
5
4
  import { SHEET_EXTENSION_TYPE } from './extensions/sheet-extension';
6
5
  import { SpreadsheetSkeleton } from './sheet-skeleton';
6
+ import { RenderComponent } from '../component';
7
7
  export declare abstract class SheetComponent extends RenderComponent<SpreadsheetSkeleton, SHEET_EXTENSION_TYPE, IRange[]> {
8
8
  private _skeleton?;
9
9
  constructor(oKey: string, _skeleton?: SpreadsheetSkeleton | undefined);
@@ -1,6 +1,6 @@
1
- import { ICellData, IColumnRange, IPaddingData, IPosition, IRange, IRowAutoHeightInfo, IRowRange, ISelectionCellWithMergeInfo, ISize, IStyleData, ITextRotation, IWorksheetData, Nullable, Styles, Worksheet, BooleanNumber, DocumentDataModel, HorizontalAlign, IContextService, LocaleService, ObjectMatrix, VerticalAlign, WrapStrategy } from '@univerjs/core';
1
+ import { ICellData, ICellDataForSheetInterceptor, IColAutoWidthInfo, IColumnRange, IPaddingData, IPosition, IRange, IRowAutoHeightInfo, IRowRange, ISelectionCellWithMergeInfo, ISize, IStyleData, ITextRotation, IWorksheetData, Nullable, Styles, Worksheet, BooleanNumber, DocumentDataModel, HorizontalAlign, IConfigService, IContextService, LocaleService, ObjectMatrix, VerticalAlign, WrapStrategy } from '@univerjs/core';
2
2
  import { IBoundRectNoAngle, IViewportInfo } from '../../basics/vector2';
3
- import { IFontCacheItem, IStylesCache } from './interfaces';
3
+ import { IFontCacheItem, IStylesCache, SHEET_VIEWPORT_KEY } from './interfaces';
4
4
  import { DocumentSkeleton } from '../docs/layout/doc-skeleton';
5
5
  import { Skeleton } from '../skeleton';
6
6
  /**
@@ -42,6 +42,7 @@ export declare class SpreadsheetSkeleton extends Skeleton {
42
42
  private _cellData;
43
43
  private _styles;
44
44
  private readonly _contextService;
45
+ private readonly _configService;
45
46
  private _rowHeightAccumulation;
46
47
  private _columnWidthAccumulation;
47
48
  private _rowTotalHeight;
@@ -49,9 +50,11 @@ export declare class SpreadsheetSkeleton extends Skeleton {
49
50
  private _rowHeaderWidth;
50
51
  private _columnHeaderHeight;
51
52
  /**
52
- * Range of visible area(range in viewBounds)
53
+ * Range viewBounds. only update by viewBounds.
54
+ * It would change multiple times in one frame if there is multiple viewport (after freeze row&col)
53
55
  */
54
56
  private _visibleRange;
57
+ private _visibleRangeMap;
55
58
  private _overflowCache;
56
59
  private _stylesCache;
57
60
  /** A matrix to store if a (row, column) position has render cache. */
@@ -61,13 +64,17 @@ export declare class SpreadsheetSkeleton extends Skeleton {
61
64
  private _showGridlines;
62
65
  private _marginTop;
63
66
  private _marginLeft;
67
+ /**
68
+ * Whether the row style precedes the column style.
69
+ */
70
+ private _isRowStylePrecedeColumnStyle;
64
71
  private _renderRawFormula;
65
72
  constructor(worksheet: Worksheet,
66
73
  /**
67
74
  * @deprecated avoid use `IWorksheetData` directly, use API provided by `Worksheet`, otherwise
68
75
  * `ViewModel` will be not working.
69
76
  */
70
- _worksheetData: IWorksheetData, _cellData: ObjectMatrix<Nullable<ICellData>>, _styles: Styles, _localeService: LocaleService, _contextService: IContextService);
77
+ _worksheetData: IWorksheetData, _cellData: ObjectMatrix<Nullable<ICellData>>, _styles: Styles, _localeService: LocaleService, _contextService: IContextService, _configService: IConfigService);
71
78
  get rowHeightAccumulation(): number[];
72
79
  get rowTotalHeight(): number;
73
80
  get columnWidthAccumulation(): number[];
@@ -78,7 +85,7 @@ export declare class SpreadsheetSkeleton extends Skeleton {
78
85
  * Range of visible area(range in viewBounds)
79
86
  */
80
87
  get rowColumnSegment(): IRowColumnRange;
81
- get visibleArea(): IRowColumnRange;
88
+ visibleRangeByViewportKey(viewportKey: SHEET_VIEWPORT_KEY): Nullable<IRowColumnRange>;
82
89
  get stylesCache(): IStylesCache;
83
90
  get overflowCache(): ObjectMatrix<IRange>;
84
91
  get showGridlines(): BooleanNumber;
@@ -105,12 +112,35 @@ export declare class SpreadsheetSkeleton extends Skeleton {
105
112
  * @param bounds
106
113
  * @returns boolean
107
114
  */
108
- calculateSegment(bounds?: IViewportInfo): boolean;
109
- calculateWithoutClearingCache(bounds?: IViewportInfo): Nullable<SpreadsheetSkeleton>;
115
+ updateVisibleRange(bounds?: IViewportInfo): boolean;
116
+ /**
117
+ * Set border background and font to this._stylesCache by visible range, which derives from bounds)
118
+ * @param bounds viewBounds
119
+ */
120
+ setStylesCache(bounds?: IViewportInfo): Nullable<SpreadsheetSkeleton>;
110
121
  calculate(bounds?: IViewportInfo): Nullable<SpreadsheetSkeleton>;
111
- calculateAutoHeightInRange(ranges: Nullable<IRange[]>): IRowAutoHeightInfo[];
112
122
  private _hasUnMergedCellInRow;
123
+ /**
124
+ * Calc all auto height by getDocsSkeletonPageSize in ranges
125
+ * @param ranges
126
+ * @returns {IRowAutoHeightInfo[]} result
127
+ */
128
+ calculateAutoHeightInRange(ranges: Nullable<IRange[]>): IRowAutoHeightInfo[];
113
129
  private _calculateRowAutoHeight;
130
+ calculateAutoWidthInRange(ranges: Nullable<IRange[]>): IColAutoWidthInfo[];
131
+ /**
132
+ * Iterate rows in visible area(and rows around it) and return column width of the specified column(by column index)
133
+ *
134
+ * @param colIndex
135
+ * @returns {number} width
136
+ */
137
+ private _calculateColWidth;
138
+ /**
139
+ * For _calculateColMaxWidth
140
+ * @param cell
141
+ * @returns {number} width
142
+ */
143
+ _getMeasuredWidthByCell(cell: ICellDataForSheetInterceptor, currColWidth: number): number;
114
144
  /**
115
145
  * Calculate data for row col & cell position, then update position value to this._rowHeaderWidth & this._rowHeightAccumulation & this._columnHeaderHeight & this._columnWidthAccumulation.
116
146
  */
@@ -249,6 +279,12 @@ export declare class SpreadsheetSkeleton extends Skeleton {
249
279
  */
250
280
  protected _getBounding(rowHeightAccumulation: number[], columnWidthAccumulation: number[], viewBound?: IBoundRectNoAngle): IRange;
251
281
  private _generateRowMatrixCache;
282
+ /**
283
+ * Calc columnWidthAccumulation by columnData
284
+ * @param colCount
285
+ * @param columnData
286
+ * @param defaultColumnWidth
287
+ */
252
288
  private _generateColumnMatrixCache;
253
289
  private _getOverflowBound;
254
290
  intersectMergeRange(row: number, column: number): boolean;
@@ -257,7 +293,6 @@ export declare class SpreadsheetSkeleton extends Skeleton {
257
293
  * @returns {IRange} The visible merge data
258
294
  */
259
295
  getCurrentRowColumnSegmentMergeData(range?: IRange): IRange[];
260
- private _calculateStylesCache;
261
296
  resetCache(): void;
262
297
  /**
263
298
  * Any changes to sheet model would reset cache.
@@ -274,12 +309,12 @@ export declare class SpreadsheetSkeleton extends Skeleton {
274
309
  } | undefined): void;
275
310
  _setFontStylesCache(row: number, col: number, cell: Nullable<ICellData>): void;
276
311
  /**
277
- * Set border background and font to this._stylesCache
312
+ * Set border background and font to this._stylesCache cell by cell.
278
313
  * @param row {number}
279
314
  * @param col {number}
280
315
  * @param options {{ mergeRange: IRange; cacheItem: ICacheItem } | undefined}
281
316
  */
282
- private _setStylesCache;
317
+ private _setStylesCacheForOneCell;
283
318
  private _updateConfigAndGetDocumentModel;
284
319
  private _getDocumentDataByStyle;
285
320
  /**
@@ -6,9 +6,9 @@ import { Scene } from '../../scene';
6
6
  import { Background } from './extensions/background';
7
7
  import { Border } from './extensions/border';
8
8
  import { Font } from './extensions/font';
9
+ import { IPaintForRefresh, IPaintForScrolling } from './interfaces';
9
10
  import { SpreadsheetSkeleton } from './sheet-skeleton';
10
11
  import { Documents } from '../docs/document';
11
- import { IPaintForRefresh, IPaintForScrolling, SHEET_VIEWPORT_KEY } from './interfaces';
12
12
  import { SheetComponent } from './sheet-component';
13
13
  export declare class Spreadsheet extends SheetComponent {
14
14
  private _allowCache;
@@ -27,9 +27,6 @@ export declare class Spreadsheet extends SheetComponent {
27
27
  getDocuments(): Documents;
28
28
  get allowCache(): boolean;
29
29
  get forceDisableGridlines(): boolean;
30
- /**
31
- * TODO: DR-Univer, fix as unknown as
32
- */
33
30
  dispose(): void;
34
31
  /**
35
32
  * draw by viewport
@@ -104,8 +101,6 @@ export declare class Spreadsheet extends SheetComponent {
104
101
  */
105
102
  private _clearRectangle;
106
103
  private _clearBackground;
107
- sheetContentViewport(): SHEET_VIEWPORT_KEY[];
108
- sheetHeaderViewport(): SHEET_VIEWPORT_KEY[];
109
104
  testShowRuler(cacheCtx: UniverRenderingContext2D, viewportInfo: IViewportInfo): void;
110
105
  testGetRandomLightColor(): string;
111
106
  }
@@ -1,28 +1,16 @@
1
- /**
2
- * Copyright 2023-present DreamNum Inc.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
1
+ import { IRenderConfig } from './services/render-config';
16
2
  export declare class UniverRenderingContext2D implements CanvasRenderingContext2D {
17
3
  __mode: string;
18
- private _system;
19
- private _browser;
20
4
  private _transformCache;
21
5
  readonly canvas: HTMLCanvasElement;
22
6
  _context: CanvasRenderingContext2D;
23
7
  private _systemType;
24
8
  private _browserType;
9
+ renderConfig: Readonly<IRenderConfig>;
25
10
  constructor(context: CanvasRenderingContext2D);
11
+ private _id;
12
+ getId(): string;
13
+ setId(id: string): void;
26
14
  isContextLost(): boolean;
27
15
  get globalAlpha(): number;
28
16
  set globalAlpha(val: number);
@@ -77,7 +65,14 @@ export declare class UniverRenderingContext2D implements CanvasRenderingContext2
77
65
  set textAlign(val: CanvasTextAlign);
78
66
  get textBaseline(): CanvasTextBaseline;
79
67
  set textBaseline(val: CanvasTextBaseline);
80
- private _getScale;
68
+ /**
69
+ * Get scale from ctx.
70
+ * DOMMatrix.a DOMMatrix.d would affect by ctx.rotate()
71
+ */
72
+ protected _getScale(): {
73
+ scaleX: number;
74
+ scaleY: number;
75
+ };
81
76
  getScale(): {
82
77
  scaleX: number;
83
78
  scaleY: number;
@@ -266,6 +261,7 @@ export declare class UniverRenderingContext2D implements CanvasRenderingContext2
266
261
  * @method
267
262
  */
268
263
  moveToByPrecision(x: number, y: number): void;
264
+ moveToByPrecisionLog(x: number, y: number): void;
269
265
  /**
270
266
  * rect function.
271
267
  * @method
@@ -352,21 +348,10 @@ export declare class UniverRenderingContext2D implements CanvasRenderingContext2
352
348
  clearRectForTexture(x: number, y: number, width: number, height: number): void;
353
349
  setGlobalCompositeOperation(val: GlobalCompositeOperation): void;
354
350
  }
355
- /**
356
- * TODO
357
- */
358
- export declare class UniverRenderingContextWebGL {
359
- }
360
- /**
361
- * TODO
362
- */
363
- export declare class UniverRenderingContextWebGPU {
364
- }
365
351
  export declare class UniverRenderingContext extends UniverRenderingContext2D {
366
352
  }
367
353
  export declare class UniverPrintingContext extends UniverRenderingContext2D {
368
354
  __mode: string;
369
- private __getScale;
370
355
  clearRect(x: number, y: number, width: number, height: number): void;
371
356
  clearRectForTexture(x: number, y: number, width: number, height: number): void;
372
357
  setGlobalCompositeOperation(val: GlobalCompositeOperation): void;
@@ -18,6 +18,7 @@ export * from './basics';
18
18
  export { getOffsetRectForDom } from './basics/position';
19
19
  export * from './canvas';
20
20
  export * from './components';
21
+ export { UniverRenderConfigService } from './services/render-config.service';
21
22
  export { DocBackground } from './components/docs/doc-background';
22
23
  export { Documents } from './components/docs/document';
23
24
  export type { IPageRenderConfig } from './components/docs/document';
@@ -37,7 +38,7 @@ export * from './custom';
37
38
  export * from './engine';
38
39
  export * from './group';
39
40
  export * from './layer';
40
- export { IRenderingEngine, UniverRenderEnginePlugin } from './render-engine';
41
+ export { IRenderingEngine, UniverRenderEnginePlugin } from './plugin';
41
42
  export { IRenderManagerService, type RenderComponentType, RenderManagerService } from './render-manager/render-manager.service';
42
43
  export { type IRender, type IRenderContext, type IRenderModule, RenderUnit } from './render-manager/render-unit';
43
44
  export * from './scene';
@@ -1,7 +1,7 @@
1
- import { Disposable } from '@univerjs/core';
2
- import { BaseObject } from './base-object';
3
1
  import { UniverRenderingContext } from './context';
4
2
  import { Scene } from './scene';
3
+ import { Disposable } from '@univerjs/core';
4
+ import { BaseObject } from './base-object';
5
5
  export declare class Layer extends Disposable {
6
6
  private _scene;
7
7
  private _zIndex;
@@ -1,8 +1,8 @@
1
1
  import { Nullable, Disposable } from '@univerjs/core';
2
- import { BaseObject } from './base-object';
3
2
  import { IMouseEvent, IPointerEvent } from './basics/i-events';
4
3
  import { ITransformerConfig } from './basics/transformer-config';
5
4
  import { Scene } from './scene';
5
+ import { BaseObject } from './base-object';
6
6
  import { Group } from './group';
7
7
  declare enum MoveObserverType {
8
8
  MOVE_START = 0,
@@ -147,6 +147,11 @@ export declare class Transformer extends Disposable implements ITransformerConfi
147
147
  private _hideControl;
148
148
  private _attachHover;
149
149
  private _clearControls;
150
+ /**
151
+ * @description Clear the control of the object with the specified id
152
+ * @param {string[]} ids the id of the object to be cleared
153
+ */
154
+ clearControlByIds(ids: string[]): void;
150
155
  private _clearControlMap;
151
156
  private _createControl;
152
157
  private _getTopScene;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export interface IRenderConfig {
17
+ [key: string]: any;
18
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * This service carries managers render config that would be passed
18
+ * to every widget, so some rendering could be optimized.
19
+ */
20
+ export declare class UniverRenderConfigService {
21
+ private readonly _renderConfig;
22
+ private readonly _updateSignal$;
23
+ readonly updateSignal$: import('rxjs').Observable<void>;
24
+ setRenderConfig(key: string, value: any): void;
25
+ getRenderConfig(): Readonly<Record<string, any>>;
26
+ }
@@ -20,6 +20,7 @@ export declare class Rect<T extends IRectProps = IRectProps> extends Shape<T> {
20
20
  get visualHeight(): Nullable<number>;
21
21
  get visualWidth(): Nullable<number>;
22
22
  get radius(): number;
23
+ setObjectType(type: ObjectType): void;
23
24
  static drawWith(ctx: UniverRenderingContext, props: IRectProps): void;
24
25
  toJson(): {
25
26
  [x: string]: any;
@@ -9,6 +9,7 @@ export type PaintFirst = 'fill' | 'stroke';
9
9
  export interface IShapeProps extends IObjectFullState, ISize, IOffset, IScale {
10
10
  rotateEnabled?: boolean;
11
11
  resizeEnabled?: boolean;
12
+ borderEnabled?: boolean;
12
13
  hoverCursor?: Nullable<string>;
13
14
  moveCursor?: string | null;
14
15
  fillRule?: string;
@@ -6,6 +6,7 @@ import { UniverRenderingContext } from './context';
6
6
  import { BaseScrollBar } from './shape/base-scroll-bar';
7
7
  import { ThinScene } from './thin-scene';
8
8
  import { Transform } from './basics/transform';
9
+ import { Canvas as UniverCanvas } from './canvas';
9
10
  interface IViewPosition {
10
11
  top?: number;
11
12
  left?: number;
@@ -204,6 +205,7 @@ export declare class Viewport {
204
205
  get _deltaScrollY(): number;
205
206
  get _deltaViewportScrollX(): number;
206
207
  get _deltaViewportScrollY(): number;
208
+ get canvas(): UniverCanvas | null;
207
209
  enable(): void;
208
210
  disable(): void;
209
211
  resetCanvasSizeAndUpdateScroll(): void;