feat(sdk): variable usage scan + preview-values adapter seam

This commit is contained in:
James
2026-07-09 13:31:02 -07:00
parent 839881a98e
commit 91831f3f8e
11 changed files with 508 additions and 1 deletions
+9
View File
@@ -84,4 +84,13 @@ export interface PreviewAdapter {
* subscription first. Returns an unsubscribe.
*/
attachSync(comp: Composition): () => void;
/**
* Optional: apply composition-variable values to the preview so it renders
* as `window.__hfVariables` injection would at render time (values must be
* visible to the runtime BEFORE composition scripts run — typically a
* preview reload with injection, not a live poke). Pass null to restore
* declared defaults. Values are ephemeral preview state, never persisted.
*/
setPreviewVariables?(values: Record<string, unknown> | null): void;
}