import { PlatformContext, PlatformContextOptions, PlatformEvent } from '../types'; /** * Platform context composable for plugin integration with MINT Platform. * * Provides secure communication with the parent platform via postMessage. * * @param options - Configuration options * @param options.allowedOrigins - List of allowed origins for postMessage * @param options.allowAnyOrigin - Allow any origin (UNSAFE, development only) * * @example * ```typescript * // Basic usage - derives origin from platform injection * const { isIntegrated, user, theme } = usePlatformContext() * * // With explicit allowed origins * const { isIntegrated } = usePlatformContext({ * allowedOrigins: ['https://mint.example.com'] * }) * * // Development mode (UNSAFE) * const { isIntegrated } = usePlatformContext({ * allowAnyOrigin: import.meta.env.DEV * }) * ``` */ /** Connects a plugin to the MINT platform via postMessage, exposing user, theme, and experiment context. */ export declare function usePlatformContext(options?: PlatformContextOptions): { context: import('vue').Ref<{ isIntegrated: boolean; plugin?: { id: string; name: string; display_name?: string | undefined; version: string; plugin_type?: string | undefined; description?: string | undefined; icon?: string | undefined; color?: string | undefined; route_prefix: string; api_prefix: string; settings_api?: "plugin" | "platform" | undefined; frontend_revision?: string | undefined; nav_items?: { id?: string | undefined; label: string; path: string; icon?: string | undefined; description?: string | undefined; requiresAuth?: boolean | undefined; requiresAdmin?: boolean | undefined; requiresFeature?: string | undefined; children?: /*elided*/ any[] | undefined; }[] | undefined; settings?: import('..').PluginSettings | undefined; } | undefined; platformApiUrl?: string | undefined; platformOrigin?: string | undefined; user?: { id: number; username: string; role: string; role_obj?: { id?: number | undefined; slug: string; name?: string | undefined; color?: string | undefined; permissions?: (readonly string[] | null) | undefined; project_scope?: "all" | "assigned" | string | undefined; plugin_access?: (readonly string[] | "all" | null) | undefined; } | null | undefined; roleObj?: { id?: number | undefined; slug: string; name?: string | undefined; color?: string | undefined; permissions?: (readonly string[] | null) | undefined; project_scope?: "all" | "assigned" | string | undefined; plugin_access?: (readonly string[] | "all" | null) | undefined; } | null | undefined; shortname?: string | undefined; } | undefined; theme: "light" | "dark" | "system"; allowedExperimentTypes?: string[] | null | undefined; features?: { admin?: boolean | undefined; experiments?: boolean | undefined; samples?: boolean | undefined; passkey?: boolean | undefined; multiUser?: boolean | undefined; } | undefined; }, PlatformContext | { isIntegrated: boolean; plugin?: { id: string; name: string; display_name?: string | undefined; version: string; plugin_type?: string | undefined; description?: string | undefined; icon?: string | undefined; color?: string | undefined; route_prefix: string; api_prefix: string; settings_api?: "plugin" | "platform" | undefined; frontend_revision?: string | undefined; nav_items?: { id?: string | undefined; label: string; path: string; icon?: string | undefined; description?: string | undefined; requiresAuth?: boolean | undefined; requiresAdmin?: boolean | undefined; requiresFeature?: string | undefined; children?: /*elided*/ any[] | undefined; }[] | undefined; settings?: import('..').PluginSettings | undefined; } | undefined; platformApiUrl?: string | undefined; platformOrigin?: string | undefined; user?: { id: number; username: string; role: string; role_obj?: { id?: number | undefined; slug: string; name?: string | undefined; color?: string | undefined; permissions?: (readonly string[] | null) | undefined; project_scope?: "all" | "assigned" | string | undefined; plugin_access?: (readonly string[] | "all" | null) | undefined; } | null | undefined; roleObj?: { id?: number | undefined; slug: string; name?: string | undefined; color?: string | undefined; permissions?: (readonly string[] | null) | undefined; project_scope?: "all" | "assigned" | string | undefined; plugin_access?: (readonly string[] | "all" | null) | undefined; } | null | undefined; shortname?: string | undefined; } | undefined; theme: "light" | "dark" | "system"; allowedExperimentTypes?: string[] | null | undefined; features?: { admin?: boolean | undefined; experiments?: boolean | undefined; samples?: boolean | undefined; passkey?: boolean | undefined; multiUser?: boolean | undefined; } | undefined; }>; isIntegrated: import('vue').ComputedRef; plugin: import('vue').ComputedRef<{ id: string; name: string; display_name?: string | undefined; version: string; plugin_type?: string | undefined; description?: string | undefined; icon?: string | undefined; color?: string | undefined; route_prefix: string; api_prefix: string; settings_api?: "plugin" | "platform" | undefined; frontend_revision?: string | undefined; nav_items?: { id?: string | undefined; label: string; path: string; icon?: string | undefined; description?: string | undefined; requiresAuth?: boolean | undefined; requiresAdmin?: boolean | undefined; requiresFeature?: string | undefined; children?: /*elided*/ any[] | undefined; }[] | undefined; settings?: import('..').PluginSettings | undefined; } | undefined>; user: import('vue').ComputedRef<{ id: number; username: string; role: string; role_obj?: { id?: number | undefined; slug: string; name?: string | undefined; color?: string | undefined; permissions?: (readonly string[] | null) | undefined; project_scope?: "all" | "assigned" | string | undefined; plugin_access?: (readonly string[] | "all" | null) | undefined; } | null | undefined; roleObj?: { id?: number | undefined; slug: string; name?: string | undefined; color?: string | undefined; permissions?: (readonly string[] | null) | undefined; project_scope?: "all" | "assigned" | string | undefined; plugin_access?: (readonly string[] | "all" | null) | undefined; } | null | undefined; shortname?: string | undefined; } | undefined>; theme: import('vue').ComputedRef<"light" | "dark" | "system">; features: import('vue').ComputedRef<{ admin?: boolean | undefined; experiments?: boolean | undefined; samples?: boolean | undefined; passkey?: boolean | undefined; multiUser?: boolean | undefined; } | undefined>; navigate: (path: string) => void; notify: (message: string, type?: "success" | "error" | "warning" | "info") => void; sendToPlatform: (event: PlatformEvent) => void; };