import { n as SUPPORTED_LOCALES, o as resolveLocale, r as SUPPORTED_LOCALE_CODES, s as LocaleDefinition, t as DEFAULT_LOCALE, u as useLocale } from "./config-BAgt8Ary.js"; import "./locales/index.js"; import { Button, Sidebar as KumoSidebar } from "@cloudflare/kumo"; import { MessageDescriptor, Messages } from "@lingui/core"; import * as _tanstack_react_query0 from "@tanstack/react-query"; import { QueryClient } from "@tanstack/react-query"; import * as _tanstack_react_router0 from "@tanstack/react-router"; import { Link, useNavigate, useParams } from "@tanstack/react-router"; import * as React$1 from "react"; import { ComponentProps } from "react"; import * as react_jsx_runtime0 from "react/jsx-runtime"; import "@phosphor-icons/react"; import { ClassValue } from "clsx"; import { Editor } from "@tiptap/react"; import { Node as Node$1 } from "@tiptap/core"; import * as _emdash_cms_blocks0 from "@emdash-cms/blocks"; import { Element } from "@emdash-cms/blocks"; import * as _tanstack_router_core0 from "@tanstack/router-core"; import * as _tanstack_history0 from "@tanstack/history"; //#region src/lib/admin-branding-context.d.ts /** Configured admin white-label overrides (see `admin` in astro.config.mjs). */ interface AdminBranding { /** URL or path to a custom logo image for the admin UI. */ logo?: string; /** Custom name displayed in place of "EmDash". */ siteName?: string; } //#endregion //#region src/lib/auth-provider-context.d.ts /** Shape of a single auth provider's admin exports */ interface AuthProviderModule { id: string; label: string; /** * Compact button for the login page (icon + label). When rendered on the * invite-accept page it receives the invite token so the button can start an * invite-completing OAuth flow. */ LoginButton?: React$1.ComponentType<{ inviteToken?: string; }>; /** Full form if the provider needs custom input (e.g., handle field) */ LoginForm?: React$1.ComponentType; /** Component for the setup wizard admin creation step */ SetupStep?: React$1.ComponentType<{ onComplete: () => void; }>; } /** All auth provider modules keyed by provider ID */ type AuthProviders = Record; interface AuthProviderContextProps { children: React$1.ReactNode; authProviders: AuthProviders; } /** * Provider that makes auth provider components available to all descendants */ declare function AuthProviderProvider({ children, authProviders }: AuthProviderContextProps): react_jsx_runtime0.JSX.Element; /** * Get all auth provider modules */ declare function useAuthProviders(): AuthProviders; /** * Get auth providers as an ordered array (buttons first, then forms) */ declare function useAuthProviderList(): AuthProviderModule[]; //#endregion //#region src/lib/plugin-context.d.ts /** Shape of a plugin's admin exports */ interface PluginAdminModule { widgets?: Record; pages?: Record; fields?: Record; } /** All plugin admin modules keyed by plugin ID */ type PluginAdmins = Record; interface PluginAdminProviderProps { children: React$1.ReactNode; pluginAdmins: PluginAdmins; } /** * Provider that makes plugin admin modules available to all descendants */ declare function PluginAdminProvider({ children, pluginAdmins }: PluginAdminProviderProps): react_jsx_runtime0.JSX.Element; /** * Get all plugin admin modules */ declare function usePluginAdmins(): PluginAdmins; /** * Get a dashboard widget component by plugin ID and widget ID */ declare function usePluginWidget(pluginId: string, widgetId: string): React$1.ComponentType | null; /** * Get a plugin page component by plugin ID and path, with trailing-slash and root-fallback resolution */ declare function usePluginPage(pluginId: string, path: string): React$1.ComponentType | null; /** * Get a field widget component by plugin ID and field type */ declare function usePluginField(pluginId: string, fieldType: string): React$1.ComponentType | null; /** * Check if a plugin has any registered admin pages */ declare function usePluginHasPages(pluginId: string): boolean; /** * Check if a plugin has any registered dashboard widgets */ declare function usePluginHasWidgets(pluginId: string): boolean; //#endregion //#region src/App.d.ts interface AdminAppProps { /** Plugin admin modules keyed by plugin ID */ pluginAdmins?: PluginAdmins; /** Auth provider UI modules keyed by provider ID */ authProviders?: AuthProviders; /** Configured admin white-label branding (logo, site name) */ adminBranding?: AdminBranding; /** Active locale code */ locale?: string; /** Compiled Lingui messages for the active locale */ messages?: Messages; } declare function AdminApp({ pluginAdmins, authProviders, adminBranding, locale, messages }: AdminAppProps): react_jsx_runtime0.JSX.Element; //#endregion //#region src/router.d.ts interface RouterContext { queryClient: QueryClient; } declare function parseBylinesLocaleSearch(search: Record): { locale: string | undefined; }; declare function createAdminRouter(queryClient: QueryClient): _tanstack_router_core0.RouterCore<_tanstack_router_core0.Route<_tanstack_react_router0.Register, any, "/", "/", string, "__root__", undefined, {}, RouterContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, readonly [_tanstack_react_router0.Route, "/setup", "/setup", string, "/setup", undefined, _tanstack_router_core0.ResolveParams<"/setup">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/login", "/login", string, "/login", undefined, _tanstack_router_core0.ResolveParams<"/login">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/signup", "/signup", string, "/signup", undefined, _tanstack_router_core0.ResolveParams<"/signup">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/invite/accept", "/invite/accept", string, "/invite/accept", (search: Record) => { token: string | undefined; }, _tanstack_router_core0.ResolveParams<"/invite/accept">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/device", "/device", string, "/device", undefined, _tanstack_router_core0.ResolveParams<"/device">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_router_core0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, readonly [_tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/", "/", string, "/_admin/", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/content/$collection", "/content/$collection", string, "/_admin/content/$collection", (search: Record) => { locale: string | undefined; }, _tanstack_router_core0.ResolveParams<"/content/$collection">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/content/$collection/new", "/content/$collection/new", string, "/_admin/content/$collection/new", (search: Record) => { locale: string | undefined; }, _tanstack_router_core0.ResolveParams<"/content/$collection/new">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/content/$collection/$id", "/content/$collection/$id", string, "/_admin/content/$collection/$id", (search: Record) => { locale?: string | undefined; field?: string | undefined; }, _tanstack_router_core0.ResolveParams<"/content/$collection/$id">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/content-types", "/content-types", string, "/_admin/content-types", undefined, _tanstack_router_core0.ResolveParams<"/content-types">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/content-types/new", "/content-types/new", string, "/_admin/content-types/new", undefined, _tanstack_router_core0.ResolveParams<"/content-types/new">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/content-types/$slug", "/content-types/$slug", string, "/_admin/content-types/$slug", undefined, _tanstack_router_core0.ResolveParams<"/content-types/$slug">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/media", "/media", string, "/_admin/media", undefined, _tanstack_router_core0.ResolveParams<"/media">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/comments", "/comments", string, "/_admin/comments", undefined, _tanstack_router_core0.ResolveParams<"/comments">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/menus", "/menus", string, "/_admin/menus", undefined, _tanstack_router_core0.ResolveParams<"/menus">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/menus/$name", "/menus/$name", string, "/_admin/menus/$name", (search: Record) => { locale: string | undefined; }, _tanstack_router_core0.ResolveParams<"/menus/$name">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/plugins-manager", "/plugins-manager", string, "/_admin/plugins-manager", undefined, _tanstack_router_core0.ResolveParams<"/plugins-manager">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/plugins-manager/$pluginId/settings", "/plugins-manager/$pluginId/settings", string, "/_admin/plugins-manager/$pluginId/settings", undefined, _tanstack_router_core0.ResolveParams<"/plugins-manager/$pluginId/settings">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/plugins/marketplace/$pluginId", "/plugins/marketplace/$pluginId", string, "/_admin/plugins/marketplace/$pluginId", undefined, _tanstack_router_core0.ResolveParams<"/plugins/marketplace/$pluginId">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/plugins/marketplace", "/plugins/marketplace", string, "/_admin/plugins/marketplace", undefined, _tanstack_router_core0.ResolveParams<"/plugins/marketplace">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/themes/marketplace", "/themes/marketplace", string, "/_admin/themes/marketplace", undefined, _tanstack_router_core0.ResolveParams<"/themes/marketplace">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/themes/marketplace/$themeId", "/themes/marketplace/$themeId", string, "/_admin/themes/marketplace/$themeId", undefined, _tanstack_router_core0.ResolveParams<"/themes/marketplace/$themeId">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/plugins/$pluginId/$", "/plugins/$pluginId/$", string, "/_admin/plugins/$pluginId/$", undefined, _tanstack_router_core0.ResolveParams<"/plugins/$pluginId/$">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/redirects", "/redirects", string, "/_admin/redirects", undefined, _tanstack_router_core0.ResolveParams<"/redirects">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/sections", "/sections", string, "/_admin/sections", undefined, _tanstack_router_core0.ResolveParams<"/sections">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/sections/$slug", "/sections/$slug", string, "/_admin/sections/$slug", undefined, _tanstack_router_core0.ResolveParams<"/sections/$slug">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/taxonomies/$taxonomy", "/taxonomies/$taxonomy", string, "/_admin/taxonomies/$taxonomy", undefined, _tanstack_router_core0.ResolveParams<"/taxonomies/$taxonomy">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/users", "/users", string, "/_admin/users", undefined, _tanstack_router_core0.ResolveParams<"/users">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/bylines", "/bylines", string, "/_admin/bylines", typeof parseBylinesLocaleSearch, _tanstack_router_core0.ResolveParams<"/bylines">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/byline-schema", "/byline-schema", string, "/_admin/byline-schema", undefined, _tanstack_router_core0.ResolveParams<"/byline-schema">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/widgets", "/widgets", string, "/_admin/widgets", undefined, _tanstack_router_core0.ResolveParams<"/widgets">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/settings", "/settings", string, "/_admin/settings", undefined, _tanstack_router_core0.ResolveParams<"/settings">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/settings/general", "/settings/general", string, "/_admin/settings/general", undefined, _tanstack_router_core0.ResolveParams<"/settings/general">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/settings/social", "/settings/social", string, "/_admin/settings/social", undefined, _tanstack_router_core0.ResolveParams<"/settings/social">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/settings/seo", "/settings/seo", string, "/_admin/settings/seo", undefined, _tanstack_router_core0.ResolveParams<"/settings/seo">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/settings/security", "/settings/security", string, "/_admin/settings/security", undefined, _tanstack_router_core0.ResolveParams<"/settings/security">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/settings/allowed-domains", "/settings/allowed-domains", string, "/_admin/settings/allowed-domains", undefined, _tanstack_router_core0.ResolveParams<"/settings/allowed-domains">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/settings/api-tokens", "/settings/api-tokens", string, "/_admin/settings/api-tokens", undefined, _tanstack_router_core0.ResolveParams<"/settings/api-tokens">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/settings/email", "/settings/email", string, "/_admin/settings/email", undefined, _tanstack_router_core0.ResolveParams<"/settings/email">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/settings/backups", "/settings/backups", string, "/_admin/settings/backups", undefined, _tanstack_router_core0.ResolveParams<"/settings/backups">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/import/wordpress", "/import/wordpress", string, "/_admin/import/wordpress", undefined, _tanstack_router_core0.ResolveParams<"/import/wordpress">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, _tanstack_react_router0.Route, "/", "/", "_admin", "/_admin", undefined, _tanstack_router_core0.ResolveParams<"/">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "*", "/*", string, "/_admin/*", undefined, _tanstack_router_core0.ResolveParams<"*">, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, _tanstack_router_core0.AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>], unknown, unknown, unknown, undefined>], unknown, unknown, unknown, undefined>, "never", false, _tanstack_history0.RouterHistory, Record>; declare module "@tanstack/react-router" { interface Register { router: ReturnType; } } //#endregion //#region src/components/Shell.d.ts declare module "@tanstack/react-router" { interface StaticDataRouteOption { /** * Route renders edge-to-edge: the Shell's
drops its padding and * page scroll, and the route's component manages its own scroll regions. */ fullBleed?: boolean; } } interface ShellProps { children: React$1.ReactNode; manifest: { collections: Record; plugins: Record; }>; taxonomies: Array<{ name: string; label: string; }>; version?: string; }; } /** * Admin shell layout with kumo Sidebar component. * * Sidebar.Provider wraps both the sidebar and main content area, * handling collapse state, mobile detection, and layout transitions. */ declare function Shell({ children, manifest }: ShellProps): react_jsx_runtime0.JSX.Element; //#endregion //#region src/components/Sidebar.d.ts interface SidebarNavProps { manifest: { collections: Record; plugins: Record; dashboardWidgets?: Array<{ id: string; title?: string; }>; version?: string; }>; taxonomies: Array<{ name: string; label: string; }>; version?: string; commit?: string; marketplace?: string; registry?: { aggregatorUrl: string; }; admin?: { logo?: string; siteName?: string; favicon?: string; }; }; } /** * Admin sidebar navigation using kumo's Sidebar compound component. */ declare function SidebarNav({ manifest }: SidebarNavProps): react_jsx_runtime0.JSX.Element; //#endregion //#region src/lib/api/current-user.d.ts /** * Current user query — shared across Shell, Header, Sidebar, and CommandPalette. */ interface CurrentUser { id: string; email: string; name?: string; role: number; avatarUrl?: string; isFirstLogin?: boolean; } declare function useCurrentUser(): _tanstack_react_query0.UseQueryResult; //#endregion //#region src/components/Header.d.ts /** * Admin header with mobile menu toggle and user actions. * Uses useSidebar() hook from kumo Sidebar.Provider context. */ declare function Header(): react_jsx_runtime0.JSX.Element; //#endregion //#region src/lib/api/client.d.ts declare const API_BASE = "/_emdash/api"; /** * Fetch wrapper that adds the X-EmDash-Request CSRF protection header * to all requests. All API calls should use this instead of raw fetch(). */ declare function apiFetch(input: string | URL | Request, init?: RequestInit): Promise; /** * Throw an error with the message from the API response body if available, * falling back to a generic message. All API error responses use the shape * `{ success: false, error: { code, message, details? } }`. For validation * errors, the field-level messages in `error.details.issues` are surfaced * instead of the generic "Invalid request data" top-level message. */ declare function throwResponseError(res: Response, fallback: string): Promise; /** * Generic paginated result */ interface FindManyResult { items: T[]; nextCursor?: string; /** * Total number of rows matching the filters (ignoring pagination). * Optional because older servers may not return it. */ total?: number; } /** * Admin manifest describing available collections and plugins */ interface AdminManifest { version: string; /** Version of Astro the host is built with, when resolvable. */ astroVersion?: string; hash: string; collections: Record | Record; validation?: Record; }>; }>; plugins: Record; dashboardWidgets?: Array<{ id: string; title?: string; size?: "full" | "half" | "third"; }>; fieldWidgets?: Array<{ name: string; label: string; fieldTypes: string[]; elements?: _emdash_cms_blocks0.Element[]; }>; /** Block types for Portable Text editor */ portableTextBlocks?: Array<{ type: string; label: string; icon?: string; description?: string; placeholder?: string; fields?: Element[]; category?: string; }>; }>; /** * Auth mode for the admin UI. When "passkey", the security settings * (passkey management, self-signup domains) are shown. When using * external auth (e.g., "cloudflare-access"), these are hidden since * authentication is handled externally. */ authMode: string; /** * Whether self-signup is enabled (at least one allowed domain is active). * Used by the login page to conditionally show the "Sign up" link. */ signupEnabled?: boolean; /** * i18n configuration. Present when multiple locales are configured. */ i18n?: { defaultLocale: string; locales: string[]; }; /** * Taxonomy definitions for the admin sidebar. */ taxonomies: Array<{ name: string; label: string; labelSingular?: string; hierarchical: boolean; collections: string[]; }>; /** * Marketplace registry URL. Present when `marketplace` is configured * in the EmDash integration. Enables marketplace features in the UI. */ marketplace?: string; /** * Experimental decentralized plugin registry. Present when * `experimental.registry` is configured in the EmDash integration. * When present, the admin UI uses the registry instead of the * centralized marketplace for browse and install. */ registry?: { aggregatorUrl: string; acceptLabelers?: string; policy?: { minimumReleaseAgeSeconds?: number; minimumReleaseAgeExclude?: string[]; }; }; /** * Admin branding overrides for white-labeling. * Set via the `admin` config in `astro.config.mjs`. */ admin?: { logo?: string; siteName?: string; favicon?: string; }; } /** * Parse an API response with the { success, data: T } envelope. * * Handles error responses via throwResponseError, then unwraps the data envelope. * Replaces both bare `response.json()` and field-unwrap patterns. */ declare function parseApiResponse(response: Response, fallbackMessage?: string): Promise; /** * Fetch admin manifest */ declare function fetchManifest(): Promise; /** * Fetch auth mode (public endpoint — works without authentication). * Used by the login page to determine which login UI to render. */ declare function fetchAuthMode(): Promise<{ authMode: string; signupEnabled?: boolean; providers?: Array<{ id: string; label: string; }>; }>; //#endregion //#region src/lib/api/bylines.d.ts /** * Runtime value type for a byline custom field (Discussion #1174). * The five v1 field types collapse to this narrow union: string-shaped * types (`string`, `text`, `url`, `select`) → string; `boolean` → boolean; * `null` for explicitly cleared values. */ type BylineCustomFieldValue = string | boolean | null; interface BylineSummary { id: string; slug: string; displayName: string; bio: string | null; avatarMediaId: string | null; websiteUrl: string | null; userId: string | null; isGuest: boolean; createdAt: string; updatedAt: string; /** Locale this byline row is presented in (migration 040). */ locale: string; /** * Shared across translations of the same byline (migration 040). * Nullable for backwards compatibility; new rows always populate it. */ translationGroup: string | null; /** * Byline custom-field values keyed by field slug (Discussion #1174). * Optional in the type for backward-compat with pre-Phase-3 servers; * post-Phase-3 servers always populate as `{}` even when no fields * are registered. */ customFields?: Record; } interface BylineInput { slug: string; displayName: string; bio?: string | null; avatarMediaId?: string | null; websiteUrl?: string | null; userId?: string | null; isGuest?: boolean; /** * Locale this byline row belongs to. When omitted, the server uses the * configured `defaultLocale`. */ locale?: string; /** * When set, the new row joins the source byline's `translation_group`. * Requires `locale` (the server returns a validation error otherwise). */ translationOf?: string; /** * Custom-field value writes (Discussion #1174). Accepted by both * the create and update routes (Phase 6 added create-flow parity). * Keys are field slugs; values pass through to the byline * repository, which validates against the registered field type * and throws `EmDashValidationError` on mismatch. * * A value of `null` clears the row (Phase 3 storage semantics). * Unknown slugs return 400 `VALIDATION_ERROR`. */ customFields?: Record; } interface BylineTranslationInput { locale: string; slug?: string; displayName?: string; bio?: string | null; avatarMediaId?: string | null; websiteUrl?: string | null; } interface BylineCreditInput { bylineId: string; roleLabel?: string | null; } declare function fetchBylines(options?: { search?: string; isGuest?: boolean; userId?: string; locale?: string; cursor?: string; limit?: number; }): Promise>; declare function fetchByline(id: string): Promise; declare function createByline(input: BylineInput): Promise; declare function updateByline(id: string, input: Partial): Promise; declare function deleteByline(id: string): Promise; /** * Fetch every translation of a byline (siblings sharing the same * translation_group). */ declare function fetchBylineTranslations(id: string): Promise<{ items: BylineSummary[]; }>; /** * Create a new locale variant of a byline. The new row joins the source's * `translation_group`. Body defaults — slug, display name, avatar, website — * inherit from the source when omitted, so editors only have to fill in the * localized bio (and optionally a localized display name). */ declare function createBylineTranslation(id: string, input: BylineTranslationInput): Promise; //#endregion //#region src/lib/api/content.d.ts /** * Derive draft status from a content item's revision pointers */ declare function getDraftStatus(item: ContentItem): "unpublished" | "published" | "published_with_changes"; /** SEO metadata for a content item */ interface ContentSeo { title: string | null; description: string | null; image: string | null; canonical: string | null; noIndex: boolean; } interface ContentItem { id: string; type: string; slug: string | null; status: string; locale: string; translationGroup: string | null; data: Record; authorId: string | null; primaryBylineId: string | null; byline?: BylineSummary | null; bylines?: Array<{ byline: BylineSummary; sortOrder: number; roleLabel: string | null; }>; createdAt: string; updatedAt: string; publishedAt: string | null; scheduledAt: string | null; liveRevisionId: string | null; draftRevisionId: string | null; seo?: ContentSeo; } interface CreateContentInput { type: string; slug?: string; data: Record; status?: string; bylines?: BylineCreditInput[]; locale?: string; translationOf?: string; } interface TranslationSummary { id: string; locale: string; slug: string | null; status: string; updatedAt: string; } interface TranslationsResponse { translationGroup: string; translations: TranslationSummary[]; } /** * Fetch translations for a content item */ declare function fetchTranslations(collection: string, id: string): Promise; /** Input for updating SEO fields on content */ interface ContentSeoInput { title?: string | null; description?: string | null; image?: string | null; canonical?: string | null; noIndex?: boolean; } interface UpdateContentInput { data?: Record; slug?: string; status?: string; authorId?: string | null; bylines?: BylineCreditInput[]; /** Skip revision creation (used by autosave) */ skipRevision?: boolean; seo?: ContentSeoInput; } /** * Trashed content item with deletion timestamp */ interface TrashedContentItem extends ContentItem { deletedAt: string; } /** * Preview URL response */ interface PreviewUrlResponse { url: string; expiresAt: number; } /** * Fetch content list */ /** Timestamp column a content-list date range can target. */ type ContentDateField = "createdAt" | "updatedAt" | "publishedAt"; declare function fetchContentList(collection: string, options?: { cursor?: string; limit?: number; status?: string; locale?: string; /** Field name to order by, matching the server's whitelist. */ orderBy?: string; /** Sort direction; defaults to "desc" on the server. */ order?: "asc" | "desc"; /** Case-insensitive substring search across title/name/slug. */ search?: string; /** Filter to entries authored by this user (the `author_id` column). */ authorId?: string; /** Which timestamp column the `dateFrom`/`dateTo` range applies to. */ dateField?: ContentDateField; /** Inclusive lower bound (ISO date or datetime). Requires `dateField`. */ dateFrom?: string; /** Inclusive upper bound (ISO date or datetime). Requires `dateField`. */ dateTo?: string; }): Promise>; /** A distinct content author, for the admin author filter. */ interface ContentAuthor { id: string; name: string | null; email: string; avatarUrl: string | null; } /** * Fetch the distinct authors of a collection's content. Gated on * `content:read`, so unlike the user-management API it's available to any * editor. Returns only users who have authored at least one live entry. */ declare function fetchContentAuthors(collection: string): Promise; /** * Fetch single content item */ declare function fetchContent(collection: string, id: string, options?: { locale?: string; }): Promise; /** * Create content */ declare function createContent(collection: string, input: Omit): Promise; /** * Update content */ declare function updateContent(collection: string, id: string, input: UpdateContentInput, options?: { locale?: string; }): Promise; /** * Delete content (moves to trash) */ declare function deleteContent(collection: string, id: string, options?: { locale?: string; }): Promise; /** * Fetch trashed content list */ declare function fetchTrashedContent(collection: string, options?: { cursor?: string; limit?: number; }): Promise>; /** * Restore content from trash */ declare function restoreContent(collection: string, id: string): Promise; /** * Permanently delete content (cannot be undone) */ declare function permanentDeleteContent(collection: string, id: string): Promise; /** * Duplicate content (creates a draft copy) */ declare function duplicateContent(collection: string, id: string): Promise; /** * Schedule content for future publishing */ declare function scheduleContent(collection: string, id: string, scheduledAt: string, options?: { locale?: string; }): Promise; /** * Unschedule content (revert to draft) */ declare function unscheduleContent(collection: string, id: string, options?: { locale?: string; }): Promise; /** * Get a preview URL for content * * Returns a signed URL that allows viewing draft content. * Returns null if the EmDash runtime isn't initialized on the server * (responds with NOT_CONFIGURED). The preview secret itself no longer * needs to be set explicitly — it auto-generates on first use. */ declare function getPreviewUrl(collection: string, id: string, options?: { expiresIn?: string; pathPattern?: string; }): Promise; /** * Publish content - promotes current draft to live */ declare function publishContent(collection: string, id: string, options?: { locale?: string; }): Promise; /** * Unpublish content - removes from public, preserves draft */ declare function unpublishContent(collection: string, id: string, options?: { locale?: string; }): Promise; /** * Discard draft changes - reverts to live version */ declare function discardDraft(collection: string, id: string, options?: { locale?: string; }): Promise; /** * Compare live and draft revisions */ declare function compareRevisions(collection: string, id: string): Promise<{ hasChanges: boolean; live: Record | null; draft: Record | null; }>; interface Revision { id: string; collection: string; entryId: string; data: Record; authorId: string | null; createdAt: string; } interface RevisionListResponse { items: Revision[]; total: number; } /** * Fetch revisions for a content item */ declare function fetchRevisions(collection: string, entryId: string, options?: { limit?: number; }): Promise; /** * Get a specific revision */ declare function fetchRevision(revisionId: string): Promise; /** * Restore a revision (updates content to this revision's data) */ declare function restoreRevision(revisionId: string): Promise; //#endregion //#region src/lib/api/media.d.ts /** * Maximum length of the media filename search term. Mirrors the server-side * zod schema (`q: z.string().trim().min(1).max(200)`); keep in sync. */ declare const MEDIA_SEARCH_MAX_LENGTH = 200; interface MediaItem { id: string; filename: string; mimeType: string; url: string; /** Storage key for local media (e.g., "01ABC.jpg"). Not present for external URLs. */ storageKey?: string; size: number; width?: number; height?: number; /** LQIP blurhash placeholder (images only) */ blurhash?: string; /** LQIP dominant-color placeholder, as a CSS color (images only) */ dominantColor?: string; alt?: string; caption?: string; createdAt: string; /** Provider ID for external media (e.g., "cloudflare-images") */ provider?: string; /** Provider-specific metadata */ meta?: Record; } /** * Fetch media list */ declare function fetchMediaList(options?: { cursor?: string; limit?: number; mimeType?: string | string[]; /** Case-insensitive filename substring search (also matches extensions). */ search?: string; }): Promise>; /** * Fetch a single media item by id. * * Used to resolve an id-only reference (e.g. a byline's `avatarMediaId`) * back into a full media item for display. */ declare function fetchMediaItem(id: string): Promise; /** * Upload media file * * Tries signed URL upload first (for S3/R2 storage), falls back to direct upload * (for local storage) if signed URLs are not supported. */ declare function uploadMedia(file: File, opts?: { fieldId?: string; }): Promise; /** * Delete media */ declare function deleteMedia(id: string): Promise; /** * Update media metadata (dimensions, alt text, etc.) */ declare function updateMedia(id: string, input: { alt?: string; caption?: string; width?: number; height?: number; }): Promise; /** Media provider capabilities */ interface MediaProviderCapabilities { browse: boolean; search: boolean; upload: boolean; delete: boolean; } /** Media provider info from the API */ interface MediaProviderInfo { id: string; name: string; icon?: string; capabilities: MediaProviderCapabilities; } /** Media item from a provider */ interface MediaProviderItem { id: string; filename: string; mimeType: string; size?: number; width?: number; height?: number; /** LQIP blurhash placeholder (images only) */ blurhash?: string; /** LQIP dominant-color placeholder, as a CSS color (images only) */ dominantColor?: string; alt?: string; previewUrl?: string; meta?: Record; } /** * Fetch all configured media providers */ declare function fetchMediaProviders(): Promise; /** * Fetch media items from a specific provider */ declare function fetchProviderMedia(providerId: string, options?: { cursor?: string; limit?: number; query?: string; mimeType?: string | string[]; }): Promise>; /** * Upload media to a specific provider */ declare function uploadToProvider(providerId: string, file: File, alt?: string): Promise; /** * Delete media from a specific provider */ declare function deleteFromProvider(providerId: string, itemId: string): Promise; //#endregion //#region src/lib/api/schema.d.ts /** * Schema/collection/field management APIs (Content Type Builder) */ type FieldType = "string" | "text" | "url" | "number" | "integer" | "boolean" | "datetime" | "select" | "multiSelect" | "portableText" | "image" | "file" | "reference" | "json" | "slug" | "repeater"; interface SchemaCollection { id: string; slug: string; label: string; labelSingular?: string; description?: string; icon?: string; supports: string[]; source?: string; urlPattern?: string; hasSeo: boolean; commentsEnabled: boolean; commentsModeration: "all" | "first_time" | "none"; commentsClosedAfterDays: number; commentsAutoApproveUsers: boolean; createdAt: string; updatedAt: string; } interface SchemaField { id: string; collectionId: string; slug: string; label: string; type: FieldType; columnType: string; required: boolean; unique: boolean; searchable: boolean; defaultValue?: unknown; validation?: { min?: number; max?: number; minLength?: number; maxLength?: number; pattern?: string; options?: string[]; allowedMimeTypes?: string[]; }; widget?: string; options?: Record; sortOrder: number; createdAt: string; } interface SchemaCollectionWithFields extends SchemaCollection { fields: SchemaField[]; } interface CreateCollectionInput { slug: string; label: string; labelSingular?: string; description?: string; icon?: string; supports?: string[]; urlPattern?: string; hasSeo?: boolean; } interface UpdateCollectionInput { label?: string; labelSingular?: string; description?: string; icon?: string; supports?: string[]; urlPattern?: string; hasSeo?: boolean; commentsEnabled?: boolean; commentsModeration?: "all" | "first_time" | "none"; commentsClosedAfterDays?: number; commentsAutoApproveUsers?: boolean; } interface CreateFieldInput { slug: string; label: string; type: FieldType; required?: boolean; unique?: boolean; searchable?: boolean; defaultValue?: unknown; validation?: { min?: number; max?: number; minLength?: number; maxLength?: number; pattern?: string; options?: string[]; allowedMimeTypes?: string[]; } | null; widget?: string; options?: Record; } interface UpdateFieldInput { label?: string; required?: boolean; unique?: boolean; searchable?: boolean; defaultValue?: unknown; validation?: { min?: number; max?: number; minLength?: number; maxLength?: number; pattern?: string; options?: string[]; allowedMimeTypes?: string[]; } | null; widget?: string; options?: Record; sortOrder?: number; } /** * Fetch all collections */ declare function fetchCollections(): Promise; /** * Fetch a single collection with fields */ declare function fetchCollection(slug: string, includeFields?: boolean): Promise; /** * Create a collection */ declare function createCollection(input: CreateCollectionInput): Promise; /** * Update a collection */ declare function updateCollection(slug: string, input: UpdateCollectionInput): Promise; /** * Delete a collection */ declare function deleteCollection(slug: string, force?: boolean): Promise; /** * Fetch fields for a collection */ declare function fetchFields(collectionSlug: string): Promise; /** * Create a field */ declare function createField(collectionSlug: string, input: CreateFieldInput): Promise; /** * Update a field */ declare function updateField(collectionSlug: string, fieldSlug: string, input: UpdateFieldInput): Promise; /** * Delete a field */ declare function deleteField(collectionSlug: string, fieldSlug: string): Promise; /** * Reorder fields */ declare function reorderFields(collectionSlug: string, fieldSlugs: string[]): Promise; interface OrphanedTable { slug: string; tableName: string; rowCount: number; } /** * Fetch orphaned content tables */ declare function fetchOrphanedTables(): Promise; /** * Register an orphaned table as a collection */ declare function registerOrphanedTable(slug: string, options?: { label?: string; labelSingular?: string; description?: string; }): Promise; //#endregion //#region src/lib/api/plugins.d.ts /** * Plugin management APIs */ interface PluginInfo { id: string; name: string; version: string; package?: string; enabled: boolean; status: "installed" | "active" | "inactive"; capabilities: string[]; hasAdminPages: boolean; hasDashboardWidgets: boolean; hasHooks: boolean; /** True when the plugin declares `admin.settingsSchema` (auto-generated settings form) */ hasSettings: boolean; installedAt?: string; activatedAt?: string; deactivatedAt?: string; /** Plugin source: 'config' (declared in astro.config), 'marketplace', or 'registry' */ source?: "config" | "marketplace" | "registry"; /** Installed marketplace version (set when source = 'marketplace') */ marketplaceVersion?: string; /** Publisher DID, for registry-source plugins. */ registryPublisherDid?: string; /** Publisher slug, for registry-source plugins. */ registrySlug?: string; /** Description of what the plugin does */ description?: string; /** URL to the plugin icon (marketplace plugins use the icon proxy) */ iconUrl?: string; /** Absent when talking to an older core that predates plugin MCP tools. */ mcpToolsEnabled?: boolean; mcpTools?: Array<{ name: string; description: string; route: string; permission: string; destructive: boolean; }>; } /** * Fetch all plugins */ declare function fetchPlugins(): Promise; /** * Fetch a single plugin */ declare function fetchPlugin(pluginId: string): Promise; interface BaseSettingField { label: string; description?: string; } type SettingField = (BaseSettingField & { type: "string"; default?: string; multiline?: boolean; }) | (BaseSettingField & { type: "number"; default?: number; min?: number; max?: number; }) | (BaseSettingField & { type: "boolean"; default?: boolean; }) | (BaseSettingField & { type: "select"; options: Array<{ value: string; label: string; }>; default?: string; }) | (BaseSettingField & { type: "secret"; }) | (BaseSettingField & { type: "url"; default?: string; placeholder?: string; }) | (BaseSettingField & { type: "email"; default?: string; placeholder?: string; }); interface PluginSettingsResponse { schema: Record; /** Current values; secret fields are never included (see secretsSet) */ values: Record; /** For secret fields: whether a value is currently stored */ secretsSet: Record; } /** * Fetch a plugin's settings schema and current values */ declare function fetchPluginSettings(pluginId: string): Promise; /** * Update a plugin's settings. Only keys present in `values` are written; * `null` clears a stored value (reverting to the schema default). */ declare function updatePluginSettings(pluginId: string, values: Record): Promise; /** * Enable a plugin */ declare function enablePlugin(pluginId: string): Promise; /** * Disable a plugin */ declare function disablePlugin(pluginId: string): Promise; declare function setPluginMcpEnabled(pluginId: string, enabled: boolean): Promise; //#endregion //#region src/lib/api/settings.d.ts /** * Site settings APIs */ interface SiteSettings { title: string; tagline?: string; logo?: { mediaId: string; alt?: string; url?: string; }; favicon?: { mediaId: string; url?: string; }; url?: string; postsPerPage: number; dateFormat: string; timezone: string; social?: { twitter?: string; github?: string; facebook?: string; instagram?: string; linkedin?: string; youtube?: string; }; seo?: { titleSeparator?: string; defaultOgImage?: { mediaId: string; alt?: string; url?: string; }; robotsTxt?: string; googleVerification?: string; bingVerification?: string; }; } /** * Fetch site settings */ declare function fetchSettings(): Promise>; /** * Update site settings */ declare function updateSettings(settings: Partial): Promise>; //#endregion //#region src/lib/api/users.d.ts /** User list item with computed fields */ interface UserListItem { id: string; email: string; name: string | null; avatarUrl: string | null; role: number; emailVerified: boolean; disabled: boolean; createdAt: string; updatedAt: string; lastLogin: string | null; credentialCount: number; oauthProviders: string[]; } /** User detail with credentials and OAuth accounts */ interface UserDetail extends UserListItem { credentials: Array<{ id: string; name: string | null; deviceType: string; createdAt: string; lastUsedAt: string; }>; oauthAccounts: Array<{ provider: string; createdAt: string; }>; } /** User update input */ interface UpdateUserInput { name?: string; email?: string; role?: number; } /** * Fetch users with search, filter, and pagination */ declare function fetchUsers(options?: { search?: string; role?: number; cursor?: string; limit?: number; }): Promise>; /** * Fetch a single user with details */ declare function fetchUser(id: string): Promise; /** * Update a user */ declare function updateUser(id: string, input: UpdateUserInput): Promise; /** * Disable a user */ declare function disableUser(id: string): Promise; /** * Send a recovery magic link to a user */ declare function sendRecoveryLink(id: string): Promise; /** * Enable a user */ declare function enableUser(id: string): Promise; /** Invite response -- includes inviteUrl when no email provider is configured */ interface InviteResult { success: true; message: string; /** Present when no email provider is configured (copy-link fallback) */ inviteUrl?: string; } /** * Invite a new user * * Uses the existing /auth/invite endpoint. * When no email provider is configured, the response includes * an `inviteUrl` for manual sharing. */ declare function inviteUser(email: string, role?: number): Promise; /** Invite token verification result */ interface InviteVerifyResult { email: string; role: number; roleName: string; } /** * Validate an invite token and return the invite data. * * Uses custom error handling to preserve error codes for the UI. */ declare function validateInviteToken(token: string): Promise; /** * Passkey info returned from API */ interface PasskeyInfo { id: string; name: string | null; deviceType: "singleDevice" | "multiDevice"; backedUp: boolean; createdAt: string; lastUsedAt: string; } /** * List all passkeys for the current user */ declare function fetchPasskeys(): Promise; /** * Rename a passkey */ declare function renamePasskey(id: string, name: string): Promise; /** * Delete a passkey */ declare function deletePasskey(id: string): Promise; /** Allowed domain for self-signup */ interface AllowedDomain { domain: string; defaultRole: number; roleName: string; enabled: boolean; createdAt: string; } /** Create allowed domain input */ interface CreateAllowedDomainInput { domain: string; defaultRole: number; } /** Update allowed domain input */ interface UpdateAllowedDomainInput { enabled?: boolean; defaultRole?: number; } /** * Fetch all allowed domains */ declare function fetchAllowedDomains(): Promise; /** * Create an allowed domain */ declare function createAllowedDomain(input: CreateAllowedDomainInput): Promise; /** * Update an allowed domain */ declare function updateAllowedDomain(domain: string, input: UpdateAllowedDomainInput): Promise; /** * Delete an allowed domain */ declare function deleteAllowedDomain(domain: string): Promise; /** Signup verification result */ interface SignupVerifyResult { email: string; role: number; roleName: string; } /** * Request signup - send verification email * Always returns success to prevent enumeration */ declare function requestSignup(email: string): Promise<{ success: true; message: string; }>; /** * Verify signup token * * Uses custom error handling to preserve error codes for the UI. */ declare function verifySignupToken(token: string): Promise; /** * Complete signup with passkey registration * * Uses custom error handling to preserve error codes for the UI. */ declare function completeSignup(token: string, credential: unknown, name?: string): Promise<{ success: true; user: { id: string; email: string; name: string | null; role: number; }; }>; /** * Check if any allowed domains exist (for showing signup link) */ declare function hasAllowedDomains(): Promise; //#endregion //#region src/lib/api/byline-fields.d.ts /** * Byline custom-field schema management API (Discussion #1174, Phase 4). * * Mirrors the server-side admin endpoints at * `/_emdash/api/admin/byline-fields/*`. Mutation responses use the * shared `ApiResult` envelope; this client unwraps it via * `parseApiResponse` and surfaces typed errors through * `throwResponseError` (so the admin client sees the registry's * `FIELD_EXISTS` / `TRANSLATABLE_LOCKED` / `REORDER_MISMATCH` messages * verbatim). */ /** * The five v1 field types — deliberately narrower than the content-field * union. Adding a new type requires server-side changes (`BYLINE_FIELD_TYPES`) * + a column in the storage tables; keep this list in lock-step with * `packages/core/src/schema/types.ts`. */ type BylineFieldType = "string" | "text" | "url" | "boolean" | "select"; /** * v1 validation shape. Only `options` is consumed today (for `select`-type * fields); future field types may extend the shape. */ interface BylineFieldValidation { options?: string[]; } interface BylineFieldDefinition { id: string; slug: string; label: string; type: BylineFieldType; required: boolean; /** * Whether values are stored per-locale (`true`, default) or shared * across all translations of the same byline (`false`). The flag is * locked once value rows exist — see `BylineFieldUsage`. */ translatable: boolean; validation: BylineFieldValidation | null; sortOrder: number; createdAt: string; updatedAt: string; } /** * Per-table value counts for a field. Backs the destructive-delete confirm * dialog and the `translatable` toggle's locked state in the editor. */ interface BylineFieldUsage { translatableValueCount: number; groupValueCount: number; totalAffectedRows: number; } interface CreateBylineFieldInput { slug: string; label: string; type: BylineFieldType; required?: boolean; translatable?: boolean; validation?: BylineFieldValidation | null; sortOrder?: number; } /** * `slug` and `type` are intentionally absent — both are immutable * post-create (changing either would invalidate stored values). */ interface UpdateBylineFieldInput { label?: string; required?: boolean; translatable?: boolean; validation?: BylineFieldValidation | null; sortOrder?: number; } declare function listBylineFields(): Promise<{ items: BylineFieldDefinition[]; }>; declare function getBylineFieldUsage(slug: string): Promise; declare function createBylineField(input: CreateBylineFieldInput): Promise; declare function updateBylineField(slug: string, input: UpdateBylineFieldInput): Promise; declare function deleteBylineField(slug: string): Promise; declare function reorderBylineFields(slugs: string[]): Promise<{ items: BylineFieldDefinition[]; }>; //#endregion //#region src/lib/api/menus.d.ts /** * Menu management APIs. * * i18n: all endpoints accept an optional `locale`. When omitted, the server * returns or acts on all locales (legacy behaviour for clients that haven't * been updated yet). */ interface Menu { id: string; name: string; label: string; createdAt: string; updatedAt: string; itemCount?: number; locale: string; translationGroup: string | null; } interface MenuItem { id: string; menuId: string; parentId: string | null; sortOrder: number; type: string; referenceCollection: string | null; referenceId: string | null; customUrl: string | null; label: string; titleAttr: string | null; target: string | null; cssClasses: string | null; createdAt: string; locale: string; translationGroup: string | null; } interface MenuWithItems extends Menu { items: MenuItem[]; } interface MenuTranslation { id: string; name: string; label: string; locale: string; updatedAt: string; } interface MenuTranslationsResponse { translationGroup: string | null; translations: MenuTranslation[]; } interface CreateMenuInput { name: string; label: string; locale?: string; translationOf?: string; } interface UpdateMenuInput { label?: string; } interface CreateMenuItemInput { type: string; label: string; referenceCollection?: string; referenceId?: string; customUrl?: string; target?: string; titleAttr?: string; cssClasses?: string; parentId?: string; sortOrder?: number; } interface UpdateMenuItemInput { label?: string; customUrl?: string; target?: string; titleAttr?: string; cssClasses?: string; parentId?: string | null; sortOrder?: number; } interface ReorderMenuItemsInput { items: Array<{ id: string; parentId: string | null; sortOrder: number; }>; } interface LocaleOptions { locale?: string; } /** * Fetch all menus */ declare function fetchMenus(options?: LocaleOptions): Promise; /** * Fetch a single menu with items */ declare function fetchMenu(name: string, options?: LocaleOptions): Promise; /** * Create a menu */ declare function createMenu(input: CreateMenuInput): Promise; /** * Update a menu */ declare function updateMenu(name: string, input: UpdateMenuInput, options?: LocaleOptions): Promise; /** * Delete a menu */ declare function deleteMenu(name: string, options?: LocaleOptions): Promise; /** * Create a menu item */ declare function createMenuItem(menuName: string, input: CreateMenuItemInput, options?: LocaleOptions): Promise; /** * Update a menu item */ declare function updateMenuItem(menuName: string, itemId: string, input: UpdateMenuItemInput, options?: LocaleOptions): Promise; /** * Delete a menu item */ declare function deleteMenuItem(menuName: string, itemId: string, options?: LocaleOptions): Promise; /** * Reorder menu items */ declare function reorderMenuItems(menuName: string, input: ReorderMenuItemsInput, options?: LocaleOptions): Promise; /** List every translation (locale variant) of a menu. */ declare function fetchMenuTranslations(name: string, options?: LocaleOptions): Promise; /** * Create a new locale translation of a menu. The new menu inherits the * source's items and label unless overridden. */ declare function createMenuTranslation(name: string, input: { locale: string; label?: string; }, options?: LocaleOptions): Promise; //#endregion //#region src/lib/api/widgets.d.ts /** * Widget areas APIs */ interface WidgetArea { id: string; name: string; label: string; description?: string; widgets?: Widget[]; widgetCount?: number; } interface Widget { id: string; type: "content" | "menu" | "component"; title?: string; content?: unknown[]; menuName?: string; componentId?: string; componentProps?: Record; sort_order?: number; } interface WidgetComponent { id: string; label: string; description?: string; props: Record; }>; } interface CreateWidgetAreaInput { name: string; label: string; description?: string; } interface CreateWidgetInput { type: "content" | "menu" | "component"; title?: string; content?: unknown[]; menuName?: string; componentId?: string; componentProps?: Record; } interface UpdateWidgetInput { type?: "content" | "menu" | "component"; title?: string; content?: unknown[]; menuName?: string; componentId?: string; componentProps?: Record; } /** * Fetch all widget areas */ declare function fetchWidgetAreas(): Promise; /** * Fetch a single widget area by name */ declare function fetchWidgetArea(name: string): Promise; /** * Create a widget area */ declare function createWidgetArea(input: CreateWidgetAreaInput): Promise; /** * Delete a widget area */ declare function deleteWidgetArea(name: string): Promise; /** * Add a widget to an area */ declare function createWidget(areaName: string, input: CreateWidgetInput): Promise; /** * Update a widget */ declare function updateWidget(areaName: string, widgetId: string, input: UpdateWidgetInput): Promise; /** * Delete a widget */ declare function deleteWidget(areaName: string, widgetId: string): Promise; /** * Reorder widgets in an area */ declare function reorderWidgets(areaName: string, widgetIds: string[]): Promise; /** * Fetch available widget components */ declare function fetchWidgetComponents(): Promise; //#endregion //#region src/lib/api/sections.d.ts /** * Sections API (reusable content blocks) */ type SectionSource = "theme" | "user" | "import"; interface Section { id: string; slug: string; title: string; description?: string; keywords: string[]; content: unknown[]; previewUrl?: string; source: SectionSource; themeId?: string; createdAt: string; updatedAt: string; } interface CreateSectionInput { slug: string; title: string; description?: string; keywords?: string[]; content: unknown[]; previewMediaId?: string; } interface UpdateSectionInput { slug?: string; title?: string; description?: string; keywords?: string[]; content?: unknown[]; previewMediaId?: string | null; } interface GetSectionsOptions { source?: SectionSource; search?: string; limit?: number; cursor?: string; } interface SectionsResult { items: Section[]; nextCursor?: string; } /** * Fetch all sections */ declare function fetchSections(options?: GetSectionsOptions): Promise; /** * Fetch a single section by slug */ declare function fetchSection(slug: string): Promise
; /** * Create a section */ declare function createSection(input: CreateSectionInput): Promise
; /** * Update a section */ declare function updateSection(slug: string, input: UpdateSectionInput): Promise
; /** * Delete a section */ declare function deleteSection(slug: string): Promise; //#endregion //#region src/lib/api/taxonomies.d.ts /** * Taxonomies API (categories, tags, custom taxonomies). * * All endpoints are locale-aware. When no `locale` option is passed we omit * the query param and the server falls back to its usual resolution (no * filter, returning every locale — same as pre-i18n behaviour for clients * that haven't yet been updated). */ interface TaxonomyTerm { id: string; name: string; slug: string; label: string; parentId?: string; description?: string; children: TaxonomyTerm[]; count?: number; locale: string; translationGroup: string | null; } interface TaxonomyDef { id: string; name: string; label: string; labelSingular?: string; hierarchical: boolean; collections: string[]; locale: string; translationGroup: string | null; } interface TermTranslation { id: string; slug: string; label: string; locale: string; } interface TermTranslationsResponse { translationGroup: string | null; translations: TermTranslation[]; } interface CreateTaxonomyInput { name: string; label: string; labelSingular?: string; hierarchical?: boolean; collections?: string[]; locale?: string; translationOf?: string; } interface CreateTermInput { slug: string; label: string; parentId?: string; description?: string; locale?: string; translationOf?: string; } interface UpdateTermInput { slug?: string; label?: string; parentId?: string; description?: string; } interface LocaleOptions$1 { locale?: string; } /** * Fetch all taxonomy definitions */ declare function fetchTaxonomyDefs(options?: LocaleOptions$1): Promise; /** * Fetch taxonomy definition by name */ declare function fetchTaxonomyDef(name: string, options?: LocaleOptions$1): Promise; /** * Create a custom taxonomy definition */ declare function createTaxonomy(input: CreateTaxonomyInput): Promise; /** * Fetch terms for a taxonomy */ declare function fetchTerms(taxonomyName: string, options?: LocaleOptions$1): Promise; /** * Create a term */ declare function createTerm(taxonomyName: string, input: CreateTermInput): Promise; /** * Update a term */ declare function updateTerm(taxonomyName: string, slug: string, input: UpdateTermInput, options?: LocaleOptions$1): Promise; /** * Delete a term */ declare function deleteTerm(taxonomyName: string, slug: string, options?: LocaleOptions$1): Promise; /** List every translation (locale variant) of a term. */ declare function fetchTermTranslations(taxonomyName: string, slug: string, options?: LocaleOptions$1): Promise; /** * Create a new locale translation of a term. The new term inherits slug, * label, parent, and description from the source unless overridden in `input`. */ declare function createTermTranslation(taxonomyName: string, slug: string, input: { locale: string; label?: string; slug?: string; }, options?: LocaleOptions$1): Promise; //#endregion //#region src/lib/api/import.d.ts /** * WordPress import and source probing APIs */ /** Field compatibility status */ type FieldCompatibility = "compatible" | "type_mismatch" | "missing"; /** Single field definition for import */ interface ImportFieldDef { slug: string; label: string; type: string; required: boolean; } /** Schema status for a collection */ interface CollectionSchemaStatus { exists: boolean; fieldStatus: Record; canImport: boolean; reason?: string; } /** Post type with full schema info */ interface PostTypeAnalysis { name: string; count: number; suggestedCollection: string; requiredFields: ImportFieldDef[]; schemaStatus: CollectionSchemaStatus; } /** Individual attachment info for media import */ interface AttachmentInfo { id?: number; title?: string; url?: string; filename?: string; mimeType?: string; } /** Navigation menu from WordPress */ interface NavMenu { name: string; slug: string; count: number; } /** Custom taxonomy from WordPress */ interface CustomTaxonomy { name: string; slug: string; count: number; hierarchical: boolean; } /** Author info from WordPress */ interface WpAuthorInfo { id?: number; login?: string; email?: string; displayName?: string; postCount: number; } interface WxrAnalysis { site: { title: string; url: string; }; postTypes: PostTypeAnalysis[]; attachments: { count: number; items: AttachmentInfo[]; }; categories: number; tags: number; authors: WpAuthorInfo[]; customFields: Array<{ key: string; count: number; samples: string[]; suggestedField: string; suggestedType: string; isInternal: boolean; }>; /** Navigation menus found in the export */ navMenus?: NavMenu[]; /** Custom taxonomies found in the export */ customTaxonomies?: CustomTaxonomy[]; } interface PrepareRequest { postTypes: Array<{ name: string; collection: string; fields: ImportFieldDef[]; }>; } interface PrepareResult { success: boolean; collectionsCreated: string[]; fieldsCreated: Array<{ collection: string; field: string; }>; errors: Array<{ collection: string; error: string; }>; } /** Author mapping from WP author login to EmDash user ID */ interface AuthorMapping { /** WordPress author login */ wpLogin: string; /** WordPress author display name (for UI) */ wpDisplayName: string; /** WordPress author email (for matching) */ wpEmail?: string; /** EmDash user ID to assign (null = leave unassigned) */ emdashUserId: string | null; /** Number of posts by this author */ postCount: number; } interface ImportConfig { postTypeMappings: Record; skipExisting: boolean; /** Author mappings (WP author login -> EmDash user ID) */ authorMappings?: Record; /** Import navigation menus (plugin import; default true) */ importMenus?: boolean; /** Take over site title & tagline (plugin import; default true) */ importSiteTitle?: boolean; /** Take over logo & favicon (plugin import; default true) */ importLogo?: boolean; /** Import per-post Yoast/Rank Math SEO fields (plugin import; default true) */ importSeo?: boolean; } interface ImportResult { success: boolean; imported: number; skipped: number; errors: Array<{ title: string; error: string; }>; byCollection: Record; /** Number of taxonomy term assignments written (plugin import) */ taxonomyAssignments?: number; /** Source taxonomies skipped because no matching EmDash taxonomy def exists */ missingTaxonomies?: string[]; /** Custom taxonomy defs auto-created during the import (plugin import) */ taxonomiesCreated?: string[]; /** Navigation menu import summary (plugin import) */ menus?: { created: number; items: number; }; /** Comment import summary (plugin import) */ comments?: { imported: number; skipped: number; }; /** Site settings applied from the source (plugin import) */ siteSettings?: string[]; } /** Progress snapshot reported after every chunk. */ interface WpImportProgress { phase: "content" | "comments" | "finalize"; /** Content items imported + skipped so far (content phase) */ processed: number; /** Comments imported + skipped so far (comments phase) */ comments: number; } /** * Run the full plugin import as a sequence of bounded requests: content * pages, then comment pages, then finalize (menus + site identity). * Each request stays well below Worker resource limits regardless of * site size. Re-running after an abort is safe: `skipExisting` skips * already-imported content while rebuilding the ID maps the later * phases need. */ declare function executeWpPluginImport(url: string, token: string, config: ImportConfig, onProgress?: (progress: WpImportProgress) => void): Promise; /** * Analyze a WordPress WXR file */ declare function analyzeWxr(file: File): Promise; /** * Prepare WordPress import (create collections/fields) */ declare function prepareWxrImport(request: PrepareRequest): Promise; /** * Execute WordPress import */ declare function executeWxrImport(file: File, config: ImportConfig): Promise; interface MediaImportResult { imported: Array<{ wpId?: number; originalUrl: string; newUrl: string; mediaId: string; }>; failed: Array<{ wpId?: number; originalUrl: string; error: string; }>; urlMap: Record; } /** Progress update sent during streaming media import */ interface MediaImportProgress { type: "progress"; current: number; total: number; filename?: string; status: "downloading" | "uploading" | "done" | "skipped" | "failed"; error?: string; } interface RewriteUrlsResult { updated: number; byCollection: Record; urlsRewritten: number; errors: Array<{ collection: string; id: string; error: string; }>; } /** * Import media from WordPress with streaming progress * * @param attachments - Array of attachments to import * @param onProgress - Callback for progress updates (optional) * @returns Final import result */ declare function importWxrMedia(attachments: AttachmentInfo[], onProgress?: (progress: MediaImportProgress) => void): Promise; /** * Import media in bounded batches instead of one giant request, so each * Worker invocation stays below resource limits and an aborted run only * loses the batch in flight (the server dedupes re-sent files by content * hash). Progress is reported against the overall total. */ declare function importWxrMediaBatched(attachments: AttachmentInfo[], onProgress?: (progress: MediaImportProgress) => void): Promise; /** Capabilities of an import source */ interface SourceCapabilities { publicContent: boolean; privateContent: boolean; customPostTypes: boolean; allMeta: boolean; mediaStream: boolean; } /** Auth requirements for import */ interface SourceAuth { type: "oauth" | "token" | "password" | "none"; provider?: string; oauthUrl?: string; instructions?: string; } /** Suggested action after probing */ type SuggestedAction = { type: "proceed"; } | { type: "oauth"; url: string; provider: string; } | { type: "upload"; instructions: string; } | { type: "install-plugin"; instructions: string; }; /** Result from probing a single source */ interface SourceProbeResult { sourceId: string; confidence: "definite" | "likely" | "possible"; detected: { platform: string; version?: string; siteTitle?: string; siteUrl?: string; }; capabilities: SourceCapabilities; auth?: SourceAuth; suggestedAction: SuggestedAction; preview?: { posts?: number; pages?: number; media?: number; }; } /** Combined probe result */ interface ProbeResult { url: string; isWordPress: boolean; bestMatch: SourceProbeResult | null; allMatches: SourceProbeResult[]; } /** * Probe a URL to detect import source */ declare function probeImportUrl(url: string): Promise; /** * Rewrite URLs in content after media import */ declare function rewriteContentUrls(urlMap: Record, collections?: string[]): Promise; /** WordPress Plugin analysis result */ interface WpPluginAnalysis { sourceId: string; site: { title: string; url: string; }; postTypes: PostTypeAnalysis[]; attachments: { count: number; items: AttachmentInfo[]; }; categories: number; tags: number; authors: WpAuthorInfo[]; /** Navigation menus found via the plugin */ navMenus?: NavMenu[]; /** Custom taxonomies found via the plugin */ customTaxonomies?: CustomTaxonomy[]; } /** * Analyze a WordPress site with EmDash Exporter plugin */ declare function analyzeWpPluginSite(url: string, token: string): Promise; //#endregion //#region src/lib/api/api-tokens.d.ts /** * API token management client functions */ /** API token info returned from the server */ interface ApiTokenInfo { id: string; name: string; prefix: string; scopes: string[]; userId: string; expiresAt: string | null; lastUsedAt: string | null; createdAt: string; } /** Result from creating a new token */ interface ApiTokenCreateResult { /** Raw token — shown once, never stored */ token: string; /** Token metadata */ info: ApiTokenInfo; } /** Input for creating a new token */ interface CreateApiTokenInput { name: string; scopes: string[]; expiresAt?: string; } /** * Scope strings for personal API tokens (wire + UI iteration order). * Human-readable copy lives in `ApiTokenSettings` (`SCOPE_UI` + Lingui). */ declare const API_TOKEN_SCOPES: { readonly ContentRead: "content:read"; readonly ContentWrite: "content:write"; readonly MediaRead: "media:read"; readonly MediaWrite: "media:write"; readonly SchemaRead: "schema:read"; readonly SchemaWrite: "schema:write"; readonly TaxonomiesManage: "taxonomies:manage"; readonly MenusManage: "menus:manage"; readonly SettingsRead: "settings:read"; readonly SettingsManage: "settings:manage"; readonly McpTools: "mcp:tools"; readonly Admin: "admin"; }; type ApiTokenScopeValue = (typeof API_TOKEN_SCOPES)[keyof typeof API_TOKEN_SCOPES]; /** * Fetch all API tokens for the current user */ declare function fetchApiTokens(): Promise; /** * Create a new API token */ declare function createApiToken(input: CreateApiTokenInput): Promise; /** * Revoke (delete) an API token */ declare function revokeApiToken(id: string): Promise; //#endregion //#region src/lib/api/comments.d.ts type CommentStatus = "pending" | "approved" | "spam" | "trash"; interface AdminComment { id: string; collection: string; contentId: string; parentId: string | null; authorName: string; authorEmail: string; authorUserId: string | null; body: string; status: CommentStatus; ipHash: string | null; userAgent: string | null; moderationMetadata: Record | null; createdAt: string; updatedAt: string; } type CommentCounts = Record; type BulkAction = "approve" | "spam" | "trash" | "delete"; /** * Fetch comments for the moderation inbox */ declare function fetchComments(options?: { status?: CommentStatus; collection?: string; search?: string; limit?: number; cursor?: string; }): Promise>; /** * Fetch comment status counts for inbox badges */ declare function fetchCommentCounts(): Promise; /** * Fetch a single comment by ID */ declare function fetchComment(id: string): Promise; /** * Update a comment's status */ declare function updateCommentStatus(id: string, status: CommentStatus): Promise; /** * Hard delete a comment (ADMIN only) */ declare function deleteComment(id: string): Promise; /** * Bulk status change or delete */ declare function bulkCommentAction(ids: string[], action: BulkAction): Promise<{ affected: number; }>; //#endregion //#region src/lib/api/dashboard.d.ts /** * Dashboard stats API */ interface CollectionStats { slug: string; label: string; total: number; published: number; draft: number; scheduled: number; } interface RecentItem { id: string; collection: string; collectionLabel: string; title: string; slug: string | null; status: string; updatedAt: string; authorId: string | null; } interface DashboardStats { collections: CollectionStats[]; mediaCount: number; userCount: number; recentItems: RecentItem[]; } /** * Fetch dashboard statistics */ declare function fetchDashboardStats(): Promise; //#endregion //#region src/lib/api/search.d.ts /** * Search enable/disable APIs */ interface SearchEnableResult { success: boolean; collection: string; enabled: boolean; indexed?: number; } /** * Enable or disable search for a collection */ declare function setSearchEnabled(collection: string, enabled: boolean, weights?: Record): Promise; //#endregion //#region src/lib/api/marketplace.d.ts /** * Marketplace API client * * Calls the site-side proxy endpoints (/_emdash/api/admin/plugins/marketplace/*) * which forward to the marketplace Worker. This avoids CORS issues since the * admin UI doesn't need to know the marketplace URL. */ interface MarketplaceAuthor { name: string; verified: boolean; } interface MarketplaceAuditSummary { verdict: "pass" | "warn" | "fail"; riskScore: number; } interface MarketplaceImageAuditSummary { verdict: "pass" | "warn" | "fail"; } interface MarketplaceVersion { version: string; minEmDashVersion?: string; bundleSize: number; changelog?: string; readme?: string; screenshotUrls?: string[]; audit?: MarketplaceAuditSummary; imageAudit?: MarketplaceImageAuditSummary; publishedAt: string; } /** Summary shown in browse cards */ interface MarketplacePluginSummary { id: string; name: string; description?: string; author: MarketplaceAuthor; capabilities: string[]; keywords?: string[]; installCount: number; iconUrl?: string; latestVersion?: { version: string; audit?: MarketplaceAuditSummary; imageAudit?: MarketplaceImageAuditSummary; }; createdAt: string; updatedAt: string; } /** Full detail returned by GET /plugins/:id */ interface MarketplacePluginDetail extends MarketplacePluginSummary { license?: string; repositoryUrl?: string; homepageUrl?: string; latestVersion?: MarketplaceVersion; } interface MarketplaceSearchResult { items: MarketplacePluginSummary[]; nextCursor?: string; } interface MarketplaceSearchOpts { q?: string; capability?: string; sort?: "installs" | "updated" | "created" | "name"; cursor?: string; limit?: number; } /** Update check result per plugin */ interface PluginUpdateInfo { pluginId: string; installed: string; latest: string; hasCapabilityChanges: boolean; } /** Install request body */ interface InstallPluginOpts { version?: string; confirmMcpTools?: boolean; } /** Update request body */ interface UpdatePluginOpts { /** User has confirmed new capabilities */ confirmCapabilityChanges?: boolean; confirmMcpTools?: boolean; } /** Uninstall request body */ interface UninstallPluginOpts { /** Delete plugin storage data */ deleteData?: boolean; } /** * Search the marketplace catalog. * Proxied through /_emdash/api/admin/plugins/marketplace */ declare function searchMarketplace(opts?: MarketplaceSearchOpts): Promise; /** * Get full plugin detail. * Proxied through /_emdash/api/admin/plugins/marketplace/:id */ declare function fetchMarketplacePlugin(id: string): Promise; /** * Install a plugin from the marketplace. * POST /_emdash/api/admin/plugins/marketplace/:id/install */ declare function installMarketplacePlugin(id: string, opts?: InstallPluginOpts): Promise; /** * Update a marketplace plugin to a newer version. * POST /_emdash/api/admin/plugins/:id/update */ declare function updateMarketplacePlugin(id: string, opts?: UpdatePluginOpts): Promise; /** * Uninstall a marketplace plugin. * POST /_emdash/api/admin/plugins/:id/uninstall */ declare function uninstallMarketplacePlugin(id: string, opts?: UninstallPluginOpts): Promise; /** * Check all marketplace plugins for available updates. * GET /_emdash/api/admin/plugins/updates */ declare function checkPluginUpdates(): Promise; declare const CAPABILITY_LABELS: Record; /** * Get a human-readable description for a capability. * For scoped network capabilities, appends the allowed hosts if provided. * * Module-scope so calls outside React components work; uses the global i18n * instance for translation. Components that have access to `useLingui` can * also resolve `CAPABILITY_LABELS[capability]` directly with `t(...)` if they * need the translated string without the host suffix. */ declare function describeCapability(capability: string, allowedHosts?: string[]): string; //#endregion //#region src/lib/api/email-settings.d.ts /** * Email settings API client functions */ interface EmailProvider { pluginId: string; } interface EmailSettings { available: boolean; providers: EmailProvider[]; selectedProviderId: string | null; middleware: { beforeSend: string[]; afterSend: string[]; }; } declare function fetchEmailSettings(): Promise; declare function sendTestEmail(to: string): Promise<{ success: boolean; message: string; }>; //#endregion //#region src/lib/api/theme-marketplace.d.ts /** * Theme Marketplace API client * * Calls the site-side proxy endpoints (/_emdash/api/admin/themes/marketplace/*) * which forward to the marketplace Worker. The preview signing endpoint * is local (/_emdash/api/themes/preview). */ interface ThemeAuthor { name: string; verified: boolean; avatarUrl: string | null; } interface ThemeAuthorDetail extends ThemeAuthor { id: string; } /** Summary shown in browse cards */ interface ThemeSummary { id: string; name: string; description: string | null; author: ThemeAuthor; keywords: string[]; previewUrl: string; demoUrl: string | null; hasThumbnail: boolean; thumbnailUrl: string | null; createdAt: string; updatedAt: string; } /** Full detail returned by GET /themes/:id */ interface ThemeDetail extends Omit { author: ThemeAuthorDetail; repositoryUrl: string | null; homepageUrl: string | null; license: string | null; screenshotCount: number; screenshotUrls: string[]; } interface ThemeSearchResult { items: ThemeSummary[]; nextCursor?: string; } interface ThemeSearchOpts { q?: string; keyword?: string; sort?: "name" | "created" | "updated"; cursor?: string; limit?: number; } /** * Search theme listings. * Proxied through /_emdash/api/admin/themes/marketplace */ declare function searchThemes(opts?: ThemeSearchOpts): Promise; /** * Get full theme detail. * Proxied through /_emdash/api/admin/themes/marketplace/:id */ declare function fetchTheme(id: string): Promise; /** * Generate a signed preview URL for the "Try with my data" flow. * POST /_emdash/api/themes/preview (local, not proxied) */ declare function generatePreviewUrl(previewUrl: string): Promise; //#endregion //#region src/lib/api/redirects.d.ts /** * Redirects API client */ interface Redirect { id: string; source: string; destination: string; type: number; isPattern: boolean; enabled: boolean; hits: number; lastHitAt: string | null; groupName: string | null; auto: boolean; createdAt: string; updatedAt: string; } interface NotFoundSummary { path: string; count: number; lastSeen: string; topReferrer: string | null; } interface CreateRedirectInput { source: string; destination: string; type?: number; enabled?: boolean; groupName?: string | null; } interface UpdateRedirectInput { source?: string; destination?: string; type?: number; enabled?: boolean; groupName?: string | null; } interface RedirectListOptions { cursor?: string; limit?: number; search?: string; group?: string; enabled?: boolean; auto?: boolean; } interface RedirectListResult { items: Redirect[]; nextCursor?: string; loopRedirectIds?: string[]; } /** * List redirects with optional filters */ declare function fetchRedirects(options?: RedirectListOptions): Promise; /** * Create a redirect */ declare function createRedirect(input: CreateRedirectInput): Promise; /** * Update a redirect */ declare function updateRedirect(id: string, input: UpdateRedirectInput): Promise; /** * Delete a redirect */ declare function deleteRedirect(id: string): Promise; /** * Fetch 404 summary (grouped by path, sorted by count) */ declare function fetch404Summary(limit?: number): Promise; //#endregion //#region src/components/Dashboard.d.ts interface DashboardProps { manifest: AdminManifest; } /** * Admin dashboard — quick actions, status, collections, recent activity. */ declare function Dashboard({ manifest }: DashboardProps): react_jsx_runtime0.JSX.Element; //#endregion //#region src/components/ContentList.d.ts /** Sortable content list columns. Maps to the server's order field whitelist. */ type ContentListSortField = "title" | "status" | "locale" | "updatedAt"; interface ContentListSort { field: ContentListSortField; direction: "asc" | "desc"; } /** Status filter values. `"all"` clears the status filter. */ type ContentStatusFilter = "all" | "published" | "draft" | "scheduled" | "archived"; /** * Date-range filter state. `from`/`to` are raw `YYYY-MM-DD` values from the * date inputs (empty string = unset); the parent converts them to UTC day * boundaries before calling the API. */ interface ContentDateFilter { field: ContentDateField; from: string; to: string; } interface ContentListProps { collection: string; collectionLabel: string; items: ContentItem[]; trashedItems?: TrashedContentItem[]; isLoading?: boolean; isTrashedLoading?: boolean; onDelete?: (id: string) => void; onDuplicate?: (id: string) => void; onRestore?: (id: string) => void; onPermanentDelete?: (id: string) => void; onLoadMore?: () => void; onLoadMoreTrashed?: () => void; hasMore?: boolean; hasMoreTrashed?: boolean; trashedCount?: number; /** i18n config — present when multiple locales are configured */ i18n?: { defaultLocale: string; locales: string[]; }; /** Currently active locale filter */ activeLocale?: string; /** Callback when locale filter changes */ onLocaleChange?: (locale: string) => void; /** URL pattern for published content links (e.g. `/blog/{slug}`) */ urlPattern?: string; /** * Controlled sort state. When `onSortChange` is also provided, the column * headers become sort controls that invoke it. Uncontrolled sort keeps * the backward-compatible "static headers, server-default ordering" * behavior for callers that haven't opted in yet. */ sort?: ContentListSort; onSortChange?: (sort: ContentListSort) => void; /** * Total rows matching the current filters (ignoring pagination). When * set, the pagination denominator reflects this stable count instead of * growing as more API pages are fetched. */ total?: number; /** * When provided, search is performed server-side: the (debounced) query is * reported here so the caller can refetch, and `items`/`total` are assumed * to already reflect the filter. Without it, the list falls back to * filtering the loaded page client-side (legacy behavior). */ onSearchChange?: (q: string) => void; /** * Filter controls. The whole bar is opt-in: it only renders when * `onStatusFilterChange` is provided, keeping the component * backward-compatible for callers that haven't wired filters yet. Each * control renders independently based on the presence of its callback * (and, for the author filter, a non-empty `authors` list). */ statusFilter?: ContentStatusFilter; onStatusFilterChange?: (status: ContentStatusFilter) => void; /** Authors who have content in this collection, for the author filter. */ authors?: ContentAuthor[]; /** Selected author id; empty string means "all authors". */ authorFilter?: string; onAuthorFilterChange?: (authorId: string) => void; /** Controlled date-range filter state. */ dateFilter?: ContentDateFilter; onDateFilterChange?: (filter: ContentDateFilter) => void; /** * Bulk actions. Each is opt-in: the selection checkboxes only appear when at * least one bulk handler is provided, and each toolbar button renders only * when its handler is present. Handlers receive the selected entry ids and * resolve with the ids that failed (empty array on full success); those * rows stay selected so a partial failure can be retried. */ onBulkPublish?: BulkActionHandler; onBulkUnpublish?: BulkActionHandler; onBulkDelete?: BulkActionHandler; } type BulkActionHandler = (ids: string[]) => Promise; /** * Content list view with table display and trash tab */ declare function ContentList({ collection, collectionLabel, items, trashedItems, isLoading, isTrashedLoading, onDelete, onDuplicate, onRestore, onPermanentDelete, onLoadMore, onLoadMoreTrashed, hasMore, hasMoreTrashed, trashedCount, i18n, activeLocale, onLocaleChange, urlPattern, sort, onSortChange, total, onSearchChange, statusFilter, onStatusFilterChange, authors, authorFilter, onAuthorFilterChange, dateFilter, onDateFilterChange, onBulkPublish, onBulkUnpublish, onBulkDelete }: ContentListProps): react_jsx_runtime0.JSX.Element; //#endregion //#region src/components/editor/PluginBlockNode.d.ts /** * Plugin block definition for slash commands */ interface PluginBlockDef { type: string; pluginId: string; label: string; icon?: string; description?: string; placeholder?: string; /** Block Kit form fields. If declared, replaces the simple URL input. */ fields?: Element[]; /** * Optional display category in the slash menu. Defaults to "Embeds" when omitted. */ category?: string; } //#endregion //#region src/components/PortableTextEditor.d.ts interface PortableTextSpan { _type: "span"; _key: string; text: string; marks?: string[]; } interface PortableTextMarkDef { _type: string; _key: string; [key: string]: unknown; } interface PortableTextTextBlock { _type: "block"; _key: string; style?: "normal" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "blockquote"; listItem?: "bullet" | "number"; level?: number; children: PortableTextSpan[]; markDefs?: PortableTextMarkDef[]; textAlign?: "left" | "center" | "right" | "justify"; } interface PortableTextImageBlock { _type: "image"; _key: string; asset: { _ref: string; url?: string; meta?: Record; }; alt?: string; caption?: string; width?: number; height?: number; /** LQIP blurhash — first-class field (legacy snapshots store it in `asset.meta`). */ blurhash?: string; /** LQIP dominant color — first-class field (legacy snapshots store it in `asset.meta`). */ dominantColor?: string; displayWidth?: number; displayHeight?: number; alignment?: "left" | "center" | "right" | "wide" | "full"; } interface PortableTextCodeBlock { _type: "code"; _key: string; code: string; language?: string; } interface PortableTextHtmlBlock { _type: "htmlBlock"; _key: string; html: string; } type PortableTextBlock = PortableTextTextBlock | PortableTextImageBlock | PortableTextCodeBlock | PortableTextHtmlBlock | { _type: string; _key: string; [key: string]: unknown; }; /** Focus mode state for the editor */ type FocusMode = "normal" | "spotlight"; /** Describes a block sidebar panel request from a node view */ interface BlockSidebarPanel { type: string; attrs: Record; onUpdate: (attrs: Record) => void; onReplace: (attrs: Record) => void; onDelete: () => void; onClose: () => void; } interface PortableTextEditorProps { value?: PortableTextBlock[]; onChange?: (value: PortableTextBlock[]) => void; placeholder?: string; className?: string; editable?: boolean; /** ID of label element for accessibility */ "aria-labelledby"?: string; /** Plugin blocks available for insertion via slash commands */ pluginBlocks?: PluginBlockDef[]; /** Focus mode - controlled from parent for distraction-free mode coordination */ focusMode?: FocusMode; /** Callback when focus mode changes */ onFocusModeChange?: (mode: FocusMode) => void; /** Callback to receive the editor instance for external integrations. * Called with the editor on mount, and with `null` on unmount so consumers * can clear stale references (e.g. before the next instance mounts). */ onEditorReady?: (editor: Editor | null) => void; /** Minimal chrome - hides toolbar, border, footer (distraction-free mode) */ minimal?: boolean; /** Callback when a block node requests sidebar space (e.g. image settings) */ onBlockSidebarOpen?: (panel: BlockSidebarPanel) => void; /** Callback when a block node closes its sidebar */ onBlockSidebarClose?: () => void; } /** * Portable Text Editor Component */ declare function PortableTextEditor({ value, onChange, placeholder, className, editable, "aria-labelledby": ariaLabelledby, pluginBlocks, focusMode: controlledFocusMode, onFocusModeChange, onEditorReady, minimal, onBlockSidebarOpen, onBlockSidebarClose }: PortableTextEditorProps): react_jsx_runtime0.JSX.Element; //#endregion //#region src/components/ContentEditor.d.ts interface FieldDescriptor { id?: string; kind: string; label?: string; required?: boolean; /** * For `select` / `multiSelect`: the list of enum choices. * For `json` fields driven by a plugin `widget`: arbitrary widget config. */ options?: Array<{ value: string; label: string; }> | Record; widget?: string; validation?: Record; } /** Simplified user info for current user context */ interface CurrentUserInfo { id: string; role: number; } interface ContentEditorProps { collection: string; collectionLabel: string; item?: ContentItem | null; fields: Record; isNew?: boolean; /** * Locale this entry is bound to. For existing entries this matches * `item.locale`; for new entries it's the URL `?locale=` (or default). * Threaded into the byline picker so the empty-state CTA links to the * right locale on the Bylines manager. */ entryLocale?: string | null; /** Whether any content update is pending. Preserves main's operation gating. */ isSaving?: boolean; /** Whether the current entry's editor save should drive visual feedback. */ isSaveFeedbackActive?: boolean; onSave?: (payload: { data: Record; slug?: string; bylines?: BylineCreditInput[]; }) => void; /** Callback for autosave (debounced, skips revision creation) */ onAutosave?: (payload: { data: Record; slug?: string; bylines?: BylineCreditInput[]; }) => void; /** Whether autosave is in progress */ isAutosaving?: boolean; /** Whether the current entry's autosave should drive visual feedback. */ isAutosaveFeedbackActive?: boolean; /** Entry-scoped token advanced after a successful autosave. */ autosaveCompletionToken?: number; onPublish?: () => void; onUnpublish?: () => void; /** Callback to discard draft changes (revert to published version) */ onDiscardDraft?: () => void; /** Callback to schedule for future publishing */ onSchedule?: (scheduledAt: string) => void; /** Callback to cancel scheduling (revert to draft) */ onUnschedule?: () => void; /** Whether scheduling is in progress */ isScheduling?: boolean; /** Whether this collection supports drafts */ supportsDrafts?: boolean; /** Whether this collection supports revisions */ supportsRevisions?: boolean; /** Whether this collection supports preview */ supportsPreview?: boolean; /** Current user (for permission checks) */ currentUser?: CurrentUserInfo; /** Available users for author selection (only shown to editors+) */ users?: UserListItem[]; /** Callback when author is changed */ onAuthorChange?: (authorId: string | null) => void; /** Available byline profiles */ availableBylines?: BylineSummary[]; /** Whether the parent's byline picker query has resolved. Suppresses the empty-state flash before first fetch. */ availableBylinesLoaded?: boolean; /** Selected byline credits (controlled for new entries) */ selectedBylines?: BylineCreditInput[]; /** Callback when byline credits are changed */ onBylinesChange?: (bylines: BylineCreditInput[]) => void; /** Callback for creating a byline inline from the editor */ onQuickCreateByline?: (input: { slug: string; displayName: string; }) => Promise; /** Callback for updating a byline inline from the editor */ onQuickEditByline?: (bylineId: string, input: { slug: string; displayName: string; }) => Promise; /** Callback when item is deleted (moved to trash) */ onDelete?: () => void; /** Whether delete is in progress */ isDeleting?: boolean; /** i18n config — present when multiple locales are configured */ i18n?: { defaultLocale: string; locales: string[]; }; /** Existing translations for this content item */ translations?: TranslationSummary[]; /** Callback to create a translation for a locale */ onTranslate?: (locale: string) => void; /** Plugin block types available for insertion in Portable Text fields */ pluginBlocks?: PluginBlockDef[]; /** Whether this collection has SEO fields enabled */ hasSeo?: boolean; /** Callback when SEO fields change */ onSeoChange?: (seo: ContentSeoInput) => void; /** Admin manifest for resolving plugin field widgets */ manifest?: AdminManifest | null; } /** * Content editor with dynamic field rendering */ declare function ContentEditor({ collection, collectionLabel, item, fields, isNew, entryLocale, isSaving, isSaveFeedbackActive, onSave, onAutosave, isAutosaving, isAutosaveFeedbackActive, autosaveCompletionToken, onPublish, onUnpublish, onDiscardDraft, onSchedule, onUnschedule, isScheduling, supportsDrafts, supportsRevisions, supportsPreview, currentUser, users, onAuthorChange, availableBylines, availableBylinesLoaded, selectedBylines, onBylinesChange, onQuickCreateByline, onQuickEditByline, onDelete, isDeleting, i18n, translations, onTranslate, pluginBlocks, hasSeo, onSeoChange, manifest }: ContentEditorProps): react_jsx_runtime0.JSX.Element; //#endregion //#region src/components/MediaLibrary.d.ts interface MediaLibraryProps { items?: MediaItem[]; isLoading?: boolean; onUpload?: (file: File) => Promise | void; onSelect?: (item: MediaItem) => void; onItemUpdated?: () => void; /** True when more local-library items can be fetched via cursor pagination */ hasMore?: boolean; /** Triggered to fetch the next page of local-library items */ onLoadMore?: () => void; /** Called (debounced) with the filename search term for the local library. */ onLocalSearchChange?: (q: string) => void; /** Called with the MIME filter for the local library (undefined = all types). */ onLocalMimeFilterChange?: (mimeType: string | string[] | undefined) => void; } /** * Media library component with upload, provider tabs, and grid view */ declare function MediaLibrary({ items, isLoading, onUpload, onItemUpdated, hasMore, onLoadMore, onLocalSearchChange, onLocalMimeFilterChange }: MediaLibraryProps): react_jsx_runtime0.JSX.Element; //#endregion //#region src/components/MediaPickerModal.d.ts interface MediaPickerModalProps { open: boolean; onOpenChange: (open: boolean) => void; onSelect: (item: MediaItem) => void; /** Allow selecting several items at once; confirms through `onSelectMany`. */ multiple?: boolean; /** Called instead of `onSelect` when `multiple` is set. */ onSelectMany?: (items: MediaItem[]) => void; /** Filter by mime type prefix, e.g. "image/" */ mimeTypeFilter?: string; title?: string; /** * Hide the "Insert from URL" input. Defaults to false. * The URL input probes image dimensions and is only meaningful for image pickers, * so non-image pickers (e.g. generic file pickers) should hide it. */ hideUrlInput?: boolean; /** * What kind of media this picker is for. Drives user-facing copy * (default title, empty-state message, upload button label, empty-state icon). * Defaults to "image" — set to "file" for generic file pickers. */ mediaKind?: "image" | "file"; /** MIME allowlist — array of exact MIMEs or `type/` prefixes. */ mimeTypeFilters?: string[]; /** `_emdash_fields` row id for server-side MIME widening. */ fieldId?: string; /** * Restrict the picker to the local Library only — hides the "Insert from URL" * input and suppresses external provider tabs. * * Use this for fields whose storage model only persists a local `mediaId`. * Selecting an external URL or provider item would return an item the * server cannot later resolve back to a URL (the `id` is either empty * for "Insert from URL" or a provider-namespaced string that won't match * a row in the `media` table). Site settings (logo, favicon, * `seo.defaultOgImage`) are the canonical callers. */ localOnly?: boolean; } declare function MediaPickerModal({ open, onOpenChange, onSelect, multiple, onSelectMany, mimeTypeFilter, mimeTypeFilters, fieldId, title: providedTitle, hideUrlInput, mediaKind, localOnly }: MediaPickerModalProps): react_jsx_runtime0.JSX.Element; //#endregion //#region src/components/Settings.d.ts /** * Settings hub page — links to all settings sub-pages. */ declare function Settings(): react_jsx_runtime0.JSX.Element; //#endregion //#region src/components/SaveButton.d.ts interface SaveButtonProps extends Omit, "children" | "shape"> { isDirty: boolean; isSaving: boolean; announce?: boolean; } declare function SaveButton({ isDirty, isSaving, announce, className, disabled, icon, loading, variant, "aria-label": ariaLabel, ...props }: SaveButtonProps): react_jsx_runtime0.JSX.Element; //#endregion //#region src/components/EditorHeader.d.ts interface EditorHeaderProps { /** Optional leading element, typically a back-link or close button. */ leading?: React$1.ReactNode; /** Header title content. Pass a heading element so semantics are correct. */ children: React$1.ReactNode; /** Right-aligned action area (Save, Publish, etc.). */ actions?: React$1.ReactNode; className?: string; } /** * Editor header with consistent placement of save / primary actions. * * Usage: * * } * actions={} * > *

