export declare const content = "# Embedding Superblocks Applications\n\nThis reference covers embedding Superblocks applications in external websites or portals.\n\n## Embed Hooks\n\nAvailable hooks from `@superblocksteam/library` for embedded applications:\n\n```typescript\nimport { \n  useEmbedProperties,\n  useEmbedEvent,\n  useEmitEmbedEvent,\n} from \"@superblocksteam/library\";\n```\n\n### useEmbedProperties\n\nRead properties passed from the embedder (parent application):\n\n```typescript\nconst properties = useEmbedProperties();\n\n// Access custom properties defined in the embed configuration\nconst { userId, theme, locale } = properties;\n```\n\n### useEmbedEvent\n\nListen to events emitted from the embedder:\n\n```typescript\nuseEmbedEvent(\"refreshData\", (payload) => {\n  // Handle refresh request from parent\n  refetchData();\n});\n\nuseEmbedEvent(\"userChanged\", (payload) => {\n  // Handle user context change\n  setCurrentUser(payload.user);\n});\n\nuseEmbedEvent(\"themeChanged\", (payload) => {\n  // Handle theme updates\n  setTheme(payload.theme);\n});\n```\n\n### useEmitEmbedEvent\n\nEmit events to the embedder (parent application):\n\n```typescript\nconst emitEvent = useEmitEmbedEvent();\n\n// Notify parent when form is submitted\nconst handleSubmit = async (data) => {\n  await saveData(data);\n  emitEvent(\"formSubmitted\", { \n    timestamp: Date.now(), \n    data,\n    success: true \n  });\n};\n\n// Notify parent of navigation\nconst handleNavigate = (route) => {\n  emitEvent(\"navigationChanged\", { route });\n  navigate(route);\n};\n\n// Notify parent of errors\nconst handleError = (error) => {\n  emitEvent(\"errorOccurred\", { \n    message: error.message,\n    code: error.code \n  });\n};\n```\n\n## Common Embedding Patterns\n\n### Bidirectional Communication\n\n```typescript\nfunction EmbeddedDashboard() {\n  const properties = useEmbedProperties();\n  const emitEvent = useEmitEmbedEvent();\n  const [data, setData] = useState(null);\n\n  // Listen for refresh commands from parent\n  useEmbedEvent(\"refresh\", () => {\n    fetchData();\n  });\n\n  // Notify parent when data changes\n  const handleDataUpdate = async (newData) => {\n    await saveData(newData);\n    setData(newData);\n    emitEvent(\"dataUpdated\", { data: newData });\n  };\n\n  return (\n    <Dashboard \n      userId={properties.userId}\n      data={data}\n      onUpdate={handleDataUpdate}\n    />\n  );\n}\n```\n\n### Synchronized State\n\n```typescript\nfunction EmbeddedForm() {\n  const properties = useEmbedProperties();\n  const emitEvent = useEmitEmbedEvent();\n  const [formState, setFormState] = useState(properties.initialData || {});\n\n  // Sync form state changes to parent\n  useEffect(() => {\n    emitEvent(\"formStateChanged\", { state: formState });\n  }, [formState, emitEvent]);\n\n  // Listen for external state updates\n  useEmbedEvent(\"updateFormState\", (payload) => {\n    setFormState(prev => ({ ...prev, ...payload }));\n  });\n\n  return <Form value={formState} onChange={setFormState} />;\n}\n```\n\n### Loading External Context\n\n```typescript\nfunction EmbeddedApp() {\n  const properties = useEmbedProperties();\n  const { customerId, permissions, branding } = properties;\n\n  // Use embed properties to customize the app\n  return (\n    <ThemeProvider theme={branding}>\n      <CustomerContext.Provider value={{ customerId, permissions }}>\n        <AppContent />\n      </CustomerContext.Provider>\n    </ThemeProvider>\n  );\n}\n```\n";
//# sourceMappingURL=embedding.generated.d.ts.map