@pygmalionjs/pygmalion 0.5.14 → 0.5.15
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-lib/types/App.d.ts +5 -0
- package/dist-lib/types/canvas/CameraLayer.d.ts +9 -0
- package/dist-lib/types/canvas/Canvas.d.ts +19 -0
- package/dist-lib/types/canvas/FrameLabelBanner.d.ts +7 -0
- package/dist-lib/types/canvas/FrameView.d.ts +9 -0
- package/dist-lib/types/canvas/FrozenRoutePreview.d.ts +12 -0
- package/dist-lib/types/canvas/InspectOverlay.d.ts +10 -0
- package/dist-lib/types/canvas/LightweightCanvas.d.ts +10 -0
- package/dist-lib/types/canvas/ObjectControls.d.ts +22 -0
- package/dist-lib/types/canvas/Preview.d.ts +3 -0
- package/dist-lib/types/canvas/SectionBoxes.d.ts +24 -0
- package/dist-lib/types/canvas/ShadowRoutePreview.d.ts +14 -0
- package/dist-lib/types/canvas/StoryboardConnections.d.ts +31 -0
- package/dist-lib/types/canvas/cameraPlacement.d.ts +45 -0
- package/dist-lib/types/canvas/domTags.d.ts +10 -0
- package/dist-lib/types/canvas/layoutContext.d.ts +9 -0
- package/dist-lib/types/canvas/useFlowSession.d.ts +36 -0
- package/dist-lib/types/canvas/useFrameLod.d.ts +35 -0
- package/dist-lib/types/editor/adaptiveFrameLayout.d.ts +67 -0
- package/dist-lib/types/editor/assetEditing.d.ts +10 -0
- package/dist-lib/types/editor/bannerStyle.d.ts +18 -0
- package/dist-lib/types/editor/catalog.d.ts +101 -0
- package/dist-lib/types/editor/codegen.d.ts +11 -0
- package/dist-lib/types/editor/componentConnections.d.ts +63 -0
- package/dist-lib/types/editor/componentInstances.d.ts +27 -0
- package/dist-lib/types/editor/contentBounds.d.ts +34 -0
- package/dist-lib/types/editor/designCompiler.d.ts +100 -0
- package/dist-lib/types/editor/designImport.d.ts +448 -0
- package/dist-lib/types/editor/documentSync.d.ts +28 -0
- package/dist-lib/types/editor/domImport.d.ts +58 -0
- package/dist-lib/types/editor/editModePolicy.d.ts +17 -0
- package/dist-lib/types/editor/fiberMap.d.ts +16 -0
- package/dist-lib/types/editor/flowSessionScheduler.d.ts +97 -0
- package/dist-lib/types/editor/flowSessions.d.ts +137 -0
- package/dist-lib/types/editor/frameHeight.d.ts +14 -0
- package/dist-lib/types/editor/frameIdentity.d.ts +9 -0
- package/dist-lib/types/editor/frameLabels.d.ts +124 -0
- package/dist-lib/types/editor/frameLanes.d.ts +62 -0
- package/dist-lib/types/editor/frameLod.d.ts +123 -0
- package/dist-lib/types/editor/frameLodRuntime.d.ts +64 -0
- package/dist-lib/types/editor/framePointerHit.d.ts +67 -0
- package/dist-lib/types/editor/framePointerIntent.d.ts +53 -0
- package/dist-lib/types/editor/framePreviewChannels.d.ts +26 -0
- package/dist-lib/types/editor/framePreviewKeys.d.ts +21 -0
- package/dist-lib/types/editor/frameWheelRouting.d.ts +16 -0
- package/dist-lib/types/editor/frozenImport.d.ts +70 -0
- package/dist-lib/types/editor/host.d.ts +114 -0
- package/dist-lib/types/editor/inspect.d.ts +225 -0
- package/dist-lib/types/editor/interactiveStates.d.ts +103 -0
- package/dist-lib/types/editor/livePreviewInstances.d.ts +93 -0
- package/dist-lib/types/editor/liveScreens.d.ts +20 -0
- package/dist-lib/types/editor/nodeSelector.d.ts +20 -0
- package/dist-lib/types/editor/previewBootstrap.d.ts +189 -0
- package/dist-lib/types/editor/previewEnvironmentControls.d.ts +33 -0
- package/dist-lib/types/editor/previewHydration.d.ts +5 -0
- package/dist-lib/types/editor/previewIntent.d.ts +17 -0
- package/dist-lib/types/editor/previewSweep.d.ts +129 -0
- package/dist-lib/types/editor/previewWarmup.d.ts +77 -0
- package/dist-lib/types/editor/projectBootGate.d.ts +45 -0
- package/dist-lib/types/editor/projectRuntime.d.ts +138 -0
- package/dist-lib/types/editor/registry.d.ts +38 -0
- package/dist-lib/types/editor/routePreview.d.ts +285 -0
- package/dist-lib/types/editor/routePreviewArtifactV2.d.ts +34 -0
- package/dist-lib/types/editor/routePreviewArtifactV3.d.ts +64 -0
- package/dist-lib/types/editor/routePreviewPlacement.d.ts +9 -0
- package/dist-lib/types/editor/routePreviewStatus.d.ts +48 -0
- package/dist-lib/types/editor/scenarioCoverage.d.ts +167 -0
- package/dist-lib/types/editor/screenCards.d.ts +101 -0
- package/dist-lib/types/editor/screenDimensions.d.ts +63 -0
- package/dist-lib/types/editor/screenFlows.d.ts +47 -0
- package/dist-lib/types/editor/screenInteractions.d.ts +4 -0
- package/dist-lib/types/editor/screenLists.d.ts +40 -0
- package/dist-lib/types/editor/screenStateGroups.d.ts +36 -0
- package/dist-lib/types/editor/screenshotBitmaps.d.ts +20 -0
- package/dist-lib/types/editor/sectionHeaders.d.ts +117 -0
- package/dist-lib/types/editor/shadowPreview.d.ts +103 -0
- package/dist-lib/types/editor/sharedSource.d.ts +40 -0
- package/dist-lib/types/editor/sourceJournal.d.ts +27 -0
- package/dist-lib/types/editor/store.d.ts +838 -0
- package/dist-lib/types/editor/storyboardComposition.d.ts +116 -0
- package/dist-lib/types/editor/storyboardDiscovery.d.ts +105 -0
- package/dist-lib/types/editor/storyboardEnvironment.d.ts +22 -0
- package/dist-lib/types/editor/storyboardGraph.d.ts +120 -0
- package/dist-lib/types/editor/storyboardGraphRuntime.d.ts +12 -0
- package/dist-lib/types/editor/storyboardGraphView.d.ts +104 -0
- package/dist-lib/types/editor/surfaceDemands.d.ts +138 -0
- package/dist-lib/types/editor/tokens.d.ts +26 -0
- package/dist-lib/types/editor/useObserved.d.ts +1 -0
- package/dist-lib/types/editor/viewportPresets.d.ts +21 -0
- package/dist-lib/types/editor/visualQa.d.ts +50 -0
- package/dist-lib/types/lib.d.ts +345 -0
- package/dist-lib/types/shell/ApplyPanel.d.ts +1 -0
- package/dist-lib/types/shell/AssetsPanel.d.ts +3 -0
- package/dist-lib/types/shell/CanvasStatusProbe.d.ts +5 -0
- package/dist-lib/types/shell/CodePanel.d.ts +1 -0
- package/dist-lib/types/shell/ComponentStateControls.d.ts +108 -0
- package/dist-lib/types/shell/ContextMenu.d.ts +1 -0
- package/dist-lib/types/shell/LayerTree.d.ts +7 -0
- package/dist-lib/types/shell/PropsPanel.d.ts +1 -0
- package/dist-lib/types/shell/StoryboardGraphPanel.d.ts +23 -0
- package/dist-lib/types/shell/ZoomIndicator.d.ts +4 -0
- package/dist-lib/types/shell/qaPresentation.d.ts +9 -0
- package/dist-lib/types/testing.d.ts +8 -0
- package/dist-lib/types/ui/SourceRefControl.d.ts +38 -0
- package/dist-lib/types/ui/icons.d.ts +30 -0
- package/package.json +7 -8
- package/testing.d.ts +0 -26
- package/types.d.ts +0 -2675
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface ContentBounds {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
}
|
|
5
|
+
type ContentBoundsMeasurement = (element: Element) => ContentBounds;
|
|
6
|
+
/**
|
|
7
|
+
* Measures the actual rendered bounds of a catalog root. Scroll metrics cover
|
|
8
|
+
* tables and forms that overflow their wrapper; the descendant union covers
|
|
9
|
+
* positioned content that is not represented by the wrapper's scroll box.
|
|
10
|
+
*/
|
|
11
|
+
export declare function measureContentBounds(element: Element): ContentBounds;
|
|
12
|
+
/**
|
|
13
|
+
* Measures the authored content root itself instead of its overflow box.
|
|
14
|
+
*
|
|
15
|
+
* `data-pygmalion-content-bounds` is an explicit frame boundary. Its layout
|
|
16
|
+
* border box already grows with normal-flow and max-content children, while
|
|
17
|
+
* scroll metrics can be polluted by editor-only layers after DOM promotion.
|
|
18
|
+
* Prefer untransformed layout metrics so canvas zoom never changes the model
|
|
19
|
+
* frame size.
|
|
20
|
+
*/
|
|
21
|
+
export declare function measureContentBorderBounds(element: Element): ContentBounds;
|
|
22
|
+
/**
|
|
23
|
+
* Reports stable rendered bounds after layout, font loading, resize, and DOM
|
|
24
|
+
* mutation. Updates are coalesced through two animation frames so a font or
|
|
25
|
+
* component layout commit cannot publish an intermediate frame size.
|
|
26
|
+
*/
|
|
27
|
+
export declare function observeContentBounds(element: Element, onBoundsChange: (bounds: ContentBounds) => void, measure?: ContentBoundsMeasurement): () => void;
|
|
28
|
+
/**
|
|
29
|
+
* Follows the measurable catalog root inside a render host. Catalog components
|
|
30
|
+
* may mount or be replaced after the frame effect runs, so observing only the
|
|
31
|
+
* first query result can leave a persisted seed size in place indefinitely.
|
|
32
|
+
*/
|
|
33
|
+
export declare function observeContentBoundsTarget(container: Element, selector: string, onBoundsChange: (bounds: ContentBounds) => void, measure?: ContentBoundsMeasurement): () => void;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { type CodegenFrameOptions, type CodegenNode } from './codegen';
|
|
2
|
+
import { type NodeJSON } from './store';
|
|
3
|
+
export declare const DESIGN_IR_SCHEMA: "pygmalion.design-ir";
|
|
4
|
+
export declare const DESIGN_IR_VERSION: 1;
|
|
5
|
+
export type DesignCompilePurpose = 'interactive' | 'export';
|
|
6
|
+
export type DesignCompileSeverity = 'info' | 'warning' | 'error';
|
|
7
|
+
export type DesignCompileStage = 'normalize' | 'analyze' | 'generate' | 'resource';
|
|
8
|
+
export type DesignCompileStatus = 'ready' | 'deferred' | 'blocked';
|
|
9
|
+
export interface DesignCompileDiagnostic {
|
|
10
|
+
severity: DesignCompileSeverity;
|
|
11
|
+
stage: DesignCompileStage;
|
|
12
|
+
code: string;
|
|
13
|
+
message: string;
|
|
14
|
+
nodeId?: string;
|
|
15
|
+
nodePath?: string;
|
|
16
|
+
details?: Readonly<Record<string, string | number | boolean>>;
|
|
17
|
+
}
|
|
18
|
+
export interface DesignIRAsset {
|
|
19
|
+
id: string;
|
|
20
|
+
kind: 'image' | 'video' | 'background';
|
|
21
|
+
source: string;
|
|
22
|
+
portability: 'embedded' | 'remote' | 'project' | 'ephemeral';
|
|
23
|
+
nodeIds: readonly string[];
|
|
24
|
+
}
|
|
25
|
+
export interface DesignIRComponent {
|
|
26
|
+
name: string;
|
|
27
|
+
importPath: string;
|
|
28
|
+
registered: boolean;
|
|
29
|
+
connectionId?: string;
|
|
30
|
+
sourcePath?: string;
|
|
31
|
+
design?: {
|
|
32
|
+
provider: string;
|
|
33
|
+
documentId?: string;
|
|
34
|
+
nodeId: string;
|
|
35
|
+
url?: string;
|
|
36
|
+
};
|
|
37
|
+
nodeIds: readonly string[];
|
|
38
|
+
}
|
|
39
|
+
export interface DesignIRMetrics {
|
|
40
|
+
nodeCount: number;
|
|
41
|
+
maxDepth: number;
|
|
42
|
+
hiddenNodeCount: number;
|
|
43
|
+
componentCount: number;
|
|
44
|
+
assetCount: number;
|
|
45
|
+
}
|
|
46
|
+
export interface DesignIntermediateDocumentV1 {
|
|
47
|
+
schema: typeof DESIGN_IR_SCHEMA;
|
|
48
|
+
version: typeof DESIGN_IR_VERSION;
|
|
49
|
+
root: NodeJSON;
|
|
50
|
+
frame?: CodegenFrameOptions;
|
|
51
|
+
components: readonly DesignIRComponent[];
|
|
52
|
+
assets: readonly DesignIRAsset[];
|
|
53
|
+
metrics: DesignIRMetrics;
|
|
54
|
+
}
|
|
55
|
+
export interface DesignCompileLimits {
|
|
56
|
+
/** Interactive code output pauses above this size until explicitly requested. */
|
|
57
|
+
previewNodeLimit: number;
|
|
58
|
+
/** Compilation is blocked instead of silently dropping nodes. */
|
|
59
|
+
maxNodes: number;
|
|
60
|
+
maxDepth: number;
|
|
61
|
+
maxOutputBytes: number;
|
|
62
|
+
}
|
|
63
|
+
export declare const DEFAULT_DESIGN_COMPILE_LIMITS: Readonly<DesignCompileLimits>;
|
|
64
|
+
export interface DesignCodegenAdapterContext {
|
|
65
|
+
document: DesignIntermediateDocumentV1;
|
|
66
|
+
}
|
|
67
|
+
export interface DesignCodegenAdapterOutput {
|
|
68
|
+
code: string;
|
|
69
|
+
diagnostics?: readonly DesignCompileDiagnostic[];
|
|
70
|
+
}
|
|
71
|
+
export interface DesignCodegenAdapter {
|
|
72
|
+
id: string;
|
|
73
|
+
label: string;
|
|
74
|
+
language: string;
|
|
75
|
+
extension: string;
|
|
76
|
+
generate(context: DesignCodegenAdapterContext): string | DesignCodegenAdapterOutput;
|
|
77
|
+
}
|
|
78
|
+
export interface DesignCompileOptions {
|
|
79
|
+
target?: string;
|
|
80
|
+
purpose?: DesignCompilePurpose;
|
|
81
|
+
force?: boolean;
|
|
82
|
+
frame?: CodegenFrameOptions;
|
|
83
|
+
limits?: Partial<DesignCompileLimits>;
|
|
84
|
+
}
|
|
85
|
+
export interface DesignCompileResult {
|
|
86
|
+
target: string;
|
|
87
|
+
status: DesignCompileStatus;
|
|
88
|
+
code: string;
|
|
89
|
+
language?: string;
|
|
90
|
+
extension?: string;
|
|
91
|
+
document: DesignIntermediateDocumentV1;
|
|
92
|
+
diagnostics: readonly DesignCompileDiagnostic[];
|
|
93
|
+
metrics: DesignIRMetrics & {
|
|
94
|
+
outputBytes: number;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export declare function createDesignIntermediateDocument(root: CodegenNode, frame?: CodegenFrameOptions): DesignIntermediateDocumentV1;
|
|
98
|
+
export declare function registerDesignCodegenAdapter(adapter: DesignCodegenAdapter): () => void;
|
|
99
|
+
export declare function getDesignCodegenAdapters(): readonly DesignCodegenAdapter[];
|
|
100
|
+
export declare function compileDesignDocument(root: CodegenNode, options?: DesignCompileOptions): DesignCompileResult;
|
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
import { type DomImportOptions, type DomImportResult } from './domImport';
|
|
2
|
+
import type { DesignFrameHeightMode } from './frameHeight';
|
|
3
|
+
import type { ComponentRegistry } from './registry';
|
|
4
|
+
import type { TokenDef } from './tokens';
|
|
5
|
+
export declare const DESIGN_IMPORT_KINDS: readonly ["icons", "design-tokens", "atoms", "components", "screens"];
|
|
6
|
+
export type DesignImportKind = (typeof DESIGN_IMPORT_KINDS)[number];
|
|
7
|
+
export type DesignFrameSizeMode = 'fixed' | 'content';
|
|
8
|
+
export type { DesignFrameHeightMode } from './frameHeight';
|
|
9
|
+
/** Individual assets discovered at source. Connect to which designer sheet it can be viewed using pageId. */
|
|
10
|
+
export interface DesignImportAsset {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
section: string;
|
|
14
|
+
pageId: string;
|
|
15
|
+
sourcePath?: string;
|
|
16
|
+
codeName?: string;
|
|
17
|
+
/** Metadata that describes the user flow/QA catalog when it is a screen asset. */
|
|
18
|
+
flow?: string;
|
|
19
|
+
scenarioId?: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
}
|
|
22
|
+
export type DesignScreenInteractionAction = 'click' | 'focus' | 'fill' | 'check' | 'press' | 'wait' | 'storage';
|
|
23
|
+
/**
|
|
24
|
+
* A critical step to capture the actual app screen after putting it in a specific user flow state.
|
|
25
|
+
* A CSS selector is used first, and if text is present, the selector candidates are narrowed down to the display string.
|
|
26
|
+
*/
|
|
27
|
+
export interface DesignScreenInteraction {
|
|
28
|
+
action: DesignScreenInteractionAction;
|
|
29
|
+
label: string;
|
|
30
|
+
selector?: string;
|
|
31
|
+
text?: string;
|
|
32
|
+
exact?: boolean;
|
|
33
|
+
index?: number;
|
|
34
|
+
/** A wait step observes visible elements by default. Use attached to wait for DOM insertion only. */
|
|
35
|
+
waitState?: 'visible' | 'attached';
|
|
36
|
+
value?: string;
|
|
37
|
+
key?: string;
|
|
38
|
+
storage?: 'local' | 'session';
|
|
39
|
+
timeoutMs?: number;
|
|
40
|
+
settleMs?: number;
|
|
41
|
+
optional?: boolean;
|
|
42
|
+
}
|
|
43
|
+
/** A JSON-compatible value that conveys host-specific meaning without Pygmalion interpreting it. */
|
|
44
|
+
export type DesignSerializable = string | number | boolean | null | readonly DesignSerializable[] | {
|
|
45
|
+
readonly [key: string]: DesignSerializable;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* A deterministic environment that the host must recreate before capture.
|
|
49
|
+
* Example: { role, api, host, timers, device, microphone }.
|
|
50
|
+
* The meaning of keys and values is entirely owned by the host adapter.
|
|
51
|
+
*/
|
|
52
|
+
export type DesignScreenPreset = Readonly<Record<string, DesignSerializable>>;
|
|
53
|
+
export type StoryboardPermissionState = 'granted' | 'denied' | 'prompt';
|
|
54
|
+
export type StoryboardMediaFailure = 'not-allowed' | 'not-found' | 'not-readable' | 'overconstrained';
|
|
55
|
+
export interface StoryboardMediaDevice {
|
|
56
|
+
kind: 'audioinput' | 'audiooutput' | 'videoinput';
|
|
57
|
+
deviceId: string;
|
|
58
|
+
groupId?: string;
|
|
59
|
+
label?: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Browser-owned state that must exist before application modules execute.
|
|
63
|
+
* Unlike a host preset, these keys have portable semantics and are installed
|
|
64
|
+
* by the Pygmalion preview runtime before the route application mounts.
|
|
65
|
+
*/
|
|
66
|
+
export interface StoryboardEnvironment {
|
|
67
|
+
localStorage?: Readonly<Record<string, string | null>>;
|
|
68
|
+
sessionStorage?: Readonly<Record<string, string | null>>;
|
|
69
|
+
permissions?: Readonly<Record<string, StoryboardPermissionState>>;
|
|
70
|
+
mediaDevices?: {
|
|
71
|
+
devices?: readonly StoryboardMediaDevice[];
|
|
72
|
+
getUserMedia?: 'passthrough' | StoryboardMediaFailure;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* 'sandbox' virtualizes the whole origin storage for the document: reads
|
|
76
|
+
* of undeclared keys see a pristine profile and writes never reach the
|
|
77
|
+
* shared storage. Hidden preview instances set it so persisted UI state
|
|
78
|
+
* from one walk cannot poison sibling instances or the designer's tab.
|
|
79
|
+
*/
|
|
80
|
+
storageIsolation?: 'sandbox';
|
|
81
|
+
/**
|
|
82
|
+
* Host screen preset installed as `window.__PYGMALION_SCREEN_PRESET__`
|
|
83
|
+
* before application modules execute — parity with the Node capture
|
|
84
|
+
* runtime's init script for fixtures that read the preset at module or
|
|
85
|
+
* mount time.
|
|
86
|
+
*/
|
|
87
|
+
screenPreset?: Readonly<Record<string, unknown>>;
|
|
88
|
+
/**
|
|
89
|
+
* Request outcomes, applied by patching fetch and XMLHttpRequest before
|
|
90
|
+
* application modules execute.
|
|
91
|
+
*
|
|
92
|
+
* A failed request, an empty result, a slow response — these are states the
|
|
93
|
+
* product spends real time in and a storyboard almost never shows, because
|
|
94
|
+
* reaching one is not something a designer can click. Hosts used to reproduce
|
|
95
|
+
* them by inventing a flag per state and branching their own mock layer,
|
|
96
|
+
* which costs enough that most were never declared at all. The mechanism is
|
|
97
|
+
* generic, so it belongs here: the host says which request, not how to fake
|
|
98
|
+
* it.
|
|
99
|
+
*/
|
|
100
|
+
network?: StoryboardNetwork;
|
|
101
|
+
}
|
|
102
|
+
export type StoryboardRequestOutcome =
|
|
103
|
+
/** Reject the request the way an offline or 5xx call rejects. */
|
|
104
|
+
{
|
|
105
|
+
kind: 'fail';
|
|
106
|
+
status?: number;
|
|
107
|
+
message?: string;
|
|
108
|
+
}
|
|
109
|
+
/** Resolve with a well-formed but empty body, for empty-state screens. */
|
|
110
|
+
| {
|
|
111
|
+
kind: 'empty';
|
|
112
|
+
status?: number;
|
|
113
|
+
body?: string;
|
|
114
|
+
}
|
|
115
|
+
/** Resolve normally, late — the loading state, held still for capture. */
|
|
116
|
+
| {
|
|
117
|
+
kind: 'slow';
|
|
118
|
+
delayMs: number;
|
|
119
|
+
};
|
|
120
|
+
export interface StoryboardRequestCondition {
|
|
121
|
+
/**
|
|
122
|
+
* Matched against the request URL as a substring, so a host can name an
|
|
123
|
+
* endpoint without knowing the origin a preview boots on.
|
|
124
|
+
*/
|
|
125
|
+
match: string;
|
|
126
|
+
method?: string;
|
|
127
|
+
outcome: StoryboardRequestOutcome;
|
|
128
|
+
}
|
|
129
|
+
export interface StoryboardNetwork {
|
|
130
|
+
conditions?: readonly StoryboardRequestCondition[];
|
|
131
|
+
}
|
|
132
|
+
export type DesignScreenAssertionVisibility = 'visible' | 'hidden';
|
|
133
|
+
export interface DesignScreenAttributeAssertion {
|
|
134
|
+
name: string;
|
|
135
|
+
/** If omitted, the existence of the attribute itself is checked. */
|
|
136
|
+
value?: string;
|
|
137
|
+
match?: 'equals' | 'contains';
|
|
138
|
+
/** If false, there should be no attribute. Default true. */
|
|
139
|
+
present?: boolean;
|
|
140
|
+
}
|
|
141
|
+
/** An end condition that is checked immediately before capturing the DOM after an interaction. */
|
|
142
|
+
export interface DesignScreenAssertion {
|
|
143
|
+
label: string;
|
|
144
|
+
selector: string;
|
|
145
|
+
index?: number;
|
|
146
|
+
/** If false, the selector should not exist. Default true. */
|
|
147
|
+
exists?: boolean;
|
|
148
|
+
text?: string;
|
|
149
|
+
exact?: boolean;
|
|
150
|
+
attribute?: DesignScreenAttributeAssertion;
|
|
151
|
+
visibility?: DesignScreenAssertionVisibility;
|
|
152
|
+
timeoutMs?: number;
|
|
153
|
+
optional?: boolean;
|
|
154
|
+
}
|
|
155
|
+
/** The page whose assets will be rendered into the actual DOM. One page can contain multiple icon/token assets. */
|
|
156
|
+
export interface DesignImportPage {
|
|
157
|
+
id: string;
|
|
158
|
+
name: string;
|
|
159
|
+
section: string;
|
|
160
|
+
componentName?: string;
|
|
161
|
+
gallery?: string[];
|
|
162
|
+
route?: string;
|
|
163
|
+
path?: string;
|
|
164
|
+
publish?: boolean;
|
|
165
|
+
width?: number;
|
|
166
|
+
height?: number;
|
|
167
|
+
/**
|
|
168
|
+
* `content` replaces the 1×1 measurement seed with the rendered catalog
|
|
169
|
+
* root's actual DOM bounds. The default keeps the configured frame size.
|
|
170
|
+
*/
|
|
171
|
+
frameSizeMode?: DesignFrameSizeMode;
|
|
172
|
+
/** `document` expands the frame to the rendered document height. The default remains a fixed viewport. */
|
|
173
|
+
heightMode?: DesignFrameHeightMode;
|
|
174
|
+
/** Safety limit used only by document-height frames. Defaults to 12,000px and is capped at 32,000px. */
|
|
175
|
+
maxHeight?: number;
|
|
176
|
+
/** User flow hierarchy and status that designers use when organizing screens. */
|
|
177
|
+
flow?: string;
|
|
178
|
+
scenario?: string;
|
|
179
|
+
state?: string;
|
|
180
|
+
/** Host-declared kind of the state branch (overlay, badge, layout, ...). */
|
|
181
|
+
stateKind?: string;
|
|
182
|
+
/** Host-declared situation group the canvas arranges the frame into. */
|
|
183
|
+
lane?: string;
|
|
184
|
+
scenarioId?: string;
|
|
185
|
+
/**
|
|
186
|
+
* Every scenario this screen demonstrates. Coverage is the whole set; the
|
|
187
|
+
* canonical `scenarioId` is only the one a reviewer is sent to first, and a
|
|
188
|
+
* screen may declare the set without naming a canonical one.
|
|
189
|
+
*/
|
|
190
|
+
scenarioIds?: readonly string[];
|
|
191
|
+
interactions?: readonly DesignScreenInteraction[];
|
|
192
|
+
environment?: StoryboardEnvironment;
|
|
193
|
+
preset?: DesignScreenPreset;
|
|
194
|
+
assertions?: readonly DesignScreenAssertion[];
|
|
195
|
+
/**
|
|
196
|
+
* Names a group of screens that one running application can serve.
|
|
197
|
+
*
|
|
198
|
+
* A declared state is reached by switching state, so screens in the same group
|
|
199
|
+
* share a booted instance — capture reuses a warm page, and the editor reuses
|
|
200
|
+
* a warm preview. Set it only when the declaration is the complete state; a
|
|
201
|
+
* screen whose result depends on how it was entered must leave it unset.
|
|
202
|
+
* Screens with interactions never share an instance, because only the screen
|
|
203
|
+
* knows how to undo what a click opened.
|
|
204
|
+
*/
|
|
205
|
+
session?: string;
|
|
206
|
+
}
|
|
207
|
+
export interface DesignImportCollection {
|
|
208
|
+
assets: readonly DesignImportAsset[];
|
|
209
|
+
pages: readonly DesignImportPage[];
|
|
210
|
+
/** Number of original code scans. If it is different from assets.length, it is judged as stale/missing. */
|
|
211
|
+
expectedCount: number;
|
|
212
|
+
}
|
|
213
|
+
/** User scenarios discovered in host code. This is the input ledger for screen case classification. */
|
|
214
|
+
export interface DesignScenarioSource {
|
|
215
|
+
id: string;
|
|
216
|
+
name?: string;
|
|
217
|
+
section: string;
|
|
218
|
+
flow?: string;
|
|
219
|
+
sourcePath?: string;
|
|
220
|
+
codeName?: string;
|
|
221
|
+
description?: string;
|
|
222
|
+
}
|
|
223
|
+
/** A single visual state that is recreated in the actual app for designers to review. */
|
|
224
|
+
export interface DesignScreenCase extends DesignImportPage {
|
|
225
|
+
scenarioIds?: readonly string[];
|
|
226
|
+
sourcePath?: string;
|
|
227
|
+
codeName?: string;
|
|
228
|
+
/** The code route that this visual state represents. Used when reproducing the route guard state with a component fixture. */
|
|
229
|
+
coverageRoutes?: readonly string[];
|
|
230
|
+
}
|
|
231
|
+
/** Operational scenarios such as network, storage, bridge, etc. without separate visual state. */
|
|
232
|
+
export interface DesignBehaviorScenario {
|
|
233
|
+
id: string;
|
|
234
|
+
reason: string;
|
|
235
|
+
}
|
|
236
|
+
export interface DesignScenarioCoverage {
|
|
237
|
+
total: number;
|
|
238
|
+
screen: number;
|
|
239
|
+
behavior: number;
|
|
240
|
+
missing: readonly string[];
|
|
241
|
+
complete: boolean;
|
|
242
|
+
}
|
|
243
|
+
export interface DesignScreenCollectionResult {
|
|
244
|
+
collection: DesignImportCollection;
|
|
245
|
+
coverage: DesignScenarioCoverage;
|
|
246
|
+
}
|
|
247
|
+
/** A portable viewport variant used to render the same authored screen recipe responsively. */
|
|
248
|
+
export interface DesignScreenViewport {
|
|
249
|
+
id: string;
|
|
250
|
+
label: string;
|
|
251
|
+
width: number;
|
|
252
|
+
height: number;
|
|
253
|
+
heightMode?: DesignFrameHeightMode;
|
|
254
|
+
maxHeight?: number;
|
|
255
|
+
}
|
|
256
|
+
export type DesignScreenViewportPagePatch = Partial<Omit<DesignImportPage, 'id' | 'name' | 'section' | 'width' | 'height'>>;
|
|
257
|
+
export interface DesignScreenViewportExpansionOptions {
|
|
258
|
+
include?: (page: DesignImportPage, viewport: DesignScreenViewport) => boolean;
|
|
259
|
+
/**
|
|
260
|
+
* Adapts viewport-specific reproduction details such as interactions,
|
|
261
|
+
* assertions, presets, or document-height behavior. Identity, grouping, and
|
|
262
|
+
* viewport dimensions are still owned by the expansion contract.
|
|
263
|
+
*/
|
|
264
|
+
transformPage?: (page: DesignImportPage, viewport: DesignScreenViewport) => DesignScreenViewportPagePatch | undefined;
|
|
265
|
+
createPageId?: (page: DesignImportPage, viewport: DesignScreenViewport) => string;
|
|
266
|
+
createPageName?: (page: DesignImportPage, viewport: DesignScreenViewport) => string;
|
|
267
|
+
createSection?: (page: DesignImportPage, viewport: DesignScreenViewport) => string;
|
|
268
|
+
}
|
|
269
|
+
export interface DesignImportManifest {
|
|
270
|
+
sourceSha?: string;
|
|
271
|
+
registry: ComponentRegistry;
|
|
272
|
+
tokens: readonly TokenDef[];
|
|
273
|
+
collections: Record<DesignImportKind, DesignImportCollection>;
|
|
274
|
+
}
|
|
275
|
+
export interface DesignImportInitialPage {
|
|
276
|
+
name: string;
|
|
277
|
+
canvas: string;
|
|
278
|
+
section?: string;
|
|
279
|
+
componentName?: string;
|
|
280
|
+
gallery?: string[];
|
|
281
|
+
route?: string;
|
|
282
|
+
path?: string;
|
|
283
|
+
publish?: boolean;
|
|
284
|
+
width?: number;
|
|
285
|
+
height?: number;
|
|
286
|
+
frameSizeMode?: DesignFrameSizeMode;
|
|
287
|
+
heightMode?: DesignFrameHeightMode;
|
|
288
|
+
maxHeight?: number;
|
|
289
|
+
/** If true, the entire actual DOM is replaced with an editable layer tree immediately after the first render. */
|
|
290
|
+
importLayers?: boolean;
|
|
291
|
+
/** Original manifest page id and asset type. */
|
|
292
|
+
importPageId?: string;
|
|
293
|
+
importKind?: DesignImportKind;
|
|
294
|
+
/** The actual code assets and source files that this edit frame represents. */
|
|
295
|
+
assetIds?: string[];
|
|
296
|
+
sourcePaths?: string[];
|
|
297
|
+
flow?: string;
|
|
298
|
+
scenario?: string;
|
|
299
|
+
state?: string;
|
|
300
|
+
stateKind?: string;
|
|
301
|
+
lane?: string;
|
|
302
|
+
scenarioId?: string;
|
|
303
|
+
interactions?: DesignScreenInteraction[];
|
|
304
|
+
environment?: StoryboardEnvironment;
|
|
305
|
+
preset?: DesignScreenPreset;
|
|
306
|
+
assertions?: DesignScreenAssertion[];
|
|
307
|
+
}
|
|
308
|
+
export interface DesignImportCoverageItem {
|
|
309
|
+
expected: number;
|
|
310
|
+
imported: number;
|
|
311
|
+
pages: number;
|
|
312
|
+
missing: number;
|
|
313
|
+
}
|
|
314
|
+
export type DesignImportCoverage = Record<DesignImportKind, DesignImportCoverageItem> & {
|
|
315
|
+
sourceSha?: string;
|
|
316
|
+
complete: boolean;
|
|
317
|
+
};
|
|
318
|
+
export interface DesignScreenInteractionReport {
|
|
319
|
+
complete: boolean;
|
|
320
|
+
completed: number;
|
|
321
|
+
total: number;
|
|
322
|
+
failedLabel?: string;
|
|
323
|
+
error?: string;
|
|
324
|
+
}
|
|
325
|
+
export type DesignScreenCaptureFailureStage = 'preset' | 'interaction' | 'assertion';
|
|
326
|
+
export type DesignScreenCaptureFailureCode = 'preset_executor_missing' | 'preset_rejected' | 'preset_error' | 'interaction_failed' | 'invalid_selector' | 'existence_mismatch' | 'text_mismatch' | 'attribute_mismatch' | 'visibility_mismatch';
|
|
327
|
+
export interface DesignScreenCaptureFailure {
|
|
328
|
+
stage: DesignScreenCaptureFailureStage;
|
|
329
|
+
code: DesignScreenCaptureFailureCode;
|
|
330
|
+
message: string;
|
|
331
|
+
label?: string;
|
|
332
|
+
index?: number;
|
|
333
|
+
selector?: string;
|
|
334
|
+
expected?: DesignSerializable;
|
|
335
|
+
actual?: DesignSerializable;
|
|
336
|
+
}
|
|
337
|
+
export interface DesignScreenAssertionReport {
|
|
338
|
+
complete: boolean;
|
|
339
|
+
completed: number;
|
|
340
|
+
total: number;
|
|
341
|
+
failures: DesignScreenCaptureFailure[];
|
|
342
|
+
}
|
|
343
|
+
export interface DesignScreenCaptureReport {
|
|
344
|
+
complete: boolean;
|
|
345
|
+
presetApplied: boolean;
|
|
346
|
+
interactions: DesignScreenInteractionReport;
|
|
347
|
+
assertions: DesignScreenAssertionReport;
|
|
348
|
+
failures: DesignScreenCaptureFailure[];
|
|
349
|
+
/** First failure summary compatible with existing screen error UI. */
|
|
350
|
+
failedLabel?: string;
|
|
351
|
+
error?: string;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Rejects a rendered route state when its authored reproduction recipe did not
|
|
355
|
+
* finish. Call this before serializing or caching a live preview so a base
|
|
356
|
+
* route cannot silently replace the requested interaction state.
|
|
357
|
+
*/
|
|
358
|
+
export declare function assertScreenCaptureComplete(report: DesignScreenCaptureReport | null | undefined): void;
|
|
359
|
+
/** Serializable preset transport. The iframe is delivered only to a separate local execution context. */
|
|
360
|
+
export interface DesignScreenPresetRequest {
|
|
361
|
+
pageId: string;
|
|
362
|
+
route?: string;
|
|
363
|
+
preset: DesignScreenPreset;
|
|
364
|
+
}
|
|
365
|
+
export interface DesignScreenPresetContext {
|
|
366
|
+
iframe: HTMLIFrameElement;
|
|
367
|
+
}
|
|
368
|
+
export interface DesignScreenPresetExecutionResult {
|
|
369
|
+
complete: boolean;
|
|
370
|
+
message?: string;
|
|
371
|
+
details?: DesignSerializable;
|
|
372
|
+
}
|
|
373
|
+
export type DesignScreenPresetExecutor = (request: DesignScreenPresetRequest, context: DesignScreenPresetContext) => Promise<DesignScreenPresetExecutionResult | void> | DesignScreenPresetExecutionResult | void;
|
|
374
|
+
export interface DesignScreenCaptureSpec {
|
|
375
|
+
pageId: string;
|
|
376
|
+
route?: string;
|
|
377
|
+
preset?: DesignScreenPreset;
|
|
378
|
+
interactions?: readonly DesignScreenInteraction[];
|
|
379
|
+
assertions?: readonly DesignScreenAssertion[];
|
|
380
|
+
}
|
|
381
|
+
export interface DesignScreenCaptureDefaults {
|
|
382
|
+
preset?: DesignScreenPreset;
|
|
383
|
+
assertions?: readonly DesignScreenAssertion[];
|
|
384
|
+
}
|
|
385
|
+
/** Host opt-in guard to block missing contracts in large catalogs before starting the editor. */
|
|
386
|
+
export interface DesignScreenCaptureRequirements {
|
|
387
|
+
preset?: boolean;
|
|
388
|
+
assertions?: boolean;
|
|
389
|
+
}
|
|
390
|
+
export interface DesignImportController {
|
|
391
|
+
readonly sourceSha?: string;
|
|
392
|
+
getRegistry(): ComponentRegistry;
|
|
393
|
+
getTokens(): TokenDef[];
|
|
394
|
+
getAssets(kind?: DesignImportKind): DesignImportAsset[];
|
|
395
|
+
getInitialPages(): DesignImportInitialPage[];
|
|
396
|
+
getCoverage(): DesignImportCoverage;
|
|
397
|
+
assertComplete(): void;
|
|
398
|
+
captureElement(element: Element, win?: Window, options?: DomImportOptions): DomImportResult | null;
|
|
399
|
+
captureIframe(iframe: HTMLIFrameElement, options?: DomImportOptions): DomImportResult | null;
|
|
400
|
+
captureIframeWhenStable(iframe: HTMLIFrameElement, options?: DomImportOptions & {
|
|
401
|
+
settleMs?: number;
|
|
402
|
+
timeoutMs?: number;
|
|
403
|
+
minElementCount?: number;
|
|
404
|
+
}): Promise<DomImportResult | null>;
|
|
405
|
+
runScreenInteractions(iframe: HTMLIFrameElement, interactions: readonly DesignScreenInteraction[]): Promise<DesignScreenInteractionReport>;
|
|
406
|
+
prepareScreenCapture(iframe: HTMLIFrameElement, spec: DesignScreenCaptureSpec): Promise<DesignScreenCaptureReport>;
|
|
407
|
+
}
|
|
408
|
+
export interface CreateDesignImportOptions {
|
|
409
|
+
/** Default budget for full layer mode. The host can explicitly increase it according to the screen size. */
|
|
410
|
+
layerOptions?: DomImportOptions;
|
|
411
|
+
/** The only boundary that enforces the host-specific semantics of the preset. The package does not interpret the payload. */
|
|
412
|
+
executeScreenPreset?: DesignScreenPresetExecutor;
|
|
413
|
+
/**
|
|
414
|
+
* How screen pages spread across canvases. `single` (default) keeps every
|
|
415
|
+
* screen on one canvas. `section` gives each section its own canvas
|
|
416
|
+
* (`<screens canvas> · <section>`): only the active section's frames
|
|
417
|
+
* materialize, so the camera, the LOD budget, and decoded previews scale
|
|
418
|
+
* with a section instead of the whole catalog. Cross-canvas activation
|
|
419
|
+
* already switches canvases (EditorStore.switchPage).
|
|
420
|
+
*/
|
|
421
|
+
screensCanvasPartition?: 'single' | 'section';
|
|
422
|
+
}
|
|
423
|
+
/** Creates responsive variants of authored cases without reclassifying source scenarios. */
|
|
424
|
+
export declare function expandDesignScreenCasesViewports(cases: readonly DesignScreenCase[], viewports: readonly DesignScreenViewport[], options?: DesignScreenViewportExpansionOptions): DesignScreenCase[];
|
|
425
|
+
/**
|
|
426
|
+
* Expands a canonical screen collection into deterministic responsive frames.
|
|
427
|
+
*
|
|
428
|
+
* Scenario coverage is intentionally calculated before this step. Responsive
|
|
429
|
+
* frames are alternate renderings of the same authored recipe, not duplicate
|
|
430
|
+
* scenario assignments.
|
|
431
|
+
*/
|
|
432
|
+
export declare function expandDesignScreenCollectionViewports(collection: DesignImportCollection, viewports: readonly DesignScreenViewport[], options?: DesignScreenViewportExpansionOptions): DesignImportCollection;
|
|
433
|
+
/**
|
|
434
|
+
* Classify every code scenario once as either a screen case or a non-visual operation.
|
|
435
|
+
* Silent omissions, duplicate classifications, and non-existent scenario/frame references are blocked before opening the editor.
|
|
436
|
+
*/
|
|
437
|
+
export declare function createDesignScreenCollection({ cases, scenarios, behaviorScenarios, captureDefaults, captureRequirements, }: {
|
|
438
|
+
cases: readonly DesignScreenCase[];
|
|
439
|
+
scenarios: readonly DesignScenarioSource[];
|
|
440
|
+
behaviorScenarios?: readonly DesignBehaviorScenario[];
|
|
441
|
+
captureDefaults?: DesignScreenCaptureDefaults;
|
|
442
|
+
captureRequirements?: DesignScreenCaptureRequirements;
|
|
443
|
+
}): DesignScreenCollectionResult;
|
|
444
|
+
/** Host basic environment + override for each case. Objects are recursively merged and arrays/primitives are replaced by cases. */
|
|
445
|
+
export declare function mergeScreenPresets(defaults?: DesignScreenPreset, override?: DesignScreenPreset): DesignScreenPreset;
|
|
446
|
+
export declare function createDesignImportController(manifest: DesignImportManifest, options?: CreateDesignImportOptions): DesignImportController;
|
|
447
|
+
export declare function setDesignImportController(controller: DesignImportController | null): void;
|
|
448
|
+
export declare function getDesignImportController(): DesignImportController | null;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { EditorStore } from './store';
|
|
2
|
+
type SyncStatus = 'idle' | 'saving' | 'saved' | 'error';
|
|
3
|
+
declare class DesignSyncState {
|
|
4
|
+
status: SyncStatus;
|
|
5
|
+
pending: number;
|
|
6
|
+
message: string;
|
|
7
|
+
constructor();
|
|
8
|
+
setPending(pending: number): void;
|
|
9
|
+
setStatus(status: SyncStatus, message: string): void;
|
|
10
|
+
}
|
|
11
|
+
/** General purpose status to show code autosave status in right panel. */
|
|
12
|
+
export declare const designSyncState: DesignSyncState;
|
|
13
|
+
/**
|
|
14
|
+
* It observes the entire edited document, but only sends the final state of changed elements to the host.
|
|
15
|
+
* Continuous typing/dragging and undo/redo are combined with the same element key, so the save history and edit history are separated.
|
|
16
|
+
*/
|
|
17
|
+
export declare function startDocumentSync(editor: EditorStore): () => void;
|
|
18
|
+
/** Tokens also use the same element change queue as canvas documents. */
|
|
19
|
+
export declare function queueTokenDesignChange(tokens: {
|
|
20
|
+
name: string;
|
|
21
|
+
value: string;
|
|
22
|
+
}[]): void;
|
|
23
|
+
/**
|
|
24
|
+
* Clear all remaining debounce/asynchronous storage just before final reflection.
|
|
25
|
+
* Save failures are propagated to the caller, and any saved pendings are retried on the next flush.
|
|
26
|
+
*/
|
|
27
|
+
export declare function flushDesignChanges(): Promise<void>;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { InstanceHit, InstanceResolver } from './fiberMap';
|
|
2
|
+
import type { NodeJSON } from './store';
|
|
3
|
+
/** Keeps a real 0 — the value that hides hover-only affordances. */
|
|
4
|
+
export declare function clampOpacity(value: string): number;
|
|
5
|
+
export interface DomImportDiagnostic {
|
|
6
|
+
severity: 'warning';
|
|
7
|
+
stage: 'capture';
|
|
8
|
+
code: 'max-nodes' | 'max-depth';
|
|
9
|
+
message: string;
|
|
10
|
+
limit: number;
|
|
11
|
+
actual: number;
|
|
12
|
+
}
|
|
13
|
+
export interface DomImportMetrics {
|
|
14
|
+
nodeCount: number;
|
|
15
|
+
maxDepth: number;
|
|
16
|
+
}
|
|
17
|
+
export interface DomImportOptions {
|
|
18
|
+
/** fiberMap resolver — Promotes the registry instance root to a component node, if present. */
|
|
19
|
+
resolveInstance?: InstanceResolver;
|
|
20
|
+
/**
|
|
21
|
+
* Overrides the `file#localName` CSS-module source lookup for an element.
|
|
22
|
+
* Defaults to the live-realm sourceTargetOf mapping; frozen previews swap in
|
|
23
|
+
* a resolver that reads the stamped data-pygmalion-source-style attribute.
|
|
24
|
+
*/
|
|
25
|
+
resolveSourceStyle?: (el: Element) => string;
|
|
26
|
+
/** collapse=component 1 node, expand=component boundary name+entire child DOM, ignore=pure DOM. */
|
|
27
|
+
instanceMode?: 'collapse' | 'expand' | 'ignore';
|
|
28
|
+
/**
|
|
29
|
+
* Hybrid collapse for 'expand' mode: a resolved hit this predicate accepts is
|
|
30
|
+
* imported as one component node exactly like instanceMode 'collapse', while
|
|
31
|
+
* rejected hits and unresolved DOM keep expanding. Ignored in other modes.
|
|
32
|
+
*/
|
|
33
|
+
collapseInstance?: (hit: InstanceHit) => boolean;
|
|
34
|
+
/** Exclude instance matching registry name — to prevent the fixture being disassembled from being re-captured in its entirety. */
|
|
35
|
+
exclude?: ReadonlySet<string>;
|
|
36
|
+
/** CSS transform scale (canvas zoom) — getBoundingClientRect is converted to model px because the transform is reflected. */
|
|
37
|
+
scale?: number;
|
|
38
|
+
/** Recursion depth/node budget. truncated=true when exceeded. */
|
|
39
|
+
maxDepth?: number;
|
|
40
|
+
maxNodes?: number;
|
|
41
|
+
/** display:none/visibility:hidden layers are also kept hidden. */
|
|
42
|
+
includeHidden?: boolean;
|
|
43
|
+
/** Structural layers of size 0 are also preserved. */
|
|
44
|
+
includeZeroSize?: boolean;
|
|
45
|
+
/** placeholder=one box of media, layers=svg/path/picture recursively down to the lower DOM. */
|
|
46
|
+
mediaMode?: 'placeholder' | 'layers';
|
|
47
|
+
}
|
|
48
|
+
export interface DomImportResult {
|
|
49
|
+
root: NodeJSON;
|
|
50
|
+
count: number;
|
|
51
|
+
truncated: boolean;
|
|
52
|
+
diagnostics: readonly DomImportDiagnostic[];
|
|
53
|
+
metrics: DomImportMetrics;
|
|
54
|
+
}
|
|
55
|
+
/** Transformation entry point starting from Element in the same document (or iframe document) — win is the window to which el belongs. */
|
|
56
|
+
export declare function importDomFromElement(el: Element, win: Window, opts?: DomImportOptions): DomImportResult | null;
|
|
57
|
+
/** Convert the body of the same-origin iframe to a node tree. null if cross-origin. */
|
|
58
|
+
export declare function importDomFromIframe(iframe: HTMLIFrameElement, opts?: DomImportOptions): DomImportResult | null;
|