MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / initEditor

Function initEditor

packages/sdk/examples/vanilla-editor.ts:18–33  ·  view source on GitHub ↗
(html: string)

Source from the content-addressed store, hash-verified

16// ── Initialize ────────────────────────────────────────────────────────────────
17
18export async function initEditor(html: string): Promise<Composition> {
19 // Use createFsAdapter({ root: projectDir }) in production:
20 // import { createFsAdapter } from '@hyperframes/sdk/adapters/fs'
21 const persist = createMemoryAdapter();
22
23 const comp = await openComposition(html, {
24 persist,
25 coalesceMs: 300,
26 });
27
28 comp.on("persist:error", ({ error }) => {
29 showError(`Auto-save failed: ${error.message}${error.hint ? ` — ${error.hint}` : ""}`);
30 });
31
32 return comp;
33}
34
35// ── Property panel — typed method layer (F10 docs page one) ──────────────────
36

Callers

nothing calls this directly

Calls 4

createMemoryAdapterFunction · 0.85
openCompositionFunction · 0.85
showErrorFunction · 0.85
onMethod · 0.65

Tested by

no test coverage detected