@univerjs/engine-render 0.1.0-beta.0 → 0.1.0-beta.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.
Files changed (57) hide show
  1. package/lib/cjs/index.js +2 -2
  2. package/lib/es/index.js +11293 -6686
  3. package/lib/types/base-object.d.ts +2 -1
  4. package/lib/types/basics/draw.d.ts +5 -4
  5. package/lib/types/basics/tools.d.ts +1 -2
  6. package/lib/types/canvas.d.ts +2 -1
  7. package/lib/types/components/component.d.ts +2 -1
  8. package/lib/types/components/docs/common/text-range.d.ts +4 -4
  9. package/lib/types/components/docs/doc-component.d.ts +3 -2
  10. package/lib/types/components/docs/document.d.ts +4 -3
  11. package/lib/types/components/docs/extensions/background.d.ts +2 -1
  12. package/lib/types/components/docs/extensions/border.d.ts +2 -1
  13. package/lib/types/components/docs/extensions/font-and-base-line.d.ts +2 -1
  14. package/lib/types/components/docs/extensions/line.d.ts +2 -2
  15. package/lib/types/components/docs/linebreak/__tests__/linebreak.spec.d.ts +16 -0
  16. package/lib/types/components/docs/linebreak/classes.d.ts +58 -0
  17. package/lib/types/components/docs/linebreak/index.d.ts +16 -0
  18. package/lib/types/components/docs/linebreak/linebreaker.d.ts +37 -0
  19. package/lib/types/components/docs/linebreak/pairs.d.ts +21 -0
  20. package/lib/types/components/docs/linebreak/swap.d.ts +16 -0
  21. package/lib/types/components/docs/linebreak/tiny-inflate.d.ts +31 -0
  22. package/lib/types/components/docs/linebreak/trie-data.d.ts +17 -0
  23. package/lib/types/components/docs/linebreak/unicode-trie.d.ts +22 -0
  24. package/lib/types/components/extension.d.ts +2 -1
  25. package/lib/types/components/sheets/column-header.d.ts +2 -1
  26. package/lib/types/components/sheets/extensions/background.d.ts +2 -1
  27. package/lib/types/components/sheets/extensions/border.d.ts +2 -1
  28. package/lib/types/components/sheets/extensions/column-header-layout.d.ts +2 -1
  29. package/lib/types/components/sheets/extensions/font.d.ts +3 -2
  30. package/lib/types/components/sheets/extensions/row-header-layout.d.ts +2 -1
  31. package/lib/types/components/sheets/extensions/sheet-extension.d.ts +4 -4
  32. package/lib/types/components/sheets/row-header.d.ts +2 -1
  33. package/lib/types/components/sheets/sheet-component.d.ts +4 -3
  34. package/lib/types/components/sheets/sheet-skeleton.d.ts +11 -4
  35. package/lib/types/components/sheets/spreadsheet.d.ts +5 -10
  36. package/lib/types/components/slides/slide.d.ts +2 -1
  37. package/lib/types/context.d.ts +399 -0
  38. package/lib/types/custom/custom-object.d.ts +3 -2
  39. package/lib/types/group.d.ts +2 -1
  40. package/lib/types/index.d.ts +1 -0
  41. package/lib/types/layer.d.ts +2 -1
  42. package/lib/types/scene-viewer.d.ts +2 -1
  43. package/lib/types/scene.d.ts +7 -2
  44. package/lib/types/scroll-timer.d.ts +11 -5
  45. package/lib/types/shape/base-scroll-bar.d.ts +2 -1
  46. package/lib/types/shape/circle.d.ts +3 -2
  47. package/lib/types/shape/path.d.ts +4 -3
  48. package/lib/types/shape/picture.d.ts +3 -2
  49. package/lib/types/shape/rect.d.ts +3 -2
  50. package/lib/types/shape/regular-polygon.d.ts +3 -2
  51. package/lib/types/shape/rich-text.d.ts +3 -2
  52. package/lib/types/shape/scroll-bar.d.ts +2 -1
  53. package/lib/types/shape/shape.d.ts +12 -11
  54. package/lib/types/thin-scene.d.ts +8 -2
  55. package/lib/types/viewport.d.ts +2 -2
  56. package/lib/umd/index.js +3 -3
  57. package/package.json +10 -10
