@wae/open-excel 0.0.0-stage → 0.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.
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Stable error surface of `@wae/open-excel`.
3
+ *
4
+ * Codes are contract, not prose: callers compare them, localize around them and
5
+ * never parse the message. A failure therefore keeps its code even when the
6
+ * text is translated.
7
+ */
8
+ /** Every stable code the workbook surface may report. */
9
+ export declare const errorCodes: readonly ["session/disposed", "session/argument-invalid", "session/budget-exceeded", "workbook/not-found", "document/revision-conflict", "io/target-exists", "io/failure", "object/not-found", "object/unsupported", "format/unsupported", "format/invalid", "capability/not-implemented"];
10
+ /** Union of {@link errorCodes}. */
11
+ export type OpenExcelErrorCode = (typeof errorCodes)[number];
12
+ /** Optional locators a failure can carry so callers can point at the object. */
13
+ export interface OpenExcelErrorDetails {
14
+ readonly revision?: number;
15
+ readonly sheetId?: string;
16
+ /** A1-style cell address such as `B4`. */
17
+ readonly cell?: string;
18
+ /** Workbook format involved in the failure, without the leading dot. */
19
+ readonly format?: string;
20
+ /** Capability involved in the failure, e.g. `workbook.export`. */
21
+ readonly feature?: string;
22
+ }
23
+ /** Options accepted by {@link OpenExcelError}. */
24
+ export interface OpenExcelErrorOptions {
25
+ readonly recoverable?: boolean;
26
+ readonly details?: OpenExcelErrorDetails;
27
+ readonly cause?: unknown;
28
+ }
29
+ /** Every failure thrown or rejected by this package. */
30
+ export declare class OpenExcelError extends Error {
31
+ /** Stable, comparable code. */
32
+ readonly code: OpenExcelErrorCode;
33
+ /** Whether retrying with different input or state can succeed. */
34
+ readonly recoverable: boolean;
35
+ /** Optional locators (`revision`, `sheetId`, `cell`, `format`, `feature`). */
36
+ readonly details: OpenExcelErrorDetails;
37
+ constructor(code: OpenExcelErrorCode, message: string, options?: OpenExcelErrorOptions);
38
+ }
39
+ /**
40
+ * Reported by declared methods whose backing capability is not wired yet.
41
+ *
42
+ * The scaffold uses one code for every unimplemented entry point instead of
43
+ * inventing per-method placeholders; each method drops this rejection as it is
44
+ * implemented, and the code disappears with the last one.
45
+ */
46
+ export declare class NotImplementedError extends OpenExcelError {
47
+ constructor(feature: string, message?: string);
48
+ }
49
+ /** Narrows an unknown thrown value to {@link OpenExcelError}. */
50
+ export declare function isOpenExcelError(value: unknown): value is OpenExcelError;
package/dist/errors.js ADDED
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Stable error surface of `@wae/open-excel`.
3
+ *
4
+ * Codes are contract, not prose: callers compare them, localize around them and
5
+ * never parse the message. A failure therefore keeps its code even when the
6
+ * text is translated.
7
+ */
8
+ /** Every stable code the workbook surface may report. */
9
+ export const errorCodes = [
10
+ 'session/disposed',
11
+ 'session/argument-invalid',
12
+ 'session/budget-exceeded',
13
+ 'workbook/not-found',
14
+ 'document/revision-conflict',
15
+ 'io/target-exists',
16
+ 'io/failure',
17
+ 'object/not-found',
18
+ 'object/unsupported',
19
+ 'format/unsupported',
20
+ 'format/invalid',
21
+ 'capability/not-implemented',
22
+ ];
23
+ /** Every failure thrown or rejected by this package. */
24
+ export class OpenExcelError extends Error {
25
+ /** Stable, comparable code. */
26
+ code;
27
+ /** Whether retrying with different input or state can succeed. */
28
+ recoverable;
29
+ /** Optional locators (`revision`, `sheetId`, `cell`, `format`, `feature`). */
30
+ details;
31
+ constructor(code, message, options = {}) {
32
+ super(message, options.cause === undefined ? undefined : { cause: options.cause });
33
+ this.name = 'OpenExcelError';
34
+ this.code = code;
35
+ this.recoverable = options.recoverable ?? false;
36
+ this.details = Object.freeze({ ...options.details });
37
+ }
38
+ }
39
+ /**
40
+ * Reported by declared methods whose backing capability is not wired yet.
41
+ *
42
+ * The scaffold uses one code for every unimplemented entry point instead of
43
+ * inventing per-method placeholders; each method drops this rejection as it is
44
+ * implemented, and the code disappears with the last one.
45
+ */
46
+ export class NotImplementedError extends OpenExcelError {
47
+ constructor(feature, message = `\`${feature}\` is not implemented yet`) {
48
+ super('capability/not-implemented', message, { recoverable: false, details: { feature } });
49
+ this.name = 'NotImplementedError';
50
+ }
51
+ }
52
+ /** Narrows an unknown thrown value to {@link OpenExcelError}. */
53
+ export function isOpenExcelError(value) {
54
+ return value instanceof OpenExcelError;
55
+ }
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Workbook format family.
3
+ *
4
+ * Excel extensions encode the container and the intended use: `x` = OOXML,
5
+ * `m` = macro-enabled OOXML, no suffix = 97-2003 binary, `t` = template. The
6
+ * registry below classifies extensions and fixes the default open intent.
7
+ *
8
+ * Classification is **not** a support claim. What the installed engine can read,
9
+ * edit, inspect or write is reported by `OpenExcel.capabilities()`; an extension
10
+ * listed here may still be `unsupported`.
11
+ */
12
+ /** Intent applied when the caller does not override it. */
13
+ export type WorkbookIntent = 'edit' | 'data' | 'template';
14
+ /** Grouping used for capability reporting and user-facing wording. */
15
+ export type FormatFamily = 'workbook' | 'template' | 'legacy' | 'text' | 'document' | 'interchange';
16
+ /** Container encoding behind an extension. */
17
+ export type FormatMarkup = 'ooxml' | 'binary' | 'odf' | 'text' | 'json' | 'xml' | 'fixed';
18
+ /** What an extension can be consumed as. `none` means it never becomes a workbook. */
19
+ export type FormatOpenKind = 'workbook' | 'data' | 'none';
20
+ /** Every extension the product must classify. */
21
+ export declare const workbookFormats: readonly ["xlsx", "xlsm", "xltx", "xls", "csv", "tsv", "ods", "json", "xml", "pdf"];
22
+ /** Union of {@link workbookFormats}. */
23
+ export type WorkbookFormat = (typeof workbookFormats)[number];
24
+ /** What a format is, independent of whether it is implemented. */
25
+ export interface WorkbookFormatInfo {
26
+ readonly format: WorkbookFormat;
27
+ readonly family: FormatFamily;
28
+ readonly markup: FormatMarkup;
29
+ /** Whether the container may hold VBA macros. Such parts are never executed. */
30
+ readonly macroEnabled: boolean;
31
+ readonly opensAs: FormatOpenKind;
32
+ /** Intent applied to `open()` when the extension arrives without one. */
33
+ readonly defaultIntent: WorkbookIntent | null;
34
+ }
35
+ type FormatRegistryEntry = Omit<WorkbookFormatInfo, 'format'>;
36
+ /** Extension to classification. Values describe the format, never a capability. */
37
+ export declare const formatRegistry: Readonly<Record<WorkbookFormat, FormatRegistryEntry>>;
38
+ /** Returns the full classification of one format. */
39
+ export declare function formatInfo(format: WorkbookFormat): WorkbookFormatInfo;
40
+ /** Extracts a classified extension from a path, ignoring case. */
41
+ export declare function formatFromPath(path: string): WorkbookFormat | undefined;
42
+ /** Default open intent of a format, or `null` when it never opens as a workbook. */
43
+ export declare function defaultIntentFor(format: WorkbookFormat): WorkbookIntent | null;
44
+ export {};
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Workbook format family.
3
+ *
4
+ * Excel extensions encode the container and the intended use: `x` = OOXML,
5
+ * `m` = macro-enabled OOXML, no suffix = 97-2003 binary, `t` = template. The
6
+ * registry below classifies extensions and fixes the default open intent.
7
+ *
8
+ * Classification is **not** a support claim. What the installed engine can read,
9
+ * edit, inspect or write is reported by `OpenExcel.capabilities()`; an extension
10
+ * listed here may still be `unsupported`.
11
+ */
12
+ /** Every extension the product must classify. */
13
+ export const workbookFormats = ['xlsx', 'xlsm', 'xltx', 'xls', 'csv', 'tsv', 'ods', 'json', 'xml', 'pdf'];
14
+ /** Extension to classification. Values describe the format, never a capability. */
15
+ export const formatRegistry = Object.freeze({
16
+ xlsx: { family: 'workbook', markup: 'ooxml', macroEnabled: false, opensAs: 'workbook', defaultIntent: 'edit' },
17
+ xlsm: { family: 'workbook', markup: 'ooxml', macroEnabled: true, opensAs: 'workbook', defaultIntent: 'edit' },
18
+ xltx: { family: 'template', markup: 'ooxml', macroEnabled: false, opensAs: 'workbook', defaultIntent: 'template' },
19
+ xls: { family: 'legacy', markup: 'binary', macroEnabled: true, opensAs: 'workbook', defaultIntent: 'edit' },
20
+ csv: { family: 'text', markup: 'text', macroEnabled: false, opensAs: 'data', defaultIntent: 'data' },
21
+ tsv: { family: 'text', markup: 'text', macroEnabled: false, opensAs: 'data', defaultIntent: 'data' },
22
+ ods: { family: 'document', markup: 'odf', macroEnabled: false, opensAs: 'workbook', defaultIntent: 'edit' },
23
+ json: { family: 'interchange', markup: 'json', macroEnabled: false, opensAs: 'data', defaultIntent: 'data' },
24
+ xml: { family: 'interchange', markup: 'xml', macroEnabled: false, opensAs: 'workbook', defaultIntent: 'edit' },
25
+ pdf: { family: 'document', markup: 'fixed', macroEnabled: false, opensAs: 'none', defaultIntent: null },
26
+ });
27
+ /** Returns the full classification of one format. */
28
+ export function formatInfo(format) {
29
+ return { format, ...formatRegistry[format] };
30
+ }
31
+ /** Extracts a classified extension from a path, ignoring case. */
32
+ export function formatFromPath(path) {
33
+ const extension = path.slice(path.lastIndexOf('.') + 1).toLowerCase();
34
+ return workbookFormats.includes(extension) ? extension : undefined;
35
+ }
36
+ /** Default open intent of a format, or `null` when it never opens as a workbook. */
37
+ export function defaultIntentFor(format) {
38
+ return formatRegistry[format].defaultIntent;
39
+ }
package/dist/gui.d.ts ADDED
@@ -0,0 +1,53 @@
1
+ /**
2
+ * WebView host surface.
3
+ *
4
+ * The window is a WAE `WebViewHost` serving the built VMZ studio from `dist/gui`;
5
+ * the page talks to this process over the WebView IPC channel and every message
6
+ * maps onto the same N-API functions the CLI uses.
7
+ */
8
+ /** Lifecycle of one GUI host. */
9
+ export interface GuiStatus {
10
+ readonly state: 'open' | 'closed' | 'not_open' | 'failed';
11
+ readonly code: string | null;
12
+ readonly backend: string | null;
13
+ readonly platform: string;
14
+ readonly uptimeMs: number;
15
+ readonly message: string | null;
16
+ }
17
+ /** Result of asking for a window; failures keep the host detail. */
18
+ export interface GuiOpenResult {
19
+ readonly ok: boolean;
20
+ readonly status: GuiStatus;
21
+ readonly stage: string | null;
22
+ readonly hresult: number | null;
23
+ readonly attempted: readonly string[];
24
+ }
25
+ /** Result of closing a window; `closed` is false when nothing was open. */
26
+ export interface GuiCloseResult {
27
+ readonly closed: boolean;
28
+ readonly status: GuiStatus;
29
+ }
30
+ /** Arguments of {@link openGui}. */
31
+ export interface OpenGuiOptions {
32
+ readonly title?: string;
33
+ readonly contentDir?: string;
34
+ readonly width?: number;
35
+ readonly height?: number;
36
+ }
37
+ /** Terminal host status that is not a clean page close. */
38
+ export declare class GuiError extends Error {
39
+ readonly status: GuiStatus;
40
+ constructor(status: GuiStatus);
41
+ }
42
+ /** The studio is staged next to the compiled CLI as `dist/gui`. */
43
+ export declare function defaultGuiContentDir(): string;
44
+ /** Opens the window, or focuses the live one. */
45
+ export declare function openGui(options?: OpenGuiOptions): GuiOpenResult;
46
+ /** Pumps the host loop once and reports the lifecycle state. */
47
+ export declare function pumpEvents(): GuiStatus;
48
+ /** Closes the window; distinguishes "already closed" from a failure. */
49
+ export declare function closeGui(): GuiCloseResult;
50
+ /** Reports whether the window is alive. */
51
+ export declare function isGuiOpen(): boolean;
52
+ /** Opens the window and pumps until it closes. */
53
+ export declare function runGui(options?: OpenGuiOptions, intervalMs?: number): Promise<GuiStatus>;
package/dist/gui.js ADDED
@@ -0,0 +1,90 @@
1
+ /**
2
+ * WebView host surface.
3
+ *
4
+ * The window is a WAE `WebViewHost` serving the built VMZ studio from `dist/gui`;
5
+ * the page talks to this process over the WebView IPC channel and every message
6
+ * maps onto the same N-API functions the CLI uses.
7
+ */
8
+ import fs from 'node:fs';
9
+ import path from 'node:path';
10
+ import { fileURLToPath } from 'node:url';
11
+ import { NotImplementedError } from './errors.js';
12
+ import { nativeBinding } from './native.js';
13
+ const here = path.dirname(fileURLToPath(import.meta.url));
14
+ /** Terminal host status that is not a clean page close. */
15
+ export class GuiError extends Error {
16
+ status;
17
+ constructor(status) {
18
+ super(status.message ?? `OpenExcel window ended with ${status.code ?? status.state}`);
19
+ this.name = 'GuiError';
20
+ this.status = status;
21
+ }
22
+ }
23
+ /** The studio is staged next to the compiled CLI as `dist/gui`. */
24
+ export function defaultGuiContentDir() {
25
+ const dir = path.resolve(here, 'gui');
26
+ if (!fs.existsSync(path.join(dir, 'index.html'))) {
27
+ throw new Error(`GUI folder missing at ${dir}; run the UI build before opening the window`);
28
+ }
29
+ return dir;
30
+ }
31
+ function native(feature) {
32
+ const binding = nativeBinding();
33
+ if (!binding) {
34
+ throw new NotImplementedError(feature);
35
+ }
36
+ return binding;
37
+ }
38
+ /** Opens the window, or focuses the live one. */
39
+ export function openGui(options = {}) {
40
+ const binding = native('gui');
41
+ const raw = binding.openGui({
42
+ title: options.title ?? 'OpenExcel Studio',
43
+ contentDir: options.contentDir ?? defaultGuiContentDir(),
44
+ width: options.width,
45
+ height: options.height,
46
+ });
47
+ return JSON.parse(raw);
48
+ }
49
+ /** Pumps the host loop once and reports the lifecycle state. */
50
+ export function pumpEvents() {
51
+ return JSON.parse(native('gui').pumpEvents());
52
+ }
53
+ /** Closes the window; distinguishes "already closed" from a failure. */
54
+ export function closeGui() {
55
+ return JSON.parse(native('gui').closeGui());
56
+ }
57
+ /** Reports whether the window is alive. */
58
+ export function isGuiOpen() {
59
+ return native('gui').isGuiOpen();
60
+ }
61
+ /** Opens the window and pumps until it closes. */
62
+ export function runGui(options = {}, intervalMs = 16) {
63
+ const opened = openGui(options);
64
+ if (!opened.ok) {
65
+ return Promise.reject(new GuiError(opened.status));
66
+ }
67
+ return new Promise((resolve, reject) => {
68
+ const timer = setInterval(() => {
69
+ let status;
70
+ try {
71
+ status = pumpEvents();
72
+ }
73
+ catch (error) {
74
+ clearInterval(timer);
75
+ reject(error);
76
+ return;
77
+ }
78
+ if (status.state === 'open') {
79
+ return;
80
+ }
81
+ clearInterval(timer);
82
+ if (status.code === 'gui_closed') {
83
+ resolve(status);
84
+ }
85
+ else {
86
+ reject(new GuiError(status));
87
+ }
88
+ }, intervalMs);
89
+ });
90
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Workbook surface of `@wae/open-excel`.
3
+ *
4
+ * The session, workbook summary, format registry and the native-backed create,
5
+ * open, save, edit, inspect, export and SVG render operations live here. When
6
+ * the addon is absent every engine call rejects with
7
+ * `capability/not-implemented`; the capability matrix always states which
8
+ * formats and checks this build really supports.
9
+ */
10
+ export { OpenExcel } from './open-excel.js';
11
+ export { GuiError, closeGui, defaultGuiContentDir, isGuiOpen, openGui, pumpEvents, runGui } from './gui.js';
12
+ export type { GuiCloseResult, GuiOpenResult, GuiStatus, OpenGuiOptions } from './gui.js';
13
+ export { NotImplementedError, OpenExcelError, errorCodes, isOpenExcelError } from './errors.js';
14
+ export type { OpenExcelErrorCode, OpenExcelErrorDetails, OpenExcelErrorOptions } from './errors.js';
15
+ export { defaultIntentFor, formatFromPath, formatInfo, formatRegistry, workbookFormats } from './formats.js';
16
+ export type { FormatFamily, FormatMarkup, FormatOpenKind, WorkbookFormat, WorkbookFormatInfo, WorkbookIntent, } from './formats.js';
17
+ export type * from './types.js';
package/dist/index.js ADDED
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Workbook surface of `@wae/open-excel`.
3
+ *
4
+ * The session, workbook summary, format registry and the native-backed create,
5
+ * open, save, edit, inspect, export and SVG render operations live here. When
6
+ * the addon is absent every engine call rejects with
7
+ * `capability/not-implemented`; the capability matrix always states which
8
+ * formats and checks this build really supports.
9
+ */
10
+ export { OpenExcel } from './open-excel.js';
11
+ export { GuiError, closeGui, defaultGuiContentDir, isGuiOpen, openGui, pumpEvents, runGui } from './gui.js';
12
+ export { NotImplementedError, OpenExcelError, errorCodes, isOpenExcelError } from './errors.js';
13
+ export { defaultIntentFor, formatFromPath, formatInfo, formatRegistry, workbookFormats } from './formats.js';
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Native addon discovery.
3
+ *
4
+ * The addon only maps values: workbook semantics, inspection and export stay in
5
+ * the shared engine. An absent addon is a declarative state, so calls report
6
+ * `capability/not-implemented` instead of inventing a matrix.
7
+ */
8
+ /** Orthogonal exports of the built addon. Every workbook call returns a JSON string. */
9
+ export interface NativeBinding {
10
+ version(): string;
11
+ capabilities(): string;
12
+ workbook_create(requestJson: string): string;
13
+ workbook_open(path: string): string;
14
+ workbook_save(handle: number, path: string, overwrite: boolean): string;
15
+ workbook_inspect(handle: number, checksJson?: string): string;
16
+ workbook_summary(handle: number): string;
17
+ workbook_edit(handle: number, requestJson: string): string;
18
+ workbook_cell(handle: number, requestJson: string): string;
19
+ workbook_range(handle: number, requestJson: string): string;
20
+ workbook_recalc(handle: number): string;
21
+ workbook_find(handle: number, requestJson: string): string;
22
+ workbook_render(handle: number, requestJson?: string): string;
23
+ workbook_export(handle: number, format: string, target: string, overwrite: boolean): string;
24
+ workbook_close(handle: number): boolean;
25
+ openGui(options?: {
26
+ title?: string;
27
+ contentDir?: string;
28
+ width?: number;
29
+ height?: number;
30
+ }): string;
31
+ pumpEvents(): string;
32
+ closeGui(): string;
33
+ isGuiOpen(): boolean;
34
+ }
35
+ /** Loads the addon once, or returns `undefined` when it is not installed. */
36
+ export declare function nativeBinding(): NativeBinding | undefined;
package/dist/native.js ADDED
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Native addon discovery.
3
+ *
4
+ * The addon only maps values: workbook semantics, inspection and export stay in
5
+ * the shared engine. An absent addon is a declarative state, so calls report
6
+ * `capability/not-implemented` instead of inventing a matrix.
7
+ */
8
+ import { createRequire } from 'node:module';
9
+ const requireNative = createRequire(import.meta.url);
10
+ let cached;
11
+ /** Loads the addon once, or returns `undefined` when it is not installed. */
12
+ export function nativeBinding() {
13
+ if (cached === undefined) {
14
+ cached = load();
15
+ }
16
+ return cached ?? undefined;
17
+ }
18
+ function load() {
19
+ for (const candidate of candidates()) {
20
+ try {
21
+ return requireNative(candidate);
22
+ }
23
+ catch (error) {
24
+ if (candidate === explicitPath()) {
25
+ throw error;
26
+ }
27
+ if (!isModuleNotFound(error, candidate)) {
28
+ throw error;
29
+ }
30
+ }
31
+ }
32
+ return null;
33
+ }
34
+ function candidates() {
35
+ const explicit = explicitPath();
36
+ if (explicit) {
37
+ return [explicit];
38
+ }
39
+ return [`@wae/open-excel-${process.platform}-${process.arch}`];
40
+ }
41
+ function explicitPath() {
42
+ const value = process.env.OPEN_EXCEL_NATIVE;
43
+ return value !== undefined && value.length > 0 ? value : undefined;
44
+ }
45
+ function isModuleNotFound(error, candidate) {
46
+ if (typeof error !== 'object' || error === null) {
47
+ return false;
48
+ }
49
+ const code = error.code;
50
+ // Node prints the resolved path, which uses the platform separator on
51
+ // Windows. Normalize it so a linked platform package without a built
52
+ // addon is still treated as "not installed" instead of a fatal error.
53
+ const message = error.message.replace(/\\/g, '/');
54
+ return code === 'MODULE_NOT_FOUND' && message.includes(candidate);
55
+ }
@@ -0,0 +1,55 @@
1
+ /**
2
+ * `new OpenExcel(options?)` workbook session.
3
+ *
4
+ * The constructor is synchronous and opens nothing: no network, no disk scan,
5
+ * no window, no file. Native initialisation and imports happen inside the async
6
+ * methods, so a failure is always awaited and always carries a stable code.
7
+ */
8
+ import type { CellDetail, CellQuery, EditRequest, EditResult, ExportOptions, ExportReport, FindRequest, FindResult, InspectOptions, InspectReport, OpenExcelCapabilities, OpenExcelOptions, RangeMatrix, RangeQuery, RecalcReport, SaveOptions, SaveReport, SvgRender, Workbook, WorkbookCreateOptions, WorkbookInput, WorkbookRenderOptions } from './types.js';
9
+ /** Workbook session. One instance may open several workbooks. */
10
+ export declare class OpenExcel {
11
+ /** BCP-47 tag used for diagnostics and default copy. */
12
+ readonly locale: string;
13
+ private closed;
14
+ private readonly handles;
15
+ private readonly workbookHandles;
16
+ constructor(options?: OpenExcelOptions);
17
+ /** Whether {@link dispose} has run. */
18
+ get disposed(): boolean;
19
+ /**
20
+ * Format, checker, renderer and export disclosure for the installed engine.
21
+ * Read this instead of treating a method name as a capability.
22
+ */
23
+ capabilities(): Promise<OpenExcelCapabilities>;
24
+ /** Creates an empty workbook and returns its committed summary. */
25
+ create(options?: WorkbookCreateOptions): Promise<Workbook>;
26
+ /** Opens a project file, spreadsheet file or in-memory package. */
27
+ open(input: WorkbookInput): Promise<Workbook>;
28
+ /** Inspects an input without keeping a workbook handle. */
29
+ inspect(input: WorkbookInput, options?: InspectOptions): Promise<InspectReport>;
30
+ /** Writes one tracked workbook to a native project path. */
31
+ save(workbook: Workbook | string, options: SaveOptions): Promise<SaveReport>;
32
+ /** Reads the current summary of one tracked workbook. */
33
+ summary(workbook: Workbook | string): Promise<Workbook>;
34
+ /** Applies one edit request and returns the committed revision and summary. */
35
+ edit(workbook: Workbook | string, request: EditRequest): Promise<EditResult>;
36
+ /** Reads one cell of a tracked workbook with its evaluated value. */
37
+ cell(workbook: Workbook | string, query: CellQuery): Promise<CellDetail>;
38
+ /** Reads a rectangle of a tracked workbook, row by row. */
39
+ range(workbook: Workbook | string, query: RangeQuery): Promise<RangeMatrix>;
40
+ /** Recomputes every formula of a tracked workbook. */
41
+ recalc(workbook: Workbook | string): Promise<RecalcReport>;
42
+ /** Searches evaluated values and formula sources of a tracked workbook. */
43
+ find(workbook: Workbook | string, request: FindRequest): Promise<FindResult>;
44
+ /** Writes one tracked workbook to an exchange format. */
45
+ export(workbook: Workbook | string, options: ExportOptions): Promise<ExportReport>;
46
+ /** Renders one sheet of a tracked workbook as SVG. */
47
+ render(workbook: Workbook | string, options?: WorkbookRenderOptions): Promise<SvgRender>;
48
+ /** Releases the session and every workbook handle it still tracks. Idempotent. */
49
+ dispose(): Promise<void>;
50
+ private track;
51
+ private handleOf;
52
+ /** @internal Throws once the session is gone. */
53
+ assertActive(): void;
54
+ private formatOf;
55
+ }