@histoire/protocol 0.0.0-stage → 1.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/LICENSE +21 -0
  2. package/dist/bridge/catalog.d.ts +12 -0
  3. package/dist/bridge/catalog.d.ts.map +1 -0
  4. package/dist/bridge/envelope.d.ts +18 -0
  5. package/dist/bridge/envelope.d.ts.map +1 -0
  6. package/dist/bridge/events.d.ts +9 -0
  7. package/dist/bridge/events.d.ts.map +1 -0
  8. package/dist/bridge/handshake.d.ts +42 -0
  9. package/dist/bridge/handshake.d.ts.map +1 -0
  10. package/dist/bridge/limits.d.ts +41 -0
  11. package/dist/bridge/limits.d.ts.map +1 -0
  12. package/dist/bridge/payload.d.ts +9 -0
  13. package/dist/bridge/payload.d.ts.map +1 -0
  14. package/dist/bridge/project-test-collection.d.ts +5 -0
  15. package/dist/bridge/project-test-collection.d.ts.map +1 -0
  16. package/dist/bridge/results.d.ts +12 -0
  17. package/dist/bridge/results.d.ts.map +1 -0
  18. package/dist/bridge/size.d.ts +23 -0
  19. package/dist/bridge/size.d.ts.map +1 -0
  20. package/dist/bridge/snapshot.d.ts +27 -0
  21. package/dist/bridge/snapshot.d.ts.map +1 -0
  22. package/dist/bridge/source-descriptor.d.ts +5 -0
  23. package/dist/bridge/source-descriptor.d.ts.map +1 -0
  24. package/dist/bridge/string-size.d.ts +12 -0
  25. package/dist/bridge/string-size.d.ts.map +1 -0
  26. package/dist/bridge/test-execution.d.ts +4 -0
  27. package/dist/bridge/test-execution.d.ts.map +1 -0
  28. package/dist/bridge/types.d.ts +83 -0
  29. package/dist/bridge/types.d.ts.map +1 -0
  30. package/dist/bridge/validation.d.ts +14 -0
  31. package/dist/bridge/validation.d.ts.map +1 -0
  32. package/dist/channels.d.ts +42 -0
  33. package/dist/channels.d.ts.map +1 -0
  34. package/dist/geometry.d.ts +9 -0
  35. package/dist/geometry.d.ts.map +1 -0
  36. package/dist/helpers/matrix-numeric.d.ts +18 -0
  37. package/dist/helpers/matrix-numeric.d.ts.map +1 -0
  38. package/dist/helpers/matrix.d.ts +22 -0
  39. package/dist/helpers/matrix.d.ts.map +1 -0
  40. package/dist/helpers/meta.d.ts +26 -0
  41. package/dist/helpers/meta.d.ts.map +1 -0
  42. package/dist/helpers/story-route.d.ts +25 -0
  43. package/dist/helpers/story-route.d.ts.map +1 -0
  44. package/dist/index.d.ts +50 -0
  45. package/dist/index.d.ts.map +1 -0
  46. package/dist/index.js +3288 -0
  47. package/dist/inspection/capabilities.d.ts +24 -0
  48. package/dist/inspection/capabilities.d.ts.map +1 -0
  49. package/dist/inspection/debug-buffer.d.ts +21 -0
  50. package/dist/inspection/debug-buffer.d.ts.map +1 -0
  51. package/dist/inspection/extensions.d.ts +5 -0
  52. package/dist/inspection/extensions.d.ts.map +1 -0
  53. package/dist/inspection/rows.d.ts +5 -0
  54. package/dist/inspection/rows.d.ts.map +1 -0
  55. package/dist/inspection/validation.d.ts +23 -0
  56. package/dist/inspection/validation.d.ts.map +1 -0
  57. package/dist/plugin-channels.d.ts +84 -0
  58. package/dist/plugin-channels.d.ts.map +1 -0
  59. package/dist/serialization/controls-revision.d.ts +12 -0
  60. package/dist/serialization/controls-revision.d.ts.map +1 -0
  61. package/dist/serialization/state.d.ts +12 -0
  62. package/dist/serialization/state.d.ts.map +1 -0
  63. package/dist/serialization/test-errors.d.ts +8 -0
  64. package/dist/serialization/test-errors.d.ts.map +1 -0
  65. package/dist/theme/color.d.ts +17 -0
  66. package/dist/theme/color.d.ts.map +1 -0
  67. package/dist/theme/semantic.d.ts +32 -0
  68. package/dist/theme/semantic.d.ts.map +1 -0
  69. package/dist/types/catalog.d.ts +161 -0
  70. package/dist/types/catalog.d.ts.map +1 -0
  71. package/dist/types/common.d.ts +59 -0
  72. package/dist/types/common.d.ts.map +1 -0
  73. package/dist/types/content.d.ts +34 -0
  74. package/dist/types/content.d.ts.map +1 -0
  75. package/dist/types/controls.d.ts +132 -0
  76. package/dist/types/controls.d.ts.map +1 -0
  77. package/dist/types/debug.d.ts +64 -0
  78. package/dist/types/debug.d.ts.map +1 -0
  79. package/dist/types/embed-presentation.d.ts +23 -0
  80. package/dist/types/embed-presentation.d.ts.map +1 -0
  81. package/dist/types/error.d.ts +23 -0
  82. package/dist/types/error.d.ts.map +1 -0
  83. package/dist/types/inspection-accessibility.d.ts +43 -0
  84. package/dist/types/inspection-accessibility.d.ts.map +1 -0
  85. package/dist/types/inspection-components.d.ts +69 -0
  86. package/dist/types/inspection-components.d.ts.map +1 -0
  87. package/dist/types/inspection.d.ts +221 -0
  88. package/dist/types/inspection.d.ts.map +1 -0
  89. package/dist/types/isolated-inspection.d.ts +69 -0
  90. package/dist/types/isolated-inspection.d.ts.map +1 -0
  91. package/dist/types/preview-message.d.ts +179 -0
  92. package/dist/types/preview-message.d.ts.map +1 -0
  93. package/dist/types/readonly.d.ts +5 -0
  94. package/dist/types/readonly.d.ts.map +1 -0
  95. package/dist/types/settings.d.ts +31 -0
  96. package/dist/types/settings.d.ts.map +1 -0
  97. package/dist/types/snapshot.d.ts +94 -0
  98. package/dist/types/snapshot.d.ts.map +1 -0
  99. package/dist/types/source-descriptor.d.ts +72 -0
  100. package/dist/types/source-descriptor.d.ts.map +1 -0
  101. package/dist/types/source-search.d.ts +20 -0
  102. package/dist/types/source-search.d.ts.map +1 -0
  103. package/dist/types/test.d.ts +208 -0
  104. package/dist/types/test.d.ts.map +1 -0
  105. package/dist/url/embed-origins.d.ts +16 -0
  106. package/dist/url/embed-origins.d.ts.map +1 -0
  107. package/dist/url/embed.d.ts +19 -0
  108. package/dist/url/embed.d.ts.map +1 -0
  109. package/dist/url/preview.d.ts +14 -0
  110. package/dist/url/preview.d.ts.map +1 -0
  111. package/package.json +32 -3
  112. package/README.md +0 -3