@@ -21,6 +21,7 @@ import type { IMouseEvent, IPointerEvent, IWheelEvent } from './basics/i-events'
21
21
  import type { IObjectFullState, ITransformChangeState } from './basics/interfaces';
22
22
  import { Transform } from './basics/transform';
23
23
  import type { IViewportBound, Vector2 } from './basics/vector2';
24
+ import type { UniverRenderingContext } from './context';
24
25
  export declare const BASE_OBJECT_ARRAY: string[];
25
26
  export declare abstract class BaseObject {
26
27
  groupKey?: string;
@@ -142,7 +143,7 @@ export declare abstract class BaseObject {
142
143
  };
143
144
  hide(): void;
144
145
  show(): void;
145
- render(ctx: CanvasRenderingContext2D, bounds?: IViewportBound): void;
146
+ render(ctx: UniverRenderingContext, bounds?: IViewportBound): void;
146
147
  isHit(coord: Vector2): boolean;
147
148
  on(eventType: EVENT_TYPE, func: (evt: unknown, state: EventState) => void): Nullable<Observer<unknown>>;
148
149
  off(eventType: EVENT_TYPE, observer: Nullable<Observer<unknown>>): void;
@@ -15,6 +15,7 @@
15
15
  */
16
16
  import type { IPosition } from '@univerjs/core';
17
17
  import { BorderStyleTypes } from '@univerjs/core';
18
+ import type { UniverRenderingContext } from '../context';
18
19
  import { BORDER_TYPE, ORIENTATION_TYPE } from './const';
19
20
  import type { IDocumentSkeletonLine } from './i-document-skeleton-cached';
20
21
  import { Vector2 } from './vector2';
@@ -26,10 +27,10 @@ export interface IContext2D extends CanvasRenderingContext2D {
26
27
  backingStorePixelRatio: number;
27
28
  }
28
29
  export declare function getDevicePixelRatio(): number;
29
- export declare function drawLineByBorderType(ctx: CanvasRenderingContext2D, type: BORDER_TYPE, position: IPosition): void;
30
- export declare function drawDiagonalLineByBorderType(ctx: CanvasRenderingContext2D, type: BORDER_TYPE, position: IPosition): void;
31
- export declare function clearLineByBorderType(ctx: CanvasRenderingContext2D, type: BORDER_TYPE, position: IPosition, scaleX: number, scaleY: number): void;
32
- export declare function setLineType(ctx: CanvasRenderingContext2D, style: BorderStyleTypes): void;
30
+ export declare function drawLineByBorderType(ctx: UniverRenderingContext, type: BORDER_TYPE, position: IPosition): void;
31
+ export declare function drawDiagonalLineByBorderType(ctx: UniverRenderingContext, type: BORDER_TYPE, position: IPosition): void;
32
+ export declare function clearLineByBorderType(ctx: UniverRenderingContext, type: BORDER_TYPE, position: IPosition): void;
33
+ export declare function setLineType(ctx: UniverRenderingContext, style: BorderStyleTypes): void;
33
34
  export declare function getLineOffset(): number;
34
35
  export declare function getLineWith(width: number): number;
35
36
  export declare function getLineWidth(style: BorderStyleTypes): number;
@@ -62,7 +62,6 @@ export declare function getFontStyleString(textStyle?: IStyleBase, localeService
62
62
  fontSize: number;
63
63
  fontFamily: string;
64
64
  };
65
- export declare function isSupportBoundingBox(ctx: CanvasRenderingContext2D): boolean;
66
65
  export declare function hasCJKText(text: string): boolean;
67
66
  export declare function hasCJK(text: string): boolean;
68
67
  export declare function hasAllLatin(text: string): boolean;
@@ -96,7 +95,7 @@ export declare function getCellInfoInMergeData(row: number, column: number, merg
96
95
  * Determine whether there are any cells in a row that are not in the merged cells, mainly used for the calculation of auto height
97
96
  */
98
97
  export declare function hasUnMergedCellInRow(row: number, startColumn: number, endColumn: number, mergeData: IRange[]): boolean;
99
- export declare function mergeInfoOffset(mergeInfo: IRangeWithCoord, offsetX: number, offsetY: number, scaleX: number, scaleY: number): {
98
+ export declare function mergeInfoOffset(mergeInfo: IRangeWithCoord, offsetX: number, offsetY: number): {
100
99
  startX: number;
101
100
  startY: number;
102
101
  endX: number;
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import { UniverRenderingContext } from './context';
16
17
  interface ICanvasProps {
17
18
  width?: number;
18
19
  height?: number;
@@ -42,7 +43,7 @@ export declare class Canvas {
42
43
  * @method
43
44
  * @returns {CanvasContext} context
44
45
  */
45
- getContext(): CanvasRenderingContext2D;
46
+ getContext(): UniverRenderingContext;
46
47
  getPixelRatio(): number;
47
48
  getWidth(): number;
48
49
  getHeight(): number;
@@ -15,6 +15,7 @@
15
15
  */
16
16
  import { BaseObject } from '../base-object';
17
17
  import type { IViewportBound } from '../basics/vector2';
18
+ import type { UniverRenderingContext } from '../context';
18
19
  import type { ComponentExtension } from './extension';
19
20
  export declare class RenderComponent<T, U, V> extends BaseObject {
20
21
  private _extensions;
@@ -23,5 +24,5 @@ export declare class RenderComponent<T, U, V> extends BaseObject {
23
24
  unRegister(...uKeys: string[]): void;
24
25
  getExtensionsByOrder(): ComponentExtension<T, U, V>[];
25
26
  getExtensionByKey(uKey: string): ComponentExtension<T, U, V> | undefined;
26
- draw(ctx: CanvasRenderingContext2D, bounds?: IViewportBound): void;
27
+ draw(ctx: UniverRenderingContext, bounds?: IViewportBound): void;
27
28
  }
@@ -21,11 +21,11 @@ import type { Scene } from '../../../scene';
21
21
  import { Rect } from '../../../shape/rect';
22
22
  import type { ThinScene } from '../../../thin-scene';
23
23
  import type { DocumentSkeleton } from '../doc-skeleton';
24
- import type { IDocumentOffsetConfig } from '../document';
25
- export declare function cursorConvertToTextRange(scene: Scene, range: ISuccinctTextRangeParam, docSkeleton: DocumentSkeleton, documentOffsetConfig: IDocumentOffsetConfig): Nullable<TextRange>;
24
+ import type { Documents } from '../document';
25
+ export declare function cursorConvertToTextRange(scene: Scene, range: ISuccinctTextRangeParam, docSkeleton: DocumentSkeleton, document: Documents): Nullable<TextRange>;
26
26
  export declare class TextRange {
27
27
  private _scene;
28
- private _documentOffsetConfig;
28
+ private _document;
29
29
  private _docSkeleton;
30
30
  anchorNodePosition?: Nullable<INodePosition>;
31
31
  focusNodePosition?: Nullable<INodePosition>;
@@ -34,7 +34,7 @@ export declare class TextRange {
34
34
  private _rangeShape;
35
35
  private _anchorShape;
36
36
  private _cursorList;
37
- constructor(_scene: ThinScene, _documentOffsetConfig: IDocumentOffsetConfig, _docSkeleton: DocumentSkeleton, anchorNodePosition?: Nullable<INodePosition>, focusNodePosition?: Nullable<INodePosition>, style?: ITextSelectionStyle);
37
+ constructor(_scene: ThinScene, _document: Documents, _docSkeleton: DocumentSkeleton, anchorNodePosition?: Nullable<INodePosition>, focusNodePosition?: Nullable<INodePosition>, style?: ITextSelectionStyle);
38
38
  get startOffset(): number | undefined;
39
39
  get endOffset(): number | undefined;
40
40
  get collapsed(): boolean;
@@ -18,6 +18,7 @@ import type { IDocumentSkeletonLine, IDocumentSkeletonSpan } from '../../basics/
18
18
  import { PageLayoutType } from '../../basics/i-document-skeleton-cached';
19
19
  import type { INodeInfo } from '../../basics/interfaces';
20
20
  import type { IBoundRectNoAngle, IViewportBound } from '../../basics/vector2';
21
+ import type { UniverRenderingContext } from '../../context';
21
22
  import { RenderComponent } from '../component';
22
23
  import type { DOCS_EXTENSION_TYPE } from './doc-extension';
23
24
  import type { DocumentSkeleton } from './doc-skeleton';
@@ -29,7 +30,7 @@ export declare class DocComponent extends RenderComponent<IDocumentSkeletonSpan
29
30
  constructor(oKey: string, _skeleton?: DocumentSkeleton | undefined);
30
31
  getSkeleton(): DocumentSkeleton | undefined;
31
32
  setSkeleton(skeleton: DocumentSkeleton): void;
32
- render(mainCtx: CanvasRenderingContext2D, bounds?: IViewportBound): this | undefined;
33
+ render(mainCtx: UniverRenderingContext, bounds?: IViewportBound): this | undefined;
33
34
  getParentScale(): {
34
35
  scaleX: any;
35
36
  scaleY: any;
@@ -40,5 +41,5 @@ export declare class DocComponent extends RenderComponent<IDocumentSkeletonSpan
40
41
  findNodeByCoord(offsetX: number, offsetY: number): Nullable<INodeInfo>;
41
42
  findCoordByNode(span: IDocumentSkeletonSpan): void;
42
43
  protected _getBounding(bounds?: IViewportBound): void;
43
- protected _draw(ctx: CanvasRenderingContext2D, bounds?: IViewportBound): void;
44
+ protected _draw(ctx: UniverRenderingContext, bounds?: IViewportBound): void;
44
45
  }
@@ -19,6 +19,7 @@ import type { IDocumentSkeletonPage } from '../../basics/i-document-skeleton-cac
19
19
  import { PageLayoutType } from '../../basics/i-document-skeleton-cached';
20
20
  import type { Transform } from '../../basics/transform';
21
21
  import type { IViewportBound } from '../../basics/vector2';
22
+ import type { UniverRenderingContext } from '../../context';
22
23
  import type { Scene } from '../../scene';
23
24
  import { DocComponent } from './doc-component';
24
25
  import type { DocumentSkeleton } from './doc-skeleton';
@@ -34,7 +35,7 @@ export interface IPageRenderConfig {
34
35
  page: IDocumentSkeletonPage;
35
36
  pageLeft: number;
36
37
  pageTop: number;
37
- ctx: CanvasRenderingContext2D;
38
+ ctx: UniverRenderingContext;
38
39
  }
39
40
  export interface IDocumentOffsetConfig extends IPageMarginLayout {
40
41
  docsLeft: number;
@@ -53,9 +54,9 @@ export declare class Documents extends DocComponent {
53
54
  setConfig(config?: IDocumentsConfig): void;
54
55
  getOffsetConfig(): IDocumentOffsetConfig;
55
56
  getEngine(): Nullable<import("../../thin-engine").ThinEngine<Scene>>;
56
- draw(ctx: CanvasRenderingContext2D, bounds?: IViewportBound): void;
57
+ draw(ctx: UniverRenderingContext, bounds?: IViewportBound): void;
57
58
  changeSkeleton(newSkeleton: DocumentSkeleton): this;
58
- protected _draw(ctx: CanvasRenderingContext2D, bounds?: IViewportBound): void;
59
+ protected _draw(ctx: UniverRenderingContext, bounds?: IViewportBound): void;
59
60
  private _horizontalHandler;
60
61
  private _verticalHandler;
61
62
  private _startRotation;
@@ -15,11 +15,12 @@
15
15
  */
16
16
  import type { IScale } from '@univerjs/core';
17
17
  import type { IDocumentSkeletonSpan } from '../../../basics/i-document-skeleton-cached';
18
+ import type { UniverRenderingContext } from '../../../context';
18
19
  import { docExtension } from '../doc-extension';
19
20
  export declare class Background extends docExtension {
20
21
  uKey: string;
21
22
  zIndex: number;
22
23
  private _preBackgroundColor;
23
- draw(ctx: CanvasRenderingContext2D, parentScale: IScale, span: IDocumentSkeletonSpan): void;
24
+ draw(ctx: UniverRenderingContext, parentScale: IScale, span: IDocumentSkeletonSpan): void;
24
25
  clearCache(): void;
25
26
  }
@@ -15,13 +15,14 @@
15
15
  */
16
16
  import type { IScale } from '@univerjs/core';
17
17
  import type { IDocumentSkeletonSpan } from '../../../basics/i-document-skeleton-cached';
18
+ import type { UniverRenderingContext } from '../../../context';
18
19
  import { docExtension } from '../doc-extension';
19
20
  export declare class Border extends docExtension {
20
21
  uKey: string;
21
22
  zIndex: number;
22
23
  private _preBorderStyle;
23
24
  private _preBorderColor;
24
- draw(ctx: CanvasRenderingContext2D, parentScale: IScale, span: IDocumentSkeletonSpan): void;
25
+ draw(ctx: UniverRenderingContext, parentScale: IScale, span: IDocumentSkeletonSpan): void;
25
26
  clearCache(): void;
26
27
  private _createBorderCache;
27
28
  }
@@ -15,13 +15,14 @@
15
15
  */
16
16
  import type { IScale } from '@univerjs/core';
17
17
  import type { IDocumentSkeletonSpan } from '../../../basics/i-document-skeleton-cached';
18
+ import type { UniverRenderingContext } from '../../../context';
18
19
  import { docExtension } from '../doc-extension';
19
20
  export declare class FontAndBaseLine extends docExtension {
20
21
  uKey: string;
21
22
  zIndex: number;
22
23
  private _preFontString;
23
24
  private _preFontColor;
24
- draw(ctx: CanvasRenderingContext2D, parentScale: IScale, span: IDocumentSkeletonSpan): void;
25
+ draw(ctx: UniverRenderingContext, parentScale: IScale, span: IDocumentSkeletonSpan): void;
25
26
  private _fillText;
26
27
  clearCache(): void;
27
28
  }
@@ -15,14 +15,14 @@
15
15
  */
16
16
  import type { IScale } from '@univerjs/core';
17
17
  import type { IDocumentSkeletonSpan } from '../../../basics/i-document-skeleton-cached';
18
+ import type { UniverRenderingContext } from '../../../context';
18
19
  import { docExtension } from '../doc-extension';
19
20
  export declare class Line extends docExtension {
20
21
  uKey: string;
21
22
  zIndex: number;
22
23
  private _preBackgroundColor;
23
- draw(ctx: CanvasRenderingContext2D, parentScale: IScale, span: IDocumentSkeletonSpan): void;
24
+ draw(ctx: UniverRenderingContext, parentScale: IScale, span: IDocumentSkeletonSpan): void;
24
25
  clearCache(): void;
25
26
  private _drawLine;
26
27
  private _setLineType;
27
- private _getLineWidth;
28
28
  }
@@ -0,0 +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
+ */
16
+ export {};
@@ -0,0 +1,58 @@
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 declare const OP = 0;
17
+ export declare const CL = 1;
18
+ export declare const CP = 2;
19
+ export declare const QU = 3;
20
+ export declare const GL = 4;
21
+ export declare const NS = 5;
22
+ export declare const EX = 6;
23
+ export declare const SY = 7;
24
+ export declare const IS = 8;
25
+ export declare const PR = 9;
26
+ export declare const PO = 10;
27
+ export declare const NU = 11;
28
+ export declare const AL = 12;
29
+ export declare const HL = 13;
30
+ export declare const ID = 14;
31
+ export declare const IN = 15;
32
+ export declare const HY = 16;
33
+ export declare const BA = 17;
34
+ export declare const BB = 18;
35
+ export declare const B2 = 19;
36
+ export declare const ZW = 20;
37
+ export declare const CM = 21;
38
+ export declare const WJ = 22;
39
+ export declare const H2 = 23;
40
+ export declare const H3 = 24;
41
+ export declare const JL = 25;
42
+ export declare const JV = 26;
43
+ export declare const JT = 27;
44
+ export declare const RI = 28;
45
+ export declare const EB = 29;
46
+ export declare const EM = 30;
47
+ export declare const ZWJ = 31;
48
+ export declare const CB = 32;
49
+ export declare const AI = 33;
50
+ export declare const BK = 34;
51
+ export declare const CJ = 35;
52
+ export declare const CR = 36;
53
+ export declare const LF = 37;
54
+ export declare const NL = 38;
55
+ export declare const SA = 39;
56
+ export declare const SG = 40;
57
+ export declare const SP = 41;
58
+ export declare const XX = 42;
@@ -0,0 +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
+ */
16
+ export { LineBreaker } from './linebreaker';
@@ -0,0 +1,37 @@
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
+ declare class Break {
17
+ position: number;
18
+ required: boolean;
19
+ constructor(position: number, required?: boolean);
20
+ }
21
+ export declare class LineBreaker {
22
+ string: string;
23
+ pos: number;
24
+ lastPos: number;
25
+ curClass: number | null;
26
+ nextClass: number | null;
27
+ LB8a: boolean;
28
+ LB21a: boolean;
29
+ LB30a: number;
30
+ constructor(string: string);
31
+ nextCodePoint(): number;
32
+ nextCharClass(): number;
33
+ getSimpleBreak(): false | null;
34
+ getPairTableBreak(lastClass: number): boolean;
35
+ nextBreak(): Break | null;
36
+ }
37
+ export {};
@@ -0,0 +1,21 @@
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 declare const DI_BRK = 0;
17
+ export declare const IN_BRK = 1;
18
+ export declare const CI_BRK = 2;
19
+ export declare const CP_BRK = 3;
20
+ export declare const PR_BRK = 4;
21
+ export declare const pairTable: number[][];
@@ -0,0 +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
+ */
16
+ export declare const swap32LE: (array: Uint8Array) => void;
@@ -0,0 +1,31 @@
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 declare class Tree {
17
+ table: Uint16Array;
18
+ trans: Uint16Array;
19
+ }
20
+ export declare class Data {
21
+ source: Uint8Array;
22
+ dest: Uint8Array;
23
+ sourceIndex: number;
24
+ tag: number;
25
+ bitcount: number;
26
+ destLen: number;
27
+ ltree: Tree;
28
+ dtree: Tree;
29
+ constructor(source: Uint8Array, dest: Uint8Array);
30
+ }
31
+ export default function tinf_uncompress(source: Uint8Array, dest: Uint8Array): Uint8Array;
@@ -0,0 +1,17 @@
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
+ declare const _default: Uint8Array;
17
+ export default _default;
@@ -0,0 +1,22 @@
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 default class UnicodeTrie {
17
+ highStart: number;
18
+ errorValue: number;
19
+ data: Uint32Array;
20
+ constructor(data: any);
21
+ get(codePoint: number): number;
22
+ }
@@ -17,6 +17,7 @@ import type { IDocumentRenderConfig, IScale, Nullable } from '@univerjs/core';
17
17
  import { Registry } from '@univerjs/core';
18
18
  import type { BaseObject } from '../base-object';
19
19
  import type { Vector2 } from '../basics/vector2';
20
+ import type { UniverRenderingContext } from '../context';
20
21
  export interface IExtensionConfig {
21
22
  originTranslate?: Vector2;
22
23
  spanStartPoint?: Vector2;
@@ -33,7 +34,7 @@ export declare class ComponentExtension<T, U, V> {
33
34
  translateX: number;
34
35
  translateY: number;
35
36
  extensionOffset: IExtensionConfig;
36
- draw(ctx: CanvasRenderingContext2D, parentScale: IScale, skeleton: T, diffBounds?: V): void;
37
+ draw(ctx: UniverRenderingContext, parentScale: IScale, skeleton: T, diffBounds?: V): void;
37
38
  clearCache(): void;
38
39
  protected _getScale(parentScale: IScale): number;
39
40
  }
@@ -14,6 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import type { IViewportBound, Vector2 } from '../../basics/vector2';
17
+ import type { UniverRenderingContext } from '../../context';
17
18
  import type { ColumnHeaderLayout } from './extensions/column-header-layout';
18
19
  import { SpreadsheetHeader } from './sheet-component';
19
20
  import type { SpreadsheetSkeleton } from './sheet-skeleton';
@@ -21,7 +22,7 @@ export declare class SpreadsheetColumnHeader extends SpreadsheetHeader {
21
22
  private _columnHeaderLayoutExtension;
22
23
  constructor(oKey: string, spreadsheetSkeleton?: SpreadsheetSkeleton);
23
24
  get columnHeaderLayoutExtension(): ColumnHeaderLayout;
24
- draw(ctx: CanvasRenderingContext2D, bounds?: IViewportBound): void;
25
+ draw(ctx: UniverRenderingContext, bounds?: IViewportBound): void;
25
26
  isHit(coord: Vector2): boolean;
26
27
  private _initialDefaultExtension;
27
28
  }
@@ -14,10 +14,11 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import type { IRange, IScale } from '@univerjs/core';
17
+ import type { UniverRenderingContext } from '../../../context';
17
18
  import type { SpreadsheetSkeleton } from '../sheet-skeleton';
18
19
  import { SheetExtension } from './sheet-extension';
19
20
  export declare class Background extends SheetExtension {
20
21
  uKey: string;
21
22
  zIndex: number;
22
- draw(ctx: CanvasRenderingContext2D, parentScale: IScale, spreadsheetSkeleton: SpreadsheetSkeleton, diffRanges?: IRange[]): void;
23
+ draw(ctx: UniverRenderingContext, parentScale: IScale, spreadsheetSkeleton: SpreadsheetSkeleton, diffRanges?: IRange[]): void;
23
24
  }
@@ -14,11 +14,12 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import type { IRange, IScale } from '@univerjs/core';
17
+ import type { UniverRenderingContext } from '../../../context';
17
18
  import type { SpreadsheetSkeleton } from '../sheet-skeleton';
18
19
  import { SheetExtension } from './sheet-extension';
19
20
  export declare class Border extends SheetExtension {
20
21
  uKey: string;
21
22
  zIndex: number;
22
- draw(ctx: CanvasRenderingContext2D, parentScale: IScale, spreadsheetSkeleton: SpreadsheetSkeleton, diffRanges?: IRange[]): void;
23
+ draw(ctx: UniverRenderingContext, parentScale: IScale, spreadsheetSkeleton: SpreadsheetSkeleton, diffRanges?: IRange[]): void;
23
24
  private _getOverflowExclusion;
24
25
  }
@@ -14,10 +14,11 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import type { IScale } from '@univerjs/core';
17
+ import type { UniverRenderingContext } from '../../../context';
17
18
  import type { SpreadsheetSkeleton } from '../sheet-skeleton';
18
19
  import { SheetExtension } from './sheet-extension';
19
20
  export declare class ColumnHeaderLayout extends SheetExtension {
20
21
  uKey: string;
21
22
  zIndex: number;
22
- draw(ctx: CanvasRenderingContext2D, parentScale: IScale, spreadsheetSkeleton: SpreadsheetSkeleton): void;
23
+ draw(ctx: UniverRenderingContext, parentScale: IScale, spreadsheetSkeleton: SpreadsheetSkeleton): void;
23
24
  }
@@ -15,7 +15,8 @@
15
15
  */
16
16
  import type { IColorStyle, IRange, IScale } from '@univerjs/core';
17
17
  import { ObjectMatrix } from '@univerjs/core';
18
- import type { SpreadsheetSkeleton } from '../sheet-skeleton';
18
+ import type { UniverRenderingContext } from '../../../context';
19
+ import { type SpreadsheetSkeleton } from '../sheet-skeleton';
19
20
  import { SheetExtension } from './sheet-extension';
20
21
  export declare class Font extends SheetExtension {
21
22
  uKey: string;
@@ -23,7 +24,7 @@ export declare class Font extends SheetExtension {
23
24
  changeFontColor: ObjectMatrix<IColorStyle>;
24
25
  getDocuments(): any;
25
26
  setChangeFontColor(r: number, c: number, color: IColorStyle): void;
26
- draw(ctx: CanvasRenderingContext2D, parentScale: IScale, spreadsheetSkeleton: SpreadsheetSkeleton, diffRanges?: IRange[]): void;
27
+ draw(ctx: UniverRenderingContext, parentScale: IScale, spreadsheetSkeleton: SpreadsheetSkeleton, diffRanges?: IRange[]): void;
27
28
  private _renderDocuments;
28
29
  private _clipRectangle;
29
30
  }
@@ -14,10 +14,11 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import type { IScale } from '@univerjs/core';
17
+ import type { UniverRenderingContext } from '../../../context';
17
18
  import type { SpreadsheetSkeleton } from '../sheet-skeleton';
18
19
  import { SheetExtension } from './sheet-extension';
19
20
  export declare class RowHeaderLayout extends SheetExtension {
20
21
  uKey: string;
21
22
  zIndex: number;
22
- draw(ctx: CanvasRenderingContext2D, parentScale: IScale, spreadsheetSkeleton: SpreadsheetSkeleton): void;
23
+ draw(ctx: UniverRenderingContext, parentScale: IScale, spreadsheetSkeleton: SpreadsheetSkeleton): void;
23
24
  }
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { IRange } from '@univerjs/core';
16
+ import { type IRange } from '@univerjs/core';
17
17
  import { ComponentExtension } from '../../extension';
18
18
  import type { SpreadsheetSkeleton } from '../sheet-skeleton';
19
19
  export declare enum SHEET_EXTENSION_TYPE {
@@ -22,7 +22,7 @@ export declare enum SHEET_EXTENSION_TYPE {
22
22
  export declare class SheetExtension extends ComponentExtension<SpreadsheetSkeleton, SHEET_EXTENSION_TYPE, IRange[]> {
23
23
  type: SHEET_EXTENSION_TYPE;
24
24
  getCellIndex(rowIndex: number, columnIndex: number, rowHeightAccumulation: number[], columnWidthAccumulation: number[], dataMergeCache: IRange[]): import("@univerjs/core").ISelectionCellWithCoord;
25
- isRenderDiffRangesByCell(row: number, column: number, diffRanges?: IRange[]): boolean;
26
- isRenderDiffRangesByColumn(column: number, diffRanges?: IRange[]): boolean;
27
- isRenderDiffRangesByRow(row: number, diffRanges?: IRange[]): boolean;
25
+ isRenderDiffRangesByCell(range: IRange, diffRanges?: IRange[]): boolean;
26
+ isRenderDiffRangesByColumn(curStartColumn: number, curEndColumn: number, diffRanges?: IRange[]): boolean;
27
+ isRenderDiffRangesByRow(curStartRow: number, curEndRow: number, diffRanges?: IRange[]): boolean;
28
28
  }
@@ -14,6 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import type { IViewportBound, Vector2 } from '../../basics/vector2';
17
+ import type { UniverRenderingContext } from '../../context';
17
18
  import type { RowHeaderLayout } from './extensions/row-header-layout';
18
19
  import { SpreadsheetHeader } from './sheet-component';
19
20
  import type { SpreadsheetSkeleton } from './sheet-skeleton';
@@ -21,7 +22,7 @@ export declare class SpreadsheetRowHeader extends SpreadsheetHeader {
21
22
  private _rowHeaderLayoutExtension;
22
23
  constructor(oKey: string, spreadsheetSkeleton?: SpreadsheetSkeleton);
23
24
  get rowHeaderLayoutExtension(): RowHeaderLayout;
24
- draw(ctx: CanvasRenderingContext2D, bounds?: IViewportBound): void;
25
+ draw(ctx: UniverRenderingContext, bounds?: IViewportBound): void;
25
26
  isHit(coord: Vector2): boolean;
26
27
  private _initialDefaultExtension;
27
28
  }