@hyperframes/sdk 0.6.113

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 (78) hide show
  1. package/LICENSE +190 -0
  2. package/dist/adapters/fs.d.ts +9 -0
  3. package/dist/adapters/fs.d.ts.map +1 -0
  4. package/dist/adapters/fs.js +122 -0
  5. package/dist/adapters/fs.js.map +1 -0
  6. package/dist/adapters/headless.d.ts +3 -0
  7. package/dist/adapters/headless.d.ts.map +1 -0
  8. package/dist/adapters/headless.js +17 -0
  9. package/dist/adapters/headless.js.map +1 -0
  10. package/dist/adapters/iframe.d.ts +102 -0
  11. package/dist/adapters/iframe.d.ts.map +1 -0
  12. package/dist/adapters/iframe.js +569 -0
  13. package/dist/adapters/iframe.js.map +1 -0
  14. package/dist/adapters/memory.d.ts +5 -0
  15. package/dist/adapters/memory.d.ts.map +1 -0
  16. package/dist/adapters/memory.js +54 -0
  17. package/dist/adapters/memory.js.map +1 -0
  18. package/dist/adapters/types.d.ts +65 -0
  19. package/dist/adapters/types.d.ts.map +1 -0
  20. package/dist/adapters/types.js +2 -0
  21. package/dist/adapters/types.js.map +1 -0
  22. package/dist/document.d.ts +25 -0
  23. package/dist/document.d.ts.map +1 -0
  24. package/dist/document.js +238 -0
  25. package/dist/document.js.map +1 -0
  26. package/dist/engine/apply-patches.d.ts +20 -0
  27. package/dist/engine/apply-patches.d.ts.map +1 -0
  28. package/dist/engine/apply-patches.js +284 -0
  29. package/dist/engine/apply-patches.js.map +1 -0
  30. package/dist/engine/cssWriter.d.ts +18 -0
  31. package/dist/engine/cssWriter.d.ts.map +1 -0
  32. package/dist/engine/cssWriter.js +139 -0
  33. package/dist/engine/cssWriter.js.map +1 -0
  34. package/dist/engine/keyframeBackfill.d.ts +17 -0
  35. package/dist/engine/keyframeBackfill.d.ts.map +1 -0
  36. package/dist/engine/keyframeBackfill.js +43 -0
  37. package/dist/engine/keyframeBackfill.js.map +1 -0
  38. package/dist/engine/model.d.ts +55 -0
  39. package/dist/engine/model.d.ts.map +1 -0
  40. package/dist/engine/model.js +256 -0
  41. package/dist/engine/model.js.map +1 -0
  42. package/dist/engine/mutate.d.ts +26 -0
  43. package/dist/engine/mutate.d.ts.map +1 -0
  44. package/dist/engine/mutate.js +1243 -0
  45. package/dist/engine/mutate.js.map +1 -0
  46. package/dist/engine/patches.d.ts +71 -0
  47. package/dist/engine/patches.d.ts.map +1 -0
  48. package/dist/engine/patches.js +197 -0
  49. package/dist/engine/patches.js.map +1 -0
  50. package/dist/engine/serialize.d.ts +15 -0
  51. package/dist/engine/serialize.d.ts.map +1 -0
  52. package/dist/engine/serialize.js +20 -0
  53. package/dist/engine/serialize.js.map +1 -0
  54. package/dist/engine/variableModel.d.ts +29 -0
  55. package/dist/engine/variableModel.d.ts.map +1 -0
  56. package/dist/engine/variableModel.js +81 -0
  57. package/dist/engine/variableModel.js.map +1 -0
  58. package/dist/history.d.ts +39 -0
  59. package/dist/history.d.ts.map +1 -0
  60. package/dist/history.js +116 -0
  61. package/dist/history.js.map +1 -0
  62. package/dist/index.d.ts +15 -0
  63. package/dist/index.d.ts.map +1 -0
  64. package/dist/index.js +11 -0
  65. package/dist/index.js.map +1 -0
  66. package/dist/persist-queue.d.ts +24 -0
  67. package/dist/persist-queue.d.ts.map +1 -0
  68. package/dist/persist-queue.js +62 -0
  69. package/dist/persist-queue.js.map +1 -0
  70. package/dist/session.d.ts +38 -0
  71. package/dist/session.d.ts.map +1 -0
  72. package/dist/session.js +514 -0
  73. package/dist/session.js.map +1 -0
  74. package/dist/types.d.ts +521 -0
  75. package/dist/types.d.ts.map +1 -0
  76. package/dist/types.js +16 -0
  77. package/dist/types.js.map +1 -0
  78. package/package.json +55 -0