@@ -0,0 +1,132 @@
1
+ /** Message names shared by the controls sandbox and its host overlay layer. */
2
+ export declare const CONTROLS_APPEARANCE = "__histoire:controls-appearance";
3
+ export declare const CONTROLS_OVERLAY = "__histoire:controls-overlay";
4
+ export declare const CONTROLS_OVERLAY_RESULT = "__histoire:controls-overlay-result";
5
+ export declare const CONTROLS_OVERLAY_REFRESH = "__histoire:controls-overlay-refresh";
6
+ /** Finite traversal request when cross-origin boundary prevents local DOM access. */
7
+ export declare const CONTROLS_FOCUS = "__histoire:controls-focus";
8
+ /** Finite document-owned preset actions; live values and callbacks never cross wire. */
9
+ export type HistoirePresetAction = {
10
+ action: 'list';
11
+ } | {
12
+ action: 'save';
13
+ label: string;
14
+ } | {
15
+ action: 'apply' | 'delete';
16
+ id: string;
17
+ } | {
18
+ action: 'rename';
19
+ id: string;
20
+ label: string;
21
+ };
22
+ /** Runtime preset presentation with no serialized state or opaque value owners. */
23
+ export interface HistoirePresetList {
24
+ /** At most 1,000 choices owned by exact runtime target/document. */
25
+ items: {
26
+ id: string;
27
+ label: string;
28
+ }[];
29
+ /** Saved/applied option, absent for list/delete/rename. */
30
+ selectedId?: string;
31
+ }
32
+ /** Serializable bounds in the controls document's viewport coordinates. */
33
+ export interface HistoireControlsRect {
34
+ /** Horizontal position. */
35
+ x: number;
36
+ /** Vertical position. */
37
+ y: number;
38
+ /** Anchor width. */
39
+ width: number;
40
+ /** Anchor height. */
41
+ height: number;
42
+ }
43
+ /** Text and identity of an option; its actual value stays in the sandbox. */
44
+ export interface HistoireControlsOverlayItem {
45
+ /** Opaque ID returned on selection. */
46
+ id: string;
47
+ /** Visible text. */
48
+ label: string;
49
+ /** Visible option unavailable for selection. */
50
+ disabled?: boolean;
51
+ }
52
+ /** Host-rendered controls overlays supported by the public adapter. */
53
+ export type HistoireControlsOverlay = {
54
+ /** Dropdown with selectable text options. */
55
+ kind: 'select';
56
+ /** Accessible dropdown name. */
57
+ label?: string;
58
+ /** Options whose values remain owned by the caller. */
59
+ items: HistoireControlsOverlayItem[];
60
+ /** Currently selected option ID. */
61
+ selectedId?: string;
62
+ } | {
63
+ /** Non-interactive text tooltip. */
64
+ kind: 'tooltip';
65
+ /** Plain text; never interpreted as HTML. */
66
+ content: string;
67
+ /** Preferred side of the anchor. */
68
+ placement?: 'top' | 'bottom' | 'left' | 'right';
69
+ /** Gap between anchor and tooltip. */
70
+ distance?: number;
71
+ };
72
+ /** Host response consumed by the overlay's local callback. */
73
+ export interface HistoireControlsOverlayResult {
74
+ /** Present when a dropdown option was selected. */
75
+ itemId?: string;
76
+ /** Return keyboard focus to the sandbox anchor. */
77
+ restoreFocus: boolean;
78
+ /** Continue keyboard traversal inside the controls form when Tab closes a menu. */
79
+ focusDirection?: 'next' | 'previous';
80
+ }
81
+ /** A controls overlay request scoped to its originating story and variant. */
82
+ export interface HistoireControlsOverlayMessage {
83
+ /** Protocol discriminator. */
84
+ type: typeof CONTROLS_OVERLAY;
85
+ /** Originating story ID. */
86
+ storyId: string;
87
+ /** Originating variant ID. */
88
+ variantId: string;
89
+ /** Unique overlay ID. */
90
+ id: string;
91
+ /** Reference bounds within the sandbox viewport. */
92
+ anchor: HistoireControlsRect;
93
+ /** Null closes an existing overlay. */
94
+ overlay: HistoireControlsOverlay | null;
95
+ }
96
+ /** Panel appearance copied explicitly into the controls document. */
97
+ export interface HistoireControlsAppearance {
98
+ /** Host color scheme. */
99
+ dark: boolean;
100
+ /** CSS properties, including theme colors and typography. */
101
+ properties: Record<string, string>;
102
+ }
103
+ /** Appearance update sent by the host. */
104
+ export interface HistoireControlsAppearanceMessage {
105
+ /** Protocol discriminator. */
106
+ type: typeof CONTROLS_APPEARANCE;
107
+ /** Panel theme and typography. */
108
+ appearance: HistoireControlsAppearance;
109
+ }
110
+ /** Host request to remeasure an overlay's anchor inside its sandbox. */
111
+ export interface HistoireControlsOverlayRefreshMessage {
112
+ /** Protocol discriminator. */
113
+ type: typeof CONTROLS_OVERLAY_REFRESH;
114
+ /** Target story ID. */
115
+ storyId: string;
116
+ /** Target variant ID. */
117
+ variantId: string;
118
+ /** Target overlay ID. */
119
+ id: string;
120
+ }
121
+ /** Host reply resolving one local overlay callback. */
122
+ export interface HistoireControlsOverlayResultMessage extends HistoireControlsOverlayResult {
123
+ /** Protocol discriminator. */
124
+ type: typeof CONTROLS_OVERLAY_RESULT;
125
+ /** Target story ID. */
126
+ storyId: string;
127
+ /** Target variant ID. */
128
+ variantId: string;
129
+ /** Target overlay ID. */
130
+ id: string;
131
+ }
132
+ //# sourceMappingURL=controls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../../src/types/controls.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,eAAO,MAAM,mBAAmB,mCAAmC,CAAA;AACnE,eAAO,MAAM,gBAAgB,gCAAgC,CAAA;AAC7D,eAAO,MAAM,uBAAuB,uCAAuC,CAAA;AAC3E,eAAO,MAAM,wBAAwB,wCAAwC,CAAA;AAC7E,qFAAqF;AACrF,eAAO,MAAM,cAAc,8BAA8B,CAAA;AAEzD,wFAAwF;AACxF,MAAM,MAAM,oBAAoB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,OAAO,GAAG,QAAQ,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAExL,mFAAmF;AACnF,MAAM,WAAW,kBAAkB;IACjC,oEAAoE;IACpE,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACtC,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,2EAA2E;AAC3E,MAAM,WAAW,oBAAoB;IACnC,2BAA2B;IAC3B,CAAC,EAAE,MAAM,CAAA;IACT,yBAAyB;IACzB,CAAC,E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oDAAoD;IACpD,MAAM,EAAE,oBAAoB,CAAA;IAC5B,uCAAuC;IACvC,OAAO,EAAE,uBAAuB,GAAG,IAAI,CAAA;CACxC;AAED,qEAAqE;AACrE,MAAM,WAAW,0BAA0B;IACzC,yBAAyB;IACzB,IAAI,EAAE,OAAO,CAAA;IACb,6DAA6D;IAC7D,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACnC;AAED,0CAA0C;AAC1C,MAAM,WAAW,iCAAiC;IAChD,8BAA8B;IAC9B,IAAI,EAAE,OAAO,mBAAmB,CAAA;IAChC,kCAAkC;IAClC,UAAU,EAAE,0BAA0B,CAAA;CACvC;AAED,wEAAwE;AACxE,MAAM,WAAW,qCAAqC;IACpD,8BAA8B;IAC9B,IAAI,EAAE,OAAO,wBAAwB,CAAA;IACrC,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAA;IACf,yBAAyB;IACzB,SAAS,EAAE,MAAM,CAAA;IACjB,yBAAyB;IACzB,EAAE,EAAE,MAAM,CAAA;CACX;AAED,uDAAuD;AACvD,MAAM,WAAW,oCAAqC,SAAQ,6BAA6B;IACzF,8BAA8B;IAC9B,IAAI,EAAE,OAAO,uBAAuB,CAAA;IACpC,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAA;IACf,yBAAyB;IACzB,SAAS,EAAE,MAAM,CAAA;IACjB,yBAAyB;IACzB,EAAE,EAAE,MAAM,CAAA;CACX"}
@@ -0,0 +1,64 @@
1
+ import type { HistoireJsonValue } from './common.js';
2
+ import type { HistoireInspectionOwner } from './inspection.js';
3
+ import type { HistoireReadonly } from './readonly.js';
4
+ /** Bounded text evidence; correlation is never inferred for unrelated console events. */
5
+ export interface HistoireDebugEntry {
6
+ /** Monotonic sequence within this retained timeline. */
7
+ sequence: number;
8
+ /** UTC epoch milliseconds. */
9
+ timestamp: number;
10
+ /** Browser monotonic clock; never joined to server clock. */
11
+ monotonicTimeMs: number;
12
+ /** Exact SDK request when known. */
13
+ requestId?: string;
14
+ /** Exact operation when known. */
15
+ operationId?: string;
16
+ /** Attributed request outcome. */
17
+ outcome?: string;
18
+ /** Bounded safe structured details; raw payloads excluded. */
19
+ details?: HistoireJsonValue;
20
+ /** Event origin/category. */
21
+ kind: 'console' | 'page-error' | 'unhandled-rejection' | 'sdk-request' | 'component-event' | 'state-patch' | 'lifecycle';
22
+ /** Bounded text without raw arguments or stack. */
23
+ message: string;
24
+ /** Console severity or request outcome. */
25
+ level?: string;
26
+ /** Source/document and subscription target, not proof of event causality. */
27
+ owner?: HistoireInspectionOwner;
28
+ /** Explicit caller correlation label. */
29
+ correlationId?: string;
30
+ }
31
+ /** Retained page with monotonic continuation and visible loss. */
32
+ export interface HistoireDebugPage {
33
+ /** Complete entries within serialized budget. */
34
+ items: HistoireDebugEntry[];
35
+ /** Last retained sequence in this page, or supplied cursor. */
36
+ nextSequence: number;
37
+ /** Entries lost to bounds or explicit clear within this timeline. */
38
+ droppedCount: number;
39
+ /** Earliest retained sequence, or next sequence when empty. */
40
+ oldestSequence: number;
41
+ /** Requested cursor predates retained history. */
42
+ gap: boolean;
43
+ }
44
+ /**
45
+ * Explicit observation lifetime; replacement requires a new subscription.
46
+ * Console and error observations span the mounted document, not only the selected target.
47
+ * Common credentials are redacted, but arbitrary user text can remain sensitive.
48
+ */
49
+ export interface HistoireDebug {
50
+ /** Read locally retained history without starting instrumentation. */
51
+ getSnapshot: (options?: {
52
+ afterSequence?: number;
53
+ limit?: number;
54
+ }) => HistoireReadonly<HistoireDebugPage>;
55
+ /** Start authorized observation; closed resolves on unsubscribe and rejects on observation loss. */
56
+ subscribe: (listener: (page: HistoireReadonly<HistoireDebugPage>) => void) => {
57
+ ready: Promise<void>;
58
+ closed: Promise<void>;
59
+ unsubscribe: () => Promise<void>;
60
+ };
61
+ /** Clear local history only; sequence identities never restart. */
62
+ clear: () => void;
63
+ }
64
+ //# sourceMappingURL=debug.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug.d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H,MAAM,WAAW,aAAa;IAC5B,sEAAsE;IACtE,WAAW,EAAE,CAAC,OAAO,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,gBAAgB,CAAC,iBAAiB,CAAC,CAAA;IAC1G,oGAAoG;IACpG,SAAS,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,KAAK,IAAI,KAAK;QAAE,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QAAC,WAAW,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;KAAE,CAAA;IAC/J,mEAAmE;IACnE,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB"}
@@ -0,0 +1,23 @@
1
+ /** Panels available in a scoped story or variant embed. */
2
+ export declare const HISTOIRE_EMBED_PANELS: readonly ['controls', 'docs', 'source', 'events'];
3
+ /** One opt-in scoped embed panel. */
4
+ export type HistoireEmbedPanel = typeof HISTOIRE_EMBED_PANELS[number];
5
+ /** Presentation hints change composition, never parent authority. */
6
+ export interface HistoireEmbedPresentation {
7
+ /** Render scoped composition instead of full explorer. */
8
+ type: 'embed';
9
+ /** Capture selected story or exact selected variant at mount. */
10
+ scope: 'story' | 'variant';
11
+ /** Enabled panels; omission enables Controls, empty array hides all panels. */
12
+ panels?: readonly HistoireEmbedPanel[];
13
+ }
14
+ /** Target and panels for a self-starting public embed document. */
15
+ export interface HistoireEmbedDocumentOptions {
16
+ /** Exact collected story ID. */
17
+ storyId: string;
18
+ /** Exact variant ID; omission enables the story's variant switcher. */
19
+ variantId?: string;
20
+ /** Enabled panels in canonical order. */
21
+ panels: readonly HistoireEmbedPanel[];
22
+ }
23
+ //# sourceMappingURL=embed-presentation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embed-presentation.d.ts","sourceRoot":"","sources":["../../src/types/embed-presentation.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,eAAO,MAAM,qBAAqB,YAAI,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAA;AAEtF,qCAAqC;AACrC,MAAM,MAAM,kBAAkB,GAAG,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAA;AAErE,qEAAqE;AACrE,MAAM,WAAW,yBAAyB;IACxC,0DAA0D;IAC1D,IAAI,EAAE,OAAO,CAAA;IACb,iEAAiE;IACjE,KAAK,EAAE,OAAO,GAAG,SAAS,CAAA;IAC1B,+EAA+E;IAC/E,MAAM,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAA;CACvC;AAED,mEAAmE;AACnE,MAAM,WAAW,4BAA4B;IAC3C,gCAAgC;IAChC,OAAO,EAAE,MAAM,CAAA;IACf,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,yCAAyC;IACzC,MAAM,EAAE,SAAS,kBAAkB,EAAE,CAAA;CACtC"}
@@ -0,0 +1,23 @@
1
+ /** Stable portable failure codes shared by SDK and Node adapters. */
2
+ export declare const HISTOIRE_ERROR_CODES: readonly ['INVALID_ARGUMENT', 'INVALID_SELECTOR', 'RESULT_TOO_LARGE', 'BROWSER_REQUIRED', 'NOT_CONNECTED', 'DISPOSED', 'CAPABILITY_UNAVAILABLE', 'PROTOCOL_MISMATCH', 'ORIGIN_DENIED', 'BOOK_UNAVAILABLE', 'STORY_NOT_FOUND', 'STORY_AMBIGUOUS', 'VARIANT_NOT_FOUND', 'SELECTION_REQUIRED', 'PREVIEW_NOT_READY', 'RUNTIME_IN_USE', 'STALE_REVISION', 'RUNTIME_CHANGED', 'DOCS_NOT_FOUND', 'SOURCE_UNAVAILABLE', 'COLLECTION_FAILED', 'QUEUE_FULL', 'RATE_LIMITED', 'DEPENDENCY_MISSING', 'BROWSER_UNAVAILABLE', 'CANCELLED', 'TIMEOUT', 'INTERNAL_ERROR'];
3
+ /** Error discriminator, not transport-specific exception classes. */
4
+ export type HistoireErrorCode = typeof HISTOIRE_ERROR_CODES[number];
5
+ /** Bounded JSON-safe error representation; no raw exception/path forwarding. */
6
+ export interface HistoireErrorData {
7
+ /** Stable typed failure reason. */
8
+ code: HistoireErrorCode;
9
+ /** Bounded human-readable failure. */
10
+ message: string;
11
+ /** Optional bounded, explicitly projected diagnostic data. */
12
+ details?: unknown;
13
+ }
14
+ /** Shared typed exception reconstructed at client boundary. */
15
+ export declare class HistoireSdkError extends Error {
16
+ /** Stable failure code. */
17
+ readonly code: HistoireErrorCode;
18
+ /** Optional bounded projected diagnostic data. */
19
+ readonly details?: unknown;
20
+ /** Constructs failure without importing platform/framework modules. */
21
+ constructor(code: HistoireErrorCode, message: string, details?: unknown);
22
+ }
23
+ //# sourceMappingURL=error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/types/error.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,eAAO,MAAM,oBAAoB,YAC/B,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,wBAAwB,EACxB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,qBAAqB,EACrB,WAAW,EACX,SAAS,EACT,gBAAgB,CACR,CAAA;AAEV,qEAAqE;AACrE,MAAM,MAAM,iBAAiB,GAAG,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAA;AAEnE,gFAAgF;AAChF,MAAM,WAAW,iBAAiB;IAChC,mCAAmC;IACnC,IAAI,EAAE,iBAAiB,CAAA;IACvB,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAA;IACf,8DAA8D;IAC9D,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,+DAA+D;AAC/D,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,2BAA2B;IAC3B,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAA;IAChC,kDAAkD;IAClD,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAE1B,uEAAuE;IACvE,YAAY,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAKtE;CACF"}
@@ -0,0 +1,43 @@
1
+ import type { HistoireInspectionMetadata } from './inspection.js';
2
+ /** Bounded axe finding without raw HTML. */
3
+ export interface HistoireAccessibilityFinding {
4
+ /** Axe rule identity. */
5
+ id: string;
6
+ /** Axe severity when available. */
7
+ impact: 'minor' | 'moderate' | 'serious' | 'critical' | null;
8
+ /** Human-readable rule title. */
9
+ help: string;
10
+ /** HTTP(S) rule documentation. */
11
+ helpUrl: string;
12
+ /** Affected elements within selected variant. */
13
+ nodes: {
14
+ /** Ordered axe selector path. */
15
+ selectors: string[];
16
+ /** Accessible name when available from the audit engine. */
17
+ accessibleName?: string;
18
+ /** Bounded diagnostic text. */
19
+ failureSummary?: string;
20
+ }[];
21
+ }
22
+ /** Automated findings, not accessibility compliance certification. */
23
+ export interface HistoireAccessibilityInspection extends HistoireInspectionMetadata {
24
+ /** Result discriminator. */
25
+ inspection: 'accessibility';
26
+ /** Requested root existed; no fallback to shell. */
27
+ matched: boolean;
28
+ /** Scanner identity. */
29
+ engine: 'axe-core';
30
+ /** Actual loaded scanner version. */
31
+ engineVersion: string;
32
+ /** Failed checks. */
33
+ violations: HistoireAccessibilityFinding[];
34
+ /** Checks needing human review. */
35
+ incomplete: HistoireAccessibilityFinding[];
36
+ /** Passed rule count. */
37
+ passesCount: number;
38
+ /** Inapplicable rule count. */
39
+ inapplicableCount: number;
40
+ /** Findings omitted by bounds. */
41
+ droppedCount: number;
42
+ }
43
+ //# sourceMappingURL=inspection-accessibility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspection-accessibility.d.ts","sourceRoot":"","sources":["../../src/types/inspection-accessibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA;AAEjE,4CAA4C;AAC5C,MAAM,WAAW,4BAA4B;IAC3C,yBAAyB;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,mCAAmC;IACnC,MAAM,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,IAAI,CAAA;IAC5D,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAA;IACf,iDAAiD;IACjD,KAAK,EAAE;QACL,iCAAiC;QACjC,SAAS,EAAE,MAAM,EAAE,CAAA;QACnB,4DAA4D;QAC5D,cAAc,CAAC,EAAE,MAAM,CAAA;QACvB,+BAA+B;QAC/B,cAAc,CAAC,EAAE,MAAM,CAAA;KACxB,EAAE,CAAA;CACJ;AACD,sEAAsE;AACtE,MAAM,WAAW,+BAAgC,SAAQ,0BAA0B;IACjF,4BAA4B;IAC5B,UAAU,EAAE,eAAe,CAAA;IAC3B,oDAAoD;IACpD,OAAO,EAAE,OAAO,CAAA;IAChB,wBAAwB;IACxB,MAAM,EAAE,UAAU,CAAA;IAClB,qCAAqC;IACrC,aAAa,EAAE,MAAM,CAAA;IACrB,qBAAqB;IACrB,UAAU,EAAE,4BAA4B,EAAE,CAAA;IAC1C,mCAAmC;IACnC,UAAU,EAAE,4BAA4B,EAAE,CAAA;IAC1C,yBAAyB;IACzB,WAAW,EAAE,MAAM,CAAA;IACnB,+BAA+B;IAC/B,iBAAiB,EAAE,MAAM,CAAA;IACzB,kCAAkC;IAClC,YAAY,EAAE,MAAM,CAAA;CACrB"}
@@ -0,0 +1,69 @@
1
+ import type { HistoireJsonValue } from './common.js';
2
+ import type { HistoireInspectionMetadata } from './inspection.js';
3
+ /** Known gaps in framework ownership coverage, independent of output truncation. */
4
+ export type HistoireComponentLimitation = 'fragment' | 'slot' | 'teleport' | 'async' | 'keep-alive' | 'framework-metadata' | 'source';
5
+ /** Declares whether framework ownership was fully established for the inspected scope. */
6
+ export interface HistoireComponentCoverage {
7
+ /** Completeness of the provider's ownership mapping. */
8
+ coverage: 'complete' | 'partial';
9
+ /** Bounded reasons for incomplete ownership evidence. */
10
+ limitations: HistoireComponentLimitation[];
11
+ }
12
+ /** Verified project-relative location; never grants editor authority. */
13
+ export interface HistoireInspectionSource {
14
+ /** Path contained in registered project. */
15
+ relativePath: string;
16
+ /** One-based source line when known. */
17
+ line?: number;
18
+ /** One-based source column when known. */
19
+ column?: number;
20
+ }
21
+ /** Detached framework instance identity, never a raw Vue instance. */
22
+ export interface HistoireInspectedComponent {
23
+ /** Opaque document-scoped identity. */
24
+ id: string;
25
+ /** Parent identity in this tree; null at root. */
26
+ parentId: string | null;
27
+ /** Human-readable component name. */
28
+ name: string;
29
+ /** Framework provider name. */
30
+ framework: string;
31
+ /** Verified location when available. */
32
+ source?: HistoireInspectionSource;
33
+ }
34
+ /** Bounded active component tree; omitted branches contribute to a lower bound. */
35
+ export interface HistoireComponentTreeInspection extends HistoireInspectionMetadata, HistoireComponentCoverage {
36
+ /** Result discriminator. */
37
+ inspection: 'components';
38
+ /** Retained parent-before-child nodes. */
39
+ nodes: HistoireInspectedComponent[];
40
+ /** At least this many component nodes or unexplored branches were omitted. */
41
+ omittedCount: number;
42
+ }
43
+ /** Safe details for one exact instance; getters never evaluated. */
44
+ export interface HistoireComponentInspection extends HistoireInspectionMetadata, HistoireComponentCoverage {
45
+ /** Result discriminator. */
46
+ inspection: 'component';
47
+ /** Inspected instance. */
48
+ node: HistoireInspectedComponent;
49
+ /** Safely projected props. */
50
+ props: Record<string, HistoireJsonValue>;
51
+ /** Opt-in safe setup/data values when available. */
52
+ state?: Record<string, HistoireJsonValue>;
53
+ /** Associated elements in owning document. */
54
+ selectors: string[];
55
+ /** Unsupported or clipped values. */
56
+ omittedValues: number;
57
+ }
58
+ /** A selector's nearest proven component owner inside the captured story root. */
59
+ export interface HistoireComponentElementInspection extends HistoireInspectionMetadata, HistoireComponentCoverage {
60
+ /** Result discriminator. */
61
+ inspection: 'componentForElement';
62
+ /** Whether the selector matched within the story root. */
63
+ matched: boolean;
64
+ /** Proven component owner, or null when unavailable. */
65
+ node: HistoireInspectedComponent | null;
66
+ /** Why a matched element has no proven owner. */
67
+ unavailableReason?: 'owner-unavailable' | 'outside-owned-root';
68
+ }
69
+ //# sourceMappingURL=inspection-components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspection-components.d.ts","sourceRoot":"","sources":["../../src/types/inspection-components.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA;AAEjE,oFAAoF;AACpF,MAAM,MAAM,2BAA2B,GAAG,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,YAAY,GAAG,oBAAoB,GAAG,QAAQ,CAAA;AAErI,0FAA0F;AAC1F,MAAM,WAAW,yBAAyB;IACxC,wDAAwD;IACxD,QAAQ,EAAE,UAAU,GAAG,SAAS,CAAA;IAChC,yDAAyD;IACzD,WAAW,EAAE,2BAA2B,EAAE,CAAA;CAC3C;AAED,yEAAyE;AACzE,MAAM,WAAW,wBAAwB;IACvC,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAA;IACpB,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AACD,sEAAsE;AACtE,MAAM,WAAW,0BAA0B;IACzC,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAA;IACV,kDAAkD;IAClD,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAA;IACZ,+BAA+B;IAC/B,SAAS,EAAE,MAAM,CAAA;IACjB,wCAAwC;IACxC,MAAM,CAAC,EAAE,wBAAwB,CAAA;CAClC;AACD,mFAAmF;AACnF,MAAM,WAAW,+BAAgC,SAAQ,0BAA0B,EAAE,yBAAyB;IAC5G,4BAA4B;IAC5B,UAAU,EAAE,YAAY,CAAA;IACxB,0CAA0C;IAC1C,KAAK,EAAE,0BAA0B,EAAE,CAAA;IACnC,8EAA8E;IAC9E,YAAY,EAAE,MAAM,CAAA;CACrB;AACD,oEAAoE;AACpE,MAAM,WAAW,2BAA4B,SAAQ,0BAA0B,EAAE,yBAAyB;IACxG,4BAA4B;IAC5B,UAAU,EAAE,WAAW,CAAA;IACvB,0BAA0B;IAC1B,IAAI,EAAE,0BAA0B,CAAA;IAChC,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;IACxC,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;IACzC,8CAA8C;IAC9C,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,qCAAqC;IACrC,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,kFAAkF;AAClF,MAAM,WAAW,kCAAmC,SAAQ,0BAA0B,EAAE,yBAAyB;IAC/G,4BAA4B;IAC5B,UAAU,EAAE,qBAAqB,CAAA;IACjC,0DAA0D;IAC1D,OAAO,EAAE,OAAO,CAAA;IAChB,wDAAwD;IACxD,IAAI,EAAE,0BAA0B,GAAG,IAAI,CAAA;IACvC,iDAAiD;IACjD,iBAAiB,CAAC,EAAE,mBAAmB,GAAG,oBAAoB,CAAA;CAC/D"}
@@ -0,0 +1,221 @@
1
+ import type { HistoireCapability, HistoireJsonValue } from './common.js';
2
+ import type { HistoireAccessibilityInspection } from './inspection-accessibility.js';
3
+ import type { HistoireComponentElementInspection, HistoireComponentInspection, HistoireComponentTreeInspection } from './inspection-components.js';
4
+ import type { HistoireReadonly } from './readonly.js';
5
+ /** Finite operations independent of transport or UI framework. */
6
+ export declare const HISTOIRE_INSPECTION_KINDS: readonly ['variant', 'dom', 'components', 'component', 'componentForElement', 'accessibility', 'highlight', 'pick', 'highlightLease', 'highlightClear'];
7
+ /** A runtime inspection operation. */
8
+ export type HistoireInspectionKind = typeof HISTOIRE_INSPECTION_KINDS[number];
9
+ /** Independently advertised feature support; absent means unavailable. */
10
+ export type HistoireInspectionCapabilities = Partial<Record<'variant' | 'dom' | 'components' | 'componentDetails' | 'accessibilityAudit' | 'highlight' | 'componentHighlight' | 'pick' | 'highlightLease' | 'diagnostics', HistoireCapability>>;
11
+ /** Captured source, document and rendered variant. IDs confer no authority. */
12
+ export interface HistoireInspectionOwner {
13
+ /** Book identity. */
14
+ sourceId: string;
15
+ /** Source lifetime. */
16
+ epoch: string;
17
+ /** Completed source publication. */
18
+ revision: string;
19
+ /** Exact mounted document lifetime. */
20
+ runtimeId: string;
21
+ /** Exact rendered variant. */
22
+ target: {
23
+ storyId: string;
24
+ variantId: string;
25
+ };
26
+ }
27
+ /** Local cancellation and optional exact ownership precondition. */
28
+ export interface HistoireInspectionOptions {
29
+ /** Defaults to synchronously captured selected variant. */
30
+ target?: HistoireInspectionOwner['target'];
31
+ /** Reject replacement rather than reading a successor. */
32
+ expectedOwner?: HistoireInspectionOwner;
33
+ /** Trace label, never authority or deduplication. */
34
+ correlationId?: string;
35
+ /** Local cancellation; never serialized. */
36
+ signal?: AbortSignal;
37
+ }
38
+ /** Bounded DOM query; first CSS match is inspected. */
39
+ export interface HistoireDomInspectionOptions extends HistoireInspectionOptions {
40
+ /** Root selector, defaults to exact rendered variant root. */
41
+ selector?: string;
42
+ /** Maximum retained elements, default 200, maximum 500. */
43
+ maxNodes?: number;
44
+ /** Maximum depth, default 8, maximum 20. */
45
+ maxDepth?: number;
46
+ }
47
+ /** Common captured result metadata. */
48
+ export interface HistoireInspectionMetadata {
49
+ /** Existing user document or fresh browser execution. */
50
+ mode: 'live' | 'isolated';
51
+ /** Captured source and runtime. */
52
+ owner: HistoireInspectionOwner;
53
+ /** UTC observation timestamp. */
54
+ observedAt: string;
55
+ /** Observation duration, not an atomic snapshot guarantee. */
56
+ durationMs: number;
57
+ /** Work or serialized-size limits omitted content. */
58
+ truncated: boolean;
59
+ }
60
+ /** Descriptive prop metadata; factories/getters are never invoked. */
61
+ export interface HistoireInspectedProp {
62
+ /** Prop label. */
63
+ name: string;
64
+ /** Framework type labels. */
65
+ types?: string[];
66
+ /** Whether prop is required. */
67
+ required?: boolean;
68
+ /** Descriptive default. */
69
+ default?: HistoireJsonValue;
70
+ /** Current projected value. */
71
+ value?: HistoireJsonValue;
72
+ /** Finite allowed values. */
73
+ values?: HistoireJsonValue[];
74
+ }
75
+ /** Detached safe state and automatic prop definitions. */
76
+ export interface HistoireVariantProjection {
77
+ /** Projected canonical state without runtime fields. */
78
+ state: Record<string, HistoireJsonValue>;
79
+ /** Automatic metadata available, distinct from empty list. */
80
+ propsAvailable: boolean;
81
+ /** Automatic prop groups, not component-instance tree. */
82
+ components: {
83
+ name: string;
84
+ index: number;
85
+ props: HistoireInspectedProp[];
86
+ }[];
87
+ /** Unsupported or clipped values. */
88
+ omittedValues: number;
89
+ /** Work or byte limit reached. */
90
+ truncated: boolean;
91
+ }
92
+ /** Rendered element projection without input values or executable attributes. */
93
+ export interface HistoireInspectedElement {
94
+ /** Snapshot-local index. */
95
+ index: number;
96
+ /** Snapshot-local parent; null for root. */
97
+ parentIndex: number | null;
98
+ /** Lowercase local tag name. */
99
+ tag: string;
100
+ /** Allowlisted descriptive attributes. */
101
+ attributes: Record<string, string>;
102
+ /** Bounded direct text. */
103
+ text: string;
104
+ /** CSS viewport geometry. */
105
+ rect: {
106
+ x: number;
107
+ y: number;
108
+ width: number;
109
+ height: number;
110
+ };
111
+ /** Selected computed styles. */
112
+ styles: Record<string, string>;
113
+ }
114
+ /** Detached element subtree. */
115
+ export interface HistoireDomProjection {
116
+ /** Root matched CSS query. */
117
+ matched: boolean;
118
+ /** Retained preorder elements. */
119
+ nodes: HistoireInspectedElement[];
120
+ /** Traversal or output limit reached. */
121
+ truncated: boolean;
122
+ }
123
+ /** Variant inspection with ownership. */
124
+ export type HistoireVariantInspection = HistoireInspectionMetadata & HistoireVariantProjection & {
125
+ inspection: 'variant';
126
+ };
127
+ /** DOM inspection with ownership. */
128
+ export type HistoireDomInspection = HistoireInspectionMetadata & HistoireDomProjection & {
129
+ inspection: 'dom';
130
+ };
131
+ /** Public initial read results. Extension DTOs remain separately discriminated. */
132
+ export type HistoireInspectionResult = HistoireVariantInspection | HistoireDomInspection | HistoireComponentInspection | HistoireComponentTreeInspection | HistoireComponentElementInspection | HistoireAccessibilityInspection | (HistoireInspectionMetadata & import('./debug.js').HistoireDebugPage & {
133
+ inspection: 'debug';
134
+ });
135
+ /** Point hit within the exact captured story root. */
136
+ export type HistoireInspectionPick = {
137
+ owner: HistoireInspectionOwner;
138
+ observedAt: string;
139
+ } & ({
140
+ matched: true;
141
+ selector: string;
142
+ } | {
143
+ matched: false;
144
+ selector?: never;
145
+ });
146
+ /** Opaque overlay lease, valid only for the captured private bridge owner. */
147
+ export interface HistoireHighlightLease {
148
+ /** Captured public source and document identity. */
149
+ owner: HistoireInspectionOwner;
150
+ /** UTC creation time. */
151
+ observedAt: string;
152
+ /** Exact lease identity; does not independently grant authority. */
153
+ leaseId: string;
154
+ }
155
+ /** Result of clearing one exact overlay lease. */
156
+ export interface HistoireHighlightClear {
157
+ /** Captured public source and document identity. */
158
+ owner: HistoireInspectionOwner;
159
+ /** Whether this request removed the matching active overlay. */
160
+ cleared: boolean;
161
+ }
162
+ /** Browser-safe inspection API; never mounts a runtime. */
163
+ export interface HistoireInspection {
164
+ /** Read getter-safe canonical runtime state. */
165
+ variant: (options?: HistoireInspectionOptions) => Promise<HistoireReadonly<HistoireVariantInspection>>;
166
+ /** Inspect a bounded subtree of the current rendered document. */
167
+ dom: (options?: HistoireDomInspectionOptions) => Promise<HistoireReadonly<HistoireDomInspection>>;
168
+ /** Bounded active framework instance tree. */
169
+ components: (options?: HistoireInspectionOptions & {
170
+ rootId?: string;
171
+ maxNodes?: number;
172
+ maxDepth?: number;
173
+ }) => Promise<HistoireReadonly<HistoireComponentTreeInspection>>;
174
+ /** Getter-safe details for exact instance. */
175
+ component: (options: HistoireInspectionOptions & {
176
+ componentId: string;
177
+ }) => Promise<HistoireReadonly<HistoireComponentInspection>>;
178
+ /** Find a proven framework owner for an element within the story root. */
179
+ componentForElement: (options: HistoireInspectionOptions & {
180
+ selector: string;
181
+ }) => Promise<HistoireReadonly<HistoireComponentElementInspection>>;
182
+ /** Explicit automated audit inside exact rendered variant. */
183
+ accessibility: (options?: HistoireInspectionOptions & {
184
+ selector?: string;
185
+ }) => Promise<HistoireReadonly<HistoireAccessibilityInspection>>;
186
+ /** Draw a temporary non-interactive ring in the exact runtime. */
187
+ highlight: (options: HistoireInspectionOptions & {
188
+ durationMs?: number;
189
+ } & ({
190
+ selector: string;
191
+ componentId?: never;
192
+ } | {
193
+ selector?: never;
194
+ componentId: string;
195
+ })) => Promise<HistoireReadonly<{
196
+ owner: HistoireInspectionOwner;
197
+ observedAt: string;
198
+ }>>;
199
+ /** Hit-test a CSS client point inside the captured runtime document. */
200
+ pick: (options: HistoireInspectionOptions & {
201
+ x: number;
202
+ y: number;
203
+ }) => Promise<HistoireReadonly<HistoireInspectionPick>>;
204
+ /** Draw an overlay whose exact lease can be cleared later. */
205
+ highlightLease: (options: HistoireInspectionOptions & {
206
+ durationMs?: number;
207
+ } & ({
208
+ selector: string;
209
+ componentId?: never;
210
+ } | {
211
+ selector?: never;
212
+ componentId: string;
213
+ })) => Promise<HistoireReadonly<HistoireHighlightLease>>;
214
+ /** Clear only the lease belonging to the captured target and owner. */
215
+ clearHighlight: (options: HistoireInspectionOptions & {
216
+ target: HistoireInspectionOwner['target'];
217
+ expectedOwner: HistoireInspectionOwner;
218
+ leaseId: string;
219
+ }) => Promise<HistoireReadonly<HistoireHighlightClear>>;
220
+ }
221
+ //# sourceMappingURL=inspection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspection.d.ts","sourceRoot":"","sources":["../../src/types/inspection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACxE,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,+BAA+B,CAAA;AACpF,OAAO,KAAK,EAAE,kCAAkC,EAAE,2BAA2B,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAA;AAClJ,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAErD,kEAAkE;AAClE,eAAO,MAAM,yBAAyB,YAAI,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,qBAAqB,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,CAAU,CAAA;AAChM,sCAAsC;AACtC,MAAM,MAAM,sBAAsB,GAAG,OAAO,yBAAyB,CAAC,MAAM,CAAC,CAAA;AAC7E,0EAA0E;AAC1E,MAAM,MAAM,8BAA8B,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,GAAG,KAAK,GAAG,YAAY,GAAG,kBAAkB,GAAG,oBAAoB,GAAG,WAAW,GAAG,oBAAoB,GAAG,MAAM,GAAG,gBAAgB,GAAG,aAAa,EAAE,kBAAkB,CAAC,CAAC,CAAA;AAC/O,+EAA+E;AAC/E,MAAM,WAAW,uBAAuB;IACtC,qBAAqB;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,oCAAoC;IACpC,QAAQ,EAAE,MAAM,CAAA;IAChB,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAA;IACjB,8BAA8B;IAC9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