import { C as VIEW_CONTRACT_VERSION, D as ViewSurface, E as ViewDeclaration, F as defineWindowView, M as definePanelView, N as defineTileView, O as WebWorker, P as defineWebWorker, S as TileView, T as ViewComponentBaseProps, _ as DockGroup, a as WorkbenchApp, b as ServiceType, c as isWorkbenchApp, d as AssetSourceView, f as DefineAssetSourceViewInput, g as DefineWindowViewInput, h as DefineWebWorkerInput, i as MediaLibraryField, j as defineAssetSourceView, k as WindowView, l as isWorkbenchConfig, m as DefineTileViewInput, n as DefineAppResult, o as WorkbenchConfig, p as DefinePanelViewInput, r as DefineMediaLibraryInput, s as defineApplication, t as DefineAppInput, u as unstable_defineMediaLibrary, v as PanelView, w as ViewComponent, x as TileSize, y as SERVICE_CONTRACT_VERSION } from "./defineApp-DOJE2kjo.js";
import { AssetSourceComponentProps } from "@sanity/types";
/**
 * The service's own declaration, surfaced to the callback.
 * @public
 */
interface ServiceInfo {
  readonly name: string;
  readonly type: string;
}
/**
 * Context every service callback receives when its worker starts. Mirrors how a
 * view component receives its `view` — the service receives its own `service`.
 * @public
 */
interface ServiceContext {
  readonly service: ServiceInfo;
}
/**
 * A service callback. Runs once inside the worker on start; returns an optional
 * disposer the host calls before terminating the worker.
 * @public
 */
type ServiceCallback = (context: ServiceContext) => (() => void) | void;
/** The callback shape each service type defines, keyed by type. */
interface ServiceCallbacksByType {
  worker: ServiceCallback;
}
/**
 * The result of `unstable_defineService`: the author's callback, the service
 * type, and the internal contract version the worker artifact targets.
 * @public
 */
interface DefinedService<TType extends ServiceType = ServiceType> {
  readonly run: ServiceCallbacksByType[TType];
  readonly type: TType;
  /** @internal */
  readonly version: typeof SERVICE_CONTRACT_VERSION;
}
/**
 * Define a Sanity Dashboard background service. The first argument narrows the
 * callback shape — `"worker"` runs the callback inside a Web Worker, where it
 * can emit dock-badge updates and return a disposer.
 *
 * Identity at runtime: returns the callback tagged with its type and the contract
 * version, for the CLI build to generate a worker artifact from. Used as the
 * default export of a service's `src` file.
 * @public
 */
declare function unstable_defineService<TType extends ServiceType>(type: TType, run: ServiceCallbacksByType[TType]): DefinedService<TType>;
/** @public */
type WindowViewProps = ViewComponentBaseProps<{
  name: string;
  src: string;
  surface: 'window';
  title: string;
}>;
/**
 * Props a panel component receives: its interface record, minus the
 * service-assigned `id`/`deployment_id` a local dev server can't provide. Mirrors
 * the `panel` record the workbench host renders from (the wire format owned by
 * `@sanity/workbench`); drift is guarded by the stamped contract version.
 * @public
 */
type PanelViewProps = ViewComponentBaseProps<{
  name: string;
  src: string;
  surface: 'panel';
  title: string;
}>;
/**
 * The component slots a `panel` view exposes — each its own module-federation
 * island, typed with the panel props.
 * @public
 */
interface PanelViewComponents {
  panel: ViewComponent<PanelViewProps>;
  title: ViewComponent<PanelViewProps>;
}
/**
 * A panel's view-component slot — the module-federation expose for one island.
 * @public
 */
type PanelComponent = keyof PanelViewComponents;
/**
 * The component slots an `asset_source` view exposes — a single picker island,
 * typed with the studio asset-source props it renders behind. The props are
 * `@sanity/types`' `AssetSourceComponentProps` directly, so an authored picker
 * receives exactly what a studio `AssetSource.component` does.
 * @public
 */
interface AssetSourceViewComponents {
  asset_source: ViewComponent<AssetSourceComponentProps>;
}
/**
 * An asset source's view-component slot — the module-federation expose for its
 * one island.
 * @public
 */
type AssetSourceComponent = keyof AssetSourceViewComponents;
/**
 * Props a tile component receives: its own interface record plus its footprint
 * `size`, so it can render per family. Mirrors the
 * `tile` record the dashboard host renders from; drift is guarded by the stamped
 * contract version. Placement `order` is host-only metadata, not surfaced here.
 * @public
 */
type TileViewProps = ViewComponentBaseProps<{
  name: string;
  size: TileSize;
  src: string;
  surface: 'tile';
  title: string;
}>;
/**
 * The component slot a `tile` view exposes — a single island, typed with the
 * tile props.
 * @public
 */
interface TileViewComponents {
  tile: ViewComponent<TileViewProps>;
}
/**
 * A tile's view-component slot — the module-federation expose for its one island.
 * @public
 */
type TileComponent = keyof TileViewComponents;
/**
 * The components each view surface exposes.
 * @public
 */
interface ViewComponentsBySurface {
  asset_source: AssetSourceViewComponents;
  panel: PanelViewComponents;
  tile: TileViewComponents;
  window: ViewComponent<WindowViewProps>;
}
/**
 * The result of `unstable_defineView`: the author's component(s), the view surface,
 * and the internal contract version the build artifact targets.
 * @public
 */
interface DefinedView<TSurface extends ViewSurface = ViewSurface> {
  readonly components: ViewComponentsBySurface[TSurface];
  readonly surface: TSurface;
  /** @internal */
  readonly version: typeof VIEW_CONTRACT_VERSION;
}
/**
 * Define a Sanity Dashboard view. The first argument narrows the component shape
 * and the props each component receives — `"panel"` yields a `{title, panel}`
 * record whose components are typed with the panel props.
 *
 * Returns the component(s) tagged with their surface and contract version, for
 * the CLI build to generate render artifacts from. Used as the default export of
 * a view's `src` file.
 * @public
 */
declare function unstable_defineView<TSurface extends ViewSurface>(surface: TSurface, components: ViewComponentsBySurface[TSurface]): DefinedView<TSurface>;
export { type AssetSourceComponent, type AssetSourceView, type AssetSourceViewComponents, type DefineAppInput, type DefineAppResult, type DefineAssetSourceViewInput, type DefineMediaLibraryInput, type DefinePanelViewInput, type DefineTileViewInput, type DefineWebWorkerInput, type DefineWindowViewInput, type DefinedService, type DefinedView, type DockGroup, type MediaLibraryField, type PanelComponent, type PanelView, type PanelViewComponents, type PanelViewProps, type ServiceCallback, type ServiceContext, type ServiceInfo, type ServiceType, type TileComponent, type TileSize, type TileView, type TileViewComponents, type TileViewProps, type ViewComponentsBySurface, type ViewDeclaration, type ViewSurface, type WebWorker, type WindowView, type WindowViewProps, type WorkbenchApp, type WorkbenchConfig, defineApplication, defineAssetSourceView, definePanelView, defineTileView, defineWebWorker, defineWindowView, isWorkbenchApp, isWorkbenchConfig, unstable_defineMediaLibrary, unstable_defineService, unstable_defineView };
//# sourceMappingURL=index.d.ts.map