logisheets 0.7.0 → 1.0.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.
- package/dist/src/api/block_manager.d.ts +21 -0
- package/dist/src/api/block_manager.js +35 -0
- package/dist/src/api/calculator.d.ts +19 -0
- package/dist/src/api/calculator.js +46 -0
- package/dist/src/api/cell.d.ts +29 -0
- package/dist/src/api/cell.js +55 -0
- package/dist/src/api/craft-calc.d.ts +83 -0
- package/dist/src/api/craft-calc.js +223 -0
- package/dist/src/api/index.d.ts +6 -0
- package/dist/src/api/index.js +4 -0
- package/dist/src/api/utils.d.ts +3 -1
- package/dist/src/api/utils.js +7 -0
- package/dist/src/api/workbook.d.ts +82 -10
- package/dist/src/api/workbook.js +285 -64
- package/dist/src/api/worksheet.d.ts +32 -11
- package/dist/src/api/worksheet.js +146 -19
- package/dist/src/bindings/action_effect.d.ts +56 -0
- package/dist/src/bindings/action_effect.js +96 -1
- package/dist/src/bindings/alignment.d.ts +7 -0
- package/dist/src/bindings/app_data.d.ts +4 -0
- package/dist/src/bindings/appendix.d.ts +5 -0
- package/dist/src/bindings/appendix_with_cell.d.ts +8 -0
- package/dist/src/bindings/async_func_result.d.ts +10 -0
- package/dist/src/bindings/async_func_result.js +19 -1
- package/dist/src/bindings/bind_form_schema.d.ts +42 -0
- package/dist/src/bindings/bind_form_schema.js +68 -0
- package/dist/src/bindings/bind_random_schema.d.ts +23 -0
- package/dist/src/bindings/bind_random_schema.js +33 -0
- package/dist/src/bindings/block_cell_id.d.ts +1 -1
- package/dist/src/bindings/block_cell_id.js +0 -1
- package/dist/src/bindings/block_cell_info.d.ts +5 -0
- package/dist/src/bindings/block_display_info.d.ts +7 -0
- package/dist/src/bindings/block_field.d.ts +5 -0
- package/dist/src/bindings/block_info.d.ts +8 -0
- package/dist/src/bindings/block_info.js +0 -1
- package/dist/src/bindings/block_input.d.ts +19 -0
- package/dist/src/bindings/block_input.js +40 -2
- package/dist/src/bindings/block_line_name_field_update.d.ts +34 -0
- package/dist/src/bindings/block_line_name_field_update.js +50 -0
- package/dist/src/bindings/block_line_style_update.d.ts +31 -0
- package/dist/src/bindings/block_line_style_update.js +47 -0
- package/dist/src/bindings/block_schema.d.ts +11 -0
- package/dist/src/bindings/block_schema_field_entry.d.ts +5 -0
- package/dist/src/bindings/block_schema_key_entry.d.ts +4 -0
- package/dist/src/bindings/block_schema_random_entry.d.ts +6 -0
- package/dist/src/bindings/block_schema_type.d.ts +1 -0
- package/dist/src/bindings/block_style_update.d.ts +19 -0
- package/dist/src/bindings/block_style_update.js +40 -1
- package/dist/src/bindings/cell_alignment.d.ts +6 -6
- package/dist/src/bindings/cell_clear.d.ts +18 -0
- package/dist/src/bindings/cell_clear.js +26 -0
- package/dist/src/bindings/cell_coordinate.d.ts +4 -0
- package/dist/src/bindings/cell_coordinate.js +1 -0
- package/dist/src/bindings/cell_coordinate_with_sheet.d.ts +5 -0
- package/dist/src/bindings/cell_coordinate_with_sheet.js +1 -0
- package/dist/src/bindings/cell_format_brush.d.ts +38 -0
- package/dist/src/bindings/cell_format_brush.js +61 -0
- package/dist/src/bindings/cell_id.d.ts +8 -3
- package/dist/src/bindings/cell_info.d.ts +2 -0
- package/dist/src/bindings/cell_input.d.ts +16 -0
- package/dist/src/bindings/cell_input.js +33 -2
- package/dist/src/bindings/cell_position.d.ts +4 -0
- package/dist/src/bindings/cell_position.js +1 -0
- package/dist/src/bindings/cell_protection.js +0 -1
- package/dist/src/bindings/cell_ref.d.ts +9 -0
- package/dist/src/bindings/cell_ref.js +1 -0
- package/dist/src/bindings/cell_style_update.d.ts +23 -0
- package/dist/src/bindings/cell_style_update.js +33 -0
- package/dist/src/bindings/col_info.js +0 -1
- package/dist/src/bindings/color.js +0 -1
- package/dist/src/bindings/comment.js +0 -1
- package/dist/src/bindings/convert_block.d.ts +30 -0
- package/dist/src/bindings/convert_block.js +47 -0
- package/dist/src/bindings/create_appendix.d.ts +38 -0
- package/dist/src/bindings/create_appendix.js +57 -0
- package/dist/src/bindings/create_block.d.ts +31 -0
- package/dist/src/bindings/create_block.js +57 -2
- package/dist/src/bindings/create_diy_cell.d.ts +18 -0
- package/dist/src/bindings/create_diy_cell.js +26 -0
- package/dist/src/bindings/create_diy_cell_by_id.d.ts +22 -0
- package/dist/src/bindings/create_diy_cell_by_id.js +33 -0
- package/dist/src/bindings/create_sheet.d.ts +10 -0
- package/dist/src/bindings/create_sheet.js +19 -2
- package/dist/src/bindings/ct_border.d.ts +13 -0
- package/dist/src/bindings/ct_border.js +1 -0
- package/dist/src/bindings/ct_border_pr.d.ts +6 -0
- package/dist/src/bindings/ct_border_pr.js +1 -0
- package/dist/src/bindings/ct_color.d.ts +7 -0
- package/dist/src/bindings/ct_color.js +1 -0
- package/dist/src/bindings/ct_fill.d.ts +9 -0
- package/dist/src/bindings/ct_fill.js +1 -0
- package/dist/src/bindings/ct_font.d.ts +25 -0
- package/dist/src/bindings/ct_font.js +1 -0
- package/dist/src/bindings/ct_gradient_fill.d.ts +11 -0
- package/dist/src/bindings/ct_gradient_fill.js +1 -0
- package/dist/src/bindings/ct_gradient_stop.d.ts +5 -0
- package/dist/src/bindings/ct_gradient_stop.js +1 -0
- package/dist/src/bindings/ct_pattern_fill.d.ts +7 -0
- package/dist/src/bindings/ct_pattern_fill.js +1 -0
- package/dist/src/bindings/delete_cols.d.ts +13 -0
- package/dist/src/bindings/delete_cols.js +26 -2
- package/dist/src/bindings/delete_cols_in_block.d.ts +16 -0
- package/dist/src/bindings/delete_cols_in_block.js +33 -2
- package/dist/src/bindings/delete_rows.d.ts +13 -0
- package/dist/src/bindings/delete_rows.js +26 -2
- package/dist/src/bindings/delete_rows_in_block.d.ts +16 -0
- package/dist/src/bindings/delete_rows_in_block.js +33 -2
- package/dist/src/bindings/delete_sheet.d.ts +7 -0
- package/dist/src/bindings/delete_sheet.js +12 -2
- package/dist/src/bindings/display_window.d.ts +14 -0
- package/dist/src/bindings/display_window.js +1 -0
- package/dist/src/bindings/display_window_request.d.ts +7 -0
- package/dist/src/bindings/display_window_request.js +1 -0
- package/dist/src/bindings/display_window_with_start_point.d.ts +6 -0
- package/dist/src/bindings/display_window_with_start_point.js +1 -0
- package/dist/src/bindings/edit_action.d.ts +5 -3
- package/dist/src/bindings/edit_payload.d.ts +160 -27
- package/dist/src/bindings/ephemeral_cell_input.d.ts +18 -0
- package/dist/src/bindings/ephemeral_cell_input.js +26 -0
- package/dist/src/bindings/ephemeral_cell_remove.d.ts +14 -0
- package/dist/src/bindings/ephemeral_cell_remove.js +19 -0
- package/dist/src/bindings/ephemeral_cell_style_update.d.ts +19 -0
- package/dist/src/bindings/ephemeral_cell_style_update.js +26 -0
- package/dist/src/bindings/error_message.js +0 -1
- package/dist/src/bindings/field_render_entry.d.ts +6 -0
- package/dist/src/bindings/field_render_entry.js +1 -0
- package/dist/src/bindings/fill.d.ts +5 -3
- package/dist/src/bindings/font_family.js +0 -1
- package/dist/src/bindings/font_name.js +0 -1
- package/dist/src/bindings/font_size.d.ts +3 -0
- package/dist/src/bindings/font_size.js +1 -0
- package/dist/src/bindings/formula_display_info.d.ts +6 -0
- package/dist/src/bindings/formula_display_info.js +1 -0
- package/dist/src/bindings/horizontal_alignment.d.ts +1 -0
- package/dist/src/bindings/horizontal_alignment.js +1 -0
- package/dist/src/bindings/index.d.ts +123 -14
- package/dist/src/bindings/index.js +123 -14
- package/dist/src/bindings/insert_cols.d.ts +13 -0
- package/dist/src/bindings/insert_cols.js +26 -2
- package/dist/src/bindings/insert_cols_in_block.d.ts +16 -0
- package/dist/src/bindings/insert_cols_in_block.js +33 -2
- package/dist/src/bindings/insert_rows.d.ts +13 -0
- package/dist/src/bindings/insert_rows.js +26 -2
- package/dist/src/bindings/insert_rows_in_block.d.ts +16 -0
- package/dist/src/bindings/insert_rows_in_block.js +33 -2
- package/dist/src/bindings/int_property.d.ts +3 -0
- package/dist/src/bindings/int_property.js +1 -0
- package/dist/src/bindings/line_format_brush.d.ts +34 -0
- package/dist/src/bindings/line_format_brush.js +54 -0
- package/dist/src/bindings/line_style_update.d.ts +27 -0
- package/dist/src/bindings/line_style_update.js +40 -0
- package/dist/src/bindings/merge_cell.d.ts +4 -4
- package/dist/src/bindings/merge_cell.js +0 -1
- package/dist/src/bindings/merge_cells.d.ts +26 -0
- package/dist/src/bindings/merge_cells.js +40 -0
- package/dist/src/bindings/modify_policy.d.ts +1 -0
- package/dist/src/bindings/modify_policy.js +1 -0
- package/dist/src/bindings/move_block.d.ts +16 -0
- package/dist/src/bindings/move_block.js +33 -2
- package/dist/src/bindings/move_block_line.d.ts +26 -0
- package/dist/src/bindings/move_block_line.js +40 -0
- package/dist/src/bindings/msg_sequencer_action_invalid_message.js +0 -1
- package/dist/src/bindings/msg_sequencer_init_workbook.js +0 -1
- package/dist/src/bindings/msg_sequencer_message.d.ts +7 -4
- package/dist/src/bindings/msg_user_message.d.ts +5 -3
- package/dist/src/bindings/normal_cell_id.js +0 -1
- package/dist/src/bindings/payloads_action.d.ts +1 -0
- package/dist/src/bindings/random_schema_unit.d.ts +22 -0
- package/dist/src/bindings/random_schema_unit.js +33 -0
- package/dist/src/bindings/raw_style.d.ts +13 -0
- package/dist/src/bindings/raw_style.js +1 -0
- package/dist/src/bindings/remove_appendix.d.ts +26 -0
- package/dist/src/bindings/remove_appendix.js +36 -0
- package/dist/src/bindings/remove_block.d.ts +10 -0
- package/dist/src/bindings/remove_block.js +19 -2
- package/dist/src/bindings/remove_diy_cell.d.ts +18 -0
- package/dist/src/bindings/remove_diy_cell.js +26 -0
- package/dist/src/bindings/remove_diy_cell_by_id.d.ts +22 -0
- package/dist/src/bindings/remove_diy_cell_by_id.js +33 -0
- package/dist/src/bindings/reorder_block_lines.d.ts +6 -0
- package/dist/src/bindings/reorder_block_lines.js +1 -0
- package/dist/src/bindings/reproduce_cells.d.ts +23 -0
- package/dist/src/bindings/reproduce_cells.js +33 -0
- package/dist/src/bindings/reproducible_cell.d.ts +10 -0
- package/dist/src/bindings/reproducible_cell.js +1 -0
- package/dist/src/bindings/resize_block.d.ts +22 -0
- package/dist/src/bindings/resize_block.js +29 -0
- package/dist/src/bindings/row_info.js +0 -1
- package/dist/src/bindings/rpc_batch_get_cell_coordinate_with_sheet_by_id_params.d.ts +4 -0
- package/dist/src/bindings/rpc_batch_get_cell_coordinate_with_sheet_by_id_params.js +1 -0
- package/dist/src/bindings/rpc_batch_get_cell_info_by_id_params.d.ts +4 -0
- package/dist/src/bindings/rpc_batch_get_cell_info_by_id_params.js +1 -0
- package/dist/src/bindings/rpc_calc_condition_params.d.ts +4 -0
- package/dist/src/bindings/rpc_calc_condition_params.js +1 -0
- package/dist/src/bindings/rpc_check_formula_params.d.ts +3 -0
- package/dist/src/bindings/rpc_check_formula_params.js +1 -0
- package/dist/src/bindings/rpc_direction.d.ts +1 -0
- package/dist/src/bindings/rpc_direction.js +1 -0
- package/dist/src/bindings/rpc_get_available_block_id_params.d.ts +3 -0
- package/dist/src/bindings/rpc_get_available_block_id_params.js +1 -0
- package/dist/src/bindings/rpc_get_block_col_id_params.d.ts +5 -0
- package/dist/src/bindings/rpc_get_block_col_id_params.js +1 -0
- package/dist/src/bindings/rpc_get_block_display_window_params.d.ts +4 -0
- package/dist/src/bindings/rpc_get_block_display_window_params.js +1 -0
- package/dist/src/bindings/rpc_get_block_info_params.d.ts +4 -0
- package/dist/src/bindings/rpc_get_block_info_params.js +1 -0
- package/dist/src/bindings/rpc_get_block_row_id_params.d.ts +5 -0
- package/dist/src/bindings/rpc_get_block_row_id_params.js +1 -0
- package/dist/src/bindings/rpc_get_block_values_params.d.ts +6 -0
- package/dist/src/bindings/rpc_get_block_values_params.js +1 -0
- package/dist/src/bindings/rpc_get_cell_id_by_block_ref_params.d.ts +5 -0
- package/dist/src/bindings/rpc_get_cell_id_by_block_ref_params.js +1 -0
- package/dist/src/bindings/rpc_get_cell_id_params.d.ts +5 -0
- package/dist/src/bindings/rpc_get_cell_id_params.js +1 -0
- package/dist/src/bindings/rpc_get_cell_infos_params.d.ts +7 -0
- package/dist/src/bindings/rpc_get_cell_infos_params.js +1 -0
- package/dist/src/bindings/rpc_get_cell_params.d.ts +5 -0
- package/dist/src/bindings/rpc_get_cell_params.js +1 -0
- package/dist/src/bindings/rpc_get_cell_position_params.d.ts +5 -0
- package/dist/src/bindings/rpc_get_cell_position_params.js +1 -0
- package/dist/src/bindings/rpc_get_cells_except_window_params.d.ts +11 -0
- package/dist/src/bindings/rpc_get_cells_except_window_params.js +1 -0
- package/dist/src/bindings/rpc_get_cells_params.d.ts +7 -0
- package/dist/src/bindings/rpc_get_cells_params.js +1 -0
- package/dist/src/bindings/rpc_get_col_width_params.d.ts +4 -0
- package/dist/src/bindings/rpc_get_col_width_params.js +1 -0
- package/dist/src/bindings/rpc_get_display_units_of_formula_params.d.ts +3 -0
- package/dist/src/bindings/rpc_get_display_units_of_formula_params.js +1 -0
- package/dist/src/bindings/rpc_get_display_window_params.d.ts +7 -0
- package/dist/src/bindings/rpc_get_display_window_params.js +1 -0
- package/dist/src/bindings/rpc_get_display_window_with_start_point_params.d.ts +7 -0
- package/dist/src/bindings/rpc_get_display_window_with_start_point_params.js +1 -0
- package/dist/src/bindings/rpc_get_display_window_within_cell_params.d.ts +7 -0
- package/dist/src/bindings/rpc_get_display_window_within_cell_params.js +1 -0
- package/dist/src/bindings/rpc_get_diy_cell_id_with_block_id_params.d.ts +6 -0
- package/dist/src/bindings/rpc_get_diy_cell_id_with_block_id_params.js +1 -0
- package/dist/src/bindings/rpc_get_merged_cells_params.d.ts +7 -0
- package/dist/src/bindings/rpc_get_merged_cells_params.js +1 -0
- package/dist/src/bindings/rpc_get_next_visible_cell_params.d.ts +7 -0
- package/dist/src/bindings/rpc_get_next_visible_cell_params.js +1 -0
- package/dist/src/bindings/rpc_get_reproducible_cell_params.d.ts +5 -0
- package/dist/src/bindings/rpc_get_reproducible_cell_params.js +1 -0
- package/dist/src/bindings/rpc_get_reproducible_cells_params.d.ts +5 -0
- package/dist/src/bindings/rpc_get_reproducible_cells_params.js +1 -0
- package/dist/src/bindings/rpc_get_row_height_params.d.ts +4 -0
- package/dist/src/bindings/rpc_get_row_height_params.js +1 -0
- package/dist/src/bindings/rpc_get_row_info_params.d.ts +4 -0
- package/dist/src/bindings/rpc_get_row_info_params.js +1 -0
- package/dist/src/bindings/rpc_get_shadow_cell_id_params.d.ts +7 -0
- package/dist/src/bindings/rpc_get_shadow_cell_id_params.js +1 -0
- package/dist/src/bindings/rpc_get_shadow_cell_ids_params.d.ts +7 -0
- package/dist/src/bindings/rpc_get_shadow_cell_ids_params.js +1 -0
- package/dist/src/bindings/rpc_get_shadow_info_by_id_params.d.ts +3 -0
- package/dist/src/bindings/rpc_get_shadow_info_by_id_params.js +1 -0
- package/dist/src/bindings/rpc_get_sheet_dimension_params.d.ts +3 -0
- package/dist/src/bindings/rpc_get_sheet_dimension_params.js +1 -0
- package/dist/src/bindings/rpc_get_sheet_id_params.d.ts +3 -0
- package/dist/src/bindings/rpc_get_sheet_id_params.js +1 -0
- package/dist/src/bindings/rpc_get_sheet_idx_params.d.ts +3 -0
- package/dist/src/bindings/rpc_get_sheet_idx_params.js +1 -0
- package/dist/src/bindings/rpc_get_sheet_name_by_idx_params.d.ts +3 -0
- package/dist/src/bindings/rpc_get_sheet_name_by_idx_params.js +1 -0
- package/dist/src/bindings/rpc_handle_transaction_params.d.ts +4 -0
- package/dist/src/bindings/rpc_handle_transaction_params.js +1 -0
- package/dist/src/bindings/rpc_load_workbook_params.d.ts +4 -0
- package/dist/src/bindings/rpc_load_workbook_params.js +1 -0
- package/dist/src/bindings/rpc_lookup_appendix_upward_params.d.ts +8 -0
- package/dist/src/bindings/rpc_lookup_appendix_upward_params.js +1 -0
- package/dist/src/bindings/rpc_save_params.d.ts +3 -0
- package/dist/src/bindings/rpc_save_params.js +1 -0
- package/dist/src/bindings/rpc_toggle_status_params.d.ts +3 -0
- package/dist/src/bindings/rpc_toggle_status_params.js +1 -0
- package/dist/src/bindings/rpc_transaction.d.ts +6 -0
- package/dist/src/bindings/rpc_transaction.js +1 -0
- package/dist/src/bindings/rpc_workbook_methods.d.ts +116 -0
- package/dist/src/bindings/rpc_workbook_methods.js +1 -0
- package/dist/src/bindings/save_file_result.d.ts +4 -0
- package/dist/src/bindings/save_file_result.js +1 -0
- package/dist/src/bindings/set_col_width.d.ts +13 -0
- package/dist/src/bindings/set_col_width.js +26 -2
- package/dist/src/bindings/set_row_height.d.ts +13 -0
- package/dist/src/bindings/set_row_height.js +26 -2
- package/dist/src/bindings/set_sheet_color.d.ts +14 -0
- package/dist/src/bindings/set_sheet_color.js +19 -0
- package/dist/src/bindings/set_sheet_visible.d.ts +14 -0
- package/dist/src/bindings/set_sheet_visible.js +19 -0
- package/dist/src/bindings/set_visible.d.ts +16 -0
- package/dist/src/bindings/set_visible.js +33 -2
- package/dist/src/bindings/shadow_cell_info.d.ts +7 -0
- package/dist/src/bindings/shadow_cell_info.js +1 -0
- package/dist/src/bindings/shadow_kind.d.ts +1 -0
- package/dist/src/bindings/shadow_kind.js +1 -0
- package/dist/src/bindings/sheet_cell_id.d.ts +15 -0
- package/dist/src/bindings/sheet_cell_id.js +19 -0
- package/dist/src/bindings/sheet_col_id.d.ts +14 -0
- package/dist/src/bindings/sheet_col_id.js +19 -0
- package/dist/src/bindings/sheet_coordinate.d.ts +4 -0
- package/dist/src/bindings/sheet_coordinate.js +1 -0
- package/dist/src/bindings/sheet_dimension.d.ts +6 -0
- package/dist/src/bindings/sheet_dimension.js +1 -0
- package/dist/src/bindings/sheet_info.d.ts +6 -0
- package/dist/src/bindings/sheet_info.js +1 -0
- package/dist/src/bindings/sheet_rename.d.ts +13 -0
- package/dist/src/bindings/sheet_rename.js +22 -2
- package/dist/src/bindings/sheet_row_id.d.ts +14 -0
- package/dist/src/bindings/sheet_row_id.js +19 -0
- package/dist/src/bindings/split_merged_cells.d.ts +18 -0
- package/dist/src/bindings/split_merged_cells.js +26 -0
- package/dist/src/bindings/st_border_style.d.ts +1 -1
- package/dist/src/bindings/st_border_style.js +0 -1
- package/dist/src/bindings/st_font_scheme.d.ts +1 -1
- package/dist/src/bindings/st_font_scheme.js +0 -1
- package/dist/src/bindings/st_gradient_type.d.ts +1 -1
- package/dist/src/bindings/st_gradient_type.js +0 -1
- package/dist/src/bindings/st_horizontal_alignment.d.ts +1 -1
- package/dist/src/bindings/st_horizontal_alignment.js +0 -1
- package/dist/src/bindings/st_pattern_type.d.ts +1 -1
- package/dist/src/bindings/st_pattern_type.js +0 -1
- package/dist/src/bindings/st_underline_values.d.ts +1 -1
- package/dist/src/bindings/st_underline_values.js +0 -1
- package/dist/src/bindings/st_vertical_align_run.d.ts +1 -1
- package/dist/src/bindings/st_vertical_align_run.js +0 -1
- package/dist/src/bindings/st_vertical_alignment.d.ts +1 -1
- package/dist/src/bindings/st_vertical_alignment.js +0 -1
- package/dist/src/bindings/status_code.d.ts +6 -3
- package/dist/src/bindings/status_code.js +0 -1
- package/dist/src/bindings/style.d.ts +2 -2
- package/dist/src/bindings/style_update_type.d.ts +79 -0
- package/dist/src/bindings/style_update_type.js +125 -1
- package/dist/src/bindings/task.js +0 -1
- package/dist/src/bindings/temp_cell_change.d.ts +8 -0
- package/dist/src/bindings/temp_cell_change.js +1 -0
- package/dist/src/bindings/temp_status_diff.d.ts +4 -0
- package/dist/src/bindings/temp_status_diff.js +1 -0
- package/dist/src/bindings/token_type.d.ts +1 -0
- package/dist/src/bindings/token_type.js +1 -0
- package/dist/src/bindings/token_unit.d.ts +6 -0
- package/dist/src/bindings/token_unit.js +1 -0
- package/dist/src/bindings/upsert_field_formulas.d.ts +18 -0
- package/dist/src/bindings/upsert_field_formulas.js +26 -0
- package/dist/src/bindings/upsert_field_render_info.d.ts +19 -0
- package/dist/src/bindings/upsert_field_render_info.js +26 -0
- package/dist/src/bindings/value.d.ts +9 -5
- package/dist/src/bindings/value.js +0 -1
- package/dist/src/bindings/vertical_alignment.d.ts +1 -0
- package/dist/src/bindings/vertical_alignment.js +1 -0
- package/dist/src/bindings/workbook_file.js +0 -1
- package/dist/src/bindings/workbook_update_type.d.ts +1 -0
- package/dist/src/bindings/workbook_update_type.js +1 -0
- package/dist/src/client.d.ts +25 -0
- package/dist/src/client.js +1 -0
- package/dist/src/index.d.ts +5 -2
- package/dist/src/index.js +5 -1
- package/dist/src/layout.d.ts +7 -0
- package/dist/src/layout.js +1 -0
- package/dist/src/payloads/index.d.ts +1 -43
- package/dist/src/payloads/index.js +1 -21
- package/dist/src/payloads/set_block_line_name_field.d.ts +34 -0
- package/dist/src/payloads/set_block_line_name_field.js +62 -0
- package/dist/src/payloads/set_block_line_num_fmt.d.ts +23 -0
- package/dist/src/payloads/set_block_line_num_fmt.js +54 -0
- package/dist/src/payloads/set_cell_alignment.d.ts +18 -0
- package/dist/src/payloads/{set_col_width.js → set_cell_alignment.js} +15 -8
- package/dist/src/payloads/{set_border.d.ts → set_cell_border.d.ts} +3 -4
- package/dist/src/payloads/{set_border.js → set_cell_border.js} +1 -2
- package/dist/src/payloads/{set_font.d.ts → set_cell_font.d.ts} +3 -4
- package/dist/src/payloads/{set_font.js → set_cell_font.js} +1 -2
- package/dist/src/payloads/{cell_input.d.ts → set_cell_num_fmt.d.ts} +6 -7
- package/dist/src/payloads/{cell_input.js → set_cell_num_fmt.js} +7 -8
- package/dist/src/payloads/set_cell_pattern_fill.d.ts +24 -0
- package/dist/src/payloads/{block_input.js → set_cell_pattern_fill.js} +15 -14
- package/dist/src/payloads/set_cell_wrap_text.d.ts +17 -0
- package/dist/src/payloads/{set_col_visible.js → set_cell_wrap_text.js} +15 -8
- package/dist/src/payloads/set_field_num_fmt.d.ts +14 -0
- package/dist/src/payloads/set_field_num_fmt.js +30 -0
- package/dist/src/payloads/set_line_alignment.d.ts +21 -0
- package/dist/src/payloads/set_line_alignment.js +46 -0
- package/dist/src/payloads/set_line_border.d.ts +48 -0
- package/dist/src/payloads/set_line_border.js +96 -0
- package/dist/src/payloads/set_line_font.d.ts +48 -0
- package/dist/src/payloads/set_line_font.js +98 -0
- package/dist/src/payloads/set_line_num_fmt.d.ts +20 -0
- package/dist/src/payloads/set_line_num_fmt.js +46 -0
- package/dist/src/payloads/set_line_pattern_fill.d.ts +27 -0
- package/dist/src/payloads/set_line_pattern_fill.js +56 -0
- package/dist/src/payloads/set_line_wrap_text.d.ts +20 -0
- package/dist/src/payloads/set_line_wrap_text.js +46 -0
- package/dist/src/types.d.ts +31 -0
- package/dist/src/types.js +21 -0
- package/dist/src/utils.d.ts +1 -0
- package/dist/src/utils.js +22 -0
- package/package.json +4 -3
- package/dist/src/bindings/cell_formula_value.d.ts +0 -7
- package/dist/src/bindings/cell_style.d.ts +0 -6
- package/dist/src/bindings/display_patch.d.ts +0 -25
- package/dist/src/bindings/display_request.d.ts +0 -4
- package/dist/src/bindings/display_request.js +0 -2
- package/dist/src/bindings/display_response.d.ts +0 -5
- package/dist/src/bindings/sheet_blocks.d.ts +0 -5
- package/dist/src/bindings/sheet_col_info.d.ts +0 -6
- package/dist/src/bindings/sheet_comments.d.ts +0 -5
- package/dist/src/bindings/sheet_merge_cells.d.ts +0 -5
- package/dist/src/bindings/sheet_names.d.ts +0 -3
- package/dist/src/bindings/sheet_names.js +0 -2
- package/dist/src/bindings/sheet_row_info.d.ts +0 -6
- package/dist/src/bindings/sheet_styles.d.ts +0 -5
- package/dist/src/bindings/sheet_values.d.ts +0 -5
- package/dist/src/bindings/style_update.d.ts +0 -7
- package/dist/src/payloads/block_input.d.ts +0 -21
- package/dist/src/payloads/create_block.d.ts +0 -24
- package/dist/src/payloads/create_block.js +0 -61
- package/dist/src/payloads/delete_block_cols.d.ts +0 -18
- package/dist/src/payloads/delete_block_cols.js +0 -39
- package/dist/src/payloads/delete_block_rows.d.ts +0 -18
- package/dist/src/payloads/delete_block_rows.js +0 -39
- package/dist/src/payloads/delete_cols.d.ts +0 -15
- package/dist/src/payloads/delete_cols.js +0 -31
- package/dist/src/payloads/delete_rows.d.ts +0 -15
- package/dist/src/payloads/delete_rows.js +0 -31
- package/dist/src/payloads/delete_sheet.d.ts +0 -9
- package/dist/src/payloads/delete_sheet.js +0 -15
- package/dist/src/payloads/insert_block_cols.d.ts +0 -18
- package/dist/src/payloads/insert_block_cols.js +0 -39
- package/dist/src/payloads/insert_block_rows.d.ts +0 -18
- package/dist/src/payloads/insert_block_rows.js +0 -39
- package/dist/src/payloads/insert_cols.d.ts +0 -15
- package/dist/src/payloads/insert_cols.js +0 -31
- package/dist/src/payloads/insert_rows.d.ts +0 -15
- package/dist/src/payloads/insert_rows.js +0 -31
- package/dist/src/payloads/insert_sheet.d.ts +0 -12
- package/dist/src/payloads/insert_sheet.js +0 -23
- package/dist/src/payloads/move_block.d.ts +0 -18
- package/dist/src/payloads/move_block.js +0 -39
- package/dist/src/payloads/set_col_visible.d.ts +0 -15
- package/dist/src/payloads/set_col_width.d.ts +0 -15
- package/dist/src/payloads/set_row_height.d.ts +0 -15
- package/dist/src/payloads/set_row_height.js +0 -31
- package/dist/src/payloads/set_row_visible.d.ts +0 -15
- package/dist/src/payloads/set_row_visible.js +0 -31
- package/dist/src/payloads/sheet_rename.d.ts +0 -15
- package/dist/src/payloads/sheet_rename.js +0 -29
- package/dist/src/transactions.d.ts +0 -7
- package/dist/src/transactions.js +0 -12
- package/wasm/.gitignore +0 -1
- package/wasm/logisheets_wasm_server.d.ts +0 -255
- package/wasm/logisheets_wasm_server.js +0 -946
- package/wasm/logisheets_wasm_server_bg.wasm +0 -0
- package/wasm/logisheets_wasm_server_bg.wasm.d.ts +0 -40
- package/wasm/package.json +0 -14
- /package/dist/src/bindings/{cell_formula_value.js → alignment.js} +0 -0
- /package/dist/src/bindings/{cell_style.js → app_data.js} +0 -0
- /package/dist/src/bindings/{display_patch.js → appendix.js} +0 -0
- /package/dist/src/bindings/{display_response.js → appendix_with_cell.js} +0 -0
- /package/dist/src/bindings/{sheet_blocks.js → block_cell_info.js} +0 -0
- /package/dist/src/bindings/{sheet_col_info.js → block_display_info.js} +0 -0
- /package/dist/src/bindings/{sheet_comments.js → block_field.js} +0 -0
- /package/dist/src/bindings/{sheet_merge_cells.js → block_schema.js} +0 -0
- /package/dist/src/bindings/{sheet_row_info.js → block_schema_field_entry.js} +0 -0
- /package/dist/src/bindings/{sheet_styles.js → block_schema_key_entry.js} +0 -0
- /package/dist/src/bindings/{sheet_values.js → block_schema_random_entry.js} +0 -0
- /package/dist/src/bindings/{style_update.js → block_schema_type.js} +0 -0
package/dist/src/api/workbook.js
CHANGED
|
@@ -1,87 +1,308 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { handle, input_async_result } from '../../wasm/logisheets_wasm_server';
|
|
2
2
|
import { Worksheet } from './worksheet';
|
|
3
|
+
import { Calculator } from './calculator';
|
|
4
|
+
import { isErrorMessage } from './utils';
|
|
5
|
+
import { BlockManager } from './block_manager';
|
|
6
|
+
function rpc(method, params, bookId
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
|
+
) {
|
|
9
|
+
const msg = params === undefined ? method : { method, value: params };
|
|
10
|
+
return handle(msg, bookId ?? null);
|
|
11
|
+
}
|
|
3
12
|
export class Workbook {
|
|
4
13
|
constructor() {
|
|
5
|
-
this._id =
|
|
14
|
+
this._id = rpc('newWorkbook');
|
|
15
|
+
this._blockManager = new BlockManager((sheetIdx, blockId, rowCount, colCount) => {
|
|
16
|
+
return rpc('checkBindBlock', { sheetIdx, blockId, rowCount, colCount }, this._id);
|
|
17
|
+
}, (sheetIdx) => {
|
|
18
|
+
return rpc('getAvailableBlockId', { sheetIdx }, this._id);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
getSheetIdx(sheetId) {
|
|
22
|
+
return rpc('getSheetIdx', { sheetId }, this._id);
|
|
23
|
+
}
|
|
24
|
+
getBlockValues(params) {
|
|
25
|
+
return rpc('getBlockValues', params, this._id);
|
|
26
|
+
}
|
|
27
|
+
getAvailableBlockId(params) {
|
|
28
|
+
return rpc('getAvailableBlockId', params, this._id);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @returns the block id if success, otherwise the error message
|
|
32
|
+
*
|
|
33
|
+
* It is caller's responsibility to store the block id.
|
|
34
|
+
*/
|
|
35
|
+
createBlockForNewCraft(sheetIdx, masterRow, masterCol, rowCnt, colCnt) {
|
|
36
|
+
const id = this._blockManager.getAvailableBlockId(sheetIdx);
|
|
37
|
+
const effect = this.execTransaction({
|
|
38
|
+
payloads: [
|
|
39
|
+
{
|
|
40
|
+
type: 'createBlock',
|
|
41
|
+
value: {
|
|
42
|
+
sheetIdx,
|
|
43
|
+
id,
|
|
44
|
+
masterRow,
|
|
45
|
+
masterCol,
|
|
46
|
+
rowCnt,
|
|
47
|
+
colCnt,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
undoable: false,
|
|
52
|
+
temp: false,
|
|
53
|
+
});
|
|
54
|
+
if (effect.status.type === 'err') {
|
|
55
|
+
return {
|
|
56
|
+
msg: 'failed to create block',
|
|
57
|
+
ty: effect.status.value,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
const bind = this._blockManager.bindBlock(sheetIdx, id, rowCnt, colCnt);
|
|
61
|
+
if (!bind) {
|
|
62
|
+
return {
|
|
63
|
+
msg: 'failed to bind block',
|
|
64
|
+
ty: 1,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
return id;
|
|
6
68
|
}
|
|
7
69
|
undo() {
|
|
8
|
-
|
|
70
|
+
const result = rpc('undo', undefined, this._id);
|
|
71
|
+
if (result) {
|
|
72
|
+
this._onCellUpdate();
|
|
73
|
+
this._onSheetUpdate();
|
|
74
|
+
}
|
|
75
|
+
return result;
|
|
9
76
|
}
|
|
10
77
|
redo() {
|
|
11
|
-
|
|
78
|
+
const result = rpc('redo', undefined, this._id);
|
|
79
|
+
if (result) {
|
|
80
|
+
this._onCellUpdate();
|
|
81
|
+
this._onSheetUpdate();
|
|
82
|
+
}
|
|
83
|
+
return result;
|
|
84
|
+
}
|
|
85
|
+
registerCellUpdatedCallback(callback) {
|
|
86
|
+
this._cellUpdatedCallbacks.push(callback);
|
|
87
|
+
}
|
|
88
|
+
registerSheetInfoUpdateCallback(callback) {
|
|
89
|
+
this._sheetInfoUpdatedCallbacks.push(callback);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Fires after a transaction with sheet indices whose row/column headers
|
|
93
|
+
* changed (i.e. SetRowHeight / SetColWidth payloads). Useful for the UI
|
|
94
|
+
* to know which sheets need their header strip re-rendered.
|
|
95
|
+
*/
|
|
96
|
+
registerHeaderUpdatedCallback(callback) {
|
|
97
|
+
this._headerUpdatedCallbacks.push(callback);
|
|
98
|
+
}
|
|
99
|
+
getSheetNameByIdx(idx) {
|
|
100
|
+
return rpc('getSheetNameByIdx', { idx }, this._id);
|
|
12
101
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
102
|
+
getAllSheetInfo() {
|
|
103
|
+
return rpc('getAllSheetInfo', undefined, this._id);
|
|
104
|
+
}
|
|
105
|
+
checkFormula(f) {
|
|
106
|
+
return rpc('checkFormula', { formula: f }, this._id);
|
|
107
|
+
}
|
|
108
|
+
calcCondition(sheetIdx, f) {
|
|
109
|
+
return rpc('calcCondition', { sheetIdx, condition: f }, this._id);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Resolve a (refName, key, field) triple to a concrete cell, the same
|
|
113
|
+
* way the BLOCKREF formula resolves at evaluation time. Useful for
|
|
114
|
+
* subscribing to block cells without threading sheet/block/row/col
|
|
115
|
+
* coordinates.
|
|
116
|
+
*/
|
|
117
|
+
getCellIdByBlockRef(refName, key, field) {
|
|
118
|
+
return rpc('getCellIdByBlockRef', { refName, key, field }, this._id);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Snapshot of all cell-value differences between the active temp
|
|
122
|
+
* branch and the committed (fork) status. Returns an empty diff
|
|
123
|
+
* when no temp branch is active. Used by the host's diff layer to
|
|
124
|
+
* drive its overlay without needing JS-side snapshot/compare.
|
|
125
|
+
*/
|
|
126
|
+
getTempStatusChanges() {
|
|
127
|
+
return rpc('getTempStatusChanges', undefined, this._id);
|
|
128
|
+
}
|
|
129
|
+
getSheetId(sheetIdx) {
|
|
130
|
+
return rpc('getSheetId', { sheetIdx }, this._id);
|
|
131
|
+
}
|
|
132
|
+
getBlockRowId(sheetId, blockId, rowIdx) {
|
|
133
|
+
return rpc('getBlockRowId', { sheetId, blockId, rowIdx }, this._id);
|
|
134
|
+
}
|
|
135
|
+
getBlockColId(sheetId, blockId, colIdx) {
|
|
136
|
+
return rpc('getBlockColId', { sheetId, blockId, colIdx }, this._id);
|
|
137
|
+
}
|
|
138
|
+
getDisplayUnitsOfFormula(f) {
|
|
139
|
+
return rpc('getDisplayUnitsOfFormula', { formula: f }, this._id);
|
|
140
|
+
}
|
|
141
|
+
onCellValueChanged(sheetIdx, rowIdx, colIdx, callback) {
|
|
142
|
+
const cellId = this.getCellId({ sheetIdx, rowIdx, colIdx });
|
|
143
|
+
if (isErrorMessage(cellId)) {
|
|
144
|
+
return cellId;
|
|
145
|
+
}
|
|
146
|
+
this._registerCellValueChangedCallback(cellId, callback);
|
|
147
|
+
}
|
|
148
|
+
onCellRemoved(sheetIdx, rowIdx, colIdx, callback) {
|
|
149
|
+
const cellId = this.getCellId({ sheetIdx, rowIdx, colIdx });
|
|
150
|
+
if (isErrorMessage(cellId)) {
|
|
151
|
+
return cellId;
|
|
152
|
+
}
|
|
153
|
+
this._registerCellRemovedCallback(cellId, callback);
|
|
154
|
+
}
|
|
155
|
+
onShadowCellValueChanged(sheetIdx, rowIdx, colIdx, callback) {
|
|
156
|
+
const shadowId = this.getShadowCellId({
|
|
157
|
+
sheetIdx,
|
|
158
|
+
rowIdx,
|
|
159
|
+
colIdx,
|
|
17
160
|
});
|
|
18
|
-
|
|
161
|
+
if (isErrorMessage(shadowId)) {
|
|
162
|
+
return shadowId;
|
|
163
|
+
}
|
|
164
|
+
this._registerCellValueChangedCallback(shadowId, callback);
|
|
165
|
+
}
|
|
166
|
+
_registerCellRemovedCallback(cellId, callback) {
|
|
167
|
+
if (!this._cellRemovedCallbacks.has(cellId)) {
|
|
168
|
+
this._cellRemovedCallbacks.set(cellId, []);
|
|
169
|
+
}
|
|
170
|
+
this._cellRemovedCallbacks.get(cellId)?.push(callback);
|
|
19
171
|
}
|
|
20
|
-
|
|
21
|
-
|
|
172
|
+
_registerCellValueChangedCallback(id, callback) {
|
|
173
|
+
if (!this._cellValueChangedCallbacks.has(id)) {
|
|
174
|
+
this._cellValueChangedCallbacks.set(id, []);
|
|
175
|
+
}
|
|
176
|
+
this._cellValueChangedCallbacks.get(id)?.push(callback);
|
|
22
177
|
}
|
|
23
|
-
|
|
24
|
-
|
|
178
|
+
registerCellValueChangedByCellId(cellId, callback) {
|
|
179
|
+
this._registerCellValueChangedCallback(cellId, callback);
|
|
25
180
|
}
|
|
26
|
-
|
|
27
|
-
|
|
181
|
+
commitTempStatus() {
|
|
182
|
+
rpc('commitTempStatus', undefined, this._id);
|
|
28
183
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return res;
|
|
184
|
+
cleanupTempStatus() {
|
|
185
|
+
rpc('cleanTempStatus', undefined, this._id);
|
|
32
186
|
}
|
|
33
|
-
|
|
34
|
-
|
|
187
|
+
toggleStatus(useTemp) {
|
|
188
|
+
rpc('toggleStatus', { useTemp }, this._id);
|
|
35
189
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
throw Error(`invalid sheet index: ${idx}`);
|
|
39
|
-
return new Worksheet(this._id, idx);
|
|
190
|
+
batchGetCellInfoById(ids) {
|
|
191
|
+
return rpc('batchGetCellInfoById', { ids }, this._id);
|
|
40
192
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
return sheet_rename_by_name(this._id, p.oldName, p.newName);
|
|
193
|
+
batchGetCellCoordinateWithSheetById(ids) {
|
|
194
|
+
return rpc('batchGetCellCoordinateWithSheetById', { ids }, this._id);
|
|
195
|
+
}
|
|
196
|
+
execTransaction(tx) {
|
|
197
|
+
const result = rpc('handleTransaction', { transaction: tx }, this._id);
|
|
198
|
+
if (result.asyncTasks.length > 0) {
|
|
199
|
+
const asyncResult = this._calculator.calc(result.asyncTasks);
|
|
200
|
+
asyncResult.then((result) => {
|
|
201
|
+
this._inputAsyncResult(result);
|
|
202
|
+
this._onCellUpdate();
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
if (result.status.type === 'ok') {
|
|
206
|
+
switch (result.status.value) {
|
|
207
|
+
case 'cell':
|
|
208
|
+
this._onCellUpdate();
|
|
209
|
+
break;
|
|
210
|
+
case 'sheet':
|
|
211
|
+
this._onSheetUpdate();
|
|
212
|
+
break;
|
|
213
|
+
case 'sheetAndCell':
|
|
214
|
+
this._onCellUpdate();
|
|
215
|
+
this._onSheetUpdate();
|
|
216
|
+
break;
|
|
217
|
+
case 'undoNothing':
|
|
218
|
+
case 'redoNothing':
|
|
219
|
+
case 'doNothing':
|
|
220
|
+
break;
|
|
221
|
+
default:
|
|
222
|
+
this._onCellUpdate();
|
|
223
|
+
this._onSheetUpdate();
|
|
73
224
|
}
|
|
74
|
-
|
|
75
|
-
|
|
225
|
+
result.valueChanged.forEach((cellId) => {
|
|
226
|
+
this._cellValueChangedCallbacks
|
|
227
|
+
.get(cellId)
|
|
228
|
+
?.forEach((callback) => {
|
|
229
|
+
callback();
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
result.cellRemoved.forEach((cellId) => {
|
|
233
|
+
this._cellRemovedCallbacks.get(cellId)?.forEach((callback) => {
|
|
234
|
+
callback();
|
|
235
|
+
});
|
|
236
|
+
this._cellRemovedCallbacks.delete(cellId);
|
|
237
|
+
this._cellValueChangedCallbacks.delete(cellId);
|
|
238
|
+
});
|
|
239
|
+
if (result.headerUpdated.length > 0) {
|
|
240
|
+
this._headerUpdatedCallbacks.forEach((cb) => cb(result.headerUpdated));
|
|
76
241
|
}
|
|
77
242
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
243
|
+
return result;
|
|
244
|
+
}
|
|
245
|
+
load(buf, bookName) {
|
|
246
|
+
return rpc('loadWorkbook', { content: Array.from(buf), name: bookName }, this._id);
|
|
247
|
+
}
|
|
248
|
+
save(data) {
|
|
249
|
+
return rpc('saveWorkbook', { appData: data }, this._id);
|
|
250
|
+
}
|
|
251
|
+
getAppData() {
|
|
252
|
+
return rpc('getAppData', undefined, this._id);
|
|
253
|
+
}
|
|
254
|
+
release() {
|
|
255
|
+
rpc('release', undefined, this._id);
|
|
256
|
+
}
|
|
257
|
+
getSheetCount() {
|
|
258
|
+
return rpc('getSheetCount', undefined, this._id);
|
|
259
|
+
}
|
|
260
|
+
getWorksheet(idx) {
|
|
261
|
+
if (idx >= this.getSheetCount())
|
|
262
|
+
throw Error(`invalid sheet index: ${idx}`);
|
|
263
|
+
return new Worksheet(this._id, idx);
|
|
264
|
+
}
|
|
265
|
+
getWorksheetById(id) {
|
|
266
|
+
return new Worksheet(this._id, id, false);
|
|
267
|
+
}
|
|
268
|
+
registryCustomFunc(customFunc) {
|
|
269
|
+
this._calculator.registry(customFunc);
|
|
270
|
+
}
|
|
271
|
+
getShadowCellId(params) {
|
|
272
|
+
return rpc('getShadowCellId', params, this._id);
|
|
273
|
+
}
|
|
274
|
+
getShadowCellIds(params) {
|
|
275
|
+
return rpc('getShadowCellIds', params, this._id);
|
|
276
|
+
}
|
|
277
|
+
getShadowInfoById(params) {
|
|
278
|
+
return rpc('getShadowInfoById', params, this._id);
|
|
279
|
+
}
|
|
280
|
+
getCellId(params) {
|
|
281
|
+
return rpc('getCellId', params, this._id);
|
|
282
|
+
}
|
|
283
|
+
getAllBlockFields() {
|
|
284
|
+
return rpc('getAllBlockFields', undefined, this._id);
|
|
285
|
+
}
|
|
286
|
+
_inputAsyncResult(r) {
|
|
287
|
+
return input_async_result(this._id, r);
|
|
288
|
+
}
|
|
289
|
+
_onCellUpdate() {
|
|
290
|
+
this._cellUpdatedCallbacks.forEach((exec) => {
|
|
291
|
+
exec();
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
_onSheetUpdate() {
|
|
295
|
+
this._sheetInfoUpdatedCallbacks.forEach((exec) => {
|
|
296
|
+
exec();
|
|
297
|
+
});
|
|
84
298
|
}
|
|
299
|
+
_cellUpdatedCallbacks = [];
|
|
300
|
+
_sheetInfoUpdatedCallbacks = [];
|
|
301
|
+
_headerUpdatedCallbacks = [];
|
|
302
|
+
_cellValueChangedCallbacks = new Map();
|
|
303
|
+
_cellRemovedCallbacks = new Map();
|
|
85
304
|
// The book id which is generated by `WASM`
|
|
86
305
|
_id;
|
|
306
|
+
_blockManager;
|
|
307
|
+
_calculator = new Calculator();
|
|
87
308
|
}
|
|
@@ -1,16 +1,37 @@
|
|
|
1
|
-
import { ColInfo, RowInfo, Style, Value } from '../bindings';
|
|
2
|
-
import {
|
|
1
|
+
import { BlockInfo, CellPosition, ColInfo, DisplayWindow, DisplayWindowWithStartPoint, RowInfo, Style, Value, CellInfo, SheetDimension, MergeCell, AppendixWithCell, ReproducibleCell, SheetCoordinate } from '../bindings';
|
|
2
|
+
import { Cell } from './cell';
|
|
3
3
|
import { Result } from './utils';
|
|
4
4
|
export declare class Worksheet {
|
|
5
|
-
constructor(id: number,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
constructor(id: number, sheetIdxOrId: number, isSheetIdx?: boolean);
|
|
6
|
+
getSheetDimension(): Result<SheetDimension>;
|
|
7
|
+
getDisplayWindow(startRow: number, endRow: number, startCol: number, endCol: number): Result<DisplayWindow>;
|
|
8
|
+
getDisplayWindowWithStartPoint(startX: number, startY: number, height: number, width: number): DisplayWindowWithStartPoint;
|
|
9
|
+
getCellPosition(row: number, col: number): CellPosition;
|
|
10
|
+
getNextUpwardVisibleCell(row: number, col: number): CellPosition;
|
|
11
|
+
getNextDownwardVisibleCell(row: number, col: number): CellPosition;
|
|
12
|
+
getNextLeftwardVisibleCell(row: number, col: number): CellPosition;
|
|
13
|
+
getNextRightwardVisibleCell(row: number, col: number): CellPosition;
|
|
14
|
+
getDisplayWindowWithCellPosition(row: number, col: number, height: number, width: number): DisplayWindowWithStartPoint;
|
|
15
|
+
getBlockDisplayWindow(blockId: number): Result<DisplayWindow>;
|
|
16
|
+
getRowHeight(rowIdx: number): Result<number>;
|
|
17
|
+
getColWidth(colIdx: number): Result<number>;
|
|
18
|
+
getRowInfo(rowIdx: number): Result<RowInfo>;
|
|
19
|
+
getColInfo(colIdx: number): Result<ColInfo>;
|
|
20
|
+
getCellInfo(rowIdx: number, colIdx: number): Result<CellInfo>;
|
|
21
|
+
getReproducibleCell(rowIdx: number, colIdx: number): Result<ReproducibleCell>;
|
|
22
|
+
getReproducibleCells(coordinates: readonly SheetCoordinate[]): Result<readonly ReproducibleCell[]>;
|
|
23
|
+
getCellInfos(startRow: number, startCol: number, endRow: number, endCol: number): Result<readonly CellInfo[]>;
|
|
24
|
+
getCellInfosExceptWindow(startRow: number, startCol: number, endRow: number, endCol: number, windowStartRow: number, windowStartCol: number, windowEndRow: number, windowEndCol: number): Result<readonly CellInfo[]>;
|
|
25
|
+
getBlockInfo(blockId: number): BlockInfo;
|
|
26
|
+
getMergedCells(startRow: number, startCol: number, endRow: number, endCol: number): readonly MergeCell[];
|
|
27
|
+
getCell(rowIdx: number, colIdx: number): Result<Cell>;
|
|
28
|
+
getFormula(rowIdx: number, colIdx: number): Result<string>;
|
|
29
|
+
getStyle(rowIdx: number, colIdx: number): Result<Style>;
|
|
30
|
+
getValue(rowIdx: number, colIdx: number): Result<Value>;
|
|
31
|
+
getDiyCellIdWithBlockId(blockId: number, row: number, col: number): Result<number>;
|
|
32
|
+
lookupAppendixUpward(blockId: number, row: number, col: number, craftId: string, tag: number): Result<AppendixWithCell>;
|
|
33
|
+
getFullyCoveredBlocks(rowIdx: number, colIdx: number, rowCnt: number, colCnt: number): Result<BlockInfo[]>;
|
|
14
34
|
private _id;
|
|
35
|
+
private _sheetId;
|
|
15
36
|
private _sheetIdx;
|
|
16
37
|
}
|
|
@@ -1,33 +1,160 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { handle } from '../../wasm/logisheets_wasm_server';
|
|
2
|
+
import { Cell } from './cell';
|
|
3
|
+
import { isErrorMessage } from './utils';
|
|
4
|
+
function rpc(method, params, bookId
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
|
+
) {
|
|
7
|
+
const msg = params === undefined ? method : { method, value: params };
|
|
8
|
+
return handle(msg, bookId ?? null);
|
|
9
|
+
}
|
|
2
10
|
export class Worksheet {
|
|
3
|
-
constructor(id,
|
|
11
|
+
constructor(id, sheetIdxOrId, isSheetIdx = true) {
|
|
4
12
|
this._id = id;
|
|
5
|
-
|
|
13
|
+
if (isSheetIdx) {
|
|
14
|
+
this._sheetIdx = sheetIdxOrId;
|
|
15
|
+
this._sheetId = rpc('getSheetId', { sheetIdx: sheetIdxOrId }, id);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
this._sheetId = sheetIdxOrId;
|
|
19
|
+
this._sheetIdx = rpc('getSheetIdx', { sheetId: sheetIdxOrId }, id);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
getSheetDimension() {
|
|
23
|
+
return rpc('getSheetDimension', { sheetId: this._sheetId }, this._id);
|
|
24
|
+
}
|
|
25
|
+
getDisplayWindow(startRow, endRow, startCol, endCol) {
|
|
26
|
+
return rpc('getDisplayWindow', { sheetIdx: this._sheetIdx, startRow, endRow, startCol, endCol }, this._id);
|
|
27
|
+
}
|
|
28
|
+
getDisplayWindowWithStartPoint(startX, startY, height, width) {
|
|
29
|
+
return rpc('getDisplayWindowWithStartPoint', { sheetIdx: this._sheetIdx, startX, startY, height, width }, this._id);
|
|
30
|
+
}
|
|
31
|
+
getCellPosition(row, col) {
|
|
32
|
+
return rpc('getCellPosition', { sheetIdx: this._sheetIdx, row, col }, this._id);
|
|
33
|
+
}
|
|
34
|
+
getNextUpwardVisibleCell(row, col) {
|
|
35
|
+
return rpc('getNextVisibleCell', {
|
|
36
|
+
sheetIdx: this._sheetIdx,
|
|
37
|
+
rowIdx: row,
|
|
38
|
+
colIdx: col,
|
|
39
|
+
direction: 'up',
|
|
40
|
+
}, this._id);
|
|
41
|
+
}
|
|
42
|
+
getNextDownwardVisibleCell(row, col) {
|
|
43
|
+
return rpc('getNextVisibleCell', {
|
|
44
|
+
sheetIdx: this._sheetIdx,
|
|
45
|
+
rowIdx: row,
|
|
46
|
+
colIdx: col,
|
|
47
|
+
direction: 'down',
|
|
48
|
+
}, this._id);
|
|
49
|
+
}
|
|
50
|
+
getNextLeftwardVisibleCell(row, col) {
|
|
51
|
+
return rpc('getNextVisibleCell', {
|
|
52
|
+
sheetIdx: this._sheetIdx,
|
|
53
|
+
rowIdx: row,
|
|
54
|
+
colIdx: col,
|
|
55
|
+
direction: 'left',
|
|
56
|
+
}, this._id);
|
|
57
|
+
}
|
|
58
|
+
getNextRightwardVisibleCell(row, col) {
|
|
59
|
+
return rpc('getNextVisibleCell', {
|
|
60
|
+
sheetIdx: this._sheetIdx,
|
|
61
|
+
rowIdx: row,
|
|
62
|
+
colIdx: col,
|
|
63
|
+
direction: 'right',
|
|
64
|
+
}, this._id);
|
|
65
|
+
}
|
|
66
|
+
getDisplayWindowWithCellPosition(row, col, height, width) {
|
|
67
|
+
return rpc('getDisplayWindowWithinCell', { sheetIdx: this._sheetIdx, row, col, height, width }, this._id);
|
|
68
|
+
}
|
|
69
|
+
getBlockDisplayWindow(blockId) {
|
|
70
|
+
return rpc('getBlockDisplayWindow', { sheetId: this._sheetId, blockId }, this._id);
|
|
71
|
+
}
|
|
72
|
+
getRowHeight(rowIdx) {
|
|
73
|
+
return rpc('getRowHeight', { sheetId: this._sheetId, rowIdx }, this._id);
|
|
74
|
+
}
|
|
75
|
+
getColWidth(colIdx) {
|
|
76
|
+
return rpc('getColWidth', { sheetId: this._sheetId, colIdx }, this._id);
|
|
77
|
+
}
|
|
78
|
+
getRowInfo(rowIdx) {
|
|
79
|
+
return rpc('getRowInfo', { sheetIdx: this._sheetIdx, rowIdx }, this._id);
|
|
80
|
+
}
|
|
81
|
+
getColInfo(colIdx) {
|
|
82
|
+
return rpc('getColInfo', { sheetIdx: this._sheetIdx, colIdx }, this._id);
|
|
83
|
+
}
|
|
84
|
+
getCellInfo(rowIdx, colIdx) {
|
|
85
|
+
return rpc('getCell', { sheetIdx: this._sheetIdx, row: rowIdx, col: colIdx }, this._id);
|
|
86
|
+
}
|
|
87
|
+
getReproducibleCell(rowIdx, colIdx) {
|
|
88
|
+
return rpc('getReproducibleCell', { sheetIdx: this._sheetIdx, row: rowIdx, col: colIdx }, this._id);
|
|
89
|
+
}
|
|
90
|
+
getReproducibleCells(coordinates) {
|
|
91
|
+
return rpc('getReproducibleCells', { sheetIdx: this._sheetIdx, coordinates }, this._id);
|
|
92
|
+
}
|
|
93
|
+
getCellInfos(startRow, startCol, endRow, endCol) {
|
|
94
|
+
return rpc('getCellInfos', { sheetIdx: this._sheetIdx, startRow, startCol, endRow, endCol }, this._id);
|
|
95
|
+
}
|
|
96
|
+
getCellInfosExceptWindow(startRow, startCol, endRow, endCol, windowStartRow, windowStartCol, windowEndRow, windowEndCol) {
|
|
97
|
+
return rpc('getCellsExceptWindow', {
|
|
98
|
+
sheetIdx: this._sheetIdx,
|
|
99
|
+
startRow,
|
|
100
|
+
startCol,
|
|
101
|
+
endRow,
|
|
102
|
+
endCol,
|
|
103
|
+
windowStartRow,
|
|
104
|
+
windowStartCol,
|
|
105
|
+
windowEndRow,
|
|
106
|
+
windowEndCol,
|
|
107
|
+
}, this._id);
|
|
108
|
+
}
|
|
109
|
+
getBlockInfo(blockId) {
|
|
110
|
+
return rpc('getBlockInfo', { sheetId: this._sheetId, blockId }, this._id);
|
|
6
111
|
}
|
|
7
|
-
|
|
8
|
-
return
|
|
112
|
+
getMergedCells(startRow, startCol, endRow, endCol) {
|
|
113
|
+
return rpc('getMergedCells', { sheetIdx: this._sheetIdx, startRow, startCol, endRow, endCol }, this._id);
|
|
9
114
|
}
|
|
10
|
-
|
|
11
|
-
|
|
115
|
+
getCell(rowIdx, colIdx) {
|
|
116
|
+
const cellInfo = this.getCellInfo(rowIdx, colIdx);
|
|
117
|
+
if (isErrorMessage(cellInfo)) {
|
|
118
|
+
return cellInfo;
|
|
119
|
+
}
|
|
120
|
+
return new Cell(cellInfo);
|
|
12
121
|
}
|
|
13
|
-
|
|
14
|
-
return
|
|
122
|
+
getFormula(rowIdx, colIdx) {
|
|
123
|
+
return rpc('getFormula', { sheetIdx: this._sheetIdx, row: rowIdx, col: colIdx }, this._id);
|
|
15
124
|
}
|
|
16
|
-
|
|
17
|
-
return
|
|
125
|
+
getStyle(rowIdx, colIdx) {
|
|
126
|
+
return rpc('getStyle', { sheetIdx: this._sheetIdx, row: rowIdx, col: colIdx }, this._id);
|
|
18
127
|
}
|
|
19
|
-
|
|
20
|
-
return
|
|
128
|
+
getValue(rowIdx, colIdx) {
|
|
129
|
+
return rpc('getValue', { sheetIdx: this._sheetIdx, row: rowIdx, col: colIdx }, this._id);
|
|
21
130
|
}
|
|
22
|
-
|
|
23
|
-
|
|
131
|
+
getDiyCellIdWithBlockId(blockId, row, col) {
|
|
132
|
+
const cellId = rpc('getDiyCellIdWithBlockId', { sheetId: this._sheetId, blockId, row, col }, this._id);
|
|
133
|
+
if (cellId === undefined) {
|
|
134
|
+
return { msg: 'Cell not found', ty: 0 };
|
|
135
|
+
}
|
|
136
|
+
return cellId;
|
|
24
137
|
}
|
|
25
|
-
|
|
26
|
-
return
|
|
138
|
+
lookupAppendixUpward(blockId, row, col, craftId, tag) {
|
|
139
|
+
return rpc('lookupAppendixUpward', {
|
|
140
|
+
sheetId: this._sheetId,
|
|
141
|
+
blockId,
|
|
142
|
+
row,
|
|
143
|
+
col,
|
|
144
|
+
craftId,
|
|
145
|
+
tag,
|
|
146
|
+
}, this._id);
|
|
27
147
|
}
|
|
28
|
-
|
|
29
|
-
return
|
|
148
|
+
getFullyCoveredBlocks(rowIdx, colIdx, rowCnt, colCnt) {
|
|
149
|
+
return rpc('getFullyCoveredBlocks', {
|
|
150
|
+
sheetId: this._sheetId,
|
|
151
|
+
row: rowIdx,
|
|
152
|
+
col: colIdx,
|
|
153
|
+
rowCnt,
|
|
154
|
+
colCnt,
|
|
155
|
+
}, this._id);
|
|
30
156
|
}
|
|
31
157
|
_id;
|
|
158
|
+
_sheetId;
|
|
32
159
|
_sheetIdx;
|
|
33
160
|
}
|
|
@@ -1,7 +1,63 @@
|
|
|
1
|
+
import { SheetCellId } from './sheet_cell_id';
|
|
2
|
+
import { SheetColId } from './sheet_col_id';
|
|
3
|
+
import { SheetRowId } from './sheet_row_id';
|
|
1
4
|
import { StatusCode } from './status_code';
|
|
2
5
|
import { Task } from './task';
|
|
3
6
|
export interface ActionEffect {
|
|
4
7
|
version: number;
|
|
5
8
|
asyncTasks: readonly Task[];
|
|
6
9
|
status: StatusCode;
|
|
10
|
+
valueChanged: readonly SheetCellId[];
|
|
11
|
+
cellRemoved: readonly SheetCellId[];
|
|
12
|
+
styleChanged: readonly SheetCellId[];
|
|
13
|
+
rowInserted: readonly SheetRowId[];
|
|
14
|
+
rowRemoved: readonly SheetRowId[];
|
|
15
|
+
rowUpdated: readonly SheetRowId[];
|
|
16
|
+
colInserted: readonly SheetColId[];
|
|
17
|
+
colRemoved: readonly SheetColId[];
|
|
18
|
+
colUpdated: readonly SheetColId[];
|
|
19
|
+
headerUpdated: readonly number[];
|
|
20
|
+
}
|
|
21
|
+
export declare class ActionEffectBuilder {
|
|
22
|
+
private _version;
|
|
23
|
+
private _asyncTasks;
|
|
24
|
+
private _status;
|
|
25
|
+
private _valueChanged;
|
|
26
|
+
private _cellRemoved;
|
|
27
|
+
private _styleChanged;
|
|
28
|
+
private _rowInserted;
|
|
29
|
+
private _rowRemoved;
|
|
30
|
+
private _rowUpdated;
|
|
31
|
+
private _colInserted;
|
|
32
|
+
private _colRemoved;
|
|
33
|
+
private _colUpdated;
|
|
34
|
+
private _headerUpdated;
|
|
35
|
+
version(value: number): this;
|
|
36
|
+
asyncTasks(value: readonly Task[]): this;
|
|
37
|
+
status(value: StatusCode): this;
|
|
38
|
+
valueChanged(value: readonly SheetCellId[]): this;
|
|
39
|
+
cellRemoved(value: readonly SheetCellId[]): this;
|
|
40
|
+
styleChanged(value: readonly SheetCellId[]): this;
|
|
41
|
+
rowInserted(value: readonly SheetRowId[]): this;
|
|
42
|
+
rowRemoved(value: readonly SheetRowId[]): this;
|
|
43
|
+
rowUpdated(value: readonly SheetRowId[]): this;
|
|
44
|
+
colInserted(value: readonly SheetColId[]): this;
|
|
45
|
+
colRemoved(value: readonly SheetColId[]): this;
|
|
46
|
+
colUpdated(value: readonly SheetColId[]): this;
|
|
47
|
+
headerUpdated(value: readonly number[]): this;
|
|
48
|
+
build(): {
|
|
49
|
+
version: number;
|
|
50
|
+
asyncTasks: readonly Task[];
|
|
51
|
+
status: StatusCode;
|
|
52
|
+
valueChanged: readonly SheetCellId[];
|
|
53
|
+
cellRemoved: readonly SheetCellId[];
|
|
54
|
+
styleChanged: readonly SheetCellId[];
|
|
55
|
+
rowInserted: readonly SheetRowId[];
|
|
56
|
+
rowRemoved: readonly SheetRowId[];
|
|
57
|
+
rowUpdated: readonly SheetRowId[];
|
|
58
|
+
colInserted: readonly SheetColId[];
|
|
59
|
+
colRemoved: readonly SheetColId[];
|
|
60
|
+
colUpdated: readonly SheetColId[];
|
|
61
|
+
headerUpdated: readonly number[];
|
|
62
|
+
};
|
|
7
63
|
}
|