@cj-tech-master/excelts 5.1.7 → 5.1.8-canary.20260302175750.f5cf6f5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,4 @@
1
+ import type { ValueType, FormulaType } from "@excel/enums";
1
2
  import { Note } from "@excel/note";
2
3
  import type { Row } from "@excel/row";
3
4
  import type { Column } from "@excel/column";
@@ -47,7 +48,7 @@ export interface NoteModel {
47
48
  }
48
49
  export interface CellModel {
49
50
  address: string;
50
- type: number;
51
+ type: ValueType;
51
52
  value?: number | string | boolean | Date | CellRichTextValue | CellErrorValue | CellHyperlinkValue;
52
53
  style?: Partial<Style>;
53
54
  comment?: NoteModel;
@@ -67,7 +68,7 @@ export interface CellModel {
67
68
  }
68
69
  export type CellValueType = CellValue;
69
70
  declare class Cell {
70
- static Types: typeof import("@excel/enums").ValueType;
71
+ static Types: typeof ValueType;
71
72
  private _row;
72
73
  private _column;
73
74
  private _address;
@@ -96,8 +97,8 @@ declare class Cell {
96
97
  get row(): number;
97
98
  get col(): number;
98
99
  get $col$row(): string;
99
- get type(): number;
100
- get effectiveType(): number;
100
+ get type(): ValueType;
101
+ get effectiveType(): ValueType;
101
102
  toCsvString(): string;
102
103
  addMergeRef(): void;
103
104
  releaseMergeRef(): void;
@@ -119,7 +120,7 @@ declare class Cell {
119
120
  toString(): string;
120
121
  get formula(): string | undefined;
121
122
  get result(): FormulaResult | undefined;
122
- get formulaType(): number;
123
+ get formulaType(): FormulaType;
123
124
  get fullAddress(): FullAddress;
124
125
  get name(): string;
125
126
  set name(value: string);
@@ -228,11 +228,11 @@ declare class Worksheet {
228
228
  * A count of the number of rows that have values. If a mid-document row is empty, it will not be included in the count.
229
229
  */
230
230
  get actualRowCount(): number;
231
- getRow(r: number): any;
232
- getRows(start: number, length: number): any[] | undefined;
233
- addRow(value: any, style?: string): any;
234
- addRows(value: any[], style?: string): any[];
235
- insertRow(pos: number, value: any, style?: string): any;
231
+ getRow(r: number): Row;
232
+ getRows(start: number, length: number): Row[] | undefined;
233
+ addRow(value: any, style?: string): Row;
234
+ addRows(value: any[], style?: string): Row[];
235
+ insertRow(pos: number, value: any, style?: string): Row;
236
236
  insertRows(pos: number, values: any[], style?: string): Row[] | undefined;
237
237
  private _setStyleOption;
238
238
  private _copyStyle;
@@ -79,8 +79,29 @@ export function normalizeWritable(stream) {
79
79
  return stream;
80
80
  }
81
81
  // Web WritableStream: detect by getWriter() (avoid relying on global WritableStream).
82
+ // Avoid `Writable.fromWeb()` — it is buggy on some runtimes (e.g. Bun).
83
+ // Instead, wrap manually by piping through the WritableStream's writer.
82
84
  if (stream?.getWriter) {
83
- return NodeWritable.fromWeb(stream);
85
+ const ws = stream;
86
+ let writer;
87
+ const getWriter = () => (writer ?? (writer = ws.getWriter()));
88
+ return new Writable({
89
+ write(_chunk, _encoding, callback) {
90
+ getWriter()
91
+ .write(_chunk)
92
+ .then(() => callback(null), callback);
93
+ },
94
+ final(callback) {
95
+ const w = getWriter();
96
+ w.close().then(() => {
97
+ w.releaseLock();
98
+ callback(null);
99
+ }, (err) => {
100
+ w.releaseLock();
101
+ callback(err);
102
+ });
103
+ }
104
+ });
84
105
  }
85
106
  // Assume it structurally matches Node's Writable.
86
107
  return stream;
@@ -124,8 +124,29 @@ function normalizeWritable(stream) {
124
124
  return stream;
125
125
  }
126
126
  // Web WritableStream: detect by getWriter() (avoid relying on global WritableStream).
127
+ // Avoid `Writable.fromWeb()` — it is buggy on some runtimes (e.g. Bun).
128
+ // Instead, wrap manually by piping through the WritableStream's writer.
127
129
  if (stream?.getWriter) {
128
- return stream_1.Writable.fromWeb(stream);
130
+ const ws = stream;
131
+ let writer;
132
+ const getWriter = () => (writer ?? (writer = ws.getWriter()));
133
+ return new Writable({
134
+ write(_chunk, _encoding, callback) {
135
+ getWriter()
136
+ .write(_chunk)
137
+ .then(() => callback(null), callback);
138
+ },
139
+ final(callback) {
140
+ const w = getWriter();
141
+ w.close().then(() => {
142
+ w.releaseLock();
143
+ callback(null);
144
+ }, (err) => {
145
+ w.releaseLock();
146
+ callback(err);
147
+ });
148
+ }
149
+ });
129
150
  }
130
151
  // Assume it structurally matches Node's Writable.
131
152
  return stream;
@@ -79,8 +79,29 @@ export function normalizeWritable(stream) {
79
79
  return stream;
80
80
  }
81
81
  // Web WritableStream: detect by getWriter() (avoid relying on global WritableStream).
82
+ // Avoid `Writable.fromWeb()` — it is buggy on some runtimes (e.g. Bun).
83
+ // Instead, wrap manually by piping through the WritableStream's writer.
82
84
  if (stream?.getWriter) {
83
- return NodeWritable.fromWeb(stream);
85
+ const ws = stream;
86
+ let writer;
87
+ const getWriter = () => (writer ?? (writer = ws.getWriter()));
88
+ return new Writable({
89
+ write(_chunk, _encoding, callback) {
90
+ getWriter()
91
+ .write(_chunk)
92
+ .then(() => callback(null), callback);
93
+ },
94
+ final(callback) {
95
+ const w = getWriter();
96
+ w.close().then(() => {
97
+ w.releaseLock();
98
+ callback(null);
99
+ }, (err) => {
100
+ w.releaseLock();
101
+ callback(err);
102
+ });
103
+ }
104
+ });
84
105
  }
85
106
  // Assume it structurally matches Node's Writable.
86
107
  return stream;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @cj-tech-master/excelts v5.1.7
2
+ * @cj-tech-master/excelts v5.1.8-canary.20260302175750.f5cf6f5
3
3
  * TypeScript Excel Workbook Manager - Read and Write xlsx and csv Files.
4
4
  * (c) 2026 cjnoname
5
5
  * Released under the MIT License