@docx-editor.dev/core 2.28.0 → 2.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +65 -13
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +54 -38
- package/dist/binding.js +1 -1
- package/dist/{index-Bsg7oIKP.d.ts → chrome-print-BM3Js-6X.d.ts} +281 -222
- package/dist/{chunk-Z6WBFXJU.js → chunk-2PV5L5NJ.js} +3 -3
- package/dist/chunk-4HENIAFG.js +1 -0
- package/dist/chunk-5OTS2EJ7.js +7 -0
- package/dist/chunk-5P4223J4.cjs +27 -0
- package/dist/{chunk-O2AL2HSJ.cjs → chunk-5RRAZMBU.cjs} +1 -1
- package/dist/chunk-5SPITS5F.js +18 -0
- package/dist/{chunk-VDNNLG6X.js → chunk-7ATNKARV.js} +1 -1
- package/dist/{chunk-SRPILEWV.cjs → chunk-BGCUTKWE.cjs} +5 -5
- package/dist/chunk-EBCXSH2W.js +3 -0
- package/dist/{chunk-K5U2PLDP.cjs → chunk-ERECKTIR.cjs} +1 -1
- package/dist/{chunk-QMLCVPCD.cjs → chunk-FLBEJC6X.cjs} +1 -1
- package/dist/{chunk-6AWEKBLB.cjs → chunk-HYASLE2G.cjs} +1 -1
- package/dist/chunk-JC47NRJC.cjs +3 -0
- package/dist/{chunk-ZUHOMK52.cjs → chunk-KJRTNY2Q.cjs} +1 -1
- package/dist/chunk-NKPUH3QJ.js +1 -0
- package/dist/chunk-PF5NJWS3.js +2 -0
- package/dist/chunk-PWTRJSES.cjs +18 -0
- package/dist/chunk-QFKGI242.cjs +30 -0
- package/dist/{chunk-5CSUYANV.js → chunk-RJCQGJR7.js} +1 -1
- package/dist/chunk-RPPV4S6T.cjs +4 -0
- package/dist/{chunk-TSLBZ26X.js → chunk-T32MGBJS.js} +1 -1
- package/dist/chunk-UM26GH5B.js +30 -0
- package/dist/chunk-V3N4SOAK.cjs +1 -0
- package/dist/chunk-VRCZBFLH.js +27 -0
- package/dist/{chunk-2GO5T2JU.cjs → chunk-WF7JZ755.cjs} +1 -1
- package/dist/chunk-WK5X2MMA.cjs +7 -0
- package/dist/{chunk-E7BQA6UP.js → chunk-WPDD2Y32.js} +1 -1
- package/dist/chunk-YBMWBXST.cjs +2 -0
- package/dist/{chunk-ETTO6GK3.js → chunk-YZGUBCHP.js} +1 -1
- package/dist/chunk-ZOS2PM4A.js +4 -0
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +5 -5
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.d.ts +4 -4
- package/dist/contracts/document.d.ts +3 -3
- package/dist/contracts/editor.d.ts +9 -10
- package/dist/contracts/interaction.d.ts +2 -2
- package/dist/contracts/modules.cjs +1 -1
- package/dist/contracts/modules.d.ts +33 -9
- package/dist/contracts/modules.js +1 -1
- package/dist/contracts/types.d.ts +2 -2
- package/dist/{custom-node-writes-cvL5rhcD.d.ts → custom-node-writes-0v0Kgw1T.d.ts} +2 -2
- package/dist/diagnostic-context-CcAO4q1s.d.ts +30 -0
- package/dist/diagnostic-hints-2Bke6H_w.d.ts +120 -0
- package/dist/{document-protection-BAGVGqaP.d.ts → document-protection-8eyMWIJ0.d.ts} +2 -2
- package/dist/{editor-Ci7IZGmG.d.ts → editor-DaEJd2so.d.ts} +460 -9
- package/dist/{editor-scope-OHPwVQ5l.d.ts → editor-scope-7o9xweiJ.d.ts} +1 -1
- package/dist/editor.cjs +1 -1
- package/dist/editor.d.ts +55 -33
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +17 -15
- package/dist/export.js +2 -2
- package/dist/{font-resolver-BVQB14qT.d.ts → font-resolver-CL9BVKZo.d.ts} +3 -3
- package/dist/font-shaping-policy-BvpkrfxM.d.ts +7 -0
- package/dist/{headless-document-view-qH331moE.d.ts → headless-document-view-DZQN8Bnx.d.ts} +2 -2
- package/dist/{image-resources-BN-hUgCn.d.ts → image-resources-Bipz8toD.d.ts} +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +67 -21
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-BEyuiQOk.d.ts → layout-shaping-cEnVrhWg.d.ts} +3 -2
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +42 -42
- package/dist/layout.js +1 -1
- package/dist/{note-properties-4Y9o6Gyk.d.ts → note-properties-9FH8zAeG.d.ts} +3 -3
- package/dist/{omml-equation-CuzBL5DD.d.ts → omml-equation-DP2WpUbK.d.ts} +13 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +8 -9
- package/dist/output.js +1 -1
- package/dist/{protocol-Bqk4Izjc.d.ts → protocol-CZ1uUlPO.d.ts} +2 -2
- package/dist/{review-paragraph-order-DT-n6ouC.d.ts → review-paragraph-order-CqVelc5A.d.ts} +1 -1
- package/dist/{semantic-cell-selection-D9D1KSXq.d.ts → semantic-cell-selection-Dr9yxFZt.d.ts} +4 -211
- package/dist/{semantic-interaction-CIC-PooQ.d.ts → semantic-interaction-Dc3pf3hr.d.ts} +1 -1
- package/dist/{semantic-paint-BME37OMv.d.ts → semantic-paint-Bz3FBAoH.d.ts} +17 -5
- package/dist/{semantic-record-queries-CBlZqZNa.d.ts → semantic-record-queries-Bx0pl6kL.d.ts} +1 -1
- package/dist/{semantic-records-4B3WwFAi.d.ts → semantic-records-CjcF26ZL.d.ts} +892 -416
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +1463 -1574
- package/dist/store.js +1 -1
- package/dist/{tree-package-fragment-BeeKxDw8.d.ts → tree-package-store-DKhdEVym.d.ts} +238 -84
- package/dist/{tree-session-contract-CVbmlMlq.d.ts → tree-session-contract-CwnTEVLF.d.ts} +8 -6
- package/dist/{types-barrel-D3xCgQX6.d.ts → types-barrel-CA0xB8kH.d.ts} +548 -527
- package/package.json +3 -3
- package/dist/chunk-2RC2EPND.js +0 -3
- package/dist/chunk-4GBTELJV.cjs +0 -28
- package/dist/chunk-4R3TEXMN.js +0 -18
- package/dist/chunk-6APGXLBB.cjs +0 -3
- package/dist/chunk-6EYYL7FL.js +0 -1
- package/dist/chunk-EO4C5QJW.cjs +0 -2
- package/dist/chunk-FIJZIQXA.cjs +0 -18
- package/dist/chunk-FRXAOVTB.js +0 -28
- package/dist/chunk-J6BVWIDB.js +0 -2
- package/dist/chunk-JGNVNT2A.cjs +0 -2
- package/dist/chunk-KKIJG3C6.js +0 -2
- package/dist/chunk-LWDSDCMO.js +0 -27
- package/dist/chunk-NBCVVZOM.cjs +0 -1
- package/dist/chunk-O5INAWZQ.js +0 -1
- package/dist/chunk-RCHS4ZEH.cjs +0 -27
- package/dist/chunk-VHAVHCQY.js +0 -7
- package/dist/chunk-VX43VBAX.cjs +0 -7
- package/dist/review-pane-D9jm8DcY.d.ts +0 -128
- package/dist/revision-projection-DZ4kKVev.d.ts +0 -242
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { b as CollaborationFailureCode } from './failure-NS2lsya4.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The public diagnostic vocabulary: stable codes and the buckets sizes and counts are reported
|
|
5
|
+
* in. It lives in this neutral lane so a headless runtime can name a refusal without the editor
|
|
6
|
+
* contracts; `contracts/diagnostics.ts` re-exports it for the editor's own types.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/** Why a document could not be opened. @public */
|
|
10
|
+
type DocumentOpenDiagnosticCode = 'open.unsupported-source' | 'open.zip-corrupt' | 'open.zip-invalid-entry-name' | 'open.zip-entry-limit' | 'open.zip-size-limit' | 'open.zip-ratio-limit' | 'open.xml-malformed' | 'open.xml-dtd-forbidden' | 'open.xml-part-size-limit' | 'open.xml-depth-limit' | 'open.xml-element-limit' | 'open.invalid-limits' | 'open.content-types-invalid' | 'open.missing-main-document' | 'open.relationships-invalid' | 'open.relationship-limit' | 'open.part-limit' | 'open.failed';
|
|
11
|
+
/**
|
|
12
|
+
* Why `save()` did not return the document: no document was loaded, the document changed while
|
|
13
|
+
* a pending edit finished, or the save threw.
|
|
14
|
+
*
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
type DocumentSaveDiagnosticCode = 'save.no-document' | 'save.document-changed' | 'save.failed';
|
|
18
|
+
/** Why an edit, a command or a tracked change was refused. @public */
|
|
19
|
+
type EditDiagnosticCode = 'edit.read-only' | 'edit.protected-content' | 'edit.suggesting-needs-author' | 'edit.review-module-required' | 'edit.tracked-drawing-delete-unsupported' | 'edit.tracked-structure-unsupported' | 'edit.tracked-operation-unsupported' | 'edit.tracking-mode-unsupported' | 'edit.tracking-author-required' | 'edit.tracking-unsupported-host' | 'edit.revision-unsupported' | 'edit.tracking-required' | 'edit.tracked-image-replace-unsupported' | 'edit.picture-selected' | 'edit.cross-structure-join' | 'edit.indivisible-content' | 'edit.field-structure' | 'edit.section-mark' | 'edit.table-structure-unsupported' | 'edit.table-insert-refused' | 'edit.table-of-contents-refused' | 'edit.unsupported-content' | 'edit.operation-unsupported' | 'edit.unsupported-story' | 'edit.unmapped-change' | 'edit.stale-target' | 'edit.invalid-argument' | 'edit.resource-limit' | 'edit.refresh-in-progress' | 'edit.collaboration-not-ready' | 'edit.collaboration-text-limit' | 'edit.internal-invariant' | 'edit.refused';
|
|
20
|
+
/** Why accepting, rejecting or re-authoring a tracked change skipped an item. @public */
|
|
21
|
+
type ReviewDiagnosticCode = 'review.revision-unsupported' | 'review.incomplete-group' | 'review.retained-structure' | 'review.stale-revision';
|
|
22
|
+
/** Why a font did not load. The family name is never reported. @public */
|
|
23
|
+
type FontDiagnosticCode = 'font.shaper-unavailable' | 'font.load-failed' | 'font.missing' | 'font.integrity-mismatch' | 'font.malformed' | 'font.size-limit' | 'font.unsupported-face';
|
|
24
|
+
/**
|
|
25
|
+
* Why the undo history did not group edits as one step. Informational: nothing was refused.
|
|
26
|
+
*
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
type HistoryDiagnosticCode = 'history.split' | 'history.possible-ungrouped-gesture' | 'history.possible-fragmented-gesture';
|
|
30
|
+
/**
|
|
31
|
+
* Why a performance summary needs attention. Informational: nothing was refused.
|
|
32
|
+
*
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
type PerformanceDiagnosticCode = 'performance.slow-interaction';
|
|
36
|
+
/** Why a custom node's stored payload could not be read. The node name is never reported. @public */
|
|
37
|
+
type CustomNodeDiagnosticCode = 'custom-node.payload-invalid' | 'custom-node.payload-missing';
|
|
38
|
+
/**
|
|
39
|
+
* Why a collaboration session failed or refused work: `collab.` and the session's own public
|
|
40
|
+
* {@link CollaborationFailureCode}, such as `collab.authentication-failed`.
|
|
41
|
+
*
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
type CollaborationDiagnosticCode = `collab.${CollaborationFailureCode}`;
|
|
45
|
+
/** Every public diagnostic code. Codes are stable: a new one is additive, none is renamed. @public */
|
|
46
|
+
type DiagnosticCode = DocumentOpenDiagnosticCode | DocumentSaveDiagnosticCode | EditDiagnosticCode | ReviewDiagnosticCode | FontDiagnosticCode | HistoryDiagnosticCode | CustomNodeDiagnosticCode | PerformanceDiagnosticCode | CollaborationDiagnosticCode;
|
|
47
|
+
/**
|
|
48
|
+
* A coarse size, in powers of two, so a size cannot single out one document.
|
|
49
|
+
* `'0-64KiB'` covers everything under 64 KiB; `'512MiB+'` everything above.
|
|
50
|
+
*
|
|
51
|
+
* @public
|
|
52
|
+
*/
|
|
53
|
+
type ByteSizeBucket = '0-64KiB' | '64-128KiB' | '128-256KiB' | '256-512KiB' | '512KiB-1MiB' | '1-2MiB' | '2-4MiB' | '4-8MiB' | '8-16MiB' | '16-32MiB' | '32-64MiB' | '64-128MiB' | '128-256MiB' | '256-512MiB' | '512MiB+';
|
|
54
|
+
/** A coarse count: `'0'`, `'1'`, `'2-9'`, `'10-99'`, `'100-999'`, `'1000+'`. @public */
|
|
55
|
+
type CountBucket = '0' | '1' | '2-9' | '10-99' | '100-999' | '1000+';
|
|
56
|
+
/**
|
|
57
|
+
* Which kind of package part a failure is in, by its role, never by its name: a part's real
|
|
58
|
+
* name is file data. A name outside the standard layout reports `'other'`.
|
|
59
|
+
*
|
|
60
|
+
* @public
|
|
61
|
+
*/
|
|
62
|
+
type DocumentPartKind = 'package' | 'content-types' | 'relationships' | 'main-document' | 'glossary' | 'styles' | 'numbering' | 'settings' | 'web-settings' | 'font-table' | 'theme' | 'header' | 'footer' | 'footnotes' | 'endnotes' | 'comments' | 'people' | 'custom-xml' | 'document-properties' | 'media' | 'embedding' | 'other';
|
|
63
|
+
/**
|
|
64
|
+
* The class of an unexpected exception, for a failure the engine did not name. The message is
|
|
65
|
+
* never reported, because it can quote document content.
|
|
66
|
+
*
|
|
67
|
+
* @public
|
|
68
|
+
*/
|
|
69
|
+
type DiagnosticErrorName = 'Error' | 'TypeError' | 'RangeError' | 'ReferenceError' | 'SyntaxError' | 'other';
|
|
70
|
+
/** What a tracked-change request was asked to do. @public */
|
|
71
|
+
type ReviewOperation = 'accept' | 'reject' | 'reassign';
|
|
72
|
+
/** The kind of a tracked change, as the review queue lists it. @public */
|
|
73
|
+
type ReviewChangeKind = 'insert' | 'delete' | 'replace' | 'moveFrom' | 'moveTo' | 'format' | 'paragraphMark' | 'structural';
|
|
74
|
+
/**
|
|
75
|
+
* Which property change a formatting change is, by its OOXML element. A name outside this list
|
|
76
|
+
* reports `'other'`.
|
|
77
|
+
*
|
|
78
|
+
* @public
|
|
79
|
+
*/
|
|
80
|
+
type FormattingChangeKind = 'rPrChange' | 'pPrChange' | 'sectPrChange' | 'tblPrChange' | 'tblPrExChange' | 'tblGridChange' | 'trPrChange' | 'tcPrChange' | 'numberingChange' | 'other';
|
|
81
|
+
/**
|
|
82
|
+
* Where an exception the engine did not expect was caught: the mount of an open, a later layout
|
|
83
|
+
* slice of an open, a command, a single review action, or an editing API batch.
|
|
84
|
+
*
|
|
85
|
+
* @public
|
|
86
|
+
*/
|
|
87
|
+
type FailureStage = 'open-mount' | 'open-layout' | 'command' | 'review-item' | 'automation' | 'save';
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* What a diagnostic code means and what to do about it.
|
|
91
|
+
*
|
|
92
|
+
* Both strings are constants written for developers. They never contain document content, so
|
|
93
|
+
* an exporter can send them with the event.
|
|
94
|
+
*
|
|
95
|
+
* @public
|
|
96
|
+
*/
|
|
97
|
+
interface DiagnosticExplanation {
|
|
98
|
+
/** One or two sentences: the cause, then the action. */
|
|
99
|
+
readonly hint: string;
|
|
100
|
+
/** The documentation anchor for this code, such as `…/guides/diagnostics#edit-read-only`. */
|
|
101
|
+
readonly docs: string;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* What a diagnostic code means and what to do about it.
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```ts
|
|
108
|
+
* editor.on('diagnostic', (event) => {
|
|
109
|
+
* if (event.kind === 'edit.rejected') console.warn(explainDiagnostic(event.code).hint);
|
|
110
|
+
* });
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
* @public
|
|
114
|
+
*/
|
|
115
|
+
declare function explainDiagnostic(code: DiagnosticCode): DiagnosticExplanation;
|
|
116
|
+
/** Every public code, in declaration order. For coverage tests and catalogs. @public */
|
|
117
|
+
declare function diagnosticCodes(): readonly DiagnosticCode[];
|
|
118
|
+
|
|
119
|
+
export { diagnosticCodes as l, explainDiagnostic as m };
|
|
120
|
+
export type { ByteSizeBucket as B, CollaborationDiagnosticCode as C, DiagnosticErrorName as D, EditDiagnosticCode as E, FailureStage as F, HistoryDiagnosticCode as H, PerformanceDiagnosticCode as P, ReviewChangeKind as R, DocumentPartKind as a, CountBucket as b, CustomNodeDiagnosticCode as c, DiagnosticCode as d, DiagnosticExplanation as e, DocumentOpenDiagnosticCode as f, DocumentSaveDiagnosticCode as g, FontDiagnosticCode as h, FormattingChangeKind as i, ReviewDiagnosticCode as j, ReviewOperation as k };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as OoxmlNode } from './types-barrel-
|
|
1
|
+
import { N as OoxmlNode } from './types-barrel-CA0xB8kH.js';
|
|
2
2
|
|
|
3
3
|
/** `ST_DocProtect`: the restriction a document asks for. `none` also stands for "no element". */
|
|
4
4
|
type DocumentProtectionEdit = 'none' | 'readOnly' | 'comments' | 'trackedChanges' | 'forms';
|
|
@@ -17,4 +17,4 @@ declare const NO_DOCUMENT_PROTECTION: DocumentProtectionState;
|
|
|
17
17
|
declare function readDocumentProtection(settingsRoot: OoxmlNode | null | undefined): DocumentProtectionState;
|
|
18
18
|
|
|
19
19
|
export { NO_DOCUMENT_PROTECTION as N, readDocumentProtection as r };
|
|
20
|
-
export type {
|
|
20
|
+
export type { DocumentProtectionEdit as D, DocumentProtectionState as a };
|
|
@@ -1,13 +1,139 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { H as HistoryDiagnostic, V as ViewScope, a as HistoryGroup, b as EditorExecOptions, E as EditorScope } from './editor-scope-OHPwVQ5l.js';
|
|
1
|
+
import { q as ResolvedRevisionMarkup, a as ReviewDisplayMode } from './semantic-records-CjcF26ZL.js';
|
|
2
|
+
import { t as DocAnchor, g as ReviewRevisionKind, c as ReviewCommentItem, b as ReviewRevisionItem, d as ReviewCustomItem, aJ as SourceCrop, Y as DrawingKind, a1 as ImageWrapTarget, _ as DrawingPositionInput, Z as DrawingLocks, r as ColorValue, x as ExecErrorCode, a5 as ParagraphFormatCommand, af as Watermark, E as ExecResult, n as ContentControlFilter, o as DocRange, k as RunFormatting, p as Revision, a7 as Rect, ab as SelectionPin, ae as Unsubscribe } from './types-barrel-CA0xB8kH.js';
|
|
3
|
+
import { H as HistoryDiagnostic, V as ViewScope, b as HistoryGroup, a as EditorExecOptions, E as EditorScope } from './editor-scope-7o9xweiJ.js';
|
|
5
4
|
import { DocEdits, DocQueries, DocQueryResults, ContentControlSummary } from './contracts/document.js';
|
|
6
5
|
import { InteractionOutcome } from './contracts/interaction.js';
|
|
7
|
-
import { a as SemanticSelection, S as SemanticPosition } from './semantic-interaction-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { a as SemanticSelection, S as SemanticPosition } from './semantic-interaction-Dc3pf3hr.js';
|
|
7
|
+
import { I as ImageResourceState, S as SupportedImageMime } from './image-resources-Bipz8toD.js';
|
|
8
|
+
import { a as DocumentProtectionState } from './document-protection-8eyMWIJ0.js';
|
|
10
9
|
import { C as CollaborationStatus } from './failure-NS2lsya4.js';
|
|
10
|
+
import { C as CollaborationDiagnosticCode, c as CustomNodeDiagnosticCode, D as DiagnosticErrorName, F as FailureStage, B as ByteSizeBucket, b as CountBucket, f as DocumentOpenDiagnosticCode, a as DocumentPartKind, g as DocumentSaveDiagnosticCode, E as EditDiagnosticCode, j as ReviewDiagnosticCode, k as ReviewOperation, R as ReviewChangeKind, i as FormattingChangeKind, h as FontDiagnosticCode, H as HistoryDiagnosticCode, P as PerformanceDiagnosticCode } from './diagnostic-hints-2Bke6H_w.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* When the review pane opens by itself.
|
|
14
|
+
*
|
|
15
|
+
* - `'auto'`: the pane opens when a document with review items loads, and when a tracked
|
|
16
|
+
* change is made while it is closed, in both cases when the pane has items to list. With
|
|
17
|
+
* `revisionsIn: 'balloons'` the pane lists no tracked change and no reply to one, so
|
|
18
|
+
* tracked changes and their replies alone do not open it.
|
|
19
|
+
* - `'manual'`: the pane stays closed until the host or the user opens it. Use it when the
|
|
20
|
+
* host shows review items its own way, such as in balloons or margin markers.
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
type ReviewPaneOpening = 'auto' | 'manual';
|
|
25
|
+
/**
|
|
26
|
+
* What the open review pane does when its full card column does not fit beside the page at
|
|
27
|
+
* the page's zoom.
|
|
28
|
+
*
|
|
29
|
+
* - `'float'`: the pane shrinks to a strip of markers, and the open card floats over the
|
|
30
|
+
* page.
|
|
31
|
+
* - `'shrinkPage'`: under a fit zoom mode, the page may shrink down to the mode's
|
|
32
|
+
* `minZoom` (or 10%) so that the full column fits. The pane changes to the marker strip
|
|
33
|
+
* only when the column does not fit at that floor either. A fixed zoom behaves as
|
|
34
|
+
* `'float'`.
|
|
35
|
+
* - `'scroll'`: the page keeps the size it has beside the closed pane's marker strip, and
|
|
36
|
+
* the full column stands beside it. The document and the column scroll together: the
|
|
37
|
+
* viewport scrolls sideways to reach the cards.
|
|
38
|
+
*
|
|
39
|
+
* The setting applies to the review pane only. The navigation pane stays docked at its side
|
|
40
|
+
* in every mode: it never scrolls with the document, and it takes its room beside the page
|
|
41
|
+
* exactly as it does with no review pane.
|
|
42
|
+
*
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
45
|
+
type ReviewPaneOverflow = 'float' | 'shrinkPage' | 'scroll';
|
|
46
|
+
/**
|
|
47
|
+
* Where tracked changes open.
|
|
48
|
+
*
|
|
49
|
+
* - `'pane'`: the review pane lists tracked changes as cards beside the comments.
|
|
50
|
+
* - `'balloons'`: the pane lists comments only, except comments that reply to a tracked
|
|
51
|
+
* change: the change's balloon shows those. A tracked change opens in a balloon at its
|
|
52
|
+
* text when the reader clicks it, or when Next Change, Previous Change, or
|
|
53
|
+
* `setActiveReviewItem(key, { announce: true })` reaches it.
|
|
54
|
+
*
|
|
55
|
+
* @public
|
|
56
|
+
*/
|
|
57
|
+
type RevisionDisplay = 'pane' | 'balloons';
|
|
58
|
+
/**
|
|
59
|
+
* How a collapsed comment marker looks.
|
|
60
|
+
*
|
|
61
|
+
* - `'initials'`: a badge with the thread author's initials in the author's color, a reply
|
|
62
|
+
* count, and a check mark when the thread is resolved.
|
|
63
|
+
* - `'icon'`: the comment icon.
|
|
64
|
+
*
|
|
65
|
+
* @public
|
|
66
|
+
*/
|
|
67
|
+
type CommentMarkerStyle = 'initials' | 'icon';
|
|
68
|
+
/**
|
|
69
|
+
* Review pane settings to change. Every field is optional, and an omitted field keeps its
|
|
70
|
+
* current value.
|
|
71
|
+
*
|
|
72
|
+
* @public
|
|
73
|
+
*/
|
|
74
|
+
interface ReviewPaneOptions {
|
|
75
|
+
/** Default `'auto'`. */
|
|
76
|
+
readonly opening?: ReviewPaneOpening;
|
|
77
|
+
/** Default `'float'`. */
|
|
78
|
+
readonly overflow?: ReviewPaneOverflow;
|
|
79
|
+
/** Default `'pane'`. */
|
|
80
|
+
readonly revisionsIn?: RevisionDisplay;
|
|
81
|
+
/** Default `'icon'`. */
|
|
82
|
+
readonly commentMarkers?: CommentMarkerStyle;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* The review pane settings in force, with every field resolved.
|
|
86
|
+
*
|
|
87
|
+
* @public
|
|
88
|
+
*/
|
|
89
|
+
interface ResolvedReviewPane {
|
|
90
|
+
/** When the pane opens by itself. */
|
|
91
|
+
readonly opening: ReviewPaneOpening;
|
|
92
|
+
/** What the open pane does when its card column does not fit beside the page. */
|
|
93
|
+
readonly overflow: ReviewPaneOverflow;
|
|
94
|
+
/** Where tracked changes open. */
|
|
95
|
+
readonly revisionsIn: RevisionDisplay;
|
|
96
|
+
/** How a collapsed comment marker looks. */
|
|
97
|
+
readonly commentMarkers: CommentMarkerStyle;
|
|
98
|
+
}
|
|
99
|
+
/** The settings an editor starts with when nothing sets them. @public */
|
|
100
|
+
declare const DEFAULT_REVIEW_PANE: ResolvedReviewPane;
|
|
101
|
+
/**
|
|
102
|
+
* Merge `options` over `base`. Throws a `TypeError` for an unknown field or value, so a
|
|
103
|
+
* misspelled setting fails loudly instead of being ignored. Returns `base` itself when
|
|
104
|
+
* nothing changes, so the snapshot keeps its reference.
|
|
105
|
+
*
|
|
106
|
+
* @public
|
|
107
|
+
*/
|
|
108
|
+
declare function resolveReviewPane(options: ReviewPaneOptions | undefined, base?: ResolvedReviewPane): ResolvedReviewPane;
|
|
109
|
+
/**
|
|
110
|
+
* The fields of a review item that decide whether the review pane lists it. A
|
|
111
|
+
* `ReviewItem` and a review item placement both have them.
|
|
112
|
+
*
|
|
113
|
+
* @public
|
|
114
|
+
*/
|
|
115
|
+
interface ReviewPaneItemFields {
|
|
116
|
+
/** The item kind, as `ReviewItem.kind` gives it. */
|
|
117
|
+
readonly kind: 'revision' | 'comment' | 'custom';
|
|
118
|
+
/** For a comment, the tracked change it replies to. */
|
|
119
|
+
readonly parentRevisionId?: string;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Whether the review pane lists a card for `item` under `revisionsIn`.
|
|
123
|
+
*
|
|
124
|
+
* With `'balloons'`, a balloon at the text shows every tracked change and every comment
|
|
125
|
+
* that replies to a tracked change, so the pane lists neither. Give the item as an
|
|
126
|
+
* unfiltered `getReviewItems()` read returns it: a query that excludes revision kinds
|
|
127
|
+
* removes `parentRevisionId` from replies to the changes it drops.
|
|
128
|
+
*
|
|
129
|
+
* The engine applies this rule to every review item when it decides whether the pane opens
|
|
130
|
+
* by itself or closes after a settings change. A review pane must apply the same rule before
|
|
131
|
+
* its own filters, such as a hidden kind or a host filter. Those filters can hide every card,
|
|
132
|
+
* and then the pane that the engine opens is empty.
|
|
133
|
+
*
|
|
134
|
+
* @public
|
|
135
|
+
*/
|
|
136
|
+
declare function reviewPaneListsItem(revisionsIn: RevisionDisplay, item: ReviewPaneItemFields): boolean;
|
|
11
137
|
|
|
12
138
|
/**
|
|
13
139
|
* What a fit mode fits the page to.
|
|
@@ -41,6 +167,315 @@ type ZoomMode = {
|
|
|
41
167
|
readonly maxZoom?: number;
|
|
42
168
|
};
|
|
43
169
|
|
|
170
|
+
/**
|
|
171
|
+
* Anonymous diagnostics: why something failed, as stable codes and bucketed numbers.
|
|
172
|
+
*
|
|
173
|
+
* A document is user data. Its text, names, part names, relationship targets, author names and
|
|
174
|
+
* font names never appear in a diagnostic. Every field below is a closed enum, a boolean or a
|
|
175
|
+
* number, so an event can go to an error tracker or a metrics backend as it is. The internal
|
|
176
|
+
* rejection reasons stay internal: they map many-to-one onto {@link DiagnosticCode}, which is
|
|
177
|
+
* the public, versioned vocabulary a host can match on.
|
|
178
|
+
*
|
|
179
|
+
* @packageDocumentation
|
|
180
|
+
*/
|
|
181
|
+
|
|
182
|
+
/** Version of the {@link EditorDiagnostic} shape. Raised only when a field changes meaning. @public */
|
|
183
|
+
declare const DIAGNOSTIC_SCHEMA_VERSION = 1;
|
|
184
|
+
|
|
185
|
+
/** The bucketed shape of an opened document. @public */
|
|
186
|
+
interface DocumentShape {
|
|
187
|
+
/** XML parts in the package. */
|
|
188
|
+
readonly parts: CountBucket;
|
|
189
|
+
readonly paragraphs: CountBucket;
|
|
190
|
+
/** Tracked changes and comments, as the review queue lists them. */
|
|
191
|
+
readonly reviewItems: CountBucket;
|
|
192
|
+
readonly embeddedFonts: CountBucket;
|
|
193
|
+
}
|
|
194
|
+
/** Fields every diagnostic carries. @public */
|
|
195
|
+
interface DiagnosticBase {
|
|
196
|
+
/** {@link DIAGNOSTIC_SCHEMA_VERSION} when the event was made. */
|
|
197
|
+
readonly schemaVersion: number;
|
|
198
|
+
/**
|
|
199
|
+
* Random for each editor instance and never stored, so one open failure can be linked to the
|
|
200
|
+
* edits after it. It identifies no person and no document.
|
|
201
|
+
*/
|
|
202
|
+
readonly editorSessionId: string;
|
|
203
|
+
/** Milliseconds since the epoch. */
|
|
204
|
+
readonly time: number;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Anonymous detail of a failure, for the engineer who fixes it. Every field is optional and
|
|
208
|
+
* comes from a closed list: never a part name, an element name, a message, or document text.
|
|
209
|
+
*
|
|
210
|
+
* @public
|
|
211
|
+
*/
|
|
212
|
+
interface DiagnosticFailureDetail {
|
|
213
|
+
/**
|
|
214
|
+
* The engine's own reason, such as `undeclared-prefix` under `open.xml-malformed`, or
|
|
215
|
+
* `exception` for an error the engine did not expect. Causes can change between engine
|
|
216
|
+
* versions: match on `code`, and include the `cause` when you report a problem. See
|
|
217
|
+
* `diagnosticCauses()` for every value.
|
|
218
|
+
*/
|
|
219
|
+
readonly cause?: string;
|
|
220
|
+
/** The class of the exception when `cause` is `exception`. Its message is never reported. */
|
|
221
|
+
readonly errorName?: DiagnosticErrorName;
|
|
222
|
+
/** Where the exception was caught, when `cause` is `exception`. */
|
|
223
|
+
readonly stage?: FailureStage;
|
|
224
|
+
}
|
|
225
|
+
/** A document opened, or failed to open. @public */
|
|
226
|
+
type DocumentOpenDiagnostic = DiagnosticBase & {
|
|
227
|
+
readonly kind: 'document.open';
|
|
228
|
+
} & ({
|
|
229
|
+
readonly outcome: 'opened';
|
|
230
|
+
/** Compressed size of the bytes the editor was given. */
|
|
231
|
+
readonly sizeBucket: ByteSizeBucket;
|
|
232
|
+
/** Pages after the first layout. Absent on a headless host that does not paginate. */
|
|
233
|
+
readonly pagesBucket?: CountBucket;
|
|
234
|
+
/**
|
|
235
|
+
* More of the document's shape, in buckets. A telemetry client sends it only when you
|
|
236
|
+
* ask for the detailed shape: several counts together describe a document more closely.
|
|
237
|
+
*/
|
|
238
|
+
readonly shape?: DocumentShape;
|
|
239
|
+
/** Milliseconds from the start of the open to the mounted first layout. */
|
|
240
|
+
readonly durationMs: number;
|
|
241
|
+
} | (DiagnosticFailureDetail & {
|
|
242
|
+
readonly outcome: 'rejected';
|
|
243
|
+
readonly code: DocumentOpenDiagnosticCode;
|
|
244
|
+
/** Compressed size of the bytes, absent when the source was not bytes at all. */
|
|
245
|
+
readonly sizeBucket?: ByteSizeBucket;
|
|
246
|
+
/** The role of the part that failed, such as `'header'`. Never its name. */
|
|
247
|
+
readonly part?: DocumentPartKind;
|
|
248
|
+
}));
|
|
249
|
+
/**
|
|
250
|
+
* A `save()` call returned the document, or failed. Reported for each call, by the editor that
|
|
251
|
+
* saved. A save the host does afterwards, such as an upload, is the host's to measure.
|
|
252
|
+
*
|
|
253
|
+
* @public
|
|
254
|
+
*/
|
|
255
|
+
type DocumentSaveDiagnostic = DiagnosticBase & {
|
|
256
|
+
readonly kind: 'document.save';
|
|
257
|
+
} & ({
|
|
258
|
+
readonly outcome: 'saved';
|
|
259
|
+
/** Size of the saved bytes. */
|
|
260
|
+
readonly sizeBucket: ByteSizeBucket;
|
|
261
|
+
/** Milliseconds from the `save()` call to the bytes, pending edits included. */
|
|
262
|
+
readonly durationMs: number;
|
|
263
|
+
} | (DiagnosticFailureDetail & {
|
|
264
|
+
readonly outcome: 'rejected';
|
|
265
|
+
readonly code: DocumentSaveDiagnosticCode;
|
|
266
|
+
/** Milliseconds from the `save()` call to the failure. */
|
|
267
|
+
readonly durationMs: number;
|
|
268
|
+
}));
|
|
269
|
+
/**
|
|
270
|
+
* What an editor did over a window of use or over its whole session. Counts and milliseconds
|
|
271
|
+
* only: no key, position, command argument or text.
|
|
272
|
+
*
|
|
273
|
+
* @public
|
|
274
|
+
*/
|
|
275
|
+
interface SessionActivity {
|
|
276
|
+
/**
|
|
277
|
+
* For `active`, milliseconds from the window's first activity to the summary. For `end`,
|
|
278
|
+
* milliseconds from the editor's creation to its end, idle time included.
|
|
279
|
+
*/
|
|
280
|
+
readonly durationMs: number;
|
|
281
|
+
/**
|
|
282
|
+
* Milliseconds of use: the time between key presses, pointer presses and edits that are at
|
|
283
|
+
* most 30 seconds apart. A longer pause counts as idle.
|
|
284
|
+
*/
|
|
285
|
+
readonly activeMs: number;
|
|
286
|
+
/**
|
|
287
|
+
* Edits from typing, the clipboard, drag and drop, keyboard undo, and other input that changed
|
|
288
|
+
* the document. Each committed change counts once: typing commits about one change per
|
|
289
|
+
* character, and characters typed faster than the editor paints commit together.
|
|
290
|
+
*/
|
|
291
|
+
readonly inputEdits: number;
|
|
292
|
+
/** Editor commands, from `exec(...)` or the toolbar, that changed the document. */
|
|
293
|
+
readonly commandEdits: number;
|
|
294
|
+
/** Editing API batches that changed the document. */
|
|
295
|
+
readonly automationEdits: number;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* The lifecycle and activity of one editor instance, without any content.
|
|
299
|
+
*
|
|
300
|
+
* - `start`: the editor was created.
|
|
301
|
+
* - `active`: a summary of one window of use. Sent after a minute of activity, when the page is
|
|
302
|
+
* hidden, and before `end`, if anything happened since the last summary. An idle editor sends
|
|
303
|
+
* none, so `active` is not a heartbeat.
|
|
304
|
+
* - `end`: the editor was destroyed, or the page closed. Carries totals for the whole session.
|
|
305
|
+
*
|
|
306
|
+
* Edits count changes this editor committed. Refused edits are in `edit.rejected`, and edits
|
|
307
|
+
* that collaborators made are not counted. Sum `active` summaries or read `end` totals, not
|
|
308
|
+
* both: the totals include every summary.
|
|
309
|
+
*
|
|
310
|
+
* @public
|
|
311
|
+
*/
|
|
312
|
+
type SessionDiagnostic = DiagnosticBase & {
|
|
313
|
+
readonly kind: 'session';
|
|
314
|
+
} & ({
|
|
315
|
+
readonly phase: 'start';
|
|
316
|
+
} | (SessionActivity & {
|
|
317
|
+
readonly phase: 'active' | 'end';
|
|
318
|
+
}));
|
|
319
|
+
/** Where a refused edit came from. @public */
|
|
320
|
+
type EditRejectionOrigin = 'command' | 'input' | 'automation';
|
|
321
|
+
/** An edit, a command or a tracked change was refused. @public */
|
|
322
|
+
interface EditRejectedDiagnostic extends DiagnosticBase, DiagnosticFailureDetail {
|
|
323
|
+
readonly kind: 'edit.rejected';
|
|
324
|
+
readonly code: EditDiagnosticCode;
|
|
325
|
+
/**
|
|
326
|
+
* `'command'` for `exec(...)`, `'input'` for typing, clipboard, drag and pointer edits, and
|
|
327
|
+
* `'automation'` for a batch from the editing API.
|
|
328
|
+
*/
|
|
329
|
+
readonly origin: EditRejectionOrigin;
|
|
330
|
+
/** True when the editor was suggesting (tracking changes) at the time. */
|
|
331
|
+
readonly tracked: boolean;
|
|
332
|
+
/** The command type for `origin: 'command'`, such as `'insertTable'`. */
|
|
333
|
+
readonly command?: EditorCommand['type'];
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* An accept, reject or re-author request skipped one or more tracked changes. One event for each
|
|
337
|
+
* code and kind of change in the request.
|
|
338
|
+
*
|
|
339
|
+
* @public
|
|
340
|
+
*/
|
|
341
|
+
interface ReviewSkippedDiagnostic extends DiagnosticBase {
|
|
342
|
+
readonly kind: 'review.skipped';
|
|
343
|
+
readonly code: ReviewDiagnosticCode;
|
|
344
|
+
/** How many items were skipped for this code and kind in the one request. */
|
|
345
|
+
readonly count: number;
|
|
346
|
+
/** What the request asked: accept, reject, or attribute to another author. */
|
|
347
|
+
readonly operation?: ReviewOperation;
|
|
348
|
+
/** The kind of the skipped changes, absent when the change no longer exists. */
|
|
349
|
+
readonly changeKind?: ReviewChangeKind;
|
|
350
|
+
/** For `changeKind: 'format'`, which property change it is. */
|
|
351
|
+
readonly formattingKind?: FormattingChangeKind;
|
|
352
|
+
/** The role of the part the changes are in, such as `'footnotes'`. Never its name. */
|
|
353
|
+
readonly part?: DocumentPartKind;
|
|
354
|
+
/**
|
|
355
|
+
* For `review.revision-unsupported`, the engine condition that refused the change, such as
|
|
356
|
+
* `unaddressed` (no `w:id` or author) or `unrecorded-properties`. See `diagnosticCauses()`.
|
|
357
|
+
*/
|
|
358
|
+
readonly cause?: string;
|
|
359
|
+
}
|
|
360
|
+
/** A font failed to load. The editor kept working with a substitute. @public */
|
|
361
|
+
interface FontFailedDiagnostic extends DiagnosticBase {
|
|
362
|
+
readonly kind: 'font.failed';
|
|
363
|
+
readonly code: FontDiagnosticCode;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* A collaboration session changed status: it joined, disconnected, failed, or healed.
|
|
367
|
+
*
|
|
368
|
+
* @public
|
|
369
|
+
*/
|
|
370
|
+
interface CollaborationStatusDiagnostic extends DiagnosticBase {
|
|
371
|
+
readonly kind: 'collab.status';
|
|
372
|
+
readonly status: CollaborationStatus;
|
|
373
|
+
/** The status before this change; `'none'` for the first status the editor saw. */
|
|
374
|
+
readonly previous: CollaborationStatus | 'none';
|
|
375
|
+
/** Why the session holds `status`, when something is wrong. */
|
|
376
|
+
readonly code?: CollaborationDiagnosticCode;
|
|
377
|
+
/** True when the session will heal on its own; wait instead of rejoining. */
|
|
378
|
+
readonly recovering: boolean;
|
|
379
|
+
/**
|
|
380
|
+
* Milliseconds from the editor attaching the session to its first `ready`. Present only on
|
|
381
|
+
* that change, and only when the editor saw the wait: a session that was already ready when
|
|
382
|
+
* the editor attached, as `useHocuspocusCollaboration` makes it, reports none.
|
|
383
|
+
*/
|
|
384
|
+
readonly connectMs?: number;
|
|
385
|
+
}
|
|
386
|
+
/** The undo history did not group edits as the gesture intended. Informational. @public */
|
|
387
|
+
interface HistoryDiagnosticEvent extends DiagnosticBase {
|
|
388
|
+
readonly kind: 'history';
|
|
389
|
+
readonly code: HistoryDiagnosticCode;
|
|
390
|
+
}
|
|
391
|
+
/** A custom node's stored payload could not be read. The node and its data are not named. @public */
|
|
392
|
+
interface CustomNodeDiagnosticEvent extends DiagnosticBase {
|
|
393
|
+
readonly kind: 'custom-node';
|
|
394
|
+
readonly code: CustomNodeDiagnosticCode;
|
|
395
|
+
}
|
|
396
|
+
/** The number of people in the collaboration room changed. @public */
|
|
397
|
+
interface CollaborationParticipantsDiagnostic extends DiagnosticBase {
|
|
398
|
+
readonly kind: 'collab.participants';
|
|
399
|
+
/** People present, this editor included. A person with two tabs counts twice. */
|
|
400
|
+
readonly count: number;
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Timings of one kind over a performance window. Every value is in milliseconds, rounded to
|
|
404
|
+
* whole milliseconds.
|
|
405
|
+
*
|
|
406
|
+
* @public
|
|
407
|
+
*/
|
|
408
|
+
interface TimingSummary {
|
|
409
|
+
/** Timings measured in the window. */
|
|
410
|
+
readonly count: number;
|
|
411
|
+
/** Median. Exact up to 2048 timings; above that, from a uniform sample of 2048. */
|
|
412
|
+
readonly p50Ms: number;
|
|
413
|
+
/** 95th percentile, from the same sample as the median. */
|
|
414
|
+
readonly p95Ms: number;
|
|
415
|
+
/** The slowest timing, always exact. */
|
|
416
|
+
readonly maxMs: number;
|
|
417
|
+
/**
|
|
418
|
+
* Timings per band, always exact. Eight counts: up to 16, 33, 50, 100, 200, 500, and 1000
|
|
419
|
+
* ms, then over 1000 ms. A metrics backend builds a histogram from these.
|
|
420
|
+
*/
|
|
421
|
+
readonly bands: readonly number[];
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* How the editor performed while it was used: one summary per window, never one event per key
|
|
425
|
+
* press. Sent after a minute of use, when the page is hidden, and when the editor is destroyed,
|
|
426
|
+
* if anything was measured since the last summary.
|
|
427
|
+
*
|
|
428
|
+
* @public
|
|
429
|
+
*/
|
|
430
|
+
interface PerformanceDiagnostic extends DiagnosticBase {
|
|
431
|
+
readonly kind: 'performance';
|
|
432
|
+
/**
|
|
433
|
+
* Present when the summary needs attention: `performance.slow-interaction` when at least 20
|
|
434
|
+
* presses were timed and more than one in 20 took over 200 ms.
|
|
435
|
+
*/
|
|
436
|
+
readonly code?: PerformanceDiagnosticCode;
|
|
437
|
+
/**
|
|
438
|
+
* Milliseconds from the window's first timing to the summary, one minute or less. Idle time
|
|
439
|
+
* inside the window counts, so this is not active editing time. Use the `count` of
|
|
440
|
+
* `interaction` to measure activity.
|
|
441
|
+
*/
|
|
442
|
+
readonly windowMs: number;
|
|
443
|
+
/** Pages in the document at the last paint. */
|
|
444
|
+
readonly pagesBucket?: CountBucket;
|
|
445
|
+
/**
|
|
446
|
+
* Key presses and pointer presses on the pages, from the browser event to the next frame on
|
|
447
|
+
* screen: the delay a person feels. Presses queued behind slow work count with their full
|
|
448
|
+
* delay. Presses of modifier keys alone, and presses while the page is hidden, are not timed.
|
|
449
|
+
*/
|
|
450
|
+
readonly interaction?: TimingSummary;
|
|
451
|
+
/**
|
|
452
|
+
* Engine layout passes that the person causes, by an edit or a view change such as zoom.
|
|
453
|
+
* Each pass includes its main-thread work in the background, and the work of a pass that a
|
|
454
|
+
* newer edit replaced. Layouts that loading causes are not here: the opening layout, which
|
|
455
|
+
* `document.open` reports as `durationMs`, and layouts after fonts or images arrive.
|
|
456
|
+
*/
|
|
457
|
+
readonly layout?: TimingSummary;
|
|
458
|
+
/** Engine paints of the pages. */
|
|
459
|
+
readonly paint?: TimingSummary;
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* One anonymous diagnostic. Switch on `kind` to narrow `code`.
|
|
463
|
+
*
|
|
464
|
+
* @example
|
|
465
|
+
* ```ts
|
|
466
|
+
* editor.on('diagnostic', (event) => {
|
|
467
|
+
* if (event.kind === 'edit.rejected') {
|
|
468
|
+
* console.warn(event.code, explainDiagnostic(event.code).hint);
|
|
469
|
+
* }
|
|
470
|
+
* });
|
|
471
|
+
* ```
|
|
472
|
+
*
|
|
473
|
+
* @public
|
|
474
|
+
*/
|
|
475
|
+
type EditorDiagnostic = DocumentOpenDiagnostic | EditRejectedDiagnostic | ReviewSkippedDiagnostic | FontFailedDiagnostic | HistoryDiagnosticEvent | CustomNodeDiagnosticEvent | CollaborationStatusDiagnostic | CollaborationParticipantsDiagnostic | PerformanceDiagnostic | DocumentSaveDiagnostic | SessionDiagnostic;
|
|
476
|
+
/** The `kind` of every {@link EditorDiagnostic}. @public */
|
|
477
|
+
type EditorDiagnosticKind = EditorDiagnostic['kind'];
|
|
478
|
+
|
|
44
479
|
/**
|
|
45
480
|
* What `editor.on(...)` can be subscribed to, and what each handler receives.
|
|
46
481
|
*
|
|
@@ -57,6 +492,22 @@ interface EditorEvents {
|
|
|
57
492
|
selectionChange: (snapshot: EditorSnapshot) => void;
|
|
58
493
|
error: (error: EditorError) => void;
|
|
59
494
|
historyDiagnostic: (diagnostic: HistoryDiagnostic) => void;
|
|
495
|
+
/**
|
|
496
|
+
* An anonymous diagnostic: a document opened or failed to open, an edit or a tracked change
|
|
497
|
+
* was refused, a font failed. Carries stable codes and bucketed numbers, never document
|
|
498
|
+
* content, so a handler may send it to an error tracker as it is.
|
|
499
|
+
*
|
|
500
|
+
* A document passed at construction opens before a host can subscribe. To see that open,
|
|
501
|
+
* register a module with `onDiagnostic` instead.
|
|
502
|
+
*
|
|
503
|
+
* @example
|
|
504
|
+
* ```ts
|
|
505
|
+
* editor.on('diagnostic', (event) => {
|
|
506
|
+
* if (event.kind === 'edit.rejected') console.warn(explainDiagnostic(event.code).hint);
|
|
507
|
+
* });
|
|
508
|
+
* ```
|
|
509
|
+
*/
|
|
510
|
+
diagnostic: (event: EditorDiagnostic) => void;
|
|
60
511
|
/**
|
|
61
512
|
* An explicit request landed on a review item, and its card or balloon should open.
|
|
62
513
|
*
|
|
@@ -2444,5 +2895,5 @@ interface EditorError extends Error {
|
|
|
2444
2895
|
readonly code?: string;
|
|
2445
2896
|
}
|
|
2446
2897
|
|
|
2447
|
-
export {
|
|
2448
|
-
export type {
|
|
2898
|
+
export { DIAGNOSTIC_SCHEMA_VERSION as D, resolveReviewPane as a$, DEFAULT_REVIEW_PANE as aQ, cropPercentFromCropPermille as aW, cropPercentFromPermille as aX, cropPercentFromSourceCrop as aY, cropPermilleFromCropPercent as aZ, cropPermilleFromPercent as a_, reviewPaneListsItem as b0, sourceCropFromCropPercent as b1, validateImageCropPercent as b2, EditorFontError as z };
|
|
2899
|
+
export type { HeaderFooterState as $, AnchorHighlightAnimation as A, EditorFontErrorCode as B, CanResult as C, EditorDiagnostic as E, EditorFormatPainterCommands as F, EditorHeaderFooterCommands as G, EditorHighlights as H, EditorNoteCommands as I, EditorPosition as J, EditorQueries as K, EditorQuery as L, EditorQueryResults as M, EditorReviewHits as N, EditorSelection as O, EditorSnapshot as P, FontConfiguration as Q, ReviewPaneOptions as R, FontFaceRequest as S, FontFailedDiagnostic as T, FontSource as U, FontSourceSubstitution as V, FormatPainterLevel as W, FormatPainterMode as X, FormatPainterSurfaceState as Y, FurnitureVariant as Z, HeaderFooterSlotArgs as _, EditorDiagnosticKind as a, HighlightHit as a0, HighlightOptions as a1, HighlightRange as a2, HighlightRect as a3, HighlightResult as a4, HistoryDiagnosticEvent as a5, HyperlinkInfo as a6, ImageContext as a7, ImageCropPercent as a8, NoteKind as a9, TableBorderStyle as aA, TableBorderTarget as aB, TableCellVerticalAlignment as aC, TableColumnDividerResizeTarget as aD, TableColumnOccurrenceTarget as aE, TableContext as aF, TableRightEdgeResizeTarget as aG, TableRowOccurrenceTarget as aH, TextMatch as aI, TimingSummary as aJ, TrackedChangeFilterMode as aK, TrackedChangePredicate as aL, ZoomFitTarget as aM, ZoomMode as aN, ReviewPaneOverflow as aO, CommentMarkerStyle as aP, ImageCropPermille as aR, ResolvedReviewPane as aS, ReviewPaneItemFields as aT, ReviewPaneOpening as aU, RevisionDisplay as aV, NotePropertiesSide as aa, NotePropertiesState as ab, PageSetup as ac, PerformanceDiagnostic as ad, ResolveReviewChangesOptions as ae, ResolvedNoteNumbering as af, ReviewActivationOptions as ag, ReviewChangesAttribution as ah, ReviewCommentPlacement as ai, ReviewCustomPlacement as aj, ReviewItemHit as ak, ReviewItemPlacement as al, ReviewItemPlacementBase as am, ReviewItemQuery as an, ReviewItemRevealEvent as ao, ReviewItemRevealSource as ap, ReviewRevisionPlacement as aq, ReviewSkippedDiagnostic as ar, ScrollPlacement as as, ScrollToAnchorOptions as at, SelectedImageState as au, SessionActivity as av, SessionDiagnostic as aw, SetReviewChangesAuthorOptions as ax, TableBorderEdgeTarget as ay, TableBorderSpec as az, EditorCommand as b, AnchorHighlightOptions as c, AuthoredNoteNumbering as d, ClearAnchorHighlightOptions as e, CollaborationParticipantsDiagnostic as f, CollaborationStatusDiagnostic as g, CustomNodeDiagnosticEvent as h, DiagnosticBase as i, DiagnosticFailureDetail as j, DocumentChange as k, DocumentEditingMode as l, DocumentHandle as m, DocumentOpenDiagnostic as n, DocumentSaveDiagnostic as o, DocumentShape as p, DocumentSource as q, EditRejectedDiagnostic as r, EditRejectionOrigin as s, Editor as t, EditorAnchorNavigation as u, EditorCommandShape as v, EditorCommands as w, EditorError as x, EditorEvents as y };
|
|
@@ -81,4 +81,4 @@ interface HistoryDiagnostic {
|
|
|
81
81
|
readonly reason: string;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
export type { EditorScope as E, HistoryDiagnostic as H, ViewScope as V,
|
|
84
|
+
export type { EditorScope as E, HistoryDiagnostic as H, ViewScope as V, EditorExecOptions as a, HistoryGroup as b, HistoryGroupOutcome as c };
|