{title}

*
*/ declare function EditorHeader({ leading, children, actions, className }: EditorHeaderProps): react_jsx_runtime0.JSX.Element; //#endregion //#region src/components/auth/PasskeyRegistration.d.ts /** * PasskeyRegistration - WebAuthn credential registration component * * Handles the passkey registration flow: * 1. Fetches registration options from server * 2. Triggers browser's WebAuthn credential creation * 3. Sends attestation back to server for verification * * Used in: * - Setup wizard (first admin creation) * - User settings (adding additional passkeys) */ interface PasskeyRegistrationProps { /** Endpoint to get registration options */ optionsEndpoint: string; /** Endpoint to verify registration */ verifyEndpoint: string; /** Called on successful registration */ onSuccess: (response: unknown) => void; /** Called on error */ onError?: (error: Error) => void; /** Button text */ buttonText?: string; /** Show passkey name input */ showNameInput?: boolean; /** Additional data to send with requests */ additionalData?: Record; } /** * PasskeyRegistration Component */ declare function PasskeyRegistration({ optionsEndpoint, verifyEndpoint, onSuccess, onError, buttonText, showNameInput, additionalData }: PasskeyRegistrationProps): react_jsx_runtime0.JSX.Element; //#endregion //#region src/components/auth/PasskeyLogin.d.ts /** * PasskeyLogin - WebAuthn authentication component * * Handles the passkey login flow: * 1. Fetches authentication options from server * 2. Triggers browser's WebAuthn credential assertion * 3. Sends assertion back to server for verification * * Supports: * - Discoverable credentials (passkey autofill) * - Non-discoverable credentials (email-first flow) */ interface PasskeyLoginProps { /** Endpoint to get authentication options */ optionsEndpoint: string; /** Endpoint to verify authentication */ verifyEndpoint: string; /** Called on successful authentication */ onSuccess: (response: unknown) => void; /** Called on error */ onError?: (error: Error) => void; /** Show email input for non-discoverable flow */ showEmailInput?: boolean; /** Button text */ buttonText?: string; } /** * PasskeyLogin Component */ declare function PasskeyLogin({ optionsEndpoint, verifyEndpoint, onSuccess, onError, showEmailInput, buttonText }: PasskeyLoginProps): react_jsx_runtime0.JSX.Element; //#endregion //#region src/components/LoginPage.d.ts /** * Login Page - Standalone login page for the admin * * This component is NOT wrapped in the admin Shell. * It's a standalone page for authentication. * * Supports: * - Passkey authentication (always available) * - Pluggable auth providers (AT Protocol, GitHub, Google, etc.) when configured * - Magic link (email) when configured * * When external auth (e.g., Cloudflare Access) is configured, this page * redirects to the admin dashboard since authentication is handled externally. */ interface LoginPageProps { /** URL to redirect to after successful login */ redirectUrl?: string; } declare function LoginPage({ redirectUrl }: LoginPageProps): react_jsx_runtime0.JSX.Element; //#endregion //#region src/components/SetupWizard.d.ts /** * Setup Wizard - Multi-step first-run setup page * * This component is NOT wrapped in the admin Shell. * It's a standalone page for initial site configuration. * * Steps: * 1. Site Configuration (title, tagline, sample content) * 2. Create admin account — user picks any available auth method: * - Passkey (always available) * - Any configured auth provider (AT Protocol, GitHub, Google, etc.) */ declare function SetupWizard(): react_jsx_runtime0.JSX.Element | null; //#endregion //#region src/lib/utils.d.ts /** * Merge class names with Tailwind CSS support */ declare function cn(...inputs: ClassValue[]): string; //#endregion export { API_BASE, API_TOKEN_SCOPES, AdminApp, AdminApp as App, type AdminBranding, type AdminComment, type AdminManifest, type AllowedDomain, type ApiTokenCreateResult, type ApiTokenInfo, type ApiTokenScopeValue, type AttachmentInfo, type AuthProviderModule, AuthProviderProvider, type AuthProviders, type AuthorMapping, type BulkAction, type BylineCreditInput, type BylineCustomFieldValue, type BylineFieldDefinition, type BylineFieldType, type BylineFieldUsage, type BylineFieldValidation, type BylineInput, type BylineSummary, type BylineTranslationInput, CAPABILITY_LABELS, type CollectionSchemaStatus, type CollectionStats, type CommentCounts, type CommentStatus, type ContentAuthor, type ContentDateField, ContentEditor, type ContentEditorProps, type ContentItem, ContentList, type ContentListProps, type ContentSeo, type ContentSeoInput, type CreateAllowedDomainInput, type CreateApiTokenInput, type CreateBylineFieldInput, type CreateCollectionInput, type CreateContentInput, type CreateFieldInput, type CreateMenuInput, type CreateMenuItemInput, type CreateRedirectInput, type CreateSectionInput, type CreateTaxonomyInput, type CreateTermInput, type CreateWidgetAreaInput, type CreateWidgetInput, type CurrentUser, type CustomTaxonomy, DEFAULT_LOCALE, Dashboard, type DashboardProps, type DashboardStats, EditorHeader, type EditorHeaderProps, type EmailProvider, type EmailSettings, type FieldCompatibility, type FieldDescriptor, type FieldType, type FindManyResult, type GetSectionsOptions, Header, type ImportConfig, type ImportFieldDef, type ImportResult, type InstallPluginOpts, type InviteVerifyResult, Link, LoginPage, MEDIA_SEARCH_MAX_LENGTH, type MarketplaceAuditSummary, type MarketplaceAuthor, type MarketplaceImageAuditSummary, type MarketplacePluginDetail, type MarketplacePluginSummary, type MarketplaceSearchOpts, type MarketplaceSearchResult, type MarketplaceVersion, type MediaImportProgress, type MediaImportResult, type MediaItem, MediaLibrary, type MediaLibraryProps, MediaPickerModal, type MediaPickerModalProps, type MediaProviderCapabilities, type MediaProviderInfo, type MediaProviderItem, type Menu, type MenuItem, type LocaleOptions as MenuLocaleOptions, type MenuTranslation, type MenuTranslationsResponse, type MenuWithItems, type NavMenu, type NotFoundSummary, type OrphanedTable, type PasskeyInfo, PasskeyLogin, type PasskeyLoginProps, PasskeyRegistration, type PasskeyRegistrationProps, type PluginAdminModule, PluginAdminProvider, type PluginAdmins, type PluginInfo, type PluginUpdateInfo, PortableTextEditor, type PortableTextEditorProps, type PostTypeAnalysis, type PrepareRequest, type PrepareResult, type PreviewUrlResponse, type ProbeResult, type RecentItem, type Redirect, type RedirectListOptions, type RedirectListResult, type ReorderMenuItemsInput, type Revision, type RevisionListResponse, type RewriteUrlsResult, SUPPORTED_LOCALES, SUPPORTED_LOCALE_CODES, SaveButton, type SaveButtonProps, type SchemaCollection, type SchemaCollectionWithFields, type SchemaField, type SearchEnableResult, type Section, type SectionSource, type SectionsResult, type SettingField, Settings, SetupWizard, Shell, type ShellProps, KumoSidebar as Sidebar, SidebarNav, type SidebarNavProps, type SignupVerifyResult, type SiteSettings, type SourceAuth, type SourceCapabilities, type SourceProbeResult, type SuggestedAction, type LocaleDefinition as SupportedLocale, type TaxonomyDef, type TaxonomyTerm, type TermTranslation, type TermTranslationsResponse, type ThemeAuthor, type ThemeAuthorDetail, type ThemeDetail, type ThemeSearchOpts, type ThemeSearchResult, type ThemeSummary, type TranslationSummary, type TranslationsResponse, type TrashedContentItem, type UninstallPluginOpts, type UpdateAllowedDomainInput, type UpdateBylineFieldInput, type UpdateCollectionInput, type UpdateContentInput, type UpdateFieldInput, type UpdateMenuInput, type UpdateMenuItemInput, type UpdatePluginOpts, type UpdateRedirectInput, type UpdateSectionInput, type UpdateTermInput, type UpdateUserInput, type UpdateWidgetInput, type UserDetail, type UserListItem, type Widget, type WidgetArea, type WidgetComponent, type WpAuthorInfo, type WpImportProgress, type WpPluginAnalysis, type WxrAnalysis, analyzeWpPluginSite, analyzeWxr, apiFetch, bulkCommentAction, checkPluginUpdates, cn, compareRevisions, completeSignup, createAdminRouter, createAllowedDomain, createApiToken, createByline, createBylineField, createBylineTranslation, createCollection, createContent, createField, createMenu, createMenuItem, createMenuTranslation, createRedirect, createSection, createTaxonomy, createTerm, createTermTranslation, createWidget, createWidgetArea, deleteAllowedDomain, deleteByline, deleteBylineField, deleteCollection, deleteComment, deleteContent, deleteField, deleteFromProvider, deleteMedia, deleteMenu, deleteMenuItem, deletePasskey, deleteRedirect, deleteSection, deleteTerm, deleteWidget, deleteWidgetArea, describeCapability, disablePlugin, disableUser, discardDraft, duplicateContent, enablePlugin, enableUser, executeWpPluginImport, executeWxrImport, fetch404Summary, fetchAllowedDomains, fetchApiTokens, fetchAuthMode, fetchByline, fetchBylineTranslations, fetchBylines, fetchCollection, fetchCollections, fetchComment, fetchCommentCounts, fetchComments, fetchContent, fetchContentAuthors, fetchContentList, fetchDashboardStats, fetchEmailSettings, fetchFields, fetchManifest, fetchMarketplacePlugin, fetchMediaItem, fetchMediaList, fetchMediaProviders, fetchMenu, fetchMenuTranslations, fetchMenus, fetchOrphanedTables, fetchPasskeys, fetchPlugin, fetchPluginSettings, fetchPlugins, fetchProviderMedia, fetchRedirects, fetchRevision, fetchRevisions, fetchSection, fetchSections, fetchSettings, fetchTaxonomyDef, fetchTaxonomyDefs, fetchTermTranslations, fetchTerms, fetchTheme, fetchTranslations, fetchTrashedContent, fetchUser, fetchUsers, fetchWidgetArea, fetchWidgetAreas, fetchWidgetComponents, generatePreviewUrl, getBylineFieldUsage, getDraftStatus, getPreviewUrl, hasAllowedDomains, importWxrMedia, importWxrMediaBatched, installMarketplacePlugin, inviteUser, listBylineFields, parseApiResponse, permanentDeleteContent, prepareWxrImport, probeImportUrl, publishContent, registerOrphanedTable, renamePasskey, reorderBylineFields, reorderFields, reorderMenuItems, reorderWidgets, requestSignup, resolveLocale, restoreContent, restoreRevision, revokeApiToken, rewriteContentUrls, scheduleContent, searchMarketplace, searchThemes, sendRecoveryLink, sendTestEmail, setPluginMcpEnabled, setSearchEnabled, throwResponseError, uninstallMarketplacePlugin, unpublishContent, unscheduleContent, updateAllowedDomain, updateByline, updateBylineField, updateCollection, updateCommentStatus, updateContent, updateField, updateMarketplacePlugin, updateMedia, updateMenu, updateMenuItem, updatePluginSettings, updateRedirect, updateSection, updateSettings, updateTerm, updateUser, updateWidget, uploadMedia, uploadToProvider, useAuthProviderList, useAuthProviders, useCurrentUser, useLocale, useNavigate, useParams, usePluginAdmins, usePluginField, usePluginHasPages, usePluginHasWidgets, usePluginPage, usePluginWidget, validateInviteToken, verifySignupToken }; //# sourceMappingURL=index.d.ts.map