@a3s-lab/office 0.12.0 → 0.13.1
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/README.md +112 -7
- package/dist/0~1403.js +20 -12
- package/dist/0~2805.js +241 -241
- package/dist/0~4980.js +1 -1
- package/dist/0~5050.js +1 -20
- package/dist/0~5093.js +547 -547
- package/dist/0~6090.js +63 -4
- package/dist/0~7048.js +31 -29
- package/dist/0~document-editor.js +694 -90
- package/dist/0~pdf-viewer.js +41 -10
- package/dist/0~presentation-editor.js +8 -6
- package/dist/0~spreadsheet-editor.js +11892 -9682
- package/dist/0~work-document-import-worker-client.js +237 -0
- package/dist/0~work-docx-export.js +1 -1
- package/dist/0~work-docx-import.js +1 -1
- package/dist/0~work-docx-large-document-import.js +559 -0
- package/dist/0~work-office-diagnostics.js +46 -32
- package/dist/4104.js +5070 -3112
- package/dist/432.js +51 -7
- package/dist/4476.js +201 -7
- package/dist/5184.js +24 -2
- package/dist/{8928.js → 6282.js} +2338 -93
- package/dist/8715.js +895 -888
- package/dist/9356.js +3 -1
- package/dist/core.js +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/features/work/editors/document-editor-support.d.ts +1 -9
- package/dist/internal/features/work/editors/document-external-content.d.ts +1 -1
- package/dist/internal/features/work/editors/office-menu-keyboard.d.ts +1 -0
- package/dist/internal/features/work/editors/presentation-slide-canvas.d.ts +3 -1
- package/dist/internal/features/work/editors/presentation-slide-thumbnail.d.ts +3 -2
- package/dist/internal/features/work/editors/presentation-thumbnail-rail.d.ts +2 -1
- package/dist/internal/features/work/editors/presentation-workspace.d.ts +2 -1
- package/dist/internal/features/work/editors/spreadsheet-border-ribbon.d.ts +5 -0
- package/dist/internal/features/work/editors/spreadsheet-calculation-projection.d.ts +10 -0
- package/dist/internal/features/work/editors/spreadsheet-cell-border-command.d.ts +3 -0
- package/dist/internal/features/work/editors/spreadsheet-cell-border-per-cell.d.ts +5 -0
- package/dist/internal/features/work/editors/spreadsheet-cell-border.d.ts +28 -0
- package/dist/internal/features/work/editors/spreadsheet-cell-fill-command.d.ts +3 -0
- package/dist/internal/features/work/editors/spreadsheet-cell-fill.d.ts +12 -0
- package/dist/internal/features/work/editors/spreadsheet-cell-range.d.ts +14 -0
- package/dist/internal/features/work/editors/spreadsheet-cell-style-command.d.ts +3 -0
- package/dist/internal/features/work/editors/spreadsheet-cell-style-ribbon.d.ts +9 -0
- package/dist/internal/features/work/editors/spreadsheet-cell-style.d.ts +41 -0
- package/dist/internal/features/work/editors/spreadsheet-command-catalog.d.ts +293 -0
- package/dist/internal/features/work/editors/spreadsheet-command-controller.d.ts +10 -4
- package/dist/internal/features/work/editors/spreadsheet-editor-ribbon.d.ts +3 -1
- package/dist/internal/features/work/editors/spreadsheet-editor-support.d.ts +8 -2
- package/dist/internal/features/work/editors/spreadsheet-home-format-ribbon.d.ts +10 -0
- package/dist/internal/features/work/editors/spreadsheet-in-place-workbook-sync.d.ts +10 -0
- package/dist/internal/features/work/editors/spreadsheet-number-format.d.ts +15 -3
- package/dist/internal/features/work/editors/spreadsheet-operation-projection.d.ts +14 -0
- package/dist/internal/features/work/editors/spreadsheet-structure-selection.d.ts +7 -0
- package/dist/internal/features/work/editors/use-document-pagination.d.ts +5 -0
- package/dist/internal/features/work/editors/use-presentation-design-commands.d.ts +2 -1
- package/dist/internal/features/work/editors/use-spreadsheet-workbook-sync.d.ts +2 -1
- package/dist/internal/features/work/spreadsheet-history-value.d.ts +1 -0
- package/dist/internal/features/work/spreadsheet-sparse.d.ts +6 -1
- package/dist/internal/features/work/work-document-chunk-geometry.d.ts +28 -0
- package/dist/internal/features/work/work-document-chunk-node.d.ts +23 -0
- package/dist/internal/features/work/work-document-extensions.d.ts +1 -0
- package/dist/internal/features/work/work-document-html-fingerprint.d.ts +15 -0
- package/dist/internal/features/work/work-document-import-worker-client.d.ts +13 -0
- package/dist/internal/features/work/work-document-import-worker-protocol.d.ts +36 -0
- package/dist/internal/features/work/work-document-import.worker.d.ts +1 -0
- package/dist/internal/features/work/work-document-incremental-layout.d.ts +1 -1
- package/dist/internal/features/work/work-document-integrity-index.d.ts +14 -0
- package/dist/internal/features/work/work-document-lazy-block.d.ts +3 -0
- package/dist/internal/features/work/work-document-lazy-html.d.ts +21 -0
- package/dist/internal/features/work/work-document-lazy-model.d.ts +29 -0
- package/dist/internal/features/work/work-document-lazy-pagination-measurement.d.ts +3 -0
- package/dist/internal/features/work/work-document-lazy-preview.d.ts +21 -0
- package/dist/internal/features/work/work-document-lazy-update.d.ts +14 -0
- package/dist/internal/features/work/work-document-model.d.ts +18 -2
- package/dist/internal/features/work/work-document-page-surface-registry.d.ts +16 -0
- package/dist/internal/features/work/work-document-pagination-dom.d.ts +1 -0
- package/dist/internal/features/work/work-document-pagination-types.d.ts +1 -0
- package/dist/internal/features/work/work-document-pagination.d.ts +1 -1
- package/dist/internal/features/work/work-document-text-statistics.d.ts +25 -0
- package/dist/internal/features/work/work-document-windowing.d.ts +23 -0
- package/dist/internal/features/work/work-docx-large-document-import.d.ts +35 -0
- package/dist/internal/features/work/work-docx-large-document-parser.d.ts +29 -0
- package/dist/internal/features/work/work-file-import.d.ts +5 -0
- package/dist/internal/features/work/work-file-io.d.ts +3 -3
- package/dist/internal/features/work/work-file-kind.d.ts +5 -0
- package/dist/internal/features/work/work-office-diagnostics.d.ts +10 -1
- package/dist/internal/features/work/work-ooxml-package.d.ts +8 -0
- package/dist/internal/features/work/work-presentation-layouts.d.ts +7 -1
- package/dist/internal/features/work/work-repository.d.ts +1 -0
- package/dist/internal/features/work/work-spreadsheet-compatibility-summary.d.ts +10 -0
- package/dist/internal/features/work/work-spreadsheet-file-export.d.ts +2 -0
- package/dist/internal/features/work/work-spreadsheet-file-import.d.ts +3 -0
- package/dist/internal/features/work/work-spreadsheet-import-diagnostics.d.ts +2 -0
- package/dist/internal/features/work/work-spreadsheet-import-worker-client.d.ts +6 -0
- package/dist/internal/features/work/work-spreadsheet-import-worker-protocol.d.ts +32 -0
- package/dist/internal/features/work/work-spreadsheet-import.worker.d.ts +1 -0
- package/dist/internal/features/work/work-spreadsheet-matrix-profile.d.ts +64 -0
- package/dist/internal/features/work/work-spreadsheet-package-scan-worker-client.d.ts +6 -0
- package/dist/internal/features/work/work-spreadsheet-package-scan-worker-protocol.d.ts +49 -0
- package/dist/internal/features/work/work-spreadsheet-package-scan.worker.d.ts +1 -0
- package/dist/internal/features/work/work-xlsx-cell-borders.d.ts +25 -0
- package/dist/internal/features/work/work-xlsx-cell-style-writer.d.ts +21 -0
- package/dist/internal/features/work/work-xlsx-cell-style-xml.d.ts +17 -0
- package/dist/internal/features/work/work-xlsx-cell-styles.d.ts +13 -0
- package/dist/internal/features/work/work-xlsx-colors.d.ts +6 -0
- package/dist/internal/features/work/work-xlsx-formula-diagnostics.d.ts +3 -1
- package/dist/internal/features/work/work-xlsx-formulas.d.ts +2 -1
- package/dist/internal/features/work/work-xlsx-interop.d.ts +8 -5
- package/dist/internal/features/work/work-xlsx-pivot-diagnostics.d.ts +2 -1
- package/dist/internal/features/work/work-xlsx-plain-fast-path.d.ts +54 -0
- package/dist/internal/features/work/work-xlsx-style-gate.d.ts +1 -0
- package/dist/internal/features/work/work-xlsx-worksheet-scan.d.ts +13 -0
- package/dist/internal/features/work/work-xlsx-worksheet.d.ts +12 -0
- package/dist/office-kernel.wasm +0 -0
- package/dist/office-kernel.worker.js +31 -29
- package/dist/react.d.ts +7 -1
- package/dist/styles.css +557 -3
- package/dist/work-document-import.worker.js +558 -0
- package/dist/work-spreadsheet-import.worker.js +24745 -0
- package/dist/work-spreadsheet-import.worker.js.LICENSE.txt +3 -0
- package/dist/work-spreadsheet-package-scan.worker.js +4161 -0
- package/dist/work-spreadsheet-package-scan.worker.js.LICENSE.txt +11 -0
- package/docs/latest/en/browser-editor-architecture.md +351 -15
- package/package.json +23 -3
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { WorkDocumentNode } from './work-types';
|
|
2
|
+
export declare const DOCUMENT_WINDOW_BLOCK_SIZE = 128;
|
|
3
|
+
export declare const DOCUMENT_WINDOW_BLOCK_THRESHOLD = 2048;
|
|
4
|
+
export declare const DOCUMENT_TABLE_WINDOW_ROW_SIZE = 16;
|
|
5
|
+
export declare const DOCUMENT_TABLE_WINDOW_ROW_THRESHOLD = 512;
|
|
6
|
+
export interface DocumentWindowingOptions {
|
|
7
|
+
blockSize: number;
|
|
8
|
+
blockThreshold: number;
|
|
9
|
+
tableRowSize: number;
|
|
10
|
+
tableRowThreshold: number;
|
|
11
|
+
trustedIntegrityFeatures?: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Adds stable semantic chunks to large section bodies. The complete
|
|
15
|
+
* ProseMirror model remains in memory, while the chunk node view can omit
|
|
16
|
+
* descendants outside the visible viewport without changing positions.
|
|
17
|
+
*/
|
|
18
|
+
export declare function windowDocumentModel(root: WorkDocumentNode, requested?: Partial<DocumentWindowingOptions>): WorkDocumentNode;
|
|
19
|
+
/** Restores the canonical schema used by controlled HTML and DOCX export. */
|
|
20
|
+
export declare function materializeWindowedDocumentModel(root: WorkDocumentNode): WorkDocumentNode;
|
|
21
|
+
export declare function documentModelUsesWindowing(root: WorkDocumentNode): boolean;
|
|
22
|
+
export declare function estimateDocumentNodeHeight(node: WorkDocumentNode): number;
|
|
23
|
+
export declare function estimateDocumentTableRowHeight(row: WorkDocumentNode): number;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type LargeSimpleDocxParseOptions, type LargeSimpleDocxStreamResult, type LargeSimpleDocxTableRow } from './work-docx-large-document-parser';
|
|
2
|
+
import type { OoxmlPackage } from './work-ooxml-package';
|
|
3
|
+
import type { WorkCompatibilityReport, WorkDocumentContent, WorkDocumentNode, WorkDocumentSectionLayout } from './work-types';
|
|
4
|
+
export { LARGE_SIMPLE_DOCX_MINIMUM_LOGICAL_BLOCKS, simpleDocxXmlIsEligibleForLargeImport, streamLargeSimpleDocxDocumentXml, } from './work-docx-large-document-parser';
|
|
5
|
+
export type { LargeSimpleDocxParseOptions, LargeSimpleDocxStreamResult, LargeSimpleDocxStreamSink, } from './work-docx-large-document-parser';
|
|
6
|
+
export interface LargeSimpleDocxParseResult {
|
|
7
|
+
html: string;
|
|
8
|
+
layout: WorkDocumentSectionLayout;
|
|
9
|
+
logicalBlockCount: number;
|
|
10
|
+
paragraphCount: number;
|
|
11
|
+
root: WorkDocumentNode;
|
|
12
|
+
tableRowCount: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function parseLargeSimpleDocxPackage(archive: OoxmlPackage, options?: LargeSimpleDocxParseOptions): Promise<LargeSimpleDocxParseResult | null>;
|
|
15
|
+
export declare function largeSimpleDocxPackageIsCandidate(archive: OoxmlPackage): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* A deliberately narrow fast path for huge, plain WordprocessingML bodies.
|
|
18
|
+
* Any rich feature routes to the complete Mammoth plus OOXML marker pipeline.
|
|
19
|
+
*/
|
|
20
|
+
export declare function parseLargeSimpleDocxDocumentXml(source: string, options?: LargeSimpleDocxParseOptions): LargeSimpleDocxParseResult | null;
|
|
21
|
+
export declare function createLargeSimpleDocxParseResult(streamed: LargeSimpleDocxStreamResult, blocks: WorkDocumentNode[], html: string[], options?: LargeSimpleDocxParseOptions): LargeSimpleDocxParseResult;
|
|
22
|
+
export declare function createLargeSimpleDocxTable(rows: WorkDocumentNode[], htmlRows: string[]): {
|
|
23
|
+
html: string;
|
|
24
|
+
node: WorkDocumentNode;
|
|
25
|
+
};
|
|
26
|
+
export declare function createLargeSimpleDocxParagraph(text: string): {
|
|
27
|
+
html: string;
|
|
28
|
+
node: WorkDocumentNode;
|
|
29
|
+
};
|
|
30
|
+
export declare function createLargeSimpleDocxTableRow(row: LargeSimpleDocxTableRow): {
|
|
31
|
+
html: string;
|
|
32
|
+
node: WorkDocumentNode;
|
|
33
|
+
};
|
|
34
|
+
export declare function largeSimpleDocxContent(result: LargeSimpleDocxParseResult): WorkDocumentContent;
|
|
35
|
+
export declare function largeSimpleDocxCompatibilityReport(file: File, result: LargeSimpleDocxParseResult): WorkCompatibilityReport;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { DocumentWindowingOptions } from './work-document-windowing';
|
|
2
|
+
import type { WorkDocumentSectionLayout } from './work-types';
|
|
3
|
+
export declare const LARGE_SIMPLE_DOCX_MINIMUM_LOGICAL_BLOCKS = 20000;
|
|
4
|
+
export interface LargeSimpleDocxParseOptions {
|
|
5
|
+
minimumLogicalBlocks?: number;
|
|
6
|
+
windowing?: Partial<DocumentWindowingOptions>;
|
|
7
|
+
}
|
|
8
|
+
export interface LargeSimpleDocxStreamResult {
|
|
9
|
+
layout: WorkDocumentSectionLayout;
|
|
10
|
+
logicalBlockCount: number;
|
|
11
|
+
paragraphCount: number;
|
|
12
|
+
tableRowCount: number;
|
|
13
|
+
}
|
|
14
|
+
export interface LargeSimpleDocxStreamSink {
|
|
15
|
+
paragraph: (text: string) => void;
|
|
16
|
+
tableEnd: () => void;
|
|
17
|
+
tableRow: (row: LargeSimpleDocxTableRow) => void;
|
|
18
|
+
tableStart: () => void;
|
|
19
|
+
}
|
|
20
|
+
export interface LargeSimpleDocxTableRow {
|
|
21
|
+
cellParagraphCounts: readonly number[];
|
|
22
|
+
texts: readonly string[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Parses logical blocks into a sink so a Worker can stream bounded batches
|
|
26
|
+
* instead of structured-cloning one complete 100,000-row object graph.
|
|
27
|
+
*/
|
|
28
|
+
export declare function streamLargeSimpleDocxDocumentXml(source: string, options: LargeSimpleDocxParseOptions, sink: LargeSimpleDocxStreamSink): LargeSimpleDocxStreamResult | null;
|
|
29
|
+
export declare function simpleDocxXmlIsEligibleForLargeImport(source: string, minimumLogicalBlocks?: number): boolean;
|
|
@@ -7,12 +7,17 @@ export interface WorkFileImportProgress {
|
|
|
7
7
|
totalBytes: number;
|
|
8
8
|
}
|
|
9
9
|
export interface WorkFileImportOptions {
|
|
10
|
+
/** Reuses a host-reserved identity so an editor shell can mount in parallel. */
|
|
11
|
+
artifactId?: string;
|
|
12
|
+
/** Reuses host-reserved worksheet identities during a spreadsheet import. */
|
|
13
|
+
spreadsheetSheetIds?: readonly string[];
|
|
10
14
|
signal?: AbortSignal;
|
|
11
15
|
onProgress?: (progress: WorkFileImportProgress) => void;
|
|
12
16
|
}
|
|
13
17
|
export interface WorkFileImportContext {
|
|
14
18
|
bytes: ArrayBuffer;
|
|
15
19
|
controller: WorkFileImportController;
|
|
20
|
+
spreadsheetSheetIds?: readonly string[];
|
|
16
21
|
}
|
|
17
22
|
export declare class WorkFileImportController {
|
|
18
23
|
private readonly options;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { WORK_IMPORT_ACCEPT } from './work-file-contract';
|
|
2
1
|
import { type WorkFileImportOptions } from './work-file-import';
|
|
3
2
|
import { type WorkPresentationExportOptions } from './work-presentation-file-io';
|
|
4
|
-
import { type WorkArtifact
|
|
3
|
+
import { type WorkArtifact } from './work-types';
|
|
4
|
+
export { WORK_IMPORT_ACCEPT } from './work-file-contract';
|
|
5
5
|
export type WorkArtifactExportOptions = WorkPresentationExportOptions;
|
|
6
6
|
export declare function importWorkFile(file: File, options?: WorkFileImportOptions): Promise<WorkArtifact>;
|
|
7
7
|
export declare function exportWorkArtifact(artifact: WorkArtifact, options?: WorkArtifactExportOptions): Promise<void>;
|
|
8
8
|
export declare function createWorkArtifactBlob(artifact: WorkArtifact, options?: WorkArtifactExportOptions): Promise<Blob>;
|
|
9
|
-
export
|
|
9
|
+
export { workKindForFile } from './work-file-kind';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { WorkArtifactKind } from './work-types';
|
|
2
|
+
export declare const WORK_SUPPORTED_FILE_EXTENSIONS: readonly string[];
|
|
3
|
+
export declare function workFileExtension(fileName: string): string;
|
|
4
|
+
export declare function workKindForFileName(fileName: string): WorkArtifactKind | null;
|
|
5
|
+
export declare function workKindForFile(file: Pick<File, 'name'>): WorkArtifactKind | null;
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import type { WorkBook } from 'xlsx';
|
|
2
2
|
import { OoxmlPackage } from './work-ooxml-package';
|
|
3
|
+
import { type SpreadsheetWorksheetCompatibilitySummary } from './work-spreadsheet-compatibility-summary';
|
|
3
4
|
import type { WorkCompatibilityReport } from './work-types';
|
|
5
|
+
import type { XlsxFormulaFeatures } from './work-xlsx-formulas';
|
|
6
|
+
import type { XlsxPivotReadResult } from './work-xlsx-pivots';
|
|
7
|
+
import type { XlsxWorksheetXmlScan } from './work-xlsx-worksheet-scan';
|
|
4
8
|
interface ConversionMessage {
|
|
5
9
|
type: string;
|
|
6
10
|
message: string;
|
|
7
11
|
}
|
|
12
|
+
export interface SpreadsheetCompatibilityImportMetadata {
|
|
13
|
+
formulaFeatures?: XlsxFormulaFeatures | null;
|
|
14
|
+
pivotFeatures?: XlsxPivotReadResult | null;
|
|
15
|
+
worksheetScans?: Readonly<Record<string, XlsxWorksheetXmlScan>>;
|
|
16
|
+
}
|
|
8
17
|
export declare function analyzeDocxCompatibility(file: File, messages: ConversionMessage[], sourcePackage?: OoxmlPackage | null): Promise<WorkCompatibilityReport>;
|
|
9
|
-
export declare function analyzeSpreadsheetCompatibility(file: File, extension: string, workbook: WorkBook, sourcePackage?: OoxmlPackage | null): Promise<WorkCompatibilityReport | null>;
|
|
18
|
+
export declare function analyzeSpreadsheetCompatibility(file: File, extension: string, workbook: WorkBook, sourcePackage?: OoxmlPackage | null, worksheetSummaries?: ReadonlyMap<string, SpreadsheetWorksheetCompatibilitySummary>, importedMetadata?: SpreadsheetCompatibilityImportMetadata): Promise<WorkCompatibilityReport | null>;
|
|
10
19
|
export {};
|
|
@@ -6,6 +6,7 @@ export interface OoxmlRelationship {
|
|
|
6
6
|
}
|
|
7
7
|
export declare class OoxmlPackage {
|
|
8
8
|
private readonly zip;
|
|
9
|
+
private readonly textCache;
|
|
9
10
|
private constructor();
|
|
10
11
|
static load(buffer: ArrayBuffer): Promise<OoxmlPackage>;
|
|
11
12
|
has(partPath: string): boolean;
|
|
@@ -16,6 +17,13 @@ export declare class OoxmlPackage {
|
|
|
16
17
|
relationships(sourcePart: string): Promise<Map<string, OoxmlRelationship>>;
|
|
17
18
|
}
|
|
18
19
|
export declare function parseXml(source: string, label?: string): Document;
|
|
20
|
+
/**
|
|
21
|
+
* Checks raw XML for selected element names before paying the cost of a full
|
|
22
|
+
* DOM tree. False positives are safe because they only select the slower
|
|
23
|
+
* parser path; the tag boundary prevents cell values and longer tag names
|
|
24
|
+
* from selecting it accidentally.
|
|
25
|
+
*/
|
|
26
|
+
export declare function xmlContainsAnyElement(source: string, localNames: readonly string[]): boolean;
|
|
19
27
|
export declare function attribute(element: Element, name: string): string | null;
|
|
20
28
|
export declare function xmlNamespacePrefix(element: Element, namespace: string | null): string | null;
|
|
21
29
|
export declare function directChildren(parent: ParentNode, localName?: string): Element[];
|
|
@@ -8,6 +8,12 @@ export interface WorkPresentationSlideView {
|
|
|
8
8
|
master?: WorkPresentationMaster;
|
|
9
9
|
layout?: WorkPresentationLayout;
|
|
10
10
|
}
|
|
11
|
-
export
|
|
11
|
+
export type WorkPresentationDesignContent = WorkPresentationContent & {
|
|
12
|
+
layouts: WorkPresentationLayout[];
|
|
13
|
+
masters: WorkPresentationMaster[];
|
|
14
|
+
};
|
|
15
|
+
export declare function withPresentationDesign(content: WorkPresentationContent): WorkPresentationDesignContent;
|
|
16
|
+
export declare function withPresentationDesignMetadata(content: WorkPresentationContent): WorkPresentationDesignContent;
|
|
12
17
|
export declare function presentationSlideView(content: WorkPresentationContent, slide: WorkSlide): WorkPresentationSlideView;
|
|
18
|
+
export declare function presentationSlideViewFromDesign(designContent: WorkPresentationDesignContent, slide: WorkSlide): WorkPresentationSlideView;
|
|
13
19
|
export declare function applyPresentationLayout(content: WorkPresentationContent, slideId: string, layoutId: string): WorkPresentationContent;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { WorkArtifact } from './work-types';
|
|
2
2
|
export declare function rememberWorkSourceBlob(artifactId: string, source: Blob): void;
|
|
3
3
|
export declare function forgetWorkSourceBlob(artifactId: string): void;
|
|
4
|
+
export declare function moveWorkSourceBlob(sourceArtifactId: string, targetArtifactId: string): void;
|
|
4
5
|
export declare function readWorkSourceBlob(artifact: WorkArtifact): Promise<Blob>;
|
|
5
6
|
export declare function readVerifiedWorkSourceBytes(artifact: WorkArtifact): Promise<ArrayBuffer>;
|
|
6
7
|
export declare function workSourceFingerprint(bytes: ArrayBuffer): Promise<string>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CellObject } from 'xlsx';
|
|
2
|
+
export interface SpreadsheetWorksheetCompatibilitySummary {
|
|
3
|
+
hasArrayFormulas: boolean;
|
|
4
|
+
hasComments: boolean;
|
|
5
|
+
hasCommentThreads: boolean;
|
|
6
|
+
hasLinks: boolean;
|
|
7
|
+
hasRichText: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function emptySpreadsheetWorksheetCompatibilitySummary(): SpreadsheetWorksheetCompatibilitySummary;
|
|
10
|
+
export declare function updateSpreadsheetWorksheetCompatibilitySummary(summary: SpreadsheetWorksheetCompatibilitySummary, cell: CellObject): void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ParsingOptions, WorkBook } from 'xlsx';
|
|
2
|
+
/**
|
|
3
|
+
* Parses a workbook away from the UI thread when a dedicated Worker can be
|
|
4
|
+
* created. A null result asks the caller to use the synchronous fallback.
|
|
5
|
+
*/
|
|
6
|
+
export declare function readSpreadsheetWorkbookInWorker(bytes: ArrayBuffer, options: ParsingOptions, signal?: AbortSignal): Promise<WorkBook | null>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { CellObject, ParsingOptions, WorkBook } from 'xlsx';
|
|
2
|
+
export declare const SPREADSHEET_IMPORT_ROW_CHUNK_SIZE = 512;
|
|
3
|
+
export declare const SPREADSHEET_IMPORT_CELL_CHUNK_SIZE = 8192;
|
|
4
|
+
export interface SpreadsheetImportWorkerRequest {
|
|
5
|
+
bytes: ArrayBuffer;
|
|
6
|
+
kind: 'parse';
|
|
7
|
+
options: ParsingOptions;
|
|
8
|
+
}
|
|
9
|
+
export type SpreadsheetImportWorkbookMetadata = Omit<WorkBook, 'Sheets'>;
|
|
10
|
+
export type SpreadsheetImportDenseRow = Array<CellObject | undefined>;
|
|
11
|
+
export type SpreadsheetImportWorkerResponse = {
|
|
12
|
+
kind: 'workbook';
|
|
13
|
+
workbook: SpreadsheetImportWorkbookMetadata;
|
|
14
|
+
} | {
|
|
15
|
+
dense: boolean;
|
|
16
|
+
kind: 'worksheet';
|
|
17
|
+
name: string;
|
|
18
|
+
properties: Record<string, unknown>;
|
|
19
|
+
} | {
|
|
20
|
+
kind: 'rows';
|
|
21
|
+
name: string;
|
|
22
|
+
rows: Array<SpreadsheetImportDenseRow | undefined>;
|
|
23
|
+
startRow: number;
|
|
24
|
+
} | {
|
|
25
|
+
cells: Array<[address: string, cell: CellObject]>;
|
|
26
|
+
kind: 'cells';
|
|
27
|
+
name: string;
|
|
28
|
+
} | {
|
|
29
|
+
kind: 'success';
|
|
30
|
+
} | {
|
|
31
|
+
kind: 'failure';
|
|
32
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { Cell, CellMatrix } from '@fortune-sheet/core';
|
|
2
|
+
export declare const SPREADSHEET_SHOWN_COMMENT_CELLS_PROPERTY = "__a3sShownCommentCells";
|
|
3
|
+
export interface SpreadsheetMatrixProfile {
|
|
4
|
+
columnCount: number;
|
|
5
|
+
formulaCells: readonly Readonly<{
|
|
6
|
+
column: number;
|
|
7
|
+
row: number;
|
|
8
|
+
}>[];
|
|
9
|
+
fortuneReady: boolean;
|
|
10
|
+
historyRoot: object;
|
|
11
|
+
historyState: object;
|
|
12
|
+
populatedCellCount: number;
|
|
13
|
+
protectionCellKey: string;
|
|
14
|
+
rowCount: number;
|
|
15
|
+
shownCommentCells: readonly Readonly<{
|
|
16
|
+
c: number;
|
|
17
|
+
r: number;
|
|
18
|
+
}>[];
|
|
19
|
+
}
|
|
20
|
+
export interface SpreadsheetMatrixCellChange {
|
|
21
|
+
column: number;
|
|
22
|
+
current: Cell | null | undefined;
|
|
23
|
+
previous: Cell | null | undefined;
|
|
24
|
+
row: number;
|
|
25
|
+
}
|
|
26
|
+
interface ImportedSpreadsheetMatrixOptions {
|
|
27
|
+
columnCount: number;
|
|
28
|
+
formulaCells: readonly Readonly<{
|
|
29
|
+
column: number;
|
|
30
|
+
row: number;
|
|
31
|
+
}>[];
|
|
32
|
+
fortuneReady: boolean;
|
|
33
|
+
populatedCellCount: number;
|
|
34
|
+
protectionCellKey: string;
|
|
35
|
+
rowCount: number;
|
|
36
|
+
shownCommentCells: readonly Readonly<{
|
|
37
|
+
c: number;
|
|
38
|
+
r: number;
|
|
39
|
+
}>[];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Freezes a package-owned import cell before it becomes controlled content.
|
|
43
|
+
* Fortune can then share the cell as an Immer base value without recursively
|
|
44
|
+
* freezing or cloning every populated cell during editor initialization.
|
|
45
|
+
*/
|
|
46
|
+
export declare function freezeImportedSpreadsheetCell(cell: Cell): Cell;
|
|
47
|
+
/**
|
|
48
|
+
* Authenticates a normalized, package-owned matrix for clone-free projection.
|
|
49
|
+
* The registry is identity-based, so an edited or host-created matrix cannot
|
|
50
|
+
* accidentally inherit the optimization.
|
|
51
|
+
*/
|
|
52
|
+
export declare function registerImportedSpreadsheetMatrix(data: CellMatrix, options: ImportedSpreadsheetMatrixOptions): void;
|
|
53
|
+
/**
|
|
54
|
+
* Carries import-time summaries across a bounded cell edit without rescanning
|
|
55
|
+
* the complete matrix. The source identity must have been authenticated by
|
|
56
|
+
* this package and must already be directly consumable by Fortune.
|
|
57
|
+
*/
|
|
58
|
+
export declare function registerDerivedSpreadsheetMatrix(data: CellMatrix, source: CellMatrix, changes: readonly SpreadsheetMatrixCellChange[]): boolean;
|
|
59
|
+
export declare function spreadsheetMatrixProfile(data: CellMatrix | undefined): SpreadsheetMatrixProfile | undefined;
|
|
60
|
+
export declare function attachSpreadsheetShownCommentCells(data: CellMatrix, cells: readonly Readonly<{
|
|
61
|
+
c: number;
|
|
62
|
+
r: number;
|
|
63
|
+
}>[]): void;
|
|
64
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SpreadsheetPackageScanResult } from './work-spreadsheet-package-scan-worker-protocol';
|
|
2
|
+
/**
|
|
3
|
+
* Decompresses and classifies worksheet XML away from the UI thread. A null
|
|
4
|
+
* result preserves the existing main-thread parser as a compatibility path.
|
|
5
|
+
*/
|
|
6
|
+
export declare function scanSpreadsheetPackageInWorker(bytes: ArrayBuffer, signal?: AbortSignal, onFastPathCandidate?: () => void): Promise<SpreadsheetPackageScanResult | null>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { CellMatrix } from '@fortune-sheet/core';
|
|
2
|
+
import type { WorkBook } from 'xlsx';
|
|
3
|
+
import type { SpreadsheetImportWorkbookMetadata } from './work-spreadsheet-import-worker-protocol';
|
|
4
|
+
import type { PlainXlsxCellChunk } from './work-xlsx-plain-fast-path';
|
|
5
|
+
import type { XlsxWorksheetXmlScan } from './work-xlsx-worksheet-scan';
|
|
6
|
+
export interface SpreadsheetPackageScanWorkerRequest {
|
|
7
|
+
bytes: ArrayBuffer;
|
|
8
|
+
kind: 'scan';
|
|
9
|
+
}
|
|
10
|
+
export interface SpreadsheetPackageScanResult {
|
|
11
|
+
plainWorksheets: Record<string, SpreadsheetPlainWorksheet> | null;
|
|
12
|
+
workbook: WorkBook | null;
|
|
13
|
+
worksheets: Record<string, XlsxWorksheetXmlScan>;
|
|
14
|
+
}
|
|
15
|
+
export interface SpreadsheetPlainWorksheet {
|
|
16
|
+
columnCount: number;
|
|
17
|
+
data: CellMatrix;
|
|
18
|
+
populatedCellCount: number;
|
|
19
|
+
rowCount: number;
|
|
20
|
+
}
|
|
21
|
+
export type SpreadsheetPackageScanWorkerResponse = {
|
|
22
|
+
kind: 'workbook';
|
|
23
|
+
workbook: SpreadsheetImportWorkbookMetadata;
|
|
24
|
+
} | {
|
|
25
|
+
columnCount: number;
|
|
26
|
+
kind: 'plain-worksheet-start';
|
|
27
|
+
name: string;
|
|
28
|
+
rowCount: number;
|
|
29
|
+
} | {
|
|
30
|
+
columnCount: number;
|
|
31
|
+
dense: true;
|
|
32
|
+
kind: 'worksheet';
|
|
33
|
+
name: string;
|
|
34
|
+
populatedCellCount: number;
|
|
35
|
+
properties: Record<string, unknown>;
|
|
36
|
+
rowCount: number;
|
|
37
|
+
} | {
|
|
38
|
+
chunk: PlainXlsxCellChunk;
|
|
39
|
+
kind: 'plain-cells';
|
|
40
|
+
name: string;
|
|
41
|
+
} | {
|
|
42
|
+
kind: 'fast-path-rejected';
|
|
43
|
+
} | {
|
|
44
|
+
fastPath: boolean;
|
|
45
|
+
kind: 'success';
|
|
46
|
+
worksheets: SpreadsheetPackageScanResult['worksheets'];
|
|
47
|
+
} | {
|
|
48
|
+
kind: 'failure';
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Sheet } from '@fortune-sheet/core';
|
|
2
|
+
export type XlsxCellBorderStyle = 'dashDot' | 'dashDotDot' | 'dashed' | 'dotted' | 'double' | 'hair' | 'medium' | 'mediumDashDot' | 'mediumDashDotDot' | 'mediumDashed' | 'slantDashDot' | 'thick' | 'thin';
|
|
3
|
+
export interface XlsxCellBorderLine {
|
|
4
|
+
color: string;
|
|
5
|
+
style: XlsxCellBorderStyle;
|
|
6
|
+
}
|
|
7
|
+
export interface XlsxCellBorder {
|
|
8
|
+
bottom?: XlsxCellBorderLine | null;
|
|
9
|
+
diagonal?: XlsxCellBorderLine | null;
|
|
10
|
+
diagonalDown?: boolean;
|
|
11
|
+
diagonalUp?: boolean;
|
|
12
|
+
left?: XlsxCellBorderLine | null;
|
|
13
|
+
right?: XlsxCellBorderLine | null;
|
|
14
|
+
top?: XlsxCellBorderLine | null;
|
|
15
|
+
}
|
|
16
|
+
export interface XlsxPositionedCellBorder {
|
|
17
|
+
border?: XlsxCellBorder;
|
|
18
|
+
column: number;
|
|
19
|
+
row: number;
|
|
20
|
+
}
|
|
21
|
+
export declare function collectXlsxCellBorders(sheet: Sheet): ReadonlyMap<string, XlsxCellBorder>;
|
|
22
|
+
export declare function fortuneBorderInfoFromXlsxCells(entries: readonly XlsxPositionedCellBorder[]): unknown[];
|
|
23
|
+
export declare function xlsxCellBorderKey(row: number, column: number): string;
|
|
24
|
+
export declare function xlsxCellBorderLineFromFortune(value: unknown): XlsxCellBorderLine | null | undefined;
|
|
25
|
+
export declare function fortuneBorderStyle(style: XlsxCellBorderStyle): string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Cell } from '@fortune-sheet/core';
|
|
2
|
+
import type { XlsxCellBorder } from './work-xlsx-cell-borders';
|
|
3
|
+
export declare class XlsxDirectCellStyleWriter {
|
|
4
|
+
private readonly styles;
|
|
5
|
+
private readonly fonts;
|
|
6
|
+
private readonly fills;
|
|
7
|
+
private readonly borders;
|
|
8
|
+
private readonly cellXfs;
|
|
9
|
+
private readonly generatedFonts;
|
|
10
|
+
private readonly generatedFills;
|
|
11
|
+
private readonly generatedBorders;
|
|
12
|
+
private readonly generatedStyles;
|
|
13
|
+
changed: boolean;
|
|
14
|
+
constructor(styles: Document);
|
|
15
|
+
styleId(baseStyleId: number, cell: Cell, border?: XlsxCellBorder): number;
|
|
16
|
+
private fontId;
|
|
17
|
+
private fillId;
|
|
18
|
+
private borderId;
|
|
19
|
+
private updateCounts;
|
|
20
|
+
}
|
|
21
|
+
export declare function hasXlsxDirectCellStyle(cell: Cell): boolean;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { XlsxCellBorderLine } from './work-xlsx-cell-borders';
|
|
2
|
+
export interface XlsxDirectAlignmentStyle {
|
|
3
|
+
horizontal?: 'center' | 'left' | 'right';
|
|
4
|
+
textRotation?: number;
|
|
5
|
+
vertical?: 'bottom' | 'center' | 'top';
|
|
6
|
+
wrapText?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function ensureXlsxStyleCollection(document: Document, name: string, anchors: readonly string[]): Element;
|
|
9
|
+
export declare function defaultXlsxFill(document: Document, patternType: string): Element;
|
|
10
|
+
export declare function defaultXlsxBorder(document: Document): Element;
|
|
11
|
+
export declare function setXlsxBorderLine(document: Document, border: Element, name: 'bottom' | 'diagonal' | 'left' | 'right' | 'top', line: XlsxCellBorderLine | null): void;
|
|
12
|
+
export declare function writeXlsxAlignment(document: Document, xf: Element, style: XlsxDirectAlignmentStyle): void;
|
|
13
|
+
export declare function setXlsxValueChild(document: Document, parent: Element, name: string, value: string, order: readonly string[]): void;
|
|
14
|
+
export declare function setXlsxColorChild(document: Document, parent: Element, color: string, order: readonly string[]): void;
|
|
15
|
+
export declare function setXlsxToggleChild(document: Document, parent: Element, name: string, enabled: boolean, order: readonly string[]): void;
|
|
16
|
+
export declare function setXlsxUnderlineChild(document: Document, parent: Element, enabled: boolean, order: readonly string[]): void;
|
|
17
|
+
export declare function xlsxRgbColor(value: unknown): string | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Cell, Sheet } from '@fortune-sheet/core';
|
|
2
|
+
import { type XlsxCellBorder } from './work-xlsx-cell-borders';
|
|
3
|
+
import { type XlsxDirectCellStyleWriter } from './work-xlsx-cell-style-writer';
|
|
4
|
+
export { XlsxDirectCellStyleWriter } from './work-xlsx-cell-style-writer';
|
|
5
|
+
export interface XlsxDirectCellStyle {
|
|
6
|
+
border?: XlsxCellBorder;
|
|
7
|
+
column: number;
|
|
8
|
+
row: number;
|
|
9
|
+
style: Partial<Cell>;
|
|
10
|
+
}
|
|
11
|
+
export declare function readXlsxDirectCellStyles(worksheet: Document, styles: Document | null, theme?: Document | null): XlsxDirectCellStyle[];
|
|
12
|
+
export declare function sheetHasDirectCellStyles(sheet: Sheet): boolean;
|
|
13
|
+
export declare function writeXlsxDirectCellStyles(worksheet: Document, sheet: Sheet, styles: XlsxDirectCellStyleWriter): void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface XlsxColorResolver {
|
|
2
|
+
indexed: readonly string[];
|
|
3
|
+
theme: readonly string[];
|
|
4
|
+
}
|
|
5
|
+
export declare function createXlsxColorResolver(styles: Document, theme: Document | null): XlsxColorResolver;
|
|
6
|
+
export declare function resolveXlsxColor(element: Element | undefined, resolver: XlsxColorResolver): string | undefined;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { OoxmlPackage } from './work-ooxml-package';
|
|
2
2
|
import type { WorkCompatibilityIssue } from './work-types';
|
|
3
|
-
|
|
3
|
+
import { type XlsxFormulaFeatures } from './work-xlsx-formulas';
|
|
4
|
+
import type { XlsxWorksheetXmlScan } from './work-xlsx-worksheet-scan';
|
|
5
|
+
export declare function diagnoseXlsxFormulas(archive: OoxmlPackage, importedFeatures?: XlsxFormulaFeatures | null, worksheetScans?: Readonly<Record<string, XlsxWorksheetXmlScan>>): Promise<WorkCompatibilityIssue[]>;
|
|
@@ -2,6 +2,7 @@ import type { Cell } from '@fortune-sheet/core';
|
|
|
2
2
|
import type { WorkSheet } from 'xlsx';
|
|
3
3
|
import { OoxmlPackage } from './work-ooxml-package';
|
|
4
4
|
import type { WorkSpreadsheetCalculationSettings, WorkSpreadsheetContent, WorkSpreadsheetFormulaMetadata, WorkSpreadsheetFormulaRange, WorkSpreadsheetSheet } from './work-types';
|
|
5
|
+
import type { XlsxWorksheetXmlScan } from './work-xlsx-worksheet-scan';
|
|
5
6
|
export interface XlsxFormulaCell {
|
|
6
7
|
address: string;
|
|
7
8
|
formula: string;
|
|
@@ -29,7 +30,7 @@ type XlsxFormulaCellObject = {
|
|
|
29
30
|
D?: boolean;
|
|
30
31
|
};
|
|
31
32
|
export declare function readXlsxFormulaFeatures(buffer: ArrayBuffer): Promise<XlsxFormulaFeatures>;
|
|
32
|
-
export declare function readXlsxFormulaFeaturesFromPackage(archive: OoxmlPackage): Promise<XlsxFormulaFeatures>;
|
|
33
|
+
export declare function readXlsxFormulaFeaturesFromPackage(archive: OoxmlPackage, worksheetScans?: Readonly<Record<string, XlsxWorksheetXmlScan>>): Promise<XlsxFormulaFeatures>;
|
|
33
34
|
export declare function createSpreadsheetFormulaMetadata(worksheet: WorkSheet, features: XlsxFormulaSheetFeatures | undefined): WorkSpreadsheetFormulaMetadata | undefined;
|
|
34
35
|
export declare function createXlsxFormulaCell(cell: Cell, row: number, column: number, sheet: WorkSpreadsheetSheet): XlsxFormulaCellObject;
|
|
35
36
|
export declare function createXlsxErrorCell(cell: Cell): {
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import type { Sheet } from '@fortune-sheet/core';
|
|
2
2
|
import { OoxmlPackage } from './work-ooxml-package';
|
|
3
|
-
import {
|
|
4
|
-
import { type XlsxProtectionFeatures } from './work-xlsx-protection';
|
|
5
|
-
import { type XlsxManualPageBreaks } from './work-xlsx-page-breaks';
|
|
3
|
+
import type { WorkSpreadsheetContent, WorkSpreadsheetDataValidationItem } from './work-types';
|
|
6
4
|
import { type XlsxWorksheetChart } from './work-xlsx-charts';
|
|
5
|
+
import { type XlsxDirectCellStyle } from './work-xlsx-cell-styles';
|
|
6
|
+
import { type FortuneConditionalFormatRule } from './work-xlsx-conditional-format';
|
|
7
7
|
import { type XlsxWorksheetImage } from './work-xlsx-images';
|
|
8
|
+
import { type XlsxManualPageBreaks } from './work-xlsx-page-breaks';
|
|
8
9
|
import { type XlsxPageSetup } from './work-xlsx-page-setup';
|
|
9
|
-
import
|
|
10
|
+
import { type XlsxProtectionFeatures } from './work-xlsx-protection';
|
|
11
|
+
import { type XlsxWorksheetXmlScan } from './work-xlsx-worksheet-scan';
|
|
10
12
|
type FrozenPane = NonNullable<Sheet['frozen']>;
|
|
11
13
|
export interface XlsxDataValidation {
|
|
12
14
|
references: string[];
|
|
13
15
|
item: FortuneDataValidationItem;
|
|
14
16
|
}
|
|
15
17
|
export interface XlsxSheetFeatures {
|
|
18
|
+
directCellStyles: XlsxDirectCellStyle[];
|
|
16
19
|
frozen?: FrozenPane;
|
|
17
20
|
validations: XlsxDataValidation[];
|
|
18
21
|
conditionalFormats: FortuneConditionalFormatRule[];
|
|
@@ -24,6 +27,6 @@ export interface XlsxSheetFeatures {
|
|
|
24
27
|
}
|
|
25
28
|
export type FortuneDataValidationItem = WorkSpreadsheetDataValidationItem;
|
|
26
29
|
export declare function readXlsxSheetFeatures(buffer: ArrayBuffer): Promise<Map<string, XlsxSheetFeatures>>;
|
|
27
|
-
export declare function readXlsxSheetFeaturesFromPackage(archive: OoxmlPackage): Promise<Map<string, XlsxSheetFeatures>>;
|
|
30
|
+
export declare function readXlsxSheetFeaturesFromPackage(archive: OoxmlPackage, worksheetScans?: Readonly<Record<string, XlsxWorksheetXmlScan>>): Promise<Map<string, XlsxSheetFeatures>>;
|
|
28
31
|
export declare function patchXlsxSheetFeatures(buffer: ArrayBuffer, content: WorkSpreadsheetContent): Promise<ArrayBuffer>;
|
|
29
32
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { OoxmlPackage } from './work-ooxml-package';
|
|
2
2
|
import type { WorkCompatibilityIssue } from './work-types';
|
|
3
|
-
|
|
3
|
+
import { type XlsxPivotReadResult } from './work-xlsx-pivots';
|
|
4
|
+
export declare function diagnoseXlsxPivots(archive: OoxmlPackage, importedInspection?: XlsxPivotReadResult | null): Promise<WorkCompatibilityIssue[]>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { SpreadsheetImportWorkbookMetadata } from './work-spreadsheet-import-worker-protocol';
|
|
2
|
+
export declare const PLAIN_XLSX_COLUMN_BITS = 14;
|
|
3
|
+
export declare const PLAIN_XLSX_COLUMN_MASK: number;
|
|
4
|
+
export declare const PLAIN_XLSX_CELL_CHUNK_SIZE = 4096;
|
|
5
|
+
export declare const PLAIN_XLSX_ROW_CHUNK_SIZE = 256;
|
|
6
|
+
export declare const PLAIN_XLSX_CELL_NUMBER = 0;
|
|
7
|
+
export declare const PLAIN_XLSX_CELL_BOOLEAN = 1;
|
|
8
|
+
export declare const PLAIN_XLSX_CELL_ERROR = 2;
|
|
9
|
+
export declare const PLAIN_XLSX_CELL_TEXT = 3;
|
|
10
|
+
export interface PlainXlsxPackageParts {
|
|
11
|
+
contentTypes: string;
|
|
12
|
+
packagePaths: readonly string[];
|
|
13
|
+
rootRelationships: string;
|
|
14
|
+
workbook: string;
|
|
15
|
+
workbookRelationships: string;
|
|
16
|
+
}
|
|
17
|
+
export interface PlainXlsxWorkbookSheet {
|
|
18
|
+
name: string;
|
|
19
|
+
partPath: string;
|
|
20
|
+
}
|
|
21
|
+
export interface PlainXlsxWorkbookPlan {
|
|
22
|
+
sheets: PlainXlsxWorkbookSheet[];
|
|
23
|
+
workbook: SpreadsheetImportWorkbookMetadata;
|
|
24
|
+
}
|
|
25
|
+
export interface PlainXlsxCellChunk {
|
|
26
|
+
coordinates: Uint32Array;
|
|
27
|
+
kinds: Uint8Array;
|
|
28
|
+
numericValues: Float64Array;
|
|
29
|
+
startRow: number;
|
|
30
|
+
textValues: string[];
|
|
31
|
+
}
|
|
32
|
+
export interface PlainXlsxWorksheetResult {
|
|
33
|
+
columnCount: number;
|
|
34
|
+
populatedCellCount: number;
|
|
35
|
+
properties: Record<string, unknown>;
|
|
36
|
+
rowCount: number;
|
|
37
|
+
}
|
|
38
|
+
export interface PlainXlsxRangeExtent {
|
|
39
|
+
columnCount: number;
|
|
40
|
+
rowCount: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Authenticates the deliberately small OOXML subset handled by the fast
|
|
44
|
+
* worksheet parser. Any package part or workbook construct outside this
|
|
45
|
+
* closed set returns null and leaves SheetJS as the authority.
|
|
46
|
+
*/
|
|
47
|
+
export declare function createPlainXlsxWorkbookPlan(parts: PlainXlsxPackageParts): PlainXlsxWorkbookPlan | null;
|
|
48
|
+
/**
|
|
49
|
+
* Parses primitive dense cells with a low-allocation cursor. Row chunks may be
|
|
50
|
+
* emitted provisionally; callers must use them only when the final result is
|
|
51
|
+
* non-null because a later unsupported element invalidates the whole sheet.
|
|
52
|
+
*/
|
|
53
|
+
export declare function streamPlainXlsxWorksheet(source: string, visit: (chunk: PlainXlsxCellChunk) => void, start?: (extent: PlainXlsxRangeExtent) => void): PlainXlsxWorksheetResult | null;
|
|
54
|
+
export declare function plainXlsxRangeExtent(reference: string): PlainXlsxRangeExtent | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function xlsxWorksheetRequiresSheetJsCellStyles(source: string): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface XlsxWorksheetXmlScan {
|
|
2
|
+
hasDirectCellStyles: boolean;
|
|
3
|
+
hasDiagnosticFeatures: boolean;
|
|
4
|
+
hasFormulaFeatures: boolean;
|
|
5
|
+
hasImportedFeatures: boolean;
|
|
6
|
+
requiresSheetJsCellStyles: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Builds every worksheet gate in one pass over the decompressed XML. The
|
|
10
|
+
* scanner deliberately permits false positives because they only select the
|
|
11
|
+
* existing full parser path; a false negative could discard workbook state.
|
|
12
|
+
*/
|
|
13
|
+
export declare function scanXlsxWorksheetXml(source: string): XlsxWorksheetXmlScan;
|