import type { ActionType, AppManifest, AuthOAuthProviderConfig, ComponentDataBindingRegistry, DataSourceRegistry, MediaAsset, NavigatorType, ThemeConfig, ThemeModeConfig, UiNode } from '@ankhorage/contracts'; export type { StudioModuleAdminContribution, StudioModuleAdminControl, StudioModuleAdminField, StudioModuleOperationResult, StudioModuleState, } from './moduleAdminContracts'; import type { StudioAuthSettings, StudioAuthSettingsMutation } from './authSettings'; import type { StudioMediaDeleteResult } from './mediaAuthoringModel'; import type { StudioMediaIngestResult, StudioMediaIngestTarget, StudioMediaPickerSource } from './mediaPickerAuthoring'; export * from './bindingAuthoringModel'; export * from './mediaAuthoringModel'; export * from './mediaPickerAuthoring'; export type { ProjectAuthDiagnostic, ProjectAuthDiagnosticSeverity, ProjectAuthHealth, ProjectAuthHealthStatus, ProjectOAuthProviderHealth, ProjectOAuthProviderHealthStatus, } from './projectAuthHealth'; export { deriveProjectId, ProjectCreationValidationError, validateProjectCreationInput, } from './projectIdentity'; export type { ProjectSecretUsage, ProjectSecretUsageCategory, ProjectSecretUsageSummary, } from './projectSecretUsage'; export type { ProjectCreationValidationCode, ProjectCreationValidationFailure, ProjectCreationValidationResult, ProjectSortKey, StudioProjectSummary, } from './projectWorkspaceContracts'; export * from './propertiesAuthoringModel'; export type { TemplateCatalog, TemplateCatalogCategory, TemplateCatalogTemplate, TemplateEntry, } from './templateCatalogContracts'; export declare const STUDIO_PACKAGE_NAME: "@ankhorage/studio"; export interface StudioPackageBoundary { readonly owns: readonly string[]; readonly consumes: readonly string[]; readonly doesNotOwn: readonly string[]; } export declare const STUDIO_PACKAGE_BOUNDARY: StudioPackageBoundary; export declare const STUDIO_PUBLIC_CONTRACTS: readonly ["StudioManifest", "StudioContextValue", "StudioSelectionState", "NodePlacement", "InsertCatalogEntry", "ActionDefinition", "StudioCommand", "StudioEvent", "StudioComponentMetaRegistry", "StudioInstancePropertyField", "listStudioMediaAssets", "createStudioMediaAssetReference", "removeStudioMediaAsset", "StudioMediaDeleteResult", "StudioMediaPickerAdapter", "resolveStudioInstancePropertyGroups", "createStudioInstancePropertyPatch", "resolveStudioBindableProps", "resolveStudioBindableEvents", "collectStudioBindingOperationOptions", "ProjectAuthHealth", "ProjectSecretUsageSummary", "StudioAdminRouteId", "StudioAdminRoutePath", "StudioModuleAdminContribution", "StudioModuleOperationResult", "StudioModuleState", "ACTION_REGISTRY", "TPL_SCREEN_EMPTY", "resolveDefaultInsertPlacement", "buildInsertCatalogEntries"]; export type StudioPublicContract = (typeof STUDIO_PUBLIC_CONTRACTS)[number]; export type StudioProjectId = string; export type StudioSessionId = string; export type StudioNodeId = string; export type StudioScreenId = string; export type StudioModuleId = string; export type StudioSaveStatus = 'idle' | 'saving' | 'saved' | 'error'; export type StudioPanelId = 'layers'; export type StudioAdminRouteId = 'overview' | 'screens' | 'screen-detail' | 'media' | 'modules' | 'module-detail' | 'apis' | 'api-catalog' | 'api-operations' | 'auth' | 'auth-providers' | 'auth-routes' | 'auth-profile' | 'secrets' | 'deploy' | 'theme' | 'theme-colors' | 'theme-typography' | 'theme-spacing' | 'theme-radii' | 'theme-shadows' | 'theme-component' | 'theme-pattern' | 'bindings' | 'properties'; export type StudioAdminStaticRoutePath = '/ankh' | '/ankh/screens' | '/ankh/media' | '/ankh/modules' | '/ankh/apis' | '/ankh/apis/catalog' | '/ankh/apis/operations' | '/ankh/auth' | '/ankh/auth/providers' | '/ankh/auth/routes' | '/ankh/auth/profile' | '/ankh/secrets' | '/ankh/deploy' | '/ankh/theme' | '/ankh/theme/colors' | '/ankh/theme/typography' | '/ankh/theme/spacing' | '/ankh/theme/radii' | '/ankh/theme/shadows'; export type StudioAdminRoutePath = StudioAdminStaticRoutePath | `/ankh/screens/${string}` | `/ankh/modules/${string}` | `/ankh/theme/components/${string}` | `/ankh/theme/patterns/${string}` | `/ankh/bindings/${string}` | `/ankh/properties/${string}`; export type StudioManifest = AppManifest; export type ThemeUpdates = Partial> & { light?: Partial; dark?: Partial; }; export interface StudioSelectionState { activeScreenId: StudioScreenId | null; selectedNodeId: StudioNodeId | null; activePanelId: StudioPanelId | null; activeAdminRouteId: StudioAdminRouteId; activeCanvasDragNodeId: StudioNodeId | null; } export interface StudioSessionState { projectId: StudioProjectId; sessionId?: StudioSessionId; previewMode: boolean; lastNonAdminLocation: string; saveStatus: StudioSaveStatus; isLoading: boolean; error: string | null; } export type PlacementKind = 'inside' | 'before' | 'after'; export interface NodePlacement { parentId: StudioNodeId; index: number; kind: PlacementKind; referenceId?: StudioNodeId; } export type PlacementFailureCode = 'missing-root' | 'missing-target' | 'missing-parent' | 'child-not-allowed' | 'invalid-index' | 'invalid-reference' | 'no-valid-target' | 'cannot-move-root' | 'cannot-move-into-self' | 'cannot-move-into-descendant' | 'no-op'; export interface PlacementFailureReason { code: PlacementFailureCode; message: string; } export type PlacementValidationResult = { ok: true; } | { ok: false; reason: PlacementFailureReason; }; export type PlacementResolutionResult = { ok: true; placement: NodePlacement; } | { ok: false; reason: PlacementFailureReason; }; export type InsertCatalogEntryKind = 'component' | 'recipe'; export type InsertCatalogEntryStatus = 'enabled' | 'disabled'; export type InsertCatalogDisabledReasonCode = 'missing-meta' | 'invalid-recipe' | 'no-placement' | 'not-direct'; export interface InsertRecipeNode { type: string; children?: InsertRecipeNode[]; } export interface InsertRecipe { id: string; label: string; description?: string; category: string; root: InsertRecipeNode; } export interface InsertRecipeIssue { code: 'missing-meta' | 'child-not-allowed'; path: string[]; nodeType: string; childType?: string; } export interface InsertCatalogDisabledReason { code: InsertCatalogDisabledReasonCode; detail: string; issue?: InsertRecipeIssue; } export interface InsertCatalogEntryBase { id: string; label: string; description?: string; category: string; rootType: string; kind: InsertCatalogEntryKind; status: InsertCatalogEntryStatus; disabledReason?: InsertCatalogDisabledReason; placement?: NodePlacement; } export interface InsertCatalogComponentEntry extends InsertCatalogEntryBase { kind: 'component'; componentType: string; } export interface InsertCatalogRecipeEntry extends InsertCatalogEntryBase { kind: 'recipe'; recipe: InsertRecipe; } export type InsertCatalogEntry = InsertCatalogComponentEntry | InsertCatalogRecipeEntry; export type StudioActionPayloadPrimitive = 'string' | 'number' | 'boolean' | 'object'; export interface StudioActionPayloadField { type: StudioActionPayloadPrimitive; label: string; required?: boolean; } export type StudioActionPayloadSchema = Record; export interface ActionDefinition { type: ActionType; label: string; description: string; requiresPayload: boolean; payloadSchema?: StudioActionPayloadSchema; } export interface StudioComponentBlueprint { label?: string; defaultProps?: Record; } export interface StudioComponentMeta { category: string; allowedChildren: readonly string[]; directManifestNode?: boolean; blueprint?: StudioComponentBlueprint; } export type StudioComponentMetaRegistry = Record; export type StudioIdGenerator = (prefix?: string) => string; export type StudioCommand = { type: 'studio.selectNode'; nodeId: StudioNodeId | null; } | { type: 'studio.setActivePanel'; panelId: StudioPanelId | null; } | { type: 'studio.setActiveAdminRoute'; routeId: StudioAdminRouteId; } | { type: 'studio.setActiveCanvasDragNode'; nodeId: StudioNodeId | null; } | { type: 'studio.setActiveScreen'; screenId: StudioScreenId; } | { type: 'studio.togglePreviewMode'; }; export type StudioEvent = { type: 'studio.nodeSelected'; nodeId: StudioNodeId | null; } | { type: 'studio.panelChanged'; panelId: StudioPanelId | null; } | { type: 'studio.adminRouteChanged'; routePath: StudioAdminRoutePath; } | { type: 'studio.screenChanged'; screenId: StudioScreenId; } | { type: 'studio.saveStatusChanged'; status: StudioSaveStatus; }; export interface StudioContextValue extends StudioSelectionState, StudioSessionState { manifest: StudioManifest | null; rootNode: UiNode | null; componentMeta: StudioComponentMetaRegistry; selectNode: (id: StudioNodeId | null) => void; setActivePanelId: (panelId: StudioPanelId | null) => void; setActiveAdminRouteId: (routeId: StudioAdminRouteId) => void; setLastNonAdminLocation: (location: string) => void; setActiveCanvasDragNodeId: (nodeId: StudioNodeId | null) => void; updateNode: (nodeId: StudioNodeId, props: Record) => void; upsertMediaAsset: (asset: MediaAsset) => void; removeMediaAsset: (mediaId: string) => boolean; deleteMediaAsset: (mediaId: string) => Promise; mediaPickerAvailable: boolean; ingestMediaFromPicker: (source: StudioMediaPickerSource, target?: StudioMediaIngestTarget) => Promise; updateDataBindings: (dataBindings: ComponentDataBindingRegistry) => void; updateDataSources: (dataSources: DataSourceRegistry) => void; deleteNode: (id: StudioNodeId) => void; insertFromCatalogEntry: (entry: InsertCatalogEntry) => boolean; moveNodeToPlacement: (nodeId: StudioNodeId, placement: NodePlacement) => boolean; addScreen: (name: string) => void; deleteScreen: (id: StudioScreenId) => void; setNavigatorType: (type: NavigatorType) => void; setNavigatorInitialRoute: (routeName: string) => void; setRoutePrimaryNavigationVisibility: (parentPath: string[], routeName: string, showInPrimaryNavigation: boolean) => void; moveRoute: (parentPath: string[], routeName: string, toIndex: number) => void; addTheme: () => void; updateTheme: (id: string, updates: ThemeUpdates) => void; deleteTheme: (id: string) => void; setActiveThemeId: (id: string) => void; updateAuthSettings: (settings: StudioAuthSettings) => void; mutateAuthSettings: (mutation: StudioAuthSettingsMutation) => StudioAuthSettings | null; updateOAuthProviders: (providers: AuthOAuthProviderConfig[]) => void; setActiveScreenId: (id: StudioScreenId) => void; findNode: (root: UiNode, id: StudioNodeId) => UiNode | null; togglePreviewMode: () => void; refetchManifest: () => Promise; flushManifest: () => Promise; } export declare const ACTION_REGISTRY: Record; export declare const TPL_SCREEN_EMPTY: UiNode; /** * Generates a unique ID for Studio-authored nodes and entities. */ export declare const generateStudioId: StudioIdGenerator; export declare const cloneWithNewIds: (node: UiNode, createId?: StudioIdGenerator) => UiNode; export declare const findNodeById: (root: UiNode, id: string) => UiNode | null; export declare const updateNodeInTree: (root: UiNode, id: string, newProps: Record) => UiNode; export declare const removeNodeFromTree: (root: UiNode, nodeId: string) => UiNode | null; export declare function canAcceptChild(args: { parentType: string; childType: string; componentMeta: StudioComponentMetaRegistry; }): boolean; export declare function validateNodePlacement(args: { root: UiNode; placement: NodePlacement; childType: string; componentMeta: StudioComponentMetaRegistry; }): PlacementValidationResult; export declare function resolveInsertPlacement(args: { root: UiNode; targetNodeId: string; childType: string; componentMeta: StudioComponentMetaRegistry; kind: PlacementKind; }): PlacementResolutionResult; export declare function resolveDefaultInsertPlacement(args: { root: UiNode; selectedNodeId: string | null; childType: string; componentMeta: StudioComponentMetaRegistry; }): PlacementResolutionResult; export interface InsertNodeAtPlacementArgs { root: UiNode; placement: NodePlacement; componentMeta: StudioComponentMetaRegistry; makeNode: () => UiNode; } export interface InsertNodeAtPlacementResult { root: UiNode; insertedNodeId: string; } export declare function insertNodeAtPlacement(args: InsertNodeAtPlacementArgs): InsertNodeAtPlacementResult | null; export interface MoveNodeToPlacementArgs { root: UiNode; nodeId: string; placement: NodePlacement; componentMeta: StudioComponentMetaRegistry; } export interface MoveNodeToPlacementResult { root: UiNode; movedNodeId: string; } export declare function resolveMoveNodePlacement(args: MoveNodeToPlacementArgs): PlacementResolutionResult; export declare function moveNodeToPlacement(args: MoveNodeToPlacementArgs): MoveNodeToPlacementResult | null; export declare const STUDIO_INSERT_RECIPES: readonly InsertRecipe[]; export declare function getInsertCatalogCategoryLabel(category: string): string; export declare function validateInsertRecipe(recipe: InsertRecipe, componentMeta: StudioComponentMetaRegistry): InsertRecipeIssue | null; export declare function createNodeFromCatalogEntry(entry: InsertCatalogEntry, componentMeta: StudioComponentMetaRegistry, createId?: StudioIdGenerator): UiNode; export declare function buildInsertCatalogEntries(args: { componentMeta: StudioComponentMetaRegistry; recipes?: readonly InsertRecipe[]; }): InsertCatalogEntry[]; export declare function resolveInsertCatalogEntries(args: { entries: readonly InsertCatalogEntry[]; root: UiNode | null; selectedNodeId: string | null; componentMeta: StudioComponentMetaRegistry; }): InsertCatalogEntry[]; //# sourceMappingURL=index.d.ts.map