@cj-tech-master/excelts 4.2.1-canary.20260111102127.f808a37 → 4.2.1-canary.20260112134913.a3cecdd

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 (101) hide show
  1. package/dist/browser/modules/archive/io/archive-sink.d.ts +0 -1
  2. package/dist/browser/modules/archive/io/archive-sink.js +6 -38
  3. package/dist/browser/modules/archive/io/archive-source.d.ts +0 -2
  4. package/dist/browser/modules/archive/io/archive-source.js +1 -8
  5. package/dist/browser/modules/excel/utils/ooxml-validator.d.ts +48 -0
  6. package/dist/browser/modules/excel/utils/ooxml-validator.js +469 -0
  7. package/dist/browser/modules/excel/worksheet.js +5 -2
  8. package/dist/browser/modules/excel/xlsx/xform/drawing/ctrl-prop-xform.d.ts +1 -0
  9. package/dist/browser/modules/excel/xlsx/xform/drawing/ctrl-prop-xform.js +13 -1
  10. package/dist/browser/modules/excel/xlsx/xform/drawing/sp-xform.d.ts +18 -0
  11. package/dist/browser/modules/excel/xlsx/xform/drawing/sp-xform.js +112 -0
  12. package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +6 -1
  13. package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +30 -2
  14. package/dist/browser/modules/excel/xlsx/xform/drawing/vml-drawing-xform.js +11 -0
  15. package/dist/browser/modules/excel/xlsx/xform/sheet/page-setup-xform.d.ts +1 -0
  16. package/dist/browser/modules/excel/xlsx/xform/sheet/page-setup-xform.js +16 -2
  17. package/dist/browser/modules/excel/xlsx/xform/sheet/worksheet-xform.js +110 -12
  18. package/dist/browser/modules/stream/base-transform.d.ts +3 -0
  19. package/dist/browser/modules/stream/base-transform.js +34 -20
  20. package/dist/browser/modules/stream/buffered-stream.d.ts +2 -12
  21. package/dist/browser/modules/stream/chunked-builder.js +4 -4
  22. package/dist/browser/modules/stream/index.browser.d.ts +13 -19
  23. package/dist/browser/modules/stream/index.browser.js +10 -22
  24. package/dist/browser/modules/stream/index.d.ts +18 -41
  25. package/dist/browser/modules/stream/index.js +15 -44
  26. package/dist/browser/modules/stream/internal/event-utils.d.ts +17 -0
  27. package/dist/browser/modules/stream/internal/event-utils.js +40 -0
  28. package/dist/browser/modules/stream/internal/type-guards.d.ts +9 -0
  29. package/dist/browser/modules/stream/internal/type-guards.js +24 -0
  30. package/dist/browser/modules/stream/pull-stream.d.ts +5 -6
  31. package/dist/browser/modules/stream/pull-stream.js +107 -43
  32. package/dist/browser/modules/stream/shared.d.ts +1 -1
  33. package/dist/browser/modules/stream/shared.js +7 -4
  34. package/dist/browser/modules/stream/streams.browser.d.ts +4 -14
  35. package/dist/browser/modules/stream/streams.browser.js +129 -164
  36. package/dist/browser/modules/stream/streams.d.ts +4 -20
  37. package/dist/browser/modules/stream/streams.js +6 -37
  38. package/dist/browser/modules/stream/utils.js +5 -38
  39. package/dist/cjs/modules/archive/io/archive-sink.js +7 -40
  40. package/dist/cjs/modules/archive/io/archive-source.js +3 -12
  41. package/dist/cjs/modules/excel/utils/ooxml-validator.js +475 -0
  42. package/dist/cjs/modules/excel/worksheet.js +5 -2
  43. package/dist/cjs/modules/excel/xlsx/xform/drawing/ctrl-prop-xform.js +13 -1
  44. package/dist/cjs/modules/excel/xlsx/xform/drawing/sp-xform.js +115 -0
  45. package/dist/cjs/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +30 -2
  46. package/dist/cjs/modules/excel/xlsx/xform/drawing/vml-drawing-xform.js +11 -0
  47. package/dist/cjs/modules/excel/xlsx/xform/sheet/page-setup-xform.js +16 -2
  48. package/dist/cjs/modules/excel/xlsx/xform/sheet/worksheet-xform.js +110 -12
  49. package/dist/cjs/modules/stream/base-transform.js +34 -20
  50. package/dist/cjs/modules/stream/chunked-builder.js +4 -4
  51. package/dist/cjs/modules/stream/index.browser.js +10 -17
  52. package/dist/cjs/modules/stream/index.js +15 -39
  53. package/dist/cjs/modules/stream/internal/event-utils.js +43 -0
  54. package/dist/cjs/modules/stream/internal/type-guards.js +30 -0
  55. package/dist/cjs/modules/stream/pull-stream.js +107 -43
  56. package/dist/cjs/modules/stream/shared.js +7 -4
  57. package/dist/cjs/modules/stream/streams.browser.js +135 -175
  58. package/dist/cjs/modules/stream/streams.js +16 -49
  59. package/dist/cjs/modules/stream/utils.js +3 -36
  60. package/dist/esm/modules/archive/io/archive-sink.js +6 -38
  61. package/dist/esm/modules/archive/io/archive-source.js +1 -8
  62. package/dist/esm/modules/excel/utils/ooxml-validator.js +469 -0
  63. package/dist/esm/modules/excel/worksheet.js +5 -2
  64. package/dist/esm/modules/excel/xlsx/xform/drawing/ctrl-prop-xform.js +13 -1
  65. package/dist/esm/modules/excel/xlsx/xform/drawing/sp-xform.js +112 -0
  66. package/dist/esm/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +30 -2
  67. package/dist/esm/modules/excel/xlsx/xform/drawing/vml-drawing-xform.js +11 -0
  68. package/dist/esm/modules/excel/xlsx/xform/sheet/page-setup-xform.js +16 -2
  69. package/dist/esm/modules/excel/xlsx/xform/sheet/worksheet-xform.js +110 -12
  70. package/dist/esm/modules/stream/base-transform.js +34 -20
  71. package/dist/esm/modules/stream/chunked-builder.js +4 -4
  72. package/dist/esm/modules/stream/index.browser.js +10 -22
  73. package/dist/esm/modules/stream/index.js +15 -44
  74. package/dist/esm/modules/stream/internal/event-utils.js +40 -0
  75. package/dist/esm/modules/stream/internal/type-guards.js +24 -0
  76. package/dist/esm/modules/stream/pull-stream.js +107 -43
  77. package/dist/esm/modules/stream/shared.js +7 -4
  78. package/dist/esm/modules/stream/streams.browser.js +129 -164
  79. package/dist/esm/modules/stream/streams.js +6 -37
  80. package/dist/esm/modules/stream/utils.js +5 -38
  81. package/dist/iife/excelts.iife.js +325 -60
  82. package/dist/iife/excelts.iife.js.map +1 -1
  83. package/dist/iife/excelts.iife.min.js +25 -25
  84. package/dist/types/modules/archive/io/archive-sink.d.ts +0 -1
  85. package/dist/types/modules/archive/io/archive-source.d.ts +0 -2
  86. package/dist/types/modules/excel/utils/ooxml-validator.d.ts +48 -0
  87. package/dist/types/modules/excel/xlsx/xform/drawing/ctrl-prop-xform.d.ts +1 -0
  88. package/dist/types/modules/excel/xlsx/xform/drawing/sp-xform.d.ts +18 -0
  89. package/dist/types/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +6 -1
  90. package/dist/types/modules/excel/xlsx/xform/sheet/page-setup-xform.d.ts +1 -0
  91. package/dist/types/modules/stream/base-transform.d.ts +3 -0
  92. package/dist/types/modules/stream/buffered-stream.d.ts +2 -12
  93. package/dist/types/modules/stream/index.browser.d.ts +13 -19
  94. package/dist/types/modules/stream/index.d.ts +18 -41
  95. package/dist/types/modules/stream/internal/event-utils.d.ts +17 -0
  96. package/dist/types/modules/stream/internal/type-guards.d.ts +9 -0
  97. package/dist/types/modules/stream/pull-stream.d.ts +5 -6
  98. package/dist/types/modules/stream/shared.d.ts +1 -1
  99. package/dist/types/modules/stream/streams.browser.d.ts +4 -14
  100. package/dist/types/modules/stream/streams.d.ts +4 -20
  101. package/package.json +10 -10