@@ -0,0 +1,521 @@
1
+ /** Full DOM-level view of one editable element. Built by the SDK adaptation layer. */
2
+ export interface HyperFramesElement {
3
+ readonly id: string;
4
+ /**
5
+ * Fully-qualified scoped id — host-chain prefix + leaf, separated by "/".
6
+ * For top-level elements: scopedId === id.
7
+ * For elements inside inlined sub-compositions: "hf-HOST/hf-LEAF" (any depth).
8
+ * This is the canonical identifier to use in dispatch targets, getElement(),
9
+ * find(), and override-set keys when addressing sub-composition elements.
10
+ */
11
+ readonly scopedId: string;
12
+ readonly tag: string;
13
+ readonly children: readonly HyperFramesElement[];
14
+ /** camelCase property names — mirrors CSSStyleDeclaration convention */
15
+ readonly inlineStyles: Readonly<Record<string, string>>;
16
+ readonly classNames: readonly string[];
17
+ /** All attributes except style, class, and data-hf-* (those are model-level) */
18
+ readonly attributes: Readonly<Record<string, string>>;
19
+ /** Direct text node content (not descendant text) */
20
+ readonly text: string | null;
21
+ readonly start: number | null;
22
+ readonly duration: number | null;
23
+ readonly trackIndex: number | null;
24
+ /** Phase 2: GSAP tween IDs whose target is this element */
25
+ readonly animationIds: readonly string[];
26
+ }
27
+ /** The SDK's in-memory document. Built from ensureHfIds + linkedom DOM walk. */
28
+ export interface SdkDocument {
29
+ readonly roots: readonly HyperFramesElement[];
30
+ readonly gsapScript: string | null;
31
+ readonly styles: string | null;
32
+ readonly width: number | null;
33
+ readonly height: number | null;
34
+ readonly compositionDuration: number | null;
35
+ /**
36
+ * BUILD-TIME snapshot of the ensureHfIds-stamped HTML. Never updated after
37
+ * mutations — use Composition.serialize() for the current document state.
38
+ */
39
+ readonly html: string;
40
+ }
41
+ /**
42
+ * Sparse map of `hfId.prop.path → value` overrides layered on top of the base template.
43
+ * null value = removal marker (element or property deleted by user).
44
+ * Examples: { "hf-x7k2.style.fontSize": "96px", "hf-y3a1.text": "Hello", "hf-z5k2": null }
45
+ *
46
+ * Font and image variable overrides store their object values under the var.{id} key:
47
+ * { "var.brand-font": { name: "Roboto", source: "https://fonts.googleapis.com/…" } }
48
+ */
49
+ /**
50
+ * A set of variable overrides. The `Record<string, unknown>` member admits
51
+ * object-valued variables (font/image). NOTE for SDK consumers: this widening
52
+ * means code reading an OverrideSet value must narrow before assuming a scalar —
53
+ * an object value will type-check anywhere `unknown` is accepted.
54
+ */
55
+ export type OverrideSet = Record<string, string | number | boolean | Record<string, unknown> | null>;
56
+ /**
57
+ * Structured result from can(op).
58
+ *
59
+ * `ok: true` — dispatch(op) will succeed.
60
+ * `ok: false` — dispatch would be a no-op or error; `code` is stable for switch.
61
+ * Codes: E_TARGET_NOT_FOUND | E_NO_ROOT | E_NO_GSAP_TIMELINE | E_NO_GSAP_SCRIPT
62
+ */
63
+ export type CanResult = {
64
+ ok: true;
65
+ } | {
66
+ ok: false;
67
+ code: string;
68
+ message: string;
69
+ hint?: string;
70
+ };
71
+ export type HfId = string;
72
+ /** Every element op takes explicit target id(s). No selection-implicit mutation. */
73
+ export type EditOp = {
74
+ type: "setStyle";
75
+ target: HfId | HfId[];
76
+ styles: Record<string, string | null>;
77
+ } | {
78
+ type: "setText";
79
+ target: HfId | HfId[];
80
+ value: string;
81
+ } | {
82
+ type: "setAttribute";
83
+ target: HfId | HfId[];
84
+ name: string;
85
+ value: string | null;
86
+ } | {
87
+ type: "setTiming";
88
+ target: HfId | HfId[];
89
+ start?: number;
90
+ duration?: number;
91
+ trackIndex?: number;
92
+ } | {
93
+ type: "setHold";
94
+ target: HfId | HfId[];
95
+ hold: ElasticHold;
96
+ } | {
97
+ type: "moveElement";
98
+ target: HfId | HfId[];
99
+ x: number;
100
+ y: number;
101
+ } | {
102
+ type: "removeElement";
103
+ target: HfId | HfId[];
104
+ } | {
105
+ type: "addElement";
106
+ /** Id of the parent element, or null to insert at the document body root. */
107
+ parent: HfId | null;
108
+ /** Zero-based sibling index at which to insert (append if >= childCount). */
109
+ index: number;
110
+ /** Single-root HTML fragment. Must not contain <script>. */
111
+ html: string;
112
+ } | {
113
+ type: "reorderElements";
114
+ /** Each entry sets inline zIndex on one element. Positioning is unchanged — z-index only takes effect on non-static elements, so the caller must ensure the target is positioned. */
115
+ entries: Array<{
116
+ target: HfId;
117
+ zIndex: number;
118
+ }>;
119
+ } | {
120
+ type: "setClassStyle";
121
+ selector: string;
122
+ styles: Record<string, string | null>;
123
+ } | {
124
+ type: "setCompositionMetadata";
125
+ width?: number;
126
+ height?: number;
127
+ duration?: number;
128
+ } | {
129
+ type: "setVariableValue";
130
+ id: string;
131
+ value: string | number | boolean | FontValue | ImageValue;
132
+ } | {
133
+ type: "addGsapTween";
134
+ target: HfId;
135
+ tween: GsapTweenSpec;
136
+ } | {
137
+ type: "setGsapTween";
138
+ animationId: string;
139
+ properties: Partial<GsapTweenSpec>;
140
+ } | {
141
+ type: "setGsapKeyframe";
142
+ animationId: string;
143
+ keyframeIndex: number;
144
+ position?: number;
145
+ value?: Record<string, unknown>;
146
+ ease?: string;
147
+ } | {
148
+ type: "addGsapKeyframe";
149
+ animationId: string;
150
+ position: number;
151
+ value: Record<string, unknown>;
152
+ } | {
153
+ type: "removeGsapKeyframe";
154
+ animationId: string;
155
+ percentage: number;
156
+ } | {
157
+ type: "removeGsapProperty";
158
+ animationId: string;
159
+ property: string;
160
+ from?: boolean;
161
+ } | {
162
+ type: "removeGsapTween";
163
+ animationId: string;
164
+ } | {
165
+ type: "removeAllKeyframes";
166
+ animationId: string;
167
+ } | {
168
+ type: "convertToKeyframes";
169
+ animationId: string;
170
+ resolvedFromValues?: Record<string, number | string>;
171
+ } | {
172
+ type: "deleteAllForSelector";
173
+ selector: string;
174
+ } | {
175
+ type: "materializeKeyframes";
176
+ animationId: string;
177
+ keyframes: Array<{
178
+ percentage: number;
179
+ properties: Record<string, number | string>;
180
+ ease?: string;
181
+ }>;
182
+ easeEach?: string;
183
+ resolvedSelector?: string;
184
+ } | {
185
+ type: "splitIntoPropertyGroups";
186
+ animationId: string;
187
+ } | {
188
+ type: "splitAnimations";
189
+ originalId: string;
190
+ newId: string;
191
+ splitTime: number;
192
+ elementStart: number;
193
+ elementDuration: number;
194
+ } | {
195
+ type: "addLabel";
196
+ name: string;
197
+ position: number;
198
+ } | {
199
+ type: "removeLabel";
200
+ name: string;
201
+ } | {
202
+ type: "setArcPath";
203
+ animationId: string;
204
+ config: {
205
+ enabled: boolean;
206
+ autoRotate: boolean | number;
207
+ segments: Array<{
208
+ curviness?: number;
209
+ cp1?: {
210
+ x: number;
211
+ y: number;
212
+ };
213
+ cp2?: {
214
+ x: number;
215
+ y: number;
216
+ };
217
+ }>;
218
+ };
219
+ } | {
220
+ type: "updateArcSegment";
221
+ animationId: string;
222
+ segmentIndex: number;
223
+ update: {
224
+ curviness?: number;
225
+ cp1?: {
226
+ x: number;
227
+ y: number;
228
+ };
229
+ cp2?: {
230
+ x: number;
231
+ y: number;
232
+ };
233
+ };
234
+ } | {
235
+ type: "removeArcPath";
236
+ animationId: string;
237
+ } | {
238
+ type: "unrollDynamicAnimations";
239
+ animationId: string;
240
+ elements: Array<{
241
+ selector: string;
242
+ keyframes: Array<{
243
+ percentage: number;
244
+ properties: Record<string, number | string>;
245
+ }>;
246
+ easeEach?: string;
247
+ }>;
248
+ } | {
249
+ /** Insert a new keyframed tween for targetSelector at the given position/duration. */
250
+ type: "addWithKeyframes";
251
+ targetSelector: string;
252
+ /** Timeline position in seconds. Number-only (unlike GsapTweenSpec.position, which also accepts label-relative strings). */
253
+ position: number;
254
+ duration: number;
255
+ keyframes: KeyframeSpec[];
256
+ ease?: string;
257
+ } | {
258
+ /**
259
+ * Replace an existing tween (by animationId) with a new keyframed tween.
260
+ * Equivalent to removeGsapTween + addWithKeyframes in one atomic op.
261
+ * Position-derived tween IDs renumber after the remove; callers must
262
+ * re-parse to discover the new ID.
263
+ */
264
+ type: "replaceWithKeyframes";
265
+ animationId: string;
266
+ targetSelector: string;
267
+ /** Timeline position in seconds. Number-only (unlike GsapTweenSpec.position, which also accepts label-relative strings). */
268
+ position: number;
269
+ duration: number;
270
+ keyframes: KeyframeSpec[];
271
+ ease?: string;
272
+ };
273
+ /**
274
+ * A single keyframe entry for `addWithKeyframes` / `replaceWithKeyframes`.
275
+ * Single source of truth — Studio-side mirrors (KeyframeEntry/KeyframeSpec) should
276
+ * import this rather than redeclare the shape.
277
+ */
278
+ export interface KeyframeSpec {
279
+ percentage: number;
280
+ properties: Record<string, number | string>;
281
+ ease?: string;
282
+ /** GSAP endpoint flag — emitted as numeric `_auto: 1`, not boolean. */
283
+ auto?: boolean;
284
+ }
285
+ export interface ElasticHold {
286
+ start: number;
287
+ end: number;
288
+ fill: "freeze" | "loop";
289
+ }
290
+ /**
291
+ * Object value for a `font` variable (LOCKED §7 — object-valued, never a CSS string).
292
+ * `name` is the CSS font-family value; `source` is the stylesheet URL to load.
293
+ */
294
+ export interface FontValue {
295
+ name: string;
296
+ source: string;
297
+ }
298
+ /**
299
+ * Object value for an `image` variable (LOCKED §7 — object-valued, never a CSS string).
300
+ * `url` is the image src. Add explicit optional fields here as consumers need them —
301
+ * an open `[key: string]: unknown` index signature was dropped because it let any
302
+ * `{url}`-shaped object through and swallowed key typos.
303
+ */
304
+ export interface ImageValue {
305
+ url: string;
306
+ alt?: string;
307
+ fit?: "cover" | "contain" | "fill" | "none" | "scale-down";
308
+ }
309
+ export interface GsapTweenSpec {
310
+ method: "from" | "to" | "fromTo" | "set";
311
+ position?: number | string;
312
+ duration?: number;
313
+ ease?: string;
314
+ fromProperties?: Record<string, unknown>;
315
+ toProperties?: Record<string, unknown>;
316
+ /** For 'to' tweens — the properties to animate toward */
317
+ properties?: Record<string, unknown>;
318
+ repeat?: number;
319
+ yoyo?: boolean;
320
+ stagger?: number | Record<string, unknown>;
321
+ }
322
+ /**
323
+ * Emit-only subset of RFC 6902: the SDK never emits move/copy/test, and
324
+ * applyPatches() ignores ops outside this subset. Hosts feeding patches back
325
+ * must restrict themselves to add/remove/replace.
326
+ */
327
+ export interface JsonPatchOp {
328
+ op: "add" | "remove" | "replace";
329
+ path: string;
330
+ value?: unknown;
331
+ }
332
+ /**
333
+ * Emitted by session.on('patch') after every committed change.
334
+ * formatVersion bumps = breaking; hosts check once and reject unknown versions.
335
+ */
336
+ export interface PatchEvent {
337
+ readonly formatVersion: 1;
338
+ readonly patches: readonly JsonPatchOp[];
339
+ readonly inversePatches: readonly JsonPatchOp[];
340
+ /** Re-emitted verbatim from the mutation entry. Use ORIGIN_APPLY_PATCHES to detect undo loops. */
341
+ readonly origin: unknown;
342
+ /** Semantic op names ('setStyle') — for analytics/history labels. Not versioned. */
343
+ readonly opTypes: readonly string[];
344
+ }
345
+ /**
346
+ * Reserved origin tag for applyPatches().
347
+ * Host listeners MUST skip this origin to prevent undo loops:
348
+ * comp.on('patch', ({ origin }) => { if (origin === ORIGIN_APPLY_PATCHES) return; ... })
349
+ *
350
+ * A namespaced string (not a unique symbol) so the sentinel survives realm
351
+ * boundaries — postMessage, structured clone, JSON — which T3 embedded hosts
352
+ * may forward patch events across. The namespace prefix keeps collision risk
353
+ * with host-chosen origins negligible.
354
+ */
355
+ export declare const ORIGIN_APPLY_PATCHES: "@hyperframes/sdk:applyPatches";
356
+ /** Default origin when none specified — UI-driven dispatch. */
357
+ export declare const ORIGIN_LOCAL: "local";
358
+ export interface PersistErrorEvent {
359
+ error: {
360
+ message: string;
361
+ hint?: string;
362
+ cause?: unknown;
363
+ };
364
+ }
365
+ /** Flat read-only snapshot returned by getElements() / getElement() */
366
+ export type ElementSnapshot = HyperFramesElement;
367
+ export interface FindQuery {
368
+ tag?: string;
369
+ text?: string;
370
+ name?: string;
371
+ track?: number;
372
+ /** Filter to elements inside a specific sub-composition host (by host hf-id). */
373
+ composition?: string;
374
+ }
375
+ /**
376
+ * Proxy returned by comp.selection() — resolves getSelection() → explicit ops at call time.
377
+ * Multi-select gets well-defined semantics: op applied per id within one batch.
378
+ */
379
+ export interface SelectionProxy {
380
+ readonly ids: readonly string[];
381
+ setStyle(styles: Record<string, string | null>): void;
382
+ setText(value: string): void;
383
+ setAttribute(name: string, value: string | null): void;
384
+ setTiming(timing: {
385
+ start?: number;
386
+ duration?: number;
387
+ trackIndex?: number;
388
+ }): void;
389
+ removeElement(): void;
390
+ }
391
+ /**
392
+ * Curried element handle — holds only the id string, no stale-ref hazard.
393
+ * comp.element('hf-x7k2').setStyle({ color: '#fff' })
394
+ */
395
+ export interface ElementHandle {
396
+ readonly id: string;
397
+ setStyle(styles: Record<string, string | null>): void;
398
+ setText(value: string): void;
399
+ setAttribute(name: string, value: string | null): void;
400
+ setTiming(timing: {
401
+ start?: number;
402
+ duration?: number;
403
+ trackIndex?: number;
404
+ }): void;
405
+ removeElement(): void;
406
+ }
407
+ /**
408
+ * Resolved timing snapshot for one element.
409
+ * Labels are GSAP timeline label names whose numeric position falls within
410
+ * [enterAt, exitAt] for this element. Parsed fresh on every call — never cached.
411
+ */
412
+ export interface ElementTimingSnapshot {
413
+ enterAt: number;
414
+ exitAt: number;
415
+ /** GSAP addLabel names active during this element's window. */
416
+ labels: string[];
417
+ }
418
+ /**
419
+ * An open composition editing session.
420
+ * Typed methods (docs page one) sugar over dispatch() — all validation in dispatch.
421
+ * dispatch() is the advanced/agent layer (data-shaped ops, automation, replay).
422
+ */
423
+ export interface Composition {
424
+ setStyle(id: HfId, styles: Record<string, string | null>): void;
425
+ setText(id: HfId, value: string): void;
426
+ setAttribute(id: HfId, name: string, value: string | null): void;
427
+ setTiming(id: HfId, timing: {
428
+ start?: number;
429
+ duration?: number;
430
+ trackIndex?: number;
431
+ }): void;
432
+ removeElement(id: HfId): void;
433
+ /**
434
+ * Insert an HTML fragment as a child of `parent` at `index` (WS-D).
435
+ * Mints a stable hf-id against the live document's existing id set.
436
+ * Returns the minted id of the inserted root element.
437
+ * Inverse = removeElement of the returned id.
438
+ */
439
+ addElement(parent: HfId | null, index: number, html: string): HfId;
440
+ setVariableValue(id: string, value: string | number | boolean | FontValue | ImageValue): void;
441
+ /**
442
+ * Read enter/exit times and GSAP labels for every timed element (WS-C).
443
+ * Derives enterAt/exitAt using the same data-duration vs data-end preference
444
+ * as handleSetTiming (data-duration wins; data-end − data-start as fallback).
445
+ * Labels are parsed fresh from the GSAP script each call.
446
+ * Read-only — does not dispatch.
447
+ */
448
+ getElementTimings(): Record<HfId, ElementTimingSnapshot>;
449
+ /**
450
+ * Apply a sparse timing map in a single batch (WS-C).
451
+ * Dispatches one setTiming op per entry inside a batch so the history sees
452
+ * one undo step. Skips entries for unknown ids silently.
453
+ */
454
+ setElementTiming(map: Record<HfId, {
455
+ start?: number;
456
+ duration?: number;
457
+ trackIndex?: number;
458
+ }>): void;
459
+ /**
460
+ * Set an elastic hold window on an element (WS-C).
461
+ * Thin typed wrapper over the existing setHold op — mirrors setVariableValue pattern.
462
+ */
463
+ setHold(id: HfId, hold: ElasticHold): void;
464
+ /** Returns the newly-assigned tween ID */
465
+ addGsapTween(target: HfId, tween: GsapTweenSpec): string;
466
+ setGsapTween(animationId: string, properties: Partial<GsapTweenSpec>): void;
467
+ removeGsapTween(animationId: string): void;
468
+ /**
469
+ * Add a keyframed tween. Typed wrapper over the addWithKeyframes op (mirrors
470
+ * addGsapTween). Returns the newly-minted animationId, or "" if rejected.
471
+ */
472
+ addWithKeyframes(targetSelector: string, position: number, duration: number, keyframes: KeyframeSpec[], ease?: string): string;
473
+ /**
474
+ * Replace an existing keyframed tween. Typed wrapper over replaceWithKeyframes.
475
+ * Returns the replacement's animationId (treat as NEW — position-derived IDs
476
+ * renumber after the remove), or "" if rejected.
477
+ */
478
+ replaceWithKeyframes(animationId: string, targetSelector: string, position: number, duration: number, keyframes: KeyframeSpec[], ease?: string): string;
479
+ undo(): void;
480
+ redo(): void;
481
+ canUndo(): boolean;
482
+ canRedo(): boolean;
483
+ getElements(): ElementSnapshot[];
484
+ getElement(id: HfId): ElementSnapshot | null;
485
+ find(query: FindQuery): string[];
486
+ /** Sugar: resolves getSelection() → explicit ops at call time */
487
+ selection(): SelectionProxy;
488
+ /** Curried handle — holds only the id, no stale-ref hazard */
489
+ element(id: HfId): ElementHandle;
490
+ getSelection(): string[];
491
+ /** Replace the current selection; fires selectionchange. Pass [] to clear. */
492
+ setSelection(ids: string[]): void;
493
+ dispatch(op: EditOp, opts?: {
494
+ origin?: unknown;
495
+ }): void;
496
+ batch(fn: () => void, opts?: {
497
+ origin?: unknown;
498
+ }): void;
499
+ /**
500
+ * Dry-run validation — would dispatch(op) succeed?
501
+ * Returns {ok:true} when dispatch would mutate the document, {ok:false,code,message} otherwise.
502
+ * Use as a feature-detection gate: `const r = comp.can(op); if (!r.ok) return;`
503
+ * Phase 3b ops return {ok:false,code:'E_NO_GSAP_TIMELINE'} until parser engine ships.
504
+ */
505
+ can(op: EditOp): CanResult;
506
+ on(event: "change", handler: () => void): () => void;
507
+ on(event: "selectionchange", handler: (ids: string[]) => void): () => void;
508
+ on(event: "patch", handler: (event: PatchEvent) => void): () => void;
509
+ on(event: "persist:error", handler: (event: PersistErrorEvent) => void): () => void;
510
+ serialize(): string;
511
+ /** Current override-set — serialize for host storage */
512
+ getOverrides(): OverrideSet;
513
+ /** Apply inverse patches from host undo stack; auto-tags origin: ORIGIN_APPLY_PATCHES */
514
+ applyPatches(patches: readonly JsonPatchOp[], opts?: {
515
+ origin?: unknown;
516
+ }): void;
517
+ /** Drain the persist queue — resolves when any queued write is committed. No-op if no adapter. */
518
+ flush(): Promise<void>;
519
+ dispose(): void;
520
+ }
521
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,sFAAsF;AACtF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACjD,wEAAwE;IACxE,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACxD,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,gFAAgF;IAChF,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,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,SAAS,IAAI,MAAM,CAAC;IAGpB,wDAAwD;IACxD,YAAY,IAAI,WAAW,CAAC;IAC5B,yFAAyF;IACzF,YAAY,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,EAAE,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IAGjF,kGAAkG;IAClG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,OAAO,IAAI,IAAI,CAAC;CACjB"}
package/dist/types.js ADDED
@@ -0,0 +1,16 @@
1
+ // ─── Document model ───────────────────────────────────────────────────────────
2
+ // ─── Origin model (F4) ────────────────────────────────────────────────────────
3
+ /**
4
+ * Reserved origin tag for applyPatches().
5
+ * Host listeners MUST skip this origin to prevent undo loops:
6
+ * comp.on('patch', ({ origin }) => { if (origin === ORIGIN_APPLY_PATCHES) return; ... })
7
+ *
8
+ * A namespaced string (not a unique symbol) so the sentinel survives realm
9
+ * boundaries — postMessage, structured clone, JSON — which T3 embedded hosts
10
+ * may forward patch events across. The namespace prefix keeps collision risk
11
+ * with host-chosen origins negligible.
12
+ */
13
+ export const ORIGIN_APPLY_PATCHES = "@hyperframes/sdk:applyPatches";
14
+ /** Default origin when none specified — UI-driven dispatch. */
15
+ export const ORIGIN_LOCAL = "local";
16
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,iFAAiF;AAkTjF,iFAAiF;AAEjF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,+BAAwC,CAAC;AAE7E,+DAA+D;AAC/D,MAAM,CAAC,MAAM,YAAY,GAAG,OAAgB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@hyperframes/sdk",
3
+ "version": "0.6.113",
4
+ "description": "Headless, framework-neutral HyperFrames composition editing engine",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/heygen-com/hyperframes",
8
+ "directory": "packages/sdk"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "README.md"
13
+ ],
14
+ "type": "module",
15
+ "sideEffects": false,
16
+ "exports": {
17
+ ".": {
18
+ "import": "./dist/index.js",
19
+ "types": "./dist/index.d.ts"
20
+ },
21
+ "./adapters/memory": {
22
+ "import": "./dist/adapters/memory.js",
23
+ "types": "./dist/adapters/memory.d.ts"
24
+ },
25
+ "./adapters/fs": {
26
+ "import": "./dist/adapters/fs.js",
27
+ "types": "./dist/adapters/fs.d.ts"
28
+ },
29
+ "./adapters/headless": {
30
+ "import": "./dist/adapters/headless.js",
31
+ "types": "./dist/adapters/headless.d.ts"
32
+ }
33
+ },
34
+ "publishConfig": {
35
+ "access": "public"
36
+ },
37
+ "dependencies": {
38
+ "linkedom": "^0.18.12",
39
+ "@hyperframes/core": "0.6.113"
40
+ },
41
+ "devDependencies": {
42
+ "@types/node": "^25.0.10",
43
+ "typescript": "^5.0.0",
44
+ "vitest": "^3.2.4"
45
+ },
46
+ "scripts": {
47
+ "build": "tsc",
48
+ "test": "vitest run",
49
+ "test:watch": "vitest",
50
+ "typecheck": "tsc --noEmit",
51
+ "typecheck:examples": "tsc --noEmit -p tsconfig.check.json"
52
+ },
53
+ "main": "./dist/index.js",
54
+ "types": "./dist/index.d.ts"
55
+ }