logisheets 0.6.0

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 (120) hide show
  1. package/README.md +15 -0
  2. package/index.ts +1 -0
  3. package/package.json +31 -0
  4. package/src/api/index.ts +1 -0
  5. package/src/api/workbook.ts +201 -0
  6. package/src/bindings/action_effect.ts +17 -0
  7. package/src/bindings/async_func_result.ts +12 -0
  8. package/src/bindings/block_cell_id.ts +7 -0
  9. package/src/bindings/block_info.ts +9 -0
  10. package/src/bindings/block_input.ts +9 -0
  11. package/src/bindings/block_style_update.ts +10 -0
  12. package/src/bindings/border.ts +15 -0
  13. package/src/bindings/border_pr.ts +8 -0
  14. package/src/bindings/cell_alignment.ts +15 -0
  15. package/src/bindings/cell_formula_value.ts +9 -0
  16. package/src/bindings/cell_id.ts +7 -0
  17. package/src/bindings/cell_input.ts +9 -0
  18. package/src/bindings/cell_protection.ts +6 -0
  19. package/src/bindings/cell_style.ts +8 -0
  20. package/src/bindings/col_info.ts +7 -0
  21. package/src/bindings/color.ts +8 -0
  22. package/src/bindings/comment.ts +8 -0
  23. package/src/bindings/create_block.ts +15 -0
  24. package/src/bindings/create_sheet.ts +6 -0
  25. package/src/bindings/delete_cols.ts +7 -0
  26. package/src/bindings/delete_cols_in_block.ts +8 -0
  27. package/src/bindings/delete_rows.ts +7 -0
  28. package/src/bindings/delete_rows_in_block.ts +8 -0
  29. package/src/bindings/delete_sheet.ts +5 -0
  30. package/src/bindings/display_patch.ts +19 -0
  31. package/src/bindings/display_request.ts +6 -0
  32. package/src/bindings/display_response.ts +7 -0
  33. package/src/bindings/edit_action.ts +10 -0
  34. package/src/bindings/edit_payload.ts +47 -0
  35. package/src/bindings/fill.ts +7 -0
  36. package/src/bindings/font.ts +25 -0
  37. package/src/bindings/font_family.ts +5 -0
  38. package/src/bindings/font_name.ts +5 -0
  39. package/src/bindings/font_scheme.ts +6 -0
  40. package/src/bindings/gradient_fill.ts +13 -0
  41. package/src/bindings/gradient_stop.ts +7 -0
  42. package/src/bindings/index.ts +85 -0
  43. package/src/bindings/insert_cols.ts +7 -0
  44. package/src/bindings/insert_cols_in_block.ts +8 -0
  45. package/src/bindings/insert_rows.ts +7 -0
  46. package/src/bindings/insert_rows_in_block.ts +8 -0
  47. package/src/bindings/merge_cell.ts +8 -0
  48. package/src/bindings/move_block.ts +8 -0
  49. package/src/bindings/msg_edit.ts +9 -0
  50. package/src/bindings/msg_join.ts +9 -0
  51. package/src/bindings/msg_sequencer_action_invalid_message.ts +10 -0
  52. package/src/bindings/msg_sequencer_action_message.ts +10 -0
  53. package/src/bindings/msg_sequencer_init_workbook.ts +8 -0
  54. package/src/bindings/msg_sequencer_message.ts +9 -0
  55. package/src/bindings/msg_user_message.ts +7 -0
  56. package/src/bindings/normal_cell_id.ts +6 -0
  57. package/src/bindings/pattern_fill.ts +9 -0
  58. package/src/bindings/payloads_action.ts +15 -0
  59. package/src/bindings/recalc_cell.ts +7 -0
  60. package/src/bindings/remove_block.ts +6 -0
  61. package/src/bindings/row_info.ts +7 -0
  62. package/src/bindings/set_col_width.ts +7 -0
  63. package/src/bindings/set_row_height.ts +7 -0
  64. package/src/bindings/set_visible.ts +8 -0
  65. package/src/bindings/sheet_blocks.ts +7 -0
  66. package/src/bindings/sheet_col_info.ts +8 -0
  67. package/src/bindings/sheet_comments.ts +7 -0
  68. package/src/bindings/sheet_merge_cells.ts +7 -0
  69. package/src/bindings/sheet_names.ts +5 -0
  70. package/src/bindings/sheet_rename.ts +8 -0
  71. package/src/bindings/sheet_row_info.ts +8 -0
  72. package/src/bindings/sheet_styles.ts +7 -0
  73. package/src/bindings/sheet_values.ts +7 -0
  74. package/src/bindings/st_border_style.ts +17 -0
  75. package/src/bindings/st_font_scheme.ts +6 -0
  76. package/src/bindings/st_gradient_type.ts +6 -0
  77. package/src/bindings/st_horizontal_alignment.ts +12 -0
  78. package/src/bindings/st_pattern_type.ts +23 -0
  79. package/src/bindings/st_underline_values.ts +9 -0
  80. package/src/bindings/st_vertical_align_run.ts +7 -0
  81. package/src/bindings/st_vertical_alignment.ts +9 -0
  82. package/src/bindings/status_code.ts +5 -0
  83. package/src/bindings/style.ts +15 -0
  84. package/src/bindings/style_update.ts +9 -0
  85. package/src/bindings/style_update_type.ts +29 -0
  86. package/src/bindings/task.ts +6 -0
  87. package/src/bindings/underline_property.ts +6 -0
  88. package/src/bindings/value.ts +8 -0
  89. package/src/bindings/vertical_align_font_property.ts +6 -0
  90. package/src/bindings/workbook_file.ts +6 -0
  91. package/src/index.ts +42 -0
  92. package/src/payloads/block_input.ts +54 -0
  93. package/src/payloads/cell_input.ts +44 -0
  94. package/src/payloads/create_block.ts +78 -0
  95. package/src/payloads/delete_block_cols.ts +44 -0
  96. package/src/payloads/delete_block_rows.ts +44 -0
  97. package/src/payloads/delete_cols.ts +37 -0
  98. package/src/payloads/delete_rows.ts +37 -0
  99. package/src/payloads/delete_sheet.ts +19 -0
  100. package/src/payloads/index.ts +66 -0
  101. package/src/payloads/insert_block_cols.ts +44 -0
  102. package/src/payloads/insert_block_rows.ts +44 -0
  103. package/src/payloads/insert_cols.ts +35 -0
  104. package/src/payloads/insert_rows.ts +36 -0
  105. package/src/payloads/insert_sheet.ts +27 -0
  106. package/src/payloads/move_block.ts +45 -0
  107. package/src/payloads/set_border.ts +113 -0
  108. package/src/payloads/set_col_visible.ts +35 -0
  109. package/src/payloads/set_col_width.ts +35 -0
  110. package/src/payloads/set_font.ts +107 -0
  111. package/src/payloads/set_row_height.ts +35 -0
  112. package/src/payloads/set_row_visible.ts +35 -0
  113. package/src/payloads/sheet_rename.ts +35 -0
  114. package/src/transactions.ts +14 -0
  115. package/wasm/.gitignore +1 -0
  116. package/wasm/logisheets_wasm_server.d.ts +255 -0
  117. package/wasm/logisheets_wasm_server.js +946 -0
  118. package/wasm/logisheets_wasm_server_bg.wasm +0 -0
  119. package/wasm/logisheets_wasm_server_bg.wasm.d.ts +40 -0
  120. package/wasm/package.json +14 -0
package/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # LogiSheets
2
+
3
+ ## What is LogiSheets?
4
+
5
+ LogiSheets is a web-based spreadsheet application that seamlessly integrates with Excel and is crafted for expansion. Notably, it comes at no cost!
6
+
7
+ You can utilize the Rust crate and Node package to efficiently read, perform operations, and write .xlsx files.
8
+
9
+ We are also working on a user interface to enable users to use spreadsheets directly in their web browsers.
10
+
11
+ ## WARNING
12
+
13
+ This version is specifically used for Node. If you are seeking a version compatible with web browsers, please see [`logisheets-web`](https://www.npmjs.com/package/logisheets-web).
14
+
15
+ LogiSheets is currently in its **early development** stages. We welcome your feedback, issues, or pull requests!
package/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './src'
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "logisheets",
3
+ "version": "0.6.0",
4
+ "description": "Read and write the xlsx files",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "wasm-build": "wasm-pack build ../../crates/wasms/server --out-dir ../../../packages/node/wasm --target nodejs",
8
+ "link": "rm -rf ./src && cp -r ../web/src ./src",
9
+ "prepublishOnly": "yarn link && yarn wasm-build",
10
+ "prepare": "yarn link && yarn wasm-build"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/logisky/LogiSheets.git"
15
+ },
16
+ "keywords": [
17
+ "xlsx",
18
+ "spreadsheets"
19
+ ],
20
+ "author": "Jeremy He<yiliang.he@qq.com>",
21
+ "license": "MIT",
22
+ "bugs": {
23
+ "url": "https://github.com/logisky/LogiSheets/issues"
24
+ },
25
+ "homepage": "https://github.com/logisky/LogiSheets",
26
+ "files": [
27
+ "wasm/*",
28
+ "src/*",
29
+ "index.ts"
30
+ ]
31
+ }
@@ -0,0 +1 @@
1
+ export * from './workbook'
@@ -0,0 +1,201 @@
1
+ import {Payload} from '../payloads'
2
+ import {
3
+ new_workbook,
4
+ undo,
5
+ redo,
6
+ transaction_end,
7
+ transaction_start,
8
+ cell_input,
9
+ row_insert,
10
+ row_delete,
11
+ col_insert,
12
+ col_delete,
13
+ create_block,
14
+ move_block,
15
+ block_input,
16
+ set_font,
17
+ set_border,
18
+ read_file,
19
+ release,
20
+ input_async_result,
21
+ get_patches,
22
+ block_line_shift,
23
+ sheet_rename_by_idx,
24
+ sheet_rename_by_name,
25
+ create_sheet,
26
+ delete_sheet,
27
+ } from '../../wasm/logisheets_wasm_server'
28
+ import {ActionEffect, AsyncFuncResult, DisplayResponse} from '../bindings'
29
+ import {Transaction} from '../transactions'
30
+
31
+ export type ReturnCode = number
32
+
33
+ export class Workbook {
34
+ public constructor() {
35
+ this._id = new_workbook()
36
+ }
37
+
38
+ public undo(): boolean {
39
+ return undo(this._id)
40
+ }
41
+
42
+ public redo(): boolean {
43
+ return redo(this._id)
44
+ }
45
+
46
+ public execTransaction(tx: Transaction, undoable: boolean): ActionEffect {
47
+ transaction_start(this._id)
48
+ tx.payloads.forEach((p: Payload) => {
49
+ this._addPayload(p)
50
+ })
51
+ return transaction_end(this._id, undoable) as ActionEffect
52
+ }
53
+
54
+ public load(buf: Uint8Array, book_name: string): ReturnCode {
55
+ return read_file(this._id, book_name, buf)
56
+ }
57
+
58
+ public release() {
59
+ release(this._id)
60
+ }
61
+
62
+ public inputAsyncResult(r: AsyncFuncResult): ActionEffect {
63
+ return input_async_result(this._id, r) as ActionEffect
64
+ }
65
+
66
+ public getPatches(sheet_idx: number, version: number): DisplayResponse {
67
+ const res = get_patches(this._id, sheet_idx, version)
68
+ return res as DisplayResponse
69
+ }
70
+
71
+ private _addPayload(p: Payload) {
72
+ if (p.type === 'cellInput')
73
+ return cell_input(this._id, p.sheetIdx, p.row, p.col, p.input)
74
+ if (p.type === 'insertRows')
75
+ return row_insert(this._id, p.sheetIdx, p.start, p.cnt)
76
+ if (p.type === 'deleteRows')
77
+ return row_delete(this._id, p.sheetIdx, p.start, p.cnt)
78
+ if (p.type === 'insertCols')
79
+ return col_insert(this._id, p.sheetIdx, p.start, p.cnt)
80
+ if (p.type === 'deleteCols')
81
+ return col_delete(this._id, p.sheetIdx, p.start, p.cnt)
82
+ if (p.type === 'createBlock')
83
+ return create_block(
84
+ this._id,
85
+ p.sheetIdx,
86
+ p.blockId,
87
+ p.masterRow,
88
+ p.masterCol,
89
+ p.rowCnt,
90
+ p.colCnt
91
+ )
92
+
93
+ if (p.type === 'moveBlock')
94
+ return move_block(
95
+ this._id,
96
+ p.sheetIdx,
97
+ p.blockId,
98
+ p.newMasterRow,
99
+ p.newMasterCol
100
+ )
101
+ if (p.type === 'setBorder')
102
+ return set_border(
103
+ this._id,
104
+ p.sheetIdx,
105
+ p.row,
106
+ p.col,
107
+ p.leftColor,
108
+ p.rightColor,
109
+ p.topColor,
110
+ p.bottomColor,
111
+ p.leftBorderType,
112
+ p.rightBorderType,
113
+ p.topBorderType,
114
+ p.bottomBorderType,
115
+ p.outline,
116
+ p.diagonalUp,
117
+ p.diagonalDown
118
+ )
119
+ if (p.type === 'setFont')
120
+ return set_font(
121
+ this._id,
122
+ p.sheetIdx,
123
+ p.row,
124
+ p.col,
125
+ p.bold,
126
+ p.italic,
127
+ p.name,
128
+ p.underline,
129
+ p.color,
130
+ p.size,
131
+ p.outline,
132
+ p.shadow,
133
+ p.strike,
134
+ p.condense
135
+ )
136
+ if (p.type === 'blockInput')
137
+ return block_input(
138
+ this._id,
139
+ p.sheetIdx,
140
+ p.blockId,
141
+ p.row,
142
+ p.col,
143
+ p.input
144
+ )
145
+
146
+ if (p.type === 'insertBlockCols')
147
+ return block_line_shift(
148
+ this._id,
149
+ p.sheetIdx,
150
+ p.blockId,
151
+ p.colIdx,
152
+ p.cnt,
153
+ false,
154
+ true
155
+ )
156
+ if (p.type === 'insertBlockRows')
157
+ return block_line_shift(
158
+ this._id,
159
+ p.sheetIdx,
160
+ p.blockId,
161
+ p.rowIdx,
162
+ p.cnt,
163
+ true,
164
+ true
165
+ )
166
+ if (p.type === 'deleteBlockRows')
167
+ return block_line_shift(
168
+ this._id,
169
+ p.sheetIdx,
170
+ p.blockId,
171
+ p.rowIdx,
172
+ p.cnt,
173
+ true,
174
+ false
175
+ )
176
+ if (p.type === 'deleteBlockCols')
177
+ return block_line_shift(
178
+ this._id,
179
+ p.sheetIdx,
180
+ p.blockId,
181
+ p.colIdx,
182
+ p.cnt,
183
+ true,
184
+ true
185
+ )
186
+ if (p.type === 'sheetRename') {
187
+ if (p.oldName) {
188
+ return sheet_rename_by_name(this._id, p.oldName, p.newName)
189
+ }
190
+ if (p.idx) {
191
+ return sheet_rename_by_idx(this._id, p.idx, p.newName)
192
+ }
193
+ }
194
+ if (p.type === 'deleteSheet') return delete_sheet(this._id, p.sheetIdx)
195
+ if (p.type === 'insertSheet')
196
+ return create_sheet(this._id, p.sheetIdx, p.name)
197
+ // eslint-disable-next-line no-console
198
+ console.log('Unimplemented!')
199
+ }
200
+ private _id: number
201
+ }
@@ -0,0 +1,17 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+ import {StatusCode} from './status_code'
3
+ import {Task} from './task'
4
+
5
+ // `ActionEffect` represents the result of handling `EditAction`.
6
+ // `version` would be increased if the action is successfully handled.
7
+ //
8
+ // What's more, since `LogiSheets` provides developers with the ability
9
+ // of developing their own functions, in these cases, `engine` will not know
10
+ // how to compute them and just return it the JS side.
11
+ export interface ActionEffect {
12
+ // The latest version after processing an action
13
+ version: number
14
+ // Tasks should be calculated outside this engine(mainly because of network limitations and customer defined)
15
+ asyncTasks: readonly Task[]
16
+ status: StatusCode
17
+ }
@@ -0,0 +1,12 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+ import {Task} from './task'
3
+
4
+ // The results of the tasks which are passed to JS side to calculate previously.
5
+ export interface AsyncFuncResult {
6
+ tasks: readonly Task[]
7
+ // These strings can be numbers, strings and other things.
8
+ // Note that now error types are hardcoded, which means if the
9
+ // value is equal to the a specific string like `#TIMEOUT!`,
10
+ // it is reagarded as an error.
11
+ values: readonly string[]
12
+ }
@@ -0,0 +1,7 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+
3
+ export interface BlockCellId {
4
+ block_id: number
5
+ row: number
6
+ col: number
7
+ }
@@ -0,0 +1,9 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+
3
+ export interface BlockInfo {
4
+ blockId: number
5
+ rowStart: number
6
+ rowCnt: number
7
+ colStart: number
8
+ colCnt: number
9
+ }
@@ -0,0 +1,9 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+
3
+ export interface BlockInput {
4
+ sheetIdx: number
5
+ blockId: number
6
+ row: number
7
+ col: number
8
+ input: string
9
+ }
@@ -0,0 +1,10 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+ import {StyleUpdateType} from './style_update_type'
3
+
4
+ export interface BlockStyleUpdate {
5
+ sheetIdx: number
6
+ blockId: number
7
+ row: number
8
+ col: number
9
+ styleUpdate: StyleUpdateType
10
+ }
@@ -0,0 +1,15 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+ import {BorderPr} from './border_pr'
3
+
4
+ export interface Border {
5
+ left?: BorderPr
6
+ right?: BorderPr
7
+ top?: BorderPr
8
+ bottom?: BorderPr
9
+ diagonal?: BorderPr
10
+ vertical?: BorderPr
11
+ horizontal?: BorderPr
12
+ diagonalUp?: boolean
13
+ diagonalDown?: boolean
14
+ outline: boolean
15
+ }
@@ -0,0 +1,8 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+ import {Color} from './color'
3
+ import {StBorderStyle} from './st_border_style'
4
+
5
+ export interface BorderPr {
6
+ color?: Color
7
+ style: StBorderStyle
8
+ }
@@ -0,0 +1,15 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+ import {StHorizontalAlignment} from './st_horizontal_alignment'
3
+ import {StVerticalAlignment} from './st_vertical_alignment'
4
+
5
+ export interface CtCellAlignment {
6
+ horizontal?: StHorizontalAlignment
7
+ vertical?: StVerticalAlignment
8
+ textRotation?: number
9
+ wrapText?: boolean
10
+ indent?: number
11
+ relativeIndent?: number
12
+ justifyLastLine?: boolean
13
+ shrinkToFit?: boolean
14
+ readingOrder?: number
15
+ }
@@ -0,0 +1,9 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+ import {Value} from './value'
3
+
4
+ export interface CellFormulaValue {
5
+ row: number
6
+ col: number
7
+ formula: string
8
+ value: Value
9
+ }
@@ -0,0 +1,7 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+ import {BlockCellId} from './block_cell_id'
3
+ import {NormalCellId} from './normal_cell_id'
4
+
5
+ export type CellId =
6
+ | {NormalCell: NormalCellId}
7
+ | {BlockCell: BlockCellId}
@@ -0,0 +1,9 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+
3
+ // Take the `content` as input to the cell. The type of the `content` can be referred automatically.
4
+ export interface CellInput {
5
+ sheetIdx: number
6
+ row: number
7
+ col: number
8
+ content: string
9
+ }
@@ -0,0 +1,6 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+
3
+ export interface CtCellProtection {
4
+ locked?: boolean
5
+ hidden?: boolean
6
+ }
@@ -0,0 +1,8 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+ import {Style} from './style'
3
+
4
+ export interface CellStyle {
5
+ row: number
6
+ col: number
7
+ style: Style
8
+ }
@@ -0,0 +1,7 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+
3
+ export interface ColInfo {
4
+ idx: number
5
+ width: number
6
+ hidden: boolean
7
+ }
@@ -0,0 +1,8 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+
3
+ export interface Color {
4
+ red?: number
5
+ green?: number
6
+ blue?: number
7
+ alpha?: number
8
+ }
@@ -0,0 +1,8 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+
3
+ export interface Comment {
4
+ row: number
5
+ col: number
6
+ author: string
7
+ content: string
8
+ }
@@ -0,0 +1,15 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+
3
+ // Create a new block.
4
+ //
5
+ // Note that the block id is assigned by you. You are supposed to
6
+ // manage all your blocks. If the `block id` is already existed, engines
7
+ // will remove the old one.
8
+ export interface CreateBlock {
9
+ sheetIdx: number
10
+ id: number
11
+ masterRow: number
12
+ masterCol: number
13
+ rowCnt: number
14
+ colCnt: number
15
+ }
@@ -0,0 +1,6 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+
3
+ export interface CreateSheet {
4
+ idx: number
5
+ newName: string
6
+ }
@@ -0,0 +1,7 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+
3
+ export interface DeleteCols {
4
+ sheetIdx: number
5
+ start: number
6
+ count: number
7
+ }
@@ -0,0 +1,8 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+
3
+ export interface DeleteColsInBlock {
4
+ sheetIdx: number
5
+ blockId: number
6
+ start: number
7
+ cnt: number
8
+ }
@@ -0,0 +1,7 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+
3
+ export interface DeleteRows {
4
+ sheetIdx: number
5
+ start: number
6
+ count: number
7
+ }
@@ -0,0 +1,8 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+
3
+ export interface DeleteRowsInBlock {
4
+ sheetIdx: number
5
+ blockId: number
6
+ start: number
7
+ cnt: number
8
+ }
@@ -0,0 +1,5 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+
3
+ export interface DeleteSheet {
4
+ idx: number
5
+ }
@@ -0,0 +1,19 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+ import {SheetBlocks} from './sheet_blocks'
3
+ import {SheetColInfo} from './sheet_col_info'
4
+ import {SheetComments} from './sheet_comments'
5
+ import {SheetMergeCells} from './sheet_merge_cells'
6
+ import {SheetNames} from './sheet_names'
7
+ import {SheetRowInfo} from './sheet_row_info'
8
+ import {SheetStyles} from './sheet_styles'
9
+ import {SheetValues} from './sheet_values'
10
+
11
+ export type DisplayPatch =
12
+ | {values: SheetValues}
13
+ | {styles: SheetStyles}
14
+ | {rowInfo: SheetRowInfo}
15
+ | {colInfo: SheetColInfo}
16
+ | {mergeCells: SheetMergeCells}
17
+ | {comments: SheetComments}
18
+ | {blocks: SheetBlocks}
19
+ | {sheetNames: SheetNames}
@@ -0,0 +1,6 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+
3
+ export interface DisplayRequest {
4
+ sheetIdx: number
5
+ version: number
6
+ }
@@ -0,0 +1,7 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+ import {DisplayPatch} from './display_patch'
3
+
4
+ export interface DisplayResponse {
5
+ incremental: boolean
6
+ patches: readonly DisplayPatch[]
7
+ }
@@ -0,0 +1,10 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+ import {PayloadsAction} from './payloads_action'
3
+ import {RecalcCell} from './recalc_cell'
4
+
5
+ // `EditAction` represents your update behavior to the workbook.
6
+ export type EditAction =
7
+ | 'undo'
8
+ | 'redo'
9
+ | {payloads: PayloadsAction}
10
+ | {recalc: readonly RecalcCell[]}
@@ -0,0 +1,47 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+ import {BlockInput} from './block_input'
3
+ import {BlockStyleUpdate} from './block_style_update'
4
+ import {CellInput} from './cell_input'
5
+ import {CreateBlock} from './create_block'
6
+ import {CreateSheet} from './create_sheet'
7
+ import {DeleteColsInBlock} from './delete_cols_in_block'
8
+ import {DeleteCols} from './delete_cols'
9
+ import {DeleteRowsInBlock} from './delete_rows_in_block'
10
+ import {DeleteRows} from './delete_rows'
11
+ import {DeleteSheet} from './delete_sheet'
12
+ import {InsertColsInBlock} from './insert_cols_in_block'
13
+ import {InsertCols} from './insert_cols'
14
+ import {InsertRowsInBlock} from './insert_rows_in_block'
15
+ import {InsertRows} from './insert_rows'
16
+ import {MoveBlock} from './move_block'
17
+ import {RemoveBlock} from './remove_block'
18
+ import {SetColWidth} from './set_col_width'
19
+ import {SetRowHeight} from './set_row_height'
20
+ import {SetVisible} from './set_visible'
21
+ import {SheetRename} from './sheet_rename'
22
+ import {StyleUpdate} from './style_update'
23
+
24
+ // `EditPayload` is the basic update unit of the Workbook. Developers can config their own
25
+ // `EditAction` (e.g. setting a button to create a table) to facilitate their users.
26
+ export type EditPayload =
27
+ | {blockInput: BlockInput}
28
+ | {moveBlock: MoveBlock}
29
+ | {removeBlock: RemoveBlock}
30
+ | {createBlock: CreateBlock}
31
+ | {styleUpdate: StyleUpdate}
32
+ | {blockStyleUpdate: BlockStyleUpdate}
33
+ | {cellInput: CellInput}
34
+ | {setColWidth: SetColWidth}
35
+ | {setRowHeight: SetRowHeight}
36
+ | {setVisible: SetVisible}
37
+ | {sheetRename: SheetRename}
38
+ | {createSheet: CreateSheet}
39
+ | {deleteSheet: DeleteSheet}
40
+ | {insertCols: InsertCols}
41
+ | {deleteCols: DeleteCols}
42
+ | {insertRows: InsertRows}
43
+ | {deleteRows: DeleteRows}
44
+ | {insertColsInBlock: InsertColsInBlock}
45
+ | {deleteColsInBlock: DeleteColsInBlock}
46
+ | {insertRowsInBlock: InsertRowsInBlock}
47
+ | {deleteRowsInBlock: DeleteRowsInBlock}
@@ -0,0 +1,7 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+ import {GradientFill} from './gradient_fill'
3
+ import {PatternFill} from './pattern_fill'
4
+
5
+ export type Fill =
6
+ | {patternFill: PatternFill}
7
+ | {gradientFill: GradientFill}
@@ -0,0 +1,25 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+ import {Color} from './color'
3
+ import {CtFontFamily} from './font_family'
4
+ import {CtFontName} from './font_name'
5
+ import {CtFontScheme} from './font_scheme'
6
+ import {CtUnderlineProperty} from './underline_property'
7
+ import {CtVerticalAlignFontProperty} from './vertical_align_font_property'
8
+
9
+ export interface Font {
10
+ bold: boolean
11
+ italic: boolean
12
+ underline?: CtUnderlineProperty
13
+ color?: Color
14
+ sz?: number
15
+ name?: CtFontName
16
+ charset?: number
17
+ family?: CtFontFamily
18
+ strike: boolean
19
+ outline: boolean
20
+ shadow: boolean
21
+ condense: boolean
22
+ extend: boolean
23
+ vertAlign?: CtVerticalAlignFontProperty
24
+ scheme?: CtFontScheme
25
+ }
@@ -0,0 +1,5 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+
3
+ export interface CtFontFamily {
4
+ val: number
5
+ }
@@ -0,0 +1,5 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+
3
+ export interface CtFontName {
4
+ val: string
5
+ }
@@ -0,0 +1,6 @@
1
+ // DO NOT EDIT. CODE GENERATED BY gents.
2
+ import {StFontScheme} from './st_font_scheme'
3
+
4
+ export interface CtFontScheme {
5
+ val: StFontScheme
6
+ }