@@ -4,6 +4,5 @@ export type ArchiveSink = WritableStream<Uint8Array> | {
4
4
  on?(event: string, listener: (...args: any[]) => void): any;
5
5
  once?(event: string, listener: (...args: any[]) => void): any;
6
6
  };
7
- export declare function isWritableStream(value: unknown): value is WritableStream<Uint8Array>;
8
7
  export declare function pipeIterableToSink(iterable: AsyncIterable<Uint8Array>, sink: ArchiveSink): Promise<void>;
9
8
  export declare function collect(iterable: AsyncIterable<Uint8Array>): Promise<Uint8Array>;
@@ -1,8 +1,6 @@
1
1
  export type ArchiveSource = Uint8Array | ArrayBuffer | string | Blob | AsyncIterable<unknown> | ReadableStream<unknown> | {
2
2
  [Symbol.asyncIterator](): AsyncIterator<unknown>;
3
3
  };
4
- export declare function isReadableStream(value: unknown): value is ReadableStream<unknown>;
5
- export declare function isAsyncIterable(value: unknown): value is AsyncIterable<unknown>;
6
4
  export declare function toUint8ArraySync(source: Uint8Array | ArrayBuffer | string): Uint8Array;
7
5
  export declare function toUint8Array(source: Uint8Array | ArrayBuffer | string | Blob): Promise<Uint8Array>;
8
6
  export declare function toAsyncIterable(source: ArchiveSource): AsyncIterable<Uint8Array>;
@@ -0,0 +1,48 @@
1
+ export type OoxmlProblemKind = "missing-part" | "xml-malformed" | "content-types-missing" | "content-types-malformed" | "content-types-missing-default" | "content-types-missing-for-part" | "content-types-duplicate-override" | "root-rels-missing-officeDocument" | "rels-malformed" | "rels-missing-target" | "rels-duplicate-id" | "rels-empty-target" | "rels-invalid-target-path" | "rels-source-missing" | "workbook-sheet-missing-rel" | "workbook-sheet-wrong-rel-type" | "workbook-duplicate-sheetId" | "workbook-duplicate-sheet-rid" | "sheet-missing-rels" | "sheet-controls-missing-drawing" | "sheet-control-missing-rel" | "sheet-control-wrong-rel-type" | "sheet-legacyDrawing-missing-rel" | "sheet-legacyDrawing-wrong-rel-type" | "sheet-drawing-missing-rel" | "sheet-drawing-wrong-rel-type" | "sheet-comments-missing-rel" | "sheet-comments-wrong-rel-type" | "sheet-hyperlink-missing-rel" | "sheet-hyperlink-wrong-rel-type" | "sheet-tablePart-missing-rel" | "sheet-tablePart-wrong-rel-type";
2
+ export type OoxmlOrderingProblemKind = "sheet-legacyDrawing-after-controls";
3
+ export interface OoxmlValidationProblem {
4
+ kind: OoxmlProblemKind;
5
+ file?: string;
6
+ message: string;
7
+ }
8
+ export interface OoxmlOrderingValidationProblem {
9
+ kind: OoxmlOrderingProblemKind;
10
+ file?: string;
11
+ message: string;
12
+ }
13
+ export interface OoxmlValidationReport {
14
+ ok: boolean;
15
+ problems: Array<OoxmlValidationProblem | OoxmlOrderingValidationProblem>;
16
+ stats: {
17
+ entryCount: number;
18
+ xmlLikeCount: number;
19
+ relsCount: number;
20
+ };
21
+ }
22
+ export interface OoxmlValidateOptions {
23
+ /**
24
+ * Whether to check every XML-like entry (.xml, .rels, .vml) for well-formedness.
25
+ * Default: true.
26
+ */
27
+ checkXmlWellFormed?: boolean;
28
+ /**
29
+ * Whether to validate relationship targets exist (TargetMode=External ignored).
30
+ * Default: true.
31
+ */
32
+ checkRelationshipTargets?: boolean;
33
+ /**
34
+ * Whether to validate that every ContentTypes Override PartName exists.
35
+ * Default: true.
36
+ */
37
+ checkContentTypesOverrides?: boolean;
38
+ /**
39
+ * Whether to validate worksheet <controls>/<legacyDrawing> r:id wiring.
40
+ * Default: true.
41
+ */
42
+ checkWorksheetControlWiring?: boolean;
43
+ /**
44
+ * If provided, stops after this many problems.
45
+ */
46
+ maxProblems?: number;
47
+ }
48
+ export declare function validateXlsxBuffer(xlsxBuffer: Uint8Array, options?: OoxmlValidateOptions): Promise<OoxmlValidationReport>;
@@ -8,6 +8,7 @@ import type { FormCheckboxModel } from "../../../form-control.js";
8
8
  */
9
9
  declare class CtrlPropXform extends BaseXform {
10
10
  model: FormCheckboxModel;
11
+ private _checkedToXmlValue;
11
12
  get tag(): string;
12
13
  render(xmlStream: any, model?: FormCheckboxModel): void;
13
14
  /**
@@ -0,0 +1,18 @@
1
+ import { BaseXform } from "../base-xform.js";
2
+ export interface ShapeModel {
3
+ /** Drawing object id (must be unique within drawing part) */
4
+ cNvPrId: number;
5
+ /** Display name (e.g. "Check Box 1") */
6
+ name: string;
7
+ /** VML spid compat value (e.g. "_x0000_s1025") */
8
+ spid: string;
9
+ /** Text shown in the shape text box */
10
+ text: string;
11
+ /** Whether the shape should be hidden */
12
+ hidden?: boolean;
13
+ }
14
+ declare class SpXform extends BaseXform {
15
+ get tag(): string;
16
+ render(xmlStream: any, model?: ShapeModel): void;
17
+ }
18
+ export { SpXform };
@@ -5,7 +5,12 @@ interface TwoCellModel {
5
5
  tl: any;
6
6
  br: any;
7
7
  };
8
- picture: any;
8
+ picture?: any;
9
+ shape?: any;
10
+ /** Wrap the anchor in mc:AlternateContent for modern drawing clients */
11
+ alternateContent?: {
12
+ requires: string;
13
+ };
9
14
  }
10
15
  declare class TwoCellAnchorXform extends BaseCellAnchorXform {
11
16
  constructor();
@@ -19,6 +19,7 @@ interface PageSetupModel {
19
19
  }
20
20
  declare class PageSetupXform extends BaseXform {
21
21
  get tag(): string;
22
+ private _dpiToXml;
22
23
  render(xmlStream: any, model: PageSetupModel): void;
23
24
  parseOpen(node: any): boolean;
24
25
  parseText(): void;
@@ -24,6 +24,8 @@ export declare abstract class BaseTransform<TInput = Uint8Array, TOutput = Uint8
24
24
  protected _errorEmitted: boolean;
25
25
  protected _objectMode: boolean;
26
26
  protected _highWaterMark: number;
27
+ private _ending;
28
+ private _flushInProgress;
27
29
  constructor(options?: BaseTransformOptions);
28
30
  /**
29
31
  * Main transform implementation - must be overridden by subclasses
@@ -49,6 +51,7 @@ export declare abstract class BaseTransform<TInput = Uint8Array, TOutput = Uint8
49
51
  * Process next chunk in buffer
50
52
  */
51
53
  private _processNext;
54
+ private _maybeFlush;
52
55
  /**
53
56
  * Emit error only once
54
57
  */
@@ -5,14 +5,8 @@
5
5
  * Works identically in both browser and Node.js environments.
6
6
  */
7
7
  import { EventEmitter } from "./event-emitter.js";
8
- /**
9
- * Represents a chunk of data with copy capabilities
10
- */
11
- export interface DataChunk {
12
- readonly length: number;
13
- copy(target: Uint8Array, targetOffset: number, offset: number, length: number): number;
14
- toUint8Array(): Uint8Array;
15
- }
8
+ import type { BufferedStreamOptions, DataChunk } from "./types.js";
9
+ export type { BufferedStreamOptions, DataChunk } from "./types.js";
16
10
  /**
17
11
  * String chunk implementation
18
12
  */
@@ -34,10 +28,6 @@ export declare class BufferChunk implements DataChunk {
34
28
  copy(target: Uint8Array, targetOffset: number, offset: number, length: number): number;
35
29
  toUint8Array(): Uint8Array;
36
30
  }
37
- export interface BufferedStreamOptions {
38
- /** Batch size for internal read-write buffers */
39
- batchSize?: number;
40
- }
41
31
  /**
42
32
  * Browser-compatible Buffered Stream with efficient chunk management
43
33
  */
@@ -1,22 +1,16 @@
1
1
  /**
2
- * Stream Module (browser type surface)
2
+ * Stream Module (browser entry)
3
3
  *
4
- * Mirrors [src/modules/stream/index.ts] but explicitly re-exports from
5
- * ./streams.browser so we can enforce index export-surface parity.
4
+ * Mirrors the public surface of `./index.ts`, but exports the browser
5
+ * implementation from `./streams.browser`.
6
+ *
7
+ * This file is intentionally export-only (tree-shaking friendly).
6
8
  */
7
- import type { ReadableStreamOptions, WritableStreamOptions, TransformStreamOptions, DuplexStreamOptions, PullStreamOptions, BufferedStreamOptions, TransformCallback, FlushCallback, WriteCallback, DestroyCallback, IEventEmitter, IReadable, IWritable, ITransform, IDuplex, IPullStream, IBufferedStream, IPassThrough, ICollector, DataChunk, EventListener, PipelineSource, PipelineTransform, PipelineDestination, ReadWriteBufferOptions } from "./types.js";
8
- export type { ReadableStreamOptions, WritableStreamOptions, TransformStreamOptions, DuplexStreamOptions, PullStreamOptions, BufferedStreamOptions, TransformCallback, FlushCallback, WriteCallback, DestroyCallback, IEventEmitter, IReadable, IWritable, ITransform, IDuplex, IPullStream, IBufferedStream, IPassThrough, ICollector, DataChunk, EventListener, PipelineSource, PipelineTransform, PipelineDestination, ReadWriteBufferOptions };
9
- import { Readable, Writable, Transform, Duplex, PassThrough, Collector, PullStream, BufferedStream, StringChunk, BufferChunk, createReadable, createWritable, createTransform, createCollector, createPassThrough, createPullStream, createBufferedStream, createReadableFromArray, createReadableFromAsyncIterable, createReadableFromGenerator, createReadableFromPromise, createDuplex, createEmptyReadable, createNullWritable, pipeline, finished, streamToPromise, streamToUint8Array, streamToBuffer, streamToString, drainStream, copyStream, addAbortSignal, compose, finishedAll, once, promisify, isReadable, isWritable, isTransform, isDuplex, isStream, isDestroyed, isDisturbed, isErrored, getDefaultHighWaterMark, setDefaultHighWaterMark, duplexPair, normalizeWritable as Writeable, consumers, promises } from "./streams.browser.js";
10
- import type { PipelineOptions, FinishedOptions } from "./streams.browser.js";
11
- export { Readable, Writable, Transform, Duplex, PassThrough, Collector, PullStream, BufferedStream, StringChunk, BufferChunk, createReadable, createWritable, createTransform, createCollector, createPassThrough, createPullStream, createBufferedStream, createReadableFromArray, createReadableFromAsyncIterable, createReadableFromGenerator, createReadableFromPromise, createDuplex, createEmptyReadable, createNullWritable, pipeline, finished, streamToPromise, streamToUint8Array, streamToBuffer, streamToString, drainStream, copyStream, addAbortSignal, compose, finishedAll, once, promisify, isReadable, isWritable, isTransform, isDuplex, isStream, isDestroyed, isDisturbed, isErrored, getDefaultHighWaterMark, setDefaultHighWaterMark, duplexPair, Writeable, consumers, promises };
12
- export type { PipelineOptions, FinishedOptions };
13
- import { EventEmitter } from "./event-emitter.js";
14
- export { EventEmitter };
15
- import { ChunkedBuilder, TransactionalChunkedBuilder } from "./chunked-builder.js";
16
- import type { ChunkedBuilderOptions, BuilderSnapshot } from "./chunked-builder.js";
17
- export { ChunkedBuilder, TransactionalChunkedBuilder };
18
- export type { ChunkedBuilderOptions, BuilderSnapshot };
19
- import { textEncoder, textDecoder, stringToUint8Array, uint8ArrayToString, uint8ArrayEquals, uint8ArrayIndexOf, uint8ArraySlice, toUint8Array, bufferToString, concatUint8Arrays } from "./shared.js";
20
- export { textEncoder, textDecoder, stringToUint8Array, uint8ArrayToString, uint8ArrayEquals, uint8ArrayIndexOf, uint8ArraySlice, toUint8Array, bufferToString, concatUint8Arrays };
21
- import { collect, text, json, bytes, fromString, fromJSON, fromBytes, transform, filter } from "./utils.js";
22
- export { collect, text, json, bytes, fromString, fromJSON, fromBytes, transform, filter };
9
+ export type { ReadableStreamOptions, WritableStreamOptions, TransformStreamOptions, DuplexStreamOptions, PullStreamOptions, BufferedStreamOptions, TransformCallback, FlushCallback, WriteCallback, DestroyCallback, IEventEmitter, IReadable, IWritable, ITransform, IDuplex, IPullStream, IBufferedStream, IPassThrough, ICollector, DataChunk, EventListener, PipelineSource, PipelineTransform, PipelineDestination, ReadWriteBufferOptions } from "./types.js";
10
+ export { Readable, Writable, Transform, Duplex, PassThrough, Collector, PullStream, BufferedStream, StringChunk, BufferChunk, createReadable, createWritable, createTransform, createCollector, createPassThrough, createPullStream, createBufferedStream, createReadableFromArray, createReadableFromAsyncIterable, createReadableFromGenerator, createReadableFromPromise, createDuplex, createEmptyReadable, createNullWritable, pipeline, finished, streamToPromise, streamToUint8Array, streamToBuffer, streamToString, drainStream, copyStream, addAbortSignal, compose, finishedAll, once, promisify, isReadable, isWritable, isTransform, isDuplex, isStream, isDestroyed, isDisturbed, isErrored, getDefaultHighWaterMark, setDefaultHighWaterMark, duplexPair, normalizeWritable as Writeable, consumers, promises } from "./streams.browser.js";
11
+ export type { PipelineOptions, FinishedOptions } from "./streams.browser.js";
12
+ export { EventEmitter } from "./event-emitter.js";
13
+ export { ChunkedBuilder, TransactionalChunkedBuilder } from "./chunked-builder.js";
14
+ export type { ChunkedBuilderOptions, BuilderSnapshot } from "./chunked-builder.js";
15
+ export { textEncoder, textDecoder, stringToUint8Array, uint8ArrayToString, uint8ArrayEquals, uint8ArrayIndexOf, uint8ArraySlice, toUint8Array, bufferToString, concatUint8Arrays } from "./shared.js";
16
+ export { collect, text, json, bytes, fromString, fromJSON, fromBytes, transform, filter } from "./utils.js";
@@ -1,49 +1,26 @@
1
1
  /**
2
- * Stream Module
2
+ * Stream Module (Node.js entry)
3
3
  *
4
- * Native stream implementations for Node.js and Browser.
4
+ * Public entrypoint for stream utilities and classes.
5
5
  *
6
- * - Node.js: Uses native `stream` module (Readable, Writable, Transform, Duplex, PassThrough)
7
- * - Browser: Uses Web Streams API (ReadableStream, WritableStream, TransformStream)
8
- *
9
- * Both implementations provide the same API for cross-platform compatibility.
6
+ * Notes:
7
+ * - This file is intentionally export-only (tree-shaking friendly).
8
+ * - Browser builds should import from `@stream/index.browser`.
10
9
  *
11
10
  * @example
12
- * ```typescript
13
- * import {
14
- * Readable,
15
- * Writable,
16
- * Transform,
17
- * Duplex,
18
- * PassThrough,
19
- * pipeline,
20
- * createTransform,
21
- * streamToUint8Array
22
- * } from './modules/stream.js';
23
- *
24
- * // Create a transform stream
25
- * const uppercase = createTransform<Uint8Array, Uint8Array>(chunk => {
26
- * const text = new TextDecoder().decode(chunk);
27
- * return new TextEncoder().encode(text.toUpperCase());
28
- * });
11
+ * ```ts
12
+ * import { pipeline, createTransform, createCollector } from "./index.js";
29
13
  *
30
- * // Use pipeline for clean stream composition
31
- * await pipeline(readable, uppercase, writable);
14
+ * const upper = createTransform<Uint8Array, Uint8Array>(chunk => chunk);
15
+ * const out = createCollector<Uint8Array>();
16
+ * await pipeline(source, upper, out);
32
17
  * ```
33
18
  */
34
- import type { ReadableStreamOptions, WritableStreamOptions, TransformStreamOptions, DuplexStreamOptions, PullStreamOptions, BufferedStreamOptions, TransformCallback, FlushCallback, WriteCallback, DestroyCallback, IEventEmitter, IReadable, IWritable, ITransform, IDuplex, IPullStream, IBufferedStream, IPassThrough, ICollector, DataChunk, EventListener, PipelineSource, PipelineTransform, PipelineDestination, ReadWriteBufferOptions } from "./types.js";
35
- export type { ReadableStreamOptions, WritableStreamOptions, TransformStreamOptions, DuplexStreamOptions, PullStreamOptions, BufferedStreamOptions, TransformCallback, FlushCallback, WriteCallback, DestroyCallback, IEventEmitter, IReadable, IWritable, ITransform, IDuplex, IPullStream, IBufferedStream, IPassThrough, ICollector, DataChunk, EventListener, PipelineSource, PipelineTransform, PipelineDestination, ReadWriteBufferOptions };
36
- import { Readable, Writable, Transform, Duplex, PassThrough, Collector, PullStream, BufferedStream, StringChunk, BufferChunk, createReadable, createWritable, createTransform, createCollector, createPassThrough, createPullStream, createBufferedStream, createReadableFromArray, createReadableFromAsyncIterable, createReadableFromGenerator, createReadableFromPromise, createDuplex, createEmptyReadable, createNullWritable, pipeline, finished, streamToPromise, streamToUint8Array, streamToBuffer, streamToString, drainStream, copyStream, addAbortSignal, compose, finishedAll, once, promisify, isReadable, isWritable, isTransform, isDuplex, isStream, isDestroyed, isDisturbed, isErrored, getDefaultHighWaterMark, setDefaultHighWaterMark, duplexPair, normalizeWritable as Writeable, consumers, promises } from "./streams.js";
37
- import type { PipelineOptions, FinishedOptions } from "./streams.js";
38
- export { Readable, Writable, Transform, Duplex, PassThrough, Collector, PullStream, BufferedStream, StringChunk, BufferChunk, createReadable, createWritable, createTransform, createCollector, createPassThrough, createPullStream, createBufferedStream, createReadableFromArray, createReadableFromAsyncIterable, createReadableFromGenerator, createReadableFromPromise, createDuplex, createEmptyReadable, createNullWritable, pipeline, finished, streamToPromise, streamToUint8Array, streamToBuffer, streamToString, drainStream, copyStream, addAbortSignal, compose, finishedAll, once, promisify, isReadable, isWritable, isTransform, isDuplex, isStream, isDestroyed, isDisturbed, isErrored, getDefaultHighWaterMark, setDefaultHighWaterMark, duplexPair, Writeable, consumers, promises };
39
- export type { PipelineOptions, FinishedOptions };
40
- import { EventEmitter } from "./event-emitter.js";
41
- export { EventEmitter };
42
- import { ChunkedBuilder, TransactionalChunkedBuilder } from "./chunked-builder.js";
43
- import type { ChunkedBuilderOptions, BuilderSnapshot } from "./chunked-builder.js";
44
- export { ChunkedBuilder, TransactionalChunkedBuilder };
45
- export type { ChunkedBuilderOptions, BuilderSnapshot };
46
- import { textEncoder, textDecoder, stringToUint8Array, uint8ArrayToString, uint8ArrayEquals, uint8ArrayIndexOf, uint8ArraySlice, toUint8Array, bufferToString, concatUint8Arrays } from "./shared.js";
47
- export { textEncoder, textDecoder, stringToUint8Array, uint8ArrayToString, uint8ArrayEquals, uint8ArrayIndexOf, uint8ArraySlice, toUint8Array, bufferToString, concatUint8Arrays };
48
- import { collect, text, json, bytes, fromString, fromJSON, fromBytes, transform, filter } from "./utils.js";
49
- export { collect, text, json, bytes, fromString, fromJSON, fromBytes, transform, filter };
19
+ export type { ReadableStreamOptions, WritableStreamOptions, TransformStreamOptions, DuplexStreamOptions, PullStreamOptions, BufferedStreamOptions, TransformCallback, FlushCallback, WriteCallback, DestroyCallback, IEventEmitter, IReadable, IWritable, ITransform, IDuplex, IPullStream, IBufferedStream, IPassThrough, ICollector, DataChunk, EventListener, PipelineSource, PipelineTransform, PipelineDestination, ReadWriteBufferOptions } from "./types.js";
20
+ export { Readable, Writable, Transform, Duplex, PassThrough, Collector, PullStream, BufferedStream, StringChunk, BufferChunk, createReadable, createWritable, createTransform, createCollector, createPassThrough, createPullStream, createBufferedStream, createReadableFromArray, createReadableFromAsyncIterable, createReadableFromGenerator, createReadableFromPromise, createDuplex, createEmptyReadable, createNullWritable, pipeline, finished, streamToPromise, streamToUint8Array, streamToBuffer, streamToString, drainStream, copyStream, addAbortSignal, compose, finishedAll, once, promisify, isReadable, isWritable, isTransform, isDuplex, isStream, isDestroyed, isDisturbed, isErrored, getDefaultHighWaterMark, setDefaultHighWaterMark, duplexPair, normalizeWritable as Writeable, consumers, promises } from "./streams.js";
21
+ export type { PipelineOptions, FinishedOptions } from "./streams.js";
22
+ export { EventEmitter } from "./event-emitter.js";
23
+ export { ChunkedBuilder, TransactionalChunkedBuilder } from "./chunked-builder.js";
24
+ export type { ChunkedBuilderOptions, BuilderSnapshot } from "./chunked-builder.js";
25
+ export { textEncoder, textDecoder, stringToUint8Array, uint8ArrayToString, uint8ArrayEquals, uint8ArrayIndexOf, uint8ArraySlice, toUint8Array, bufferToString, concatUint8Arrays } from "./shared.js";
26
+ export { collect, text, json, bytes, fromString, fromJSON, fromBytes, transform, filter } from "./utils.js";
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Small event utilities for Node-style emitters.
3
+ *
4
+ * Prefer keeping this separate from the main stream implementation so other
5
+ * modules (e.g. archive) can reuse it without pulling in the whole stream API.
6
+ */
7
+ type NodeStyleEmitter = {
8
+ on?: (event: string, listener: (...args: any[]) => void) => any;
9
+ once?: (event: string, listener: (...args: any[]) => void) => any;
10
+ off?: (event: string, listener: (...args: any[]) => void) => any;
11
+ removeListener?: (event: string, listener: (...args: any[]) => void) => any;
12
+ };
13
+ /**
14
+ * Resolve when an emitter fires `event`, reject on `error`.
15
+ */
16
+ export declare function onceEvent(emitter: NodeStyleEmitter, event: string): Promise<void>;
17
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Lightweight runtime type guards shared across modules.
3
+ *
4
+ * Keep this file dependency-free to maximize deduping in bundled builds.
5
+ */
6
+ export declare function isReadableStream(value: unknown): value is ReadableStream<unknown>;
7
+ export declare function isWritableStream(value: unknown): value is WritableStream<unknown>;
8
+ export declare function isAsyncIterable(value: unknown): value is AsyncIterable<unknown>;
9
+ export declare function isTransformStream(value: unknown): value is TransformStream<unknown, unknown>;
@@ -5,16 +5,15 @@
5
5
  * Works identically in both browser and Node.js environments.
6
6
  */
7
7
  import { EventEmitter } from "./event-emitter.js";
8
- export interface PullStreamOptions {
9
- /** Enable object mode */
10
- objectMode?: boolean;
11
- }
8
+ import type { PullStreamOptions } from "./types.js";
9
+ export type { PullStreamOptions } from "./types.js";
12
10
  /**
13
11
  * Browser-compatible Pull Stream - Read data from buffer on demand with pattern matching
14
12
  */
15
13
  export declare class PullStream extends EventEmitter {
16
- private _bufferChunks;
17
- private _totalLength;
14
+ private _buffer;
15
+ private _bufferReadIndex;
16
+ private _bufferWriteIndex;
18
17
  protected finished: boolean;
19
18
  protected _match?: number;
20
19
  private _destroyed;
@@ -31,7 +31,7 @@ export declare function uint8ArrayToString(arr: Uint8Array, encoding?: string):
31
31
  /**
32
32
  * Concatenate multiple Uint8Arrays efficiently
33
33
  */
34
- export declare function concatUint8Arrays(arrays: readonly Uint8Array[]): Uint8Array;
34
+ export declare function concatUint8Arrays(arrays: readonly Uint8Array[], totalLength?: number): Uint8Array;
35
35
  /**
36
36
  * Compare two Uint8Arrays for equality
37
37
  */
@@ -10,11 +10,11 @@
10
10
  * - Safari >= 14.1
11
11
  * - Edge >= 89
12
12
  */
13
- import type { TransformStreamOptions, ReadableStreamOptions, WritableStreamOptions, DuplexStreamOptions, PullStreamOptions, BufferedStreamOptions, DataChunk, ICollector, IDuplex, IEventEmitter, IPassThrough, IReadable, ITransform, IWritable, PipelineStreamLike, ReadableLike, WritableLike } from "./types.js";
13
+ import type { TransformStreamOptions, ReadableStreamOptions, WritableStreamOptions, DuplexStreamOptions, PullStreamOptions, BufferedStreamOptions, ICollector, IDuplex, IEventEmitter, IPassThrough, IReadable, ITransform, IWritable, PipelineStreamLike, ReadableLike, WritableLike } from "./types.js";
14
14
  import type { Writable as NodeWritable } from "stream";
15
15
  import { EventEmitter } from "./event-emitter.js";
16
- import { PullStream as StandalonePullStream, type PullStreamOptions as StandalonePullStreamOptions } from "./pull-stream.js";
17
- import { BufferedStream as StandaloneBufferedStream, StringChunk as StandaloneStringChunk, BufferChunk as StandaloneBufferChunk } from "./buffered-stream.js";
16
+ import { PullStream } from "./pull-stream.js";
17
+ import { BufferedStream, BufferChunk, StringChunk } from "./buffered-stream.js";
18
18
  /**
19
19
  * A wrapper around Web ReadableStream that provides Node.js-like API
20
20
  */
@@ -667,16 +667,7 @@ export declare class Collector<T = Uint8Array> extends Writable<T> {
667
667
  toString(): string;
668
668
  get isFinished(): boolean;
669
669
  }
670
- export declare class PullStream extends StandalonePullStream {
671
- constructor(options?: PullStreamOptions | StandalonePullStreamOptions);
672
- }
673
- export declare class StringChunk extends StandaloneStringChunk implements DataChunk {
674
- }
675
- export declare class BufferChunk extends StandaloneBufferChunk implements DataChunk {
676
- }
677
- export declare class BufferedStream extends StandaloneBufferedStream {
678
- constructor(options?: BufferedStreamOptions);
679
- }
670
+ export { PullStream, BufferedStream, StringChunk, BufferChunk };
680
671
  /**
681
672
  * Create a readable stream with custom read implementation
682
673
  */
@@ -933,4 +924,3 @@ export declare const promises: {
933
924
  pipeline: typeof pipeline;
934
925
  finished: typeof finished;
935
926
  };
936
- export {};
@@ -5,9 +5,9 @@
5
5
  * Provides Readable, Writable, Transform, Duplex, and PassThrough streams.
6
6
  */
7
7
  import { Readable, Writable as NodeWritable, Transform, Duplex, PassThrough } from "stream";
8
- import type { TransformStreamOptions, ReadableStreamOptions, WritableStreamOptions, DuplexStreamOptions, PullStreamOptions, BufferedStreamOptions, DataChunk, ICollector, IDuplex, IEventEmitter, IPassThrough, IReadable, ITransform, IWritable, PipelineStreamLike, ReadableLike, WritableLike } from "./types.js";
9
- import { BufferedStream as StandaloneBufferedStream, StringChunk as StandaloneStringChunk, BufferChunk as StandaloneBufferChunk } from "./buffered-stream.js";
10
- import { PullStream as StandalonePullStream } from "./pull-stream.js";
8
+ import type { TransformStreamOptions, ReadableStreamOptions, WritableStreamOptions, DuplexStreamOptions, PullStreamOptions, BufferedStreamOptions, ICollector, IDuplex, IEventEmitter, IPassThrough, IReadable, ITransform, IWritable, PipelineStreamLike, ReadableLike, WritableLike } from "./types.js";
9
+ import { BufferedStream, BufferChunk, StringChunk } from "./buffered-stream.js";
10
+ import { PullStream } from "./pull-stream.js";
11
11
  /**
12
12
  * Extended Writable options that match browser API
13
13
  * Supports wrapping an existing Node.js stream
@@ -30,6 +30,7 @@ export declare class Writable<T = Uint8Array> extends NodeWritable {
30
30
  constructor(options?: WritableOptions<T>);
31
31
  }
32
32
  export { Readable, Transform, Duplex, PassThrough };
33
+ export { PullStream, BufferedStream, StringChunk, BufferChunk };
33
34
  /**
34
35
  * Normalize a user-provided writable into a Node.js-compatible Writable.
35
36
  *
@@ -130,27 +131,10 @@ export declare class Collector<T = Uint8Array> extends Writable {
130
131
  * Create a collector stream
131
132
  */
132
133
  export declare function createCollector<T = Uint8Array>(options?: WritableStreamOptions): ICollector<T>;
133
- export declare class PullStream extends StandalonePullStream {
134
- }
135
134
  /**
136
135
  * Create a pull stream
137
136
  */
138
137
  export declare function createPullStream(options?: PullStreamOptions): PullStream;
139
- /**
140
- * String chunk implementation
141
- */
142
- export declare class StringChunk extends StandaloneStringChunk implements DataChunk {
143
- }
144
- /**
145
- * Buffer chunk implementation
146
- */
147
- export declare class BufferChunk extends StandaloneBufferChunk implements DataChunk {
148
- }
149
- /**
150
- * Buffered stream with efficient chunk management
151
- */
152
- export declare class BufferedStream extends StandaloneBufferedStream {
153
- }
154
138
  /**
155
139
  * Create a buffered stream
156
140
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cj-tech-master/excelts",
3
- "version": "4.2.1-canary.20260111102127.f808a37",
3
+ "version": "4.2.1-canary.20260112134913.a3cecdd",
4
4
  "description": "TypeScript Excel Workbook Manager - Read and Write xlsx and csv Files.",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -90,23 +90,23 @@
90
90
  ],
91
91
  "devDependencies": {
92
92
  "@eslint/js": "^9.39.2",
93
- "@types/node": "^25.0.3",
93
+ "@types/node": "^25.0.6",
94
94
  "@typescript-eslint/eslint-plugin": "^8.52.0",
95
95
  "@typescript-eslint/parser": "^8.52.0",
96
- "@typescript/native-preview": "^7.0.0-dev.20260108.1",
97
- "@vitest/browser": "^4.0.16",
98
- "@vitest/browser-playwright": "^4.0.16",
99
- "@vitest/ui": "^4.0.16",
96
+ "@typescript/native-preview": "^7.0.0-dev.20260112.1",
97
+ "@vitest/browser": "^4.0.17",
98
+ "@vitest/browser-playwright": "^4.0.17",
99
+ "@vitest/ui": "^4.0.17",
100
100
  "concurrently": "^9.2.1",
101
101
  "cross-env": "^10.1.0",
102
102
  "eslint": "^9.39.2",
103
103
  "eslint-config-prettier": "^10.1.8",
104
104
  "eslint-import-resolver-typescript": "^4.4.4",
105
105
  "eslint-plugin-import-x": "^4.16.1",
106
- "eslint-plugin-oxlint": "^1.38.0",
106
+ "eslint-plugin-oxlint": "^1.39.0",
107
107
  "eslint-plugin-unused-imports": "^4.3.0",
108
108
  "husky": "^9.1.7",
109
- "oxlint": "^1.38.0",
109
+ "oxlint": "^1.39.0",
110
110
  "playwright": "^1.57.0",
111
111
  "prettier": "^3.7.4",
112
112
  "rimraf": "^6.1.2",
@@ -114,8 +114,8 @@
114
114
  "rollup-plugin-visualizer": "^6.0.5",
115
115
  "typescript": "^5.9.3",
116
116
  "typescript-eslint": "^8.52.0",
117
- "vite-tsconfig-paths": "^6.0.3",
118
- "vitest": "^4.0.16"
117
+ "vite-tsconfig-paths": "^6.0.4",
118
+ "vitest": "^4.0.17"
119
119
  },
120
120
  "scripts": {
121
121
  "example": "node scripts/run-examples.ts",