declare module 'alinea/adapter/core/cms' {

  import { CMS } from 'alinea/core/CMS';
  import type { Config } from 'alinea/core/Config';
  import type { UploadResponse } from 'alinea/core/Connection';
  import type { AnyQueryResult, GraphQuery } from 'alinea/core/Graph';
  import type { Mutation } from 'alinea/core/db/Mutation';
  export class CoreCMS<Definition extends Config = Config> extends CMS<Definition> {
      sync(): Promise<string>;
      resolve<Query extends GraphQuery>(query: Query): Promise<AnyQueryResult<Query>>;
      mutate(mutations: Array<Mutation>): Promise<{
          sha: string;
      }>;
      prepareUpload(file: string): Promise<UploadResponse>;
  }
  export function createCMS<Definition extends Config>(config: Definition): CoreCMS<Definition>;
  
}

declare module 'alinea/adapter/core/handler' {

  export { createHandler } from 'alinea/backend/Handler';
  
}

declare module 'alinea/adapter/core/preview' {

  import type { CoreCMS } from 'alinea/adapter/core/cms';
  export function preview<T>(cms: CoreCMS, request: Request, run: () => Promise<T>): Promise<T>;
  
}

declare module 'alinea/adapter/core/previewContext' {

  import type { AsyncLocalStorage } from 'node:async_hooks';
  import type { ConnectionContext } from 'alinea/core/CMS';
  import type { CoreCMS } from 'alinea/adapter/core/cms';
  export const previewStore: WeakMap<CoreCMS<import("alinea/core/Config").Config>, AsyncLocalStorage<ConnectionContext>>;
  export function previewContext(cms: CoreCMS): ConnectionContext;
  
}

declare module 'alinea/adapter/next/cms' {

  import { CMS } from 'alinea/core/CMS';
  import type { Config } from 'alinea/core/Config';
  import type { UploadResponse } from 'alinea/core/Connection';
  import type { Mutation } from 'alinea/core/db/Mutation';
  import type { GraphQuery } from 'alinea/core/Graph';
  import type { User } from 'alinea/core/User';
  export interface PreviewProps {
      widget?: boolean;
      workspace?: string;
      root?: string;
  }
  export class NextCMS<Definition extends Config = Config> extends CMS<Definition> {
      #private;
      constructor(config: Definition);
      resolve<Query extends GraphQuery>(query: Query): Promise<any>;
      user(): Promise<User | undefined>;
      mutate(mutations: Array<Mutation>): Promise<{
          sha: string;
      }>;
      prepareUpload(file: string): Promise<UploadResponse>;
      previews: ({ widget, workspace, root }: PreviewProps) => Promise<import("react/jsx-runtime").JSX.Element | null>;
  }
  export function createCMS<Definition extends Config>(config: Definition): NextCMS<Definition>;
  
}

declare module 'alinea/adapter/next/context' {

  import { Config } from 'alinea/core/Config';
  import type { RequestContext } from 'alinea/core/Connection';
  export function requestContext(config: Config): Promise<RequestContext>;
  
}

declare module 'alinea/adapter/next/handler' {

  import { type BackendOptions } from 'alinea/backend/api/CreateBackend';
  import { type HandlerHooks } from 'alinea/backend/Handler';
  import type { RemoteConnection, RequestContext } from 'alinea/core/Connection';
  import { NextCMS } from 'alinea/adapter/next/cms';
  type Handler = (request: Request) => Promise<Response>;
  export interface NextHandlerOptions extends HandlerHooks {
      cms: NextCMS;
      backend?: BackendOptions;
      remote?: (context: RequestContext) => RemoteConnection;
  }
  export function createHandler(input: NextCMS | NextHandlerOptions): Handler;
  export {};
  
}

declare module 'alinea/adapter/next/previews' {

  export interface NextPreviewsProps {
      dashboardUrl: string;
      widget?: boolean;
      root?: string;
      workspace?: string;
  }
  export default function NextPreviews({ dashboardUrl, widget, root, workspace }: NextPreviewsProps): import("react/jsx-runtime").JSX.Element | null;
  /**
   * Wrapper around `router.refresh()` from `next/navigation` `useRouter()` to return Promise, and resolve after refresh completed
   * @returns Refresh function
   */
  export function useRouterRefresh(): () => Promise<unknown>;
  
}

declare module 'alinea/adapter/next/with-alinea' {

  import type { NextConfig } from 'next/dist/types.js';
  export function createCMS(): void;
  export function withAlinea(config: NextConfig): NextConfig;
  
}

declare module 'alinea/backend/api/BasicAuth' {

  import type { AuthApi, AuthedContext, RequestContext } from 'alinea/core/Connection';
  export interface Verifier {
      (username: string, password: string): boolean | Promise<boolean>;
  }
  export class BasicAuth implements AuthApi {
      #private;
      constructor(context: RequestContext, verify: Verifier);
      authenticate(request: Request): Promise<Response>;
      verify(request: Request): Promise<AuthedContext>;
  }
  
}

declare module 'alinea/backend/api/CreateBackend' {

  import type { Config } from 'alinea/core/Config';
  import type { RemoteConnection, RequestContext } from 'alinea/core/Connection';
  import * as driver from 'rado/driver';
  import { type GithubOptions } from 'alinea/backend/api/GithubApi';
  import { type OAuth2Options } from 'alinea/backend/api/OAuth2';
  export type AvailableDrivers = 'd1' | 'mysql2' | '@neondatabase/serverless' | '@vercel/postgres' | 'pg' | '@electric-sql/pglite' | 'sql.js' | '@libsql/client';
  type DatabaseClient<Driver extends AvailableDrivers> = Parameters<(typeof driver)[Driver]>[0];
  type DatabaseOption<Driver extends AvailableDrivers> = {
      driver: Driver;
      client: DatabaseClient<Driver>;
  };
  export type DatabaseDeclaration = DatabaseOption<'d1'> | DatabaseOption<'mysql2'> | DatabaseOption<'@neondatabase/serverless'> | DatabaseOption<'@vercel/postgres'> | DatabaseOption<'pg'> | DatabaseOption<'@electric-sql/pglite'> | DatabaseOption<'sql.js'> | DatabaseOption<'@libsql/client'>;
  export interface BackendOptions {
      auth?(username: string, password: string): boolean | Promise<boolean>;
      oauth2?: OAuth2Options;
      database: DatabaseDeclaration;
      github: GithubOptions;
  }
  export function createBackend(config: Config, options: BackendOptions): (context: RequestContext) => RemoteConnection;
  export function createRemote(...impl: Array<Partial<RemoteConnection>>): RemoteConnection;
  export {};
  
}

declare module 'alinea/backend/api/DatabaseApi' {

  import type { DraftsApi, RequestContext, UploadResponse, UploadsApi } from 'alinea/core/Connection';
  import { type Draft, type DraftKey } from 'alinea/core/Draft';
  import { type Database } from 'rado';
  export interface DatabaseOptions {
      db: Database;
  }
  export class DatabaseApi implements DraftsApi, UploadsApi {
      #private;
      constructor(context: RequestContext, { db }: DatabaseOptions);
      getDraft(draftKey: DraftKey): Promise<Draft | undefined>;
      storeDraft(draft: Draft): Promise<void>;
      prepareUpload(file: string): Promise<UploadResponse>;
      handleUpload(entryId: string, file: Blob): Promise<void>;
      previewUpload(entryId: string): Promise<Response>;
  }
  
}

declare module 'alinea/backend/api/GithubApi' {

  import type { CommitApi, HistoryApi, Revision, SyncApi } from 'alinea/core/Connection';
  import type { EntryRecord } from 'alinea/core/EntryRecord';
  import type { CommitRequest } from 'alinea/core/db/CommitRequest';
  import { GithubSource, type GithubSourceOptions } from 'alinea/core/source/GithubSource';
  export interface GithubOptions extends GithubSourceOptions {
      author?: {
          name: string;
          email: string;
      };
  }
  export class GithubApi extends GithubSource implements HistoryApi, CommitApi, SyncApi {
      #private;
      constructor(options: GithubOptions);
      write(request: CommitRequest): Promise<{
          sha: string;
      }>;
      revisions(file: string): Promise<Array<Revision>>;
      revisionData(file: string, revisionId: string): Promise<EntryRecord | undefined>;
  }
  
}

declare module 'alinea/backend/api/OAuth2' {

  import { Request, Response } from '@alinea/iso';
  import type { Config } from 'alinea/core/Config';
  import type { AuthApi, AuthedContext, RequestContext } from 'alinea/core/Connection';
  export interface OAuth2Options {
      /**
       * OAuth2 clientId
       */
      clientId: string;
      /**
       * OAuth2 clientSecret
       *
       * This is required when using the 'client_secret_basic' authenticationMethod
       * for the client_credentials and password flows, but not authorization_code
       * or implicit.
       */
      clientSecret?: string;
      /**
       * The JSON Web Key Set (JWKS) URI.
       */
      jwksUri: string;
      /**
       * The /authorize endpoint.
       *
       * Required only for the browser-portion of the authorization_code flow.
       */
      authorizationEndpoint: string;
      /**
       * The token endpoint.
       *
       * Required for most grant types and refreshing tokens.
       */
      tokenEndpoint: string;
      /**
       * Revocation endpoint.
       *
       * Required for revoking tokens. Not supported by all servers.
       */
      revocationEndpoint?: string;
  }
  export class OAuth2 implements AuthApi {
      #private;
      constructor(context: RequestContext, config: Config, options: OAuth2Options);
      authenticate(request: Request): Promise<Response>;
      verify(request: Request): Promise<AuthedContext>;
  }
  
}

declare module 'alinea/backend/Auth' {

  import { HttpError } from 'alinea/core/HttpError';
  export enum AuthAction {
      Status = "status",
      Handshake = "handshake",
      Login = "login",
      Logout = "logout",
      Refresh = "refresh"
  }
  export class AuthError extends HttpError {
      name: string;
      constructor(message: string, options?: ErrorOptions);
  }
  export class MissingCredentialsError extends AuthError {
      name: string;
  }
  export class InvalidCredentialsError extends AuthError {
      name: string;
  }
  
}

declare module 'alinea/backend/HandleAction' {

  export enum HandleAction {
      Auth = "auth",
      User = "user",
      Resolve = "resolve",
      Pending = "pending",
      Sync = "sync",
      Draft = "draft",
      History = "history",
      PreviewToken = "previewToken",
      Mutate = "mutate",
      Upload = "upload",
      Tree = "tree",
      Commit = "commit",
      Blob = "blob"
  }
  
}

declare module 'alinea/backend/Handler' {

  import type { Entry } from 'alinea/core';
  import type { CMS } from 'alinea/core/CMS';
  import type { RemoteConnection, RequestContext } from 'alinea/core/Connection';
  import type { LocalDB } from 'alinea/core/db/LocalDB';
  export interface Handler {
      (request: Request, context: RequestContext): Promise<Response>;
  }
  export type HookResponse<T = void> = void | T | Promise<T> | Promise<void>;
  export interface HandlerHooks {
      beforeCreate?(entry: Entry): HookResponse<Entry>;
      afterCreate?(entry: Entry): HookResponse;
      beforeUpdate?(entry: Entry): HookResponse<Entry>;
      afterUpdate?(entry: Entry): HookResponse;
      beforeArchive?(entryId: string): HookResponse;
      afterArchive?(entryId: string): HookResponse;
      beforeRemove?(entryId: string): HookResponse;
      afterRemove?(entryId: string): HookResponse;
  }
  export interface HandlerOptions extends HandlerHooks {
      cms: CMS;
      db: LocalDB | Promise<LocalDB>;
      remote?: (context: RequestContext) => RemoteConnection;
  }
  export function createHandler({ cms, remote, db, ...hooks }: HandlerOptions): Handler;
  
}

declare module 'alinea/backend/Loader' {

  import type { EntryRecord } from 'alinea/core/EntryRecord';
  import type { Schema } from 'alinea/core/Schema';
  export interface Loader {
      extension: string;
      parse(schema: Schema, input: Uint8Array): EntryRecord;
      format(schema: Schema, entry: EntryRecord): Uint8Array;
  }
  
}

declare module 'alinea/backend/loader/JsonLoader' {

  import type { Loader } from 'alinea/backend/Loader';
  export const JsonLoader: Loader;
  
}

declare module 'alinea/backend/Previews' {

  export interface PreviewInfo {
      url: string;
  }
  export interface Previews {
      sign(data: PreviewInfo): Promise<string>;
      verify(token: string): Promise<PreviewInfo>;
  }
  
}

declare module 'alinea/backend/resolver/ParsePreview' {

  import type { LocalDB } from 'alinea/core/db/LocalDB';
  import type { PreviewRequest } from 'alinea/core/Preview';
  export function createPreviewParser(local: LocalDB): {
      parse(preview: PreviewRequest, sync: () => Promise<unknown>): Promise<PreviewRequest | undefined>;
  };
  
}

declare module 'alinea/backend/router/NodeHandler' {

  import { Request, type Response } from '@alinea/iso';
  import type http from 'node:http';
  export function respondTo(to: http.ServerResponse, response: Response): Promise<void>;
  export function fromNodeRequest(request: http.IncomingMessage): globalThis.Request;
  export function nodeHandler(handler: (request: Request) => Promise<Response | undefined> | Response | undefined): (req: http.IncomingMessage, res: http.ServerResponse, next?: () => void) => Promise<void>;
  
}

declare module 'alinea/backend/router/Router' {

  import { type Request, Response } from '@alinea/iso';
  export interface HttpRouter {
      (input: Request): Promise<Response>;
  }
  export interface Handle<In, Out> {
      (input: In): Out | undefined | Promise<Out | undefined>;
  }
  type Next<In, Out> = Handle<In, Out> | Route<In, Out>;
  export class Route<In, Out> {
      handle: Handle<In, Out>;
      constructor(handle: Handle<In, Out>);
      map<T>(next: Handle<Out, T>): Route<In, T>;
      map<T>(next: Route<Out, T>): Route<In, T>;
      notFound(handler: (input: In) => Out | Promise<Out>): Route<In, Out>;
      recover(handler: (error: Error) => Out | Promise<Out>): Route<In, Out>;
  }
  export function router(...routes: Array<Next<Request, Response | undefined> | undefined>): Route<Request, Response | undefined>;
  export namespace router {
      function use<In, Out>(handle: Handle<In, Out>): Route<In, Out>;
      function matcher(getPathname?: (url: URL) => string): {
          get(path: string): Route<globalThis.Request, {
              request: globalThis.Request;
              url: URL;
              params: Record<string, unknown>;
          }>;
          post(path: string): Route<globalThis.Request, {
              request: globalThis.Request;
              url: URL;
              params: Record<string, unknown>;
          }>;
          put(path: string): Route<globalThis.Request, {
              request: globalThis.Request;
              url: URL;
              params: Record<string, unknown>;
          }>;
          delete(path: string): Route<globalThis.Request, {
              request: globalThis.Request;
              url: URL;
              params: Record<string, unknown>;
          }>;
          all(path: string): Route<globalThis.Request, {
              request: globalThis.Request;
              url: URL;
              params: Record<string, unknown>;
          }>;
      };
      function base(url: string): {
          get(path: string): Route<globalThis.Request, {
              request: globalThis.Request;
              url: URL;
              params: Record<string, unknown>;
          }>;
          post(path: string): Route<globalThis.Request, {
              request: globalThis.Request;
              url: URL;
              params: Record<string, unknown>;
          }>;
          put(path: string): Route<globalThis.Request, {
              request: globalThis.Request;
              url: URL;
              params: Record<string, unknown>;
          }>;
          delete(path: string): Route<globalThis.Request, {
              request: globalThis.Request;
              url: URL;
              params: Record<string, unknown>;
          }>;
          all(path: string): Route<globalThis.Request, {
              request: globalThis.Request;
              url: URL;
              params: Record<string, unknown>;
          }>;
      };
      const queryMatcher: {
          get(path: string): Route<globalThis.Request, {
              request: globalThis.Request;
              url: URL;
              params: Record<string, unknown>;
          }>;
          post(path: string): Route<globalThis.Request, {
              request: globalThis.Request;
              url: URL;
              params: Record<string, unknown>;
          }>;
          put(path: string): Route<globalThis.Request, {
              request: globalThis.Request;
              url: URL;
              params: Record<string, unknown>;
          }>;
          delete(path: string): Route<globalThis.Request, {
              request: globalThis.Request;
              url: URL;
              params: Record<string, unknown>;
          }>;
          all(path: string): Route<globalThis.Request, {
              request: globalThis.Request;
              url: URL;
              params: Record<string, unknown>;
          }>;
      };
      function parseFormData<In extends {
          request: Request;
      }>(input: In): Promise<In & {
          body: FormData;
      }>;
      function parseBuffer<In extends {
          request: Request;
      }>(input: In): Promise<In & {
          body: ArrayBuffer;
      }>;
      function parseJson<In extends {
          request: Request;
      }>(input: In): Promise<In & {
          body: unknown;
      }>;
      function reportError(error: any): globalThis.Response;
      function redirect(url: URL | string, init?: ResponseInit): globalThis.Response;
      type Cookie = {
          name: string;
          value: string;
          expires?: Date;
          maxAge?: number;
          domain?: string;
          path?: string;
          secure?: boolean;
          httpOnly?: boolean;
          sameSite?: 'strict' | 'lax' | 'none';
      };
      function cookie(...cookies: Array<Cookie>): string;
      function compress(...routes: Array<Next<Request, Response | undefined>>): Route<Request, Response | undefined>;
  }
  export {};
  
}

declare module 'alinea/backend/router/Router.test' {

  export {};
  
}

declare module 'alinea/backend/store/GeneratedRelease' {

  export const generatedRelease: Promise<string>;
  
}

declare module 'alinea/backend/store/GeneratedSource' {

  import { MemorySource } from 'alinea/core/source/MemorySource';
  export const generatedSource: Promise<MemorySource>;
  
}

declare module 'alinea/backend/util/ExecGit' {

  import PLazy from 'p-lazy';
  export function execGit(cwd: string, args: string[]): Promise<string>;
  export function gitUser(cwd: string): PLazy<{
      name: string;
      email: string;
      sub: string;
  }>;
  
}

declare module 'alinea/backend/util/JsonPatch' {

  export function applyJsonPatch(source: any, patch: object): any;
  
}

declare module 'alinea/backend/util/JWTPreviews' {

  import type { PreviewInfo, Previews } from 'alinea/backend/Previews';
  export class JWTPreviews implements Previews {
      private secret;
      constructor(secret: string);
      sign(data: PreviewInfo): Promise<string>;
      verify(token: string): Promise<PreviewInfo>;
  }
  
}

declare module 'alinea/backend/util/ORM' {

  import { type Sql } from 'rado';
  import { type Input } from 'rado/core/expr/Input';
  export function is<T>(a: Input<T>, b: Input<T>): Sql<boolean>;
  export function values<const Values extends Array<Input>>(...rows: Array<Values>): Sql<Array<Values>>;
  
}

declare module 'alinea/cli' {

  import 'alinea/cli/bin';
  
}

declare module 'alinea/cli/bin' {

  export {};
  
}

declare module 'alinea/cli/build/BuildEmitter' {

  import { type BuildOptions, type BuildResult } from 'esbuild';
  import { type Emitter } from 'alinea/cli/util/Emitter';
  export type BuildInfo = {
      type: 'start';
      result: undefined;
  } | {
      type: 'done';
      result: BuildResult;
  };
  export function buildEmitter(config: BuildOptions): Emitter<BuildInfo>;
  
}

declare module 'alinea/cli/build/BuildOptions' {

  import type { BuildOptions } from 'esbuild';
  export const buildOptions: BuildOptions;
  
}

declare module 'alinea/cli/Generate' {

  import type { CMS } from 'alinea/core/CMS';
  import { DevDB } from 'alinea/cli/generate/DevDB';
  export interface GenerateOptions {
      cmd: 'dev' | 'build';
      cwd?: string;
      staticDir?: string;
      configFile?: string;
      watch?: boolean;
      fix?: boolean;
      wasmCache?: boolean;
      quiet?: boolean;
      onAfterGenerate?: (buildMessage: string) => void;
      dashboardUrl?: Promise<string>;
  }
  export function generate(options: GenerateOptions): AsyncGenerator<{
      cms: CMS;
      db: DevDB;
  }, void>;
  
}

declare module 'alinea/cli/generate/CompileConfig' {

  import type { GenerateContext } from 'alinea/cli/generate/GenerateContext';
  export function compileConfig(ctx: GenerateContext): AsyncGenerator<import("alinea/core/CMS").CMS<import("alinea/core/Config").Config>, void, unknown>;
  
}

declare module 'alinea/cli/generate/CopyStaticFiles' {

  import type { GenerateContext } from 'alinea/cli/generate/GenerateContext';
  export function copyStaticFiles({ outDir }: GenerateContext): Promise<void>;
  
}

declare module 'alinea/cli/generate/DevDB' {

  import { Config } from 'alinea/core/Config';
  import type { UploadResponse } from 'alinea/core/Connection';
  import { type CommitRequest } from 'alinea/core/db/CommitRequest';
  import { LocalDB } from 'alinea/core/db/LocalDB';
  import { CachedFSSource } from 'alinea/core/source/FSSource';
  export interface DevDBOptions {
      config: Config;
      rootDir: string;
      dashboardUrl: string | undefined;
  }
  export interface WatchFiles {
      files: Array<string>;
      dirs: Array<string>;
  }
  export class DevDB extends LocalDB {
      #private;
      source: CachedFSSource;
      constructor(options: DevDBOptions);
      sync(): Promise<string>;
      fix(): Promise<void>;
      watchFiles(): Promise<WatchFiles>;
      isInMediaLocation(file: string): boolean;
      write(request: CommitRequest): Promise<{
          sha: string;
      }>;
      prepareUpload(file: string): Promise<UploadResponse>;
  }
  
}

declare module 'alinea/cli/generate/FillCache' {

  import { type Emitter } from 'alinea/cli/util/Emitter';
  import type { DevDB } from 'alinea/cli/generate/DevDB';
  export function fillCache(db: DevDB, fix?: boolean): Emitter<DevDB>;
  
}

declare module 'alinea/cli/generate/GenerateContext' {

  export interface GenerateContext {
      cmd: 'dev' | 'build';
      wasmCache: boolean;
      rootDir: string;
      configLocation: string;
      configDir: string;
      staticDir: string;
      quiet: boolean;
      outDir: string;
      fix: boolean;
  }
  
}

declare module 'alinea/cli/generate/GenerateDashboard' {

  import type { CMS } from 'alinea/core/CMS';
  import type { GenerateContext } from 'alinea/cli/generate/GenerateContext';
  export function generateDashboard({ configLocation, rootDir, configDir }: GenerateContext, cms: CMS, handlerUrl: string, staticFile: string): Promise<void>;
  
}

declare module 'alinea/cli/generate/LoadConfig' {

  import { CMS } from 'alinea/core/CMS';
  export function loadCMS(outDir: string): Promise<CMS>;
  
}

declare module 'alinea/cli/Init' {

  export type InitOptions = {
      cwd?: string;
      quiet?: boolean;
      next?: boolean;
  };
  export function init(options: InitOptions): Promise<void>;
  
}

declare module 'alinea/cli/Init.test' {

  export {};
  
}

declare module 'alinea/cli/Serve' {

  import type { BuildOptions } from 'esbuild';
  export type ServeOptions = {
      cmd: 'dev' | 'build';
      cwd?: string;
      base?: string;
      staticDir?: string;
      configFile?: string;
      port?: number;
      buildOptions?: BuildOptions;
      alineaDev?: boolean;
      production?: boolean;
      onAfterGenerate?: (env?: Record<string, string>) => void;
  };
  export function serve(options: ServeOptions): Promise<void>;
  
}

declare module 'alinea/cli/serve/CreateLocalServer' {

  import { type Request, Response } from '@alinea/iso';
  import type { Handler } from 'alinea/backend/Handler';
  import type { CMS } from 'alinea/core/CMS';
  import type { User } from 'alinea/core/User';
  import type { ServeContext } from 'alinea/cli/serve/ServeContext';
  export function createLocalServer({ cmd, configLocation, rootDir, staticDir, alineaDev, buildOptions, production, liveReload, buildId }: ServeContext, cms: CMS, handleApi: Handler, user: User): {
      close(): void;
      handle(input: Request): Promise<Response>;
  };
  
}

declare module 'alinea/cli/serve/GitHistory' {

  import type { Config } from 'alinea/core/Config';
  import type { Revision } from 'alinea/core/Connection';
  import type { HistoryApi } from 'alinea/core/Connection';
  import type { EntryRecord } from 'alinea/core/EntryRecord';
  export class GitHistory implements HistoryApi {
      config: Config;
      rootDir: string;
      constructor(config: Config, rootDir: string);
      revisions(file: string): Promise<Array<Revision>>;
      revisionData(file: string, ref: string): Promise<EntryRecord>;
  }
  
}

declare module 'alinea/cli/serve/LiveReload' {

  type Client = {
      write(value: string): void;
      close(): void;
  };
  export class LiveReload {
      clients: Array<Client>;
      reload(type: 'refetch' | 'refresh' | 'reload'): void;
      register(client: Client): void;
  }
  export {};
  
}

declare module 'alinea/cli/serve/LocalAuth' {

  import type { AuthApi, AuthedContext, RequestContext } from 'alinea/core/Connection';
  import type { User } from 'alinea/core/User';
  export class LocalAuth implements AuthApi {
      #private;
      constructor(context: RequestContext, user: Promise<User>);
      authenticate(): Promise<Response>;
      verify(request: Request): Promise<AuthedContext>;
  }
  
}

declare module 'alinea/cli/serve/MemoryDrafts' {

  import type { DraftsApi } from 'alinea/core/Connection';
  import type { Draft } from 'alinea/core/Draft';
  export class MemoryDrafts implements DraftsApi {
      drafts: Map<string, Draft>;
      getDraft(entryId: string): Promise<Draft | undefined>;
      storeDraft(draft: Draft): Promise<void>;
  }
  
}

declare module 'alinea/cli/serve/ServeContext' {

  import type { BuildOptions } from 'esbuild';
  import type { LiveReload } from 'alinea/cli/serve/LiveReload';
  export interface ServeContext {
      cmd: 'dev' | 'build';
      configLocation: string;
      rootDir: string;
      base: string | undefined;
      staticDir: string;
      alineaDev: boolean;
      buildOptions: BuildOptions;
      production: boolean;
      liveReload: LiveReload;
      buildId: string;
  }
  
}

declare module 'alinea/cli/serve/StartServer' {

  import type { Request, Response } from '@alinea/iso';
  interface RequestEvent {
      request: Request;
      respondWith(response: Response): Promise<void>;
  }
  export interface Server {
      port: number;
      serve(abortController?: AbortController): AsyncIterable<RequestEvent>;
      close(): void;
  }
  function startBunServer(port?: number, attempt?: number, silent?: boolean): Promise<Server>;
  export const startServer: typeof startBunServer;
  export {};
  
}

declare module 'alinea/cli/Upgrade' {

  export function upgrade(): Promise<void>;
  
}

declare module 'alinea/cli/util/CommitMessage' {

  export function parseCoAuthoredBy(commitMessage: string): {
      email: string;
      name: string;
  } | undefined;
  
}

declare module 'alinea/cli/util/CommitMessage.test' {

  export {};
  
}

declare module 'alinea/cli/util/CommitSha' {

  export function getCommitSha(): string | undefined;
  
}

declare module 'alinea/cli/util/Dirname' {

  export function dirname(url?: string): string;
  export function filename(url?: string): string;
  
}

declare module 'alinea/cli/util/Emitter' {

  export interface Emitter<T> extends AsyncIterable<T> {
      emit(value: T): void;
      throw(error: any): void;
      return(): void;
  }
  export interface EmitterOptions {
      onReturn?: () => void;
      onThrow?: (error: any) => void;
  }
  export function createEmitter<T>({ onReturn, onThrow }?: EmitterOptions): Emitter<T>;
  
}

declare module 'alinea/cli/util/EnsureEnv' {

  export function ensureEnv(cwd?: string): void;
  
}

declare module 'alinea/cli/util/EnsureLibs' {

  export function ensureLibs(libs: Record<string, string>): void;
  
}

declare module 'alinea/cli/util/EnsureNode' {

  export function ensureNode(): void;
  
}

declare module 'alinea/cli/util/ExternalPlugin' {

  import type { Plugin } from 'esbuild';
  export function externalPlugin(cwd: string): Plugin;
  
}

declare module 'alinea/cli/util/FindConfigFile' {

  export function findConfigFile(cwd: string): string | undefined;
  
}

declare module 'alinea/cli/util/ForwardCommand' {

  export function forwardCommand(env?: Record<string, string>): boolean;
  
}

declare module 'alinea/cli/util/FS' {

  export function copyFileIfContentsDiffer(source: string, target: string): Promise<void>;
  export function writeFileIfContentsDiffer(destination: string, contents: string | Buffer): Promise<void>;
  
}

declare module 'alinea/cli/util/IgnorePlugin' {

  import type { Plugin } from 'esbuild';
  export const ignorePlugin: Plugin;
  
}

declare module 'alinea/cli/util/PublicDefines' {

  export function publicDefines(environment: typeof process.env): {
      [k: string]: string;
  };
  
}

declare module 'alinea/cli/util/Report' {

  export function reportWarning(...messages: Array<string>): void;
  export function reportFatal(...messages: Array<string>): void;
  export function reportError(error: Error): void;
  export const red: (input: string) => string;
  export const gray: (input: string) => string;
  export const cyan: (input: string) => string;
  export const yellow: (input: string) => string;
  export const bold: (input: string) => string;
  export const redBg: (input: string) => string;
  
}

declare module 'alinea/cli/util/ViewsPlugin' {

  import type { CMS } from 'alinea/core/CMS';
  import type { Plugin } from 'esbuild';
  export function viewsPlugin(rootDir: string, cms: CMS): Plugin;
  export namespace viewsPlugin {
      const entry = "#alinea/views";
  }
  
}

declare module 'alinea/cli/util/WarnPublicEnv' {

  const mockProcess: {
      env: any;
  };
  export { mockProcess as process };
  
}

declare module 'alinea/cli/util/Watcher' {

  interface ToWatch {
      dirs: Array<string>;
      files: Array<string>;
  }
  export interface WatchOptions {
      watchFiles(): Promise<ToWatch>;
      onChange(): void;
  }
  export function createWatcher(options: WatchOptions): Promise<() => void>;
  export {};
  
}

declare module 'alinea/cloud/AuthResult' {

  import type { User } from 'alinea/core/User';
  export enum AuthResultType {
      Authenticated = 0,
      UnAuthenticated = 1,
      MissingApiKey = 2,
      NeedsRefresh = 3
  }
  export type AuthResult = {
      type: AuthResultType.Authenticated;
      user: User;
  } | {
      type: AuthResultType.UnAuthenticated;
      redirect: string;
  } | {
      type: AuthResultType.MissingApiKey;
      setupUrl: string;
  } | {
      type: AuthResultType.NeedsRefresh;
  };
  
}

declare module 'alinea/cloud/CloudConfig' {

  export const cloudUrl: string;
  export const cloudConfig: {
      url: string;
      jwks: string;
      setup: string;
      handshake: string;
      upload: string;
      logout: string;
      history: string;
      drafts: string;
      tree: string;
      blobs: string;
      write: string;
      auth: string;
      token: string;
      revocation: string;
  };
  
}

declare module 'alinea/cloud/CloudRemote' {

  import { OAuth2 } from 'alinea/backend/api/OAuth2';
  import { Config } from 'alinea/core/Config';
  import type { RemoteConnection, RequestContext, Revision } from 'alinea/core/Connection';
  import { type Draft, type DraftKey } from 'alinea/core/Draft';
  import type { CommitRequest } from 'alinea/core/db/CommitRequest';
  import type { EntryRecord } from 'alinea/core/EntryRecord';
  import { ReadonlyTree } from 'alinea/core/source/Tree';
  export class CloudRemote extends OAuth2 implements RemoteConnection {
      #private;
      constructor(context: RequestContext, config: Config);
      getTreeIfDifferent(sha: string): Promise<ReadonlyTree | undefined>;
      getBlobs(shas: Array<string>): AsyncGenerator<[sha: string, blob: Uint8Array]>;
      write(request: CommitRequest): Promise<{
          sha: string;
      }>;
      authenticate(request: Request): Promise<globalThis.Response>;
      prepareUpload(file: string): Promise<{
          method: string | undefined;
          url: string;
          entryId: string;
          location: string;
          previewUrl: string;
          provider: string;
      }>;
      getDraft(draftKey: DraftKey): Promise<Draft | undefined>;
      storeDraft(draft: Draft): Promise<void>;
      revisions(file: string): Promise<Array<Revision>>;
      revisionData(file: string, revisionId: string): Promise<EntryRecord | undefined>;
  }
  
}

declare module 'alinea/cloud/view/CloudAuth.browser' {

  import type { Auth } from 'alinea/core/Auth';
  export function CloudAuthView({ setSession }: Auth.ViewProps): import("react/jsx-runtime").JSX.Element | null;
  
}

declare module 'alinea/cloud/view/CloudAuth' {

  export function CloudAuthView(): null;
  
}

declare module 'alinea/config' {

  export { createMediaRoot as media } from 'alinea/core/media/MediaRoot';
  export { createConfig as create } from 'alinea/core/Config';
  export { document } from 'alinea/core/Document';
  export { page } from 'alinea/core/Page';
  export { snippet } from 'alinea/core/pages/Snippet';
  export { root } from 'alinea/core/Root';
  export { schema } from 'alinea/core/Schema';
  export { track } from 'alinea/core/Tracker';
  export { type } from 'alinea/core/Type';
  export { workspace } from 'alinea/core/Workspace';
  
}

declare module 'alinea/core' {

  export { createCMS } from 'alinea/adapter/core/cms';
  export * from 'alinea/core/Entry';
  export * from 'alinea/core/Field';
  export * from 'alinea/core/field/ListField';
  export * from 'alinea/core/field/RecordField';
  export * from 'alinea/core/field/RichTextField';
  export * from 'alinea/core/field/ScalarField';
  export * from 'alinea/core/field/UnionField';
  
}

declare module 'alinea/core/Auth' {

  import type { ComponentType } from 'react';
  import type { Session } from 'alinea/core/Session';
  export namespace Auth {
      type ViewProps = {
          setSession: (session: Session | undefined) => void;
      };
      type View = ComponentType<ViewProps>;
  }
  
}

declare module 'alinea/core/Client' {

  import type { PreviewInfo } from 'alinea/backend/Previews';
  import { type AuthResult } from 'alinea/cloud/AuthResult';
  import type { Config } from 'alinea/core/Config';
  import type { LocalConnection, Revision, UploadResponse } from 'alinea/core/Connection';
  import type { Draft, DraftKey } from 'alinea/core/Draft';
  import type { CommitRequest } from 'alinea/core/db/CommitRequest';
  import type { Mutation } from 'alinea/core/db/Mutation';
  import type { EntryRecord } from 'alinea/core/EntryRecord';
  import type { AnyQueryResult, GraphQuery } from 'alinea/core/Graph';
  import { ReadonlyTree } from 'alinea/core/source/Tree';
  import type { User } from 'alinea/core/User';
  export type AuthenticateRequest = (request?: RequestInit) => RequestInit | undefined;
  export interface ClientOptions {
      config: Config;
      url: string;
      applyAuth?: AuthenticateRequest;
      unauthorized?: () => void;
  }
  export class Client implements LocalConnection {
      #private;
      constructor(options: ClientOptions);
      get url(): string;
      authStatus(): Promise<AuthResult>;
      logout: () => Promise<void>;
      previewToken(request: PreviewInfo): Promise<string>;
      prepareUpload(file: string): Promise<UploadResponse>;
      user(): Promise<User | undefined>;
      resolve<Query extends GraphQuery>(query: Query): Promise<AnyQueryResult<Query>>;
      mutate(mutations: Array<Mutation>): Promise<{
          sha: string;
      }>;
      authenticate(applyAuth: AuthenticateRequest, unauthorized: () => void): Client;
      revisions(file: string): Promise<Array<Revision>>;
      revisionData(file: string, revisionId: string): Promise<EntryRecord | undefined>;
      getTreeIfDifferent(sha: string): Promise<ReadonlyTree | undefined>;
      getBlobs(shas: Array<string>): AsyncGenerator<[sha: string, blob: Uint8Array]>;
      write(request: CommitRequest): Promise<{
          sha: string;
      }>;
      getDraft(key: DraftKey): Promise<Draft | undefined>;
      storeDraft(draft: Draft): Promise<void>;
  }
  
}

declare module 'alinea/core/CMS' {

  import { type Config } from 'alinea/core/Config';
  import type { PreviewRequest } from 'alinea/core/Preview';
  import { WriteableGraph } from 'alinea/core/db/WriteableGraph';
  export interface ConnectionContext {
      apiKey?: string;
      accessToken?: string;
      preview?: PreviewRequest;
  }
  export abstract class CMS<Definition extends Config = Config> extends WriteableGraph {
      config: Definition;
      constructor(config: Definition);
      get schema(): Definition['schema'];
      get workspaces(): Definition['workspaces'];
  }
  
}

declare module 'alinea/core/Config' {

  import type { Preview } from 'alinea/core/Preview';
  import type { Auth } from 'alinea/core/Auth';
  import { Root } from 'alinea/core/Root';
  import { Schema } from 'alinea/core/Schema';
  import { Type } from 'alinea/core/Type';
  import { Workspace, type WorkspaceInternal } from 'alinea/core/Workspace';
  /** Configuration options */
  export interface Config {
      /** A schema describing the types of entries */
      schema: Schema;
      /** A record containing workspace configurations */
      workspaces: Record<string, Workspace>;
      /** A url which will be embedded in the dashboard for live previews */
      preview?: Preview;
      /** Every edit will pass through a draft status before being published */
      enableDrafts?: boolean;
      /** The interval in seconds at which the frontend will poll for updates */
      syncInterval?: number;
      /** The base url of the application */
      baseUrl?: string | {
          development?: string;
          production?: string;
      };
      /** The url of the handler endpoint */
      handlerUrl?: string;
      /** The folder where public assets are stored, defaults to /public */
      publicDir?: string;
      /** Filename of the generated dashboard */
      dashboardFile?: string;
      auth?: Auth.View;
  }
  export namespace Config {
      function baseUrl(config: Config, env?: string): string | undefined;
      function mainWorkspace(config: Config): WorkspaceInternal;
      function type(config: Config, name: string): Type | undefined;
      function rootContains(config: Config, root: Root, childType: Type): boolean;
      function typeContains(config: Config, parentType: Type, childType: Type): boolean;
      function hasAuth(config: Config): boolean;
      function multipleWorkspaces(config: Config): boolean;
      function contentDir(config: Config): string;
      function filePath(config: Config, workspace: string, root: string, locale: string | null, ...rest: Array<string>): string;
      function validate(config: Config): void;
      function referencedViews(config: Config): Array<string>;
  }
  /** Create a new config instance */
  export function createConfig<Definition extends Config>(definition: Definition): Definition;
  
}

declare module 'alinea/core/Config.test' {

  export {};
  
}

declare module 'alinea/core/Connection' {

  import type { Request, Response } from '@alinea/iso';
  import type { PreviewInfo } from 'alinea/backend/Previews';
  import type { Draft, DraftKey } from 'alinea/core/Draft';
  import type { CommitRequest } from 'alinea/core/db/CommitRequest';
  import type { Mutation } from 'alinea/core/db/Mutation';
  import type { EntryRecord } from 'alinea/core/EntryRecord';
  import type { AnyQueryResult, GraphQuery } from 'alinea/core/Graph';
  import type { ReadonlyTree } from 'alinea/core/source/Tree';
  import type { User } from 'alinea/core/User';
  export interface AuthApi {
      authenticate(request: Request): Promise<Response>;
      verify(request: Request): Promise<AuthedContext>;
  }
  export interface RemoteConnection extends Connection, AuthApi {
  }
  export interface BrowserConnection extends Connection {
      logout?(): Promise<void>;
  }
  export interface LocalConnection extends Connection {
      mutate(mutations: Array<Mutation>): Promise<{
          sha: string;
      }>;
      previewToken(request: PreviewInfo): Promise<string>;
      resolve<Query extends GraphQuery>(query: Query): Promise<AnyQueryResult<Query>>;
      user(): Promise<User | undefined>;
  }
  export interface SyncApi {
      getTreeIfDifferent(sha: string): Promise<ReadonlyTree | undefined>;
      getBlobs(shas: Array<string>): AsyncGenerator<[sha: string, blob: Uint8Array]>;
  }
  export interface CommitApi {
      write(request: CommitRequest): Promise<{
          sha: string;
      }>;
  }
  export interface HistoryApi {
      revisions(file: string): Promise<Array<Revision>>;
      revisionData(file: string, revisionId: string): Promise<EntryRecord | undefined>;
  }
  export interface DraftsApi {
      getDraft(draftKey: DraftKey): Promise<Draft | undefined>;
      storeDraft(draft: Draft): Promise<void>;
  }
  export interface UploadsApi {
      prepareUpload(file: string): Promise<UploadResponse>;
      handleUpload?(entryId: string, file: Blob): Promise<void>;
      previewUpload?(entryId: string): Promise<Response>;
  }
  export interface Connection extends CommitApi, SyncApi, HistoryApi, DraftsApi, UploadsApi {
  }
  export interface RequestContext {
      isDev: boolean;
      handlerUrl: URL;
      apiKey: string;
      user?: User;
      token?: string;
  }
  export interface AuthedContext extends RequestContext {
      user: User;
      token: string;
  }
  export interface Revision {
      ref: string;
      createdAt: number;
      file: string;
      user?: {
          name: string;
          email: string;
      };
      description?: string;
  }
  export interface UploadDestination {
      entryId: string;
      location: string;
      previewUrl: string;
  }
  export interface UploadResponse extends UploadDestination {
      url: string;
      method?: string;
  }
  export interface DraftTransport {
      entryId: string;
      locale: string | null;
      commitHash: string;
      fileHash: string;
      draft: string;
  }
  
}

declare module 'alinea/core/db/CommitRequest' {

  import type { Change, ChangeFile, ChangesBatch } from 'alinea/core/source/Change';
  import type { ReadonlyTree } from 'alinea/core/source/Tree';
  import type { RemoveFileMutation, UploadFileMutation } from 'alinea/core/db/Mutation';
  export interface AddContent extends ChangeFile {
      op: 'addContent';
      contents: string;
  }
  export interface DeleteContent extends ChangeFile {
      op: 'deleteContent';
  }
  export type CommitChange = AddContent | DeleteContent | UploadFileMutation | RemoveFileMutation;
  export function commitChanges(changes: Array<Change>): Array<CommitChange>;
  export function sourceChanges(request: CommitRequest): ChangesBatch;
  export interface CommitRequest {
      description: string;
      fromSha: string;
      intoSha: string;
      checks: Array<[path: string, sha: string]>;
      changes: Array<CommitChange>;
  }
  export function checkCommit(tree: ReadonlyTree, request: CommitRequest): void;
  
}

declare module 'alinea/core/db/EntryDB' {

  import type { Config } from 'alinea/core/Config';
  import type { LocalConnection, UploadResponse } from 'alinea/core/Connection';
  import type { Source } from 'alinea/core/source/Source';
  import { type CommitRequest } from 'alinea/core/db/CommitRequest';
  import { LocalDB } from 'alinea/core/db/LocalDB';
  import type { Mutation } from 'alinea/core/db/Mutation';
  export class EntryDB extends LocalDB {
      connect: () => Promise<LocalConnection>;
      constructor(config: Config, source: Source, connect: () => Promise<LocalConnection>);
      mutate(mutations: Array<Mutation>): Promise<{
          sha: string;
          remote: Promise<string>;
      }>;
      write(request: CommitRequest): Promise<{
          sha: string;
      }>;
      prepareUpload(file: string): Promise<UploadResponse>;
      syncWithRemote(): Promise<string>;
  }
  
}

declare module 'alinea/core/db/EntryIndex' {

  import { Config } from 'alinea/core/Config';
  import type { Entry, EntryStatus } from 'alinea/core/Entry';
  import type { ChangesBatch } from 'alinea/core/source/Change';
  import { type Source } from 'alinea/core/source/Source';
  import { ReadonlyTree } from 'alinea/core/source/Tree';
  import { Type } from 'alinea/core/Type';
  import { EntryTransaction } from 'alinea/core/db/EntryTransaction';
  export interface EntryFilter {
      ids?: ReadonlyArray<string>;
      search?: string;
      condition?(entry: Entry): boolean;
  }
  export interface EntryCondition {
      search?: string;
      nodes?: Iterable<EntryNode>;
      node?(node: EntryNode): boolean;
      language?(language: EntryLanguageNode): boolean;
      entry?(entry: Entry): boolean;
  }
  export function combineConditions(a: EntryCondition, b: EntryCondition): EntryCondition;
  interface EntryVersionData {
      id: string;
      type: string;
      index: string;
      searchableText: string;
      title: string;
      data: Record<string, unknown>;
      seeded: string | null;
      rowHash: string;
      fileHash: string;
  }
  interface EntryVersion extends EntryVersionData {
      locale: string | null;
      workspace: string;
      root: string;
      path: string;
      status: EntryStatus;
      parentDir: string;
      childrenDir: string;
      filePath: string;
      level: number;
  }
  class EntryLanguage extends Map<EntryStatus, EntryVersion> {
      readonly locale: string | null;
      readonly parentDir: string;
      readonly selfDir: string;
      constructor(versions: Array<EntryVersion>);
  }
  class EntryCollection extends Map<string | null, EntryLanguage> {
      versions: Array<EntryVersion>;
      readonly type: string;
      constructor(versions: Array<EntryVersion>);
  }
  class EntryLanguageNode {
      #private;
      private node;
      private language;
      inheritedStatus: EntryStatus | undefined;
      main: EntryVersion;
      active: EntryVersion;
      url: string;
      locale: string | null;
      path: string;
      readonly seeded: string | null;
      constructor(node: EntryNode, language: EntryLanguage);
      [Symbol.iterator](): MapIterator<[EntryStatus, EntryVersion]>;
      has(status: EntryStatus): boolean;
      get parentPaths(): string[];
      get entries(): Entry<Record<string, unknown>>[];
      filter(filter: EntryCondition): Generator<Entry>;
  }
  export class EntryNode extends Map<string | null, EntryLanguageNode> {
      entryType: Type;
      parent: EntryNode | null;
      children: () => Iterable<EntryNode>;
      readonly id: string;
      readonly index: string;
      readonly parentId: string | null;
      readonly parents: Array<string>;
      readonly workspace: string;
      readonly root: string;
      readonly type: string;
      readonly level: number;
      constructor(entryType: Type, parent: EntryNode | null, children: () => Iterable<EntryNode>, collection: EntryCollection);
      filter(filter: EntryCondition): Generator<Entry>;
  }
  export class EntryGraph {
      #private;
      nodes: Array<EntryNode>;
      constructor(config: Config, versionData: Map<string, EntryVersionData>, seeds: Map<string, Seed>);
      byId(id: string): EntryNode | undefined;
      byDir(dir: string): EntryNode | undefined;
      withChanges(batch: ChangesBatch): EntryGraph;
      filter({ search, ...filter }: EntryCondition): Generator<Entry>;
  }
  export class EntryIndex extends EventTarget {
      #private;
      tree: ReadonlyTree;
      initialSync: ReadonlyTree | undefined;
      graph: EntryGraph;
      constructor(config: Config);
      get sha(): string;
      filter(filter: EntryCondition): Iterable<Entry>;
      findFirst<T extends Record<string, unknown>>(filter: (entry: Entry) => boolean): Entry<T> | undefined;
      findMany(filter: (entry: Entry) => boolean): Iterable<Entry>;
      syncWith(source: Source): Promise<string>;
      indexChanges(batch: ChangesBatch): Promise<string>;
      seed(source: Source): Promise<void>;
      byId(id: string): EntryNode | undefined;
      fix(source: Source): Promise<void>;
      transaction(source: Source): Promise<EntryTransaction>;
  }
  interface Seed {
      seedId: string;
      type: string;
      workspace: string;
      root: string;
      locale: string | null;
      data: Record<string, any>;
  }
  export {};
  
}

declare module 'alinea/core/db/EntryIndex.test' {

  export {};
  
}

declare module 'alinea/core/db/EntryResolver' {

  import type { Type } from 'alinea';
  import type { Config } from 'alinea/core/Config';
  import type { Entry } from 'alinea/core/Entry';
  import type { Expr } from 'alinea/core/Expr';
  import { Field } from 'alinea/core/Field';
  import { type AnyQueryResult, type Edge, type EdgeQuery, type GraphQuery, type Projection, type Status } from 'alinea/core/Graph';
  import { type HasExpr } from 'alinea/core/Internal';
  import type { Resolver } from 'alinea/core/Resolver';
  import { type EntryCondition, type EntryFilter, type EntryGraph, type EntryIndex } from 'alinea/core/db/EntryIndex';
  import { LinkResolver } from 'alinea/core/db/LinkResolver';
  type Interim = any;
  export interface PostContext {
      linkResolver: LinkResolver;
  }
  export class EntryResolver implements Resolver {
      #private;
      index: EntryIndex;
      constructor(config: Config, index: EntryIndex);
      call(ctx: ResolveContext, entry: Entry, internal: {
          method: string;
          args: Array<Expr>;
      }): unknown;
      field(entry: Entry, field: Expr): unknown;
      expr(ctx: ResolveContext, entry: Entry, expr: Expr): unknown;
      projectTypes(types: Array<Type>): Array<[string, Expr]>;
      projection(query: GraphQuery<Projection>): Projection;
      sourceFilter(ctx: ResolveContext, entry: Entry, query: EdgeQuery): EntryCondition;
      selectProjection(ctx: ResolveContext, entry: Entry, value: Projection): unknown;
      select(ctx: ResolveContext, entry: Entry | null, query: GraphQuery<Projection>): unknown;
      condition(ctx: ResolveContext, query: EdgeQuery): EntryFilter;
      isSingleResult(query: GraphQuery & Partial<Edge>): boolean;
      query(ctx: ResolveContext, query: GraphQuery<Projection>, preFilter?: EntryCondition): {
          entries: Entry<Record<string, unknown>>[];
          getUnprocessed: () => unknown;
          getProcessed: () => Promise<any>;
      };
      postField(ctx: PostContext, interim: Interim, field: Field): Promise<void>;
      postExpr(ctx: PostContext, interim: Interim, expr: HasExpr): Promise<void>;
      postRow(ctx: PostContext, interim: Interim, query: GraphQuery<Projection>): Promise<void>;
      post(ctx: PostContext, interim: Interim, input: EdgeQuery<Projection>): Promise<void>;
      resolve<Query extends GraphQuery>(query: Query): Promise<AnyQueryResult<Query>>;
  }
  export interface ResolveContext {
      status: Status;
      locale?: string | null;
      graph: EntryGraph;
      searchTerms?: string;
  }
  export function statusChecker(status: Status): Check;
  interface Check {
      (input: Entry): boolean;
  }
  export {};
  
}

declare module 'alinea/core/db/EntryResolver.test' {

  export {};
  
}

declare module 'alinea/core/db/EntryTarget' {

  import type { RemoteSource } from 'alinea/core/source/Source';
  import type { CommitRequest } from 'alinea/core/db/CommitRequest';
  export interface EntryTarget extends RemoteSource {
      commit(request: CommitRequest): Promise<string>;
  }
  
}

declare module 'alinea/core/db/EntryTransaction' {

  import { Config } from 'alinea/core/Config';
  import type { Source } from 'alinea/core/source/Source';
  import type { ReadonlyTree } from 'alinea/core/source/Tree';
  import { type CommitChange } from 'alinea/core/db/CommitRequest';
  import type { EntryIndex } from 'alinea/core/db/EntryIndex';
  import type { ArchiveMutation, CreateMutation, MoveMutation, Mutation, PublishMutation, RemoveFileMutation, RemoveMutation, UnpublishMutation, UpdateMutation, UploadFileMutation } from 'alinea/core/db/Mutation';
  type Op<T> = Omit<T, 'op'>;
  export class EntryTransaction {
      #private;
      constructor(config: Config, index: EntryIndex, source: Source, from: ReadonlyTree);
      get empty(): boolean;
      create({ locale, type, data, root, workspace, fromSeed, parentId, id, insertOrder, status, overwrite }: Op<CreateMutation>): this;
      update({ id, locale, status, set }: Op<UpdateMutation>): this;
      publish({ id, locale, status }: Op<PublishMutation>): this;
      unpublish({ id, locale }: Op<UnpublishMutation>): this;
      archive({ id, locale }: Op<ArchiveMutation>): this;
      move({ id, after, toParent, toRoot }: Op<MoveMutation>): this;
      remove({ id, locale, status }: Op<RemoveMutation>): this;
      removeFile(mutation: Op<RemoveFileMutation>): this;
      uploadFile(mutation: Op<UploadFileMutation>): this;
      description(): string;
      apply(mutations: Array<Mutation>): void;
      toRequest(): Promise<{
          fromSha: string;
          intoSha: string;
          description: string;
          checks: [path: string, sha: string][];
          changes: CommitChange[];
      }>;
  }
  export {};
  
}

declare module 'alinea/core/db/IndexEvent' {

  export class IndexEvent extends Event {
      data: IndexOp;
      static readonly type = "index";
      constructor(data: IndexOp);
  }
  export type IndexOp = {
      op: 'index';
      sha: string;
  } | {
      op: 'entry';
      id: string;
  } | {
      op: 'mutate';
      id: string;
      status: 'pending' | 'success' | 'failure';
      error?: Error;
  };
  
}

declare module 'alinea/core/db/LinkResolver' {

  import type { InferProjection, Projection } from 'alinea/core/Graph';
  import type { EntryResolver, ResolveContext } from 'alinea/core/db/EntryResolver';
  export class LinkResolver {
      resolver: EntryResolver;
      private ctx;
      private locale;
      constructor(resolver: EntryResolver, ctx: ResolveContext, locale: string | null);
      includedAtBuild(filePath: string): boolean;
      resolveLinks<P extends Projection>(projection: P, entryIds: ReadonlyArray<string>): Promise<Array<InferProjection<P>>>;
  }
  
}

declare module 'alinea/core/db/LocalDB' {

  import type { Config } from 'alinea/core/Config';
  import type { SyncApi, UploadResponse } from 'alinea/core/Connection';
  import type { AnyQueryResult, GraphQuery } from 'alinea/core/Graph';
  import type { ChangesBatch } from 'alinea/core/source/Change';
  import type { Source } from 'alinea/core/source/Source';
  import { type CommitRequest } from 'alinea/core/db/CommitRequest';
  import { EntryIndex } from 'alinea/core/db/EntryIndex';
  import type { Mutation } from 'alinea/core/db/Mutation';
  import { WriteableGraph } from 'alinea/core/db/WriteableGraph';
  export class LocalDB extends WriteableGraph {
      #private;
      config: Config;
      index: EntryIndex;
      source: Source;
      constructor(config: Config, source?: Source);
      resolve<Query extends GraphQuery>(query: Query): Promise<AnyQueryResult<Query>>;
      get sha(): string;
      indexChanges(batch: ChangesBatch): Promise<string>;
      applyChanges(batch: ChangesBatch): Promise<void>;
      getTreeIfDifferent(sha: string): Promise<import("alinea/core/source/Tree").ReadonlyTree | undefined>;
      getBlobs(shas: Array<string>): AsyncGenerator<[sha: string, blob: Uint8Array], any, any>;
      sync(): Promise<string>;
      syncWith(remote: SyncApi): Promise<string>;
      logEntries(): Promise<void>;
      request(mutations: Array<Mutation>): Promise<{
          fromSha: string;
          intoSha: string;
          description: string;
          checks: [path: string, sha: string][];
          changes: import("alinea/core/db/CommitRequest").CommitChange[];
      }>;
      mutate(mutations: Array<Mutation>): Promise<{
          sha: string;
      }>;
      write(request: CommitRequest): Promise<{
          sha: string;
      }>;
      prepareUpload(file: string): Promise<UploadResponse>;
  }
  
}

declare module 'alinea/core/db/LocalDB.test' {

  export {};
  
}

declare module 'alinea/core/db/Mutation' {

  import type { EntryStatus } from 'alinea/core/Entry';
  export type Mutation = CreateMutation | UpdateMutation | RemoveMutation | MoveMutation | PublishMutation | UnpublishMutation | ArchiveMutation | UploadFileMutation | RemoveFileMutation;
  export interface CreateMutation {
      op: 'create';
      type: string;
      locale: string | null;
      data: Record<string, unknown>;
      parentId?: string | null;
      id?: string;
      insertOrder?: 'first' | 'last';
      status?: 'draft' | 'archived' | 'published';
      overwrite?: boolean;
      fromSeed?: string;
      root?: string;
      workspace?: string;
  }
  export interface UpdateMutation {
      op: 'update';
      id: string;
      locale: string | null;
      status: EntryStatus;
      set: Record<string, unknown>;
  }
  export interface RemoveMutation {
      op: 'remove';
      id: string;
      locale?: string | null;
      status?: 'draft' | 'archived' | 'published';
  }
  export interface PublishMutation {
      op: 'publish';
      id: string;
      locale: string | null;
      status: 'draft' | 'archived';
  }
  export interface UnpublishMutation {
      op: 'unpublish';
      id: string;
      locale: string | null;
  }
  export interface ArchiveMutation {
      op: 'archive';
      id: string;
      locale: string | null;
  }
  export interface MoveMutation {
      op: 'move';
      id: string;
      after: string | null;
      toParent?: string;
      toRoot?: string;
  }
  export interface UploadFileMutation {
      op: 'uploadFile';
      url: string;
      location: string;
  }
  export interface RemoveFileMutation {
      op: 'removeFile';
      location: string;
  }
  
}

declare module 'alinea/core/db/Operation' {

  import type { StoredRow } from 'alinea/core/Infer';
  import type { ImagePreviewDetails } from 'alinea/core/media/CreatePreview';
  import { Type } from 'alinea/core/Type';
  import type { Mutation } from 'alinea/core/db/Mutation';
  import type { WriteableGraph } from 'alinea/core/db/WriteableGraph';
  type Awaitable<T> = T | Promise<T>;
  type Task = (graph: WriteableGraph) => Awaitable<Array<Mutation>>;
  export class Operation {
      task: Task;
      constructor(task: Task);
  }
  export interface CreateQuery<Fields> {
      type: Type<Fields>;
      id?: string;
      workspace?: string;
      root?: string;
      parentId?: string | null;
      locale?: string | null;
      status?: 'draft' | 'published' | 'archived';
      set: Partial<StoredRow<Fields>>;
      insertOrder?: 'first' | 'last';
      overwrite?: boolean;
  }
  export class CreateOp<Fields> extends Operation {
      id: string;
      constructor(op: CreateQuery<Fields>);
  }
  export class DeleteOp extends Operation {
      protected entryIds: Array<string>;
      constructor(entryIds: Array<string>);
  }
  export interface DiscardQuery {
      id: string;
      locale?: string | null;
      status: 'draft' | 'archived' | 'published';
  }
  export class DiscardOp extends Operation {
      constructor(query: DiscardQuery);
  }
  export interface UpdateQuery<Fields> {
      type?: Type<Fields>;
      id: string;
      set: Partial<StoredRow<Fields>>;
      status?: 'draft' | 'published' | 'archived';
      locale?: string | null;
  }
  export class UpdateOperation<Definition> extends Operation {
      constructor(query: UpdateQuery<Definition>);
  }
  export interface MoveQuery {
      id: string;
      after?: string | null;
      toParent?: string;
      toRoot?: string;
  }
  export class MoveOperation extends Operation {
      constructor(query: MoveQuery);
  }
  export interface PublishQuery {
      id: string;
      status: 'draft' | 'archived';
      locale?: string | null;
  }
  export class PublishOperation extends Operation {
      constructor(query: PublishQuery);
  }
  export interface UnpublishQuery {
      id: string;
      locale?: string | null;
  }
  export class UnpublishOperation extends Operation {
      constructor(query: UnpublishQuery);
  }
  export interface ArchiveQuery {
      id: string;
      locale?: string | null;
  }
  export class ArchiveOperation extends Operation {
      constructor(query: ArchiveQuery);
  }
  export interface UploadQuery {
      file: File | [string, Uint8Array];
      workspace?: string;
      root?: string;
      parentId?: string | null;
      createPreview?(blob: Blob): Promise<ImagePreviewDetails>;
      replaceId?: string;
  }
  export class UploadOperation extends Operation {
      id: string;
      constructor(query: UploadQuery);
  }
  export function update<Definition>(query: UpdateQuery<Definition>): UpdateOperation<Definition>;
  export function create<Definition>(query: CreateQuery<Definition>): CreateOp<Definition>;
  export function remove(...entryIds: Array<string>): DeleteOp;
  export function discard(query: DiscardQuery): DiscardOp;
  export function upload(query: UploadQuery): UploadOperation;
  export function move(query: MoveQuery): MoveOperation;
  export function publish(query: PublishQuery): PublishOperation;
  export function archive(query: ArchiveQuery): ArchiveOperation;
  export {};
  
}

declare module 'alinea/core/db/TestDB' {

  import type { LocalConnection } from 'alinea/core/Connection';
  import { type User } from 'alinea/core/User';
  import { LocalDB } from 'alinea/core/db/LocalDB';
  export class TestDB extends LocalDB implements LocalConnection {
      previewToken(): Promise<string>;
      user(): Promise<User>;
      revisions(): Promise<never[]>;
      revisionData(): Promise<undefined>;
      getDraft(): Promise<undefined>;
      storeDraft(): Promise<void>;
  }
  
}

declare module 'alinea/core/db/WriteableGraph' {

  import type { Infer } from 'alinea';
  import type { Type } from 'alinea/core/Type';
  import type { UploadResponse } from 'alinea/core/Connection';
  import type { EntryFields } from 'alinea/core/EntryFields';
  import { Graph } from 'alinea/core/Graph';
  import type { Mutation } from 'alinea/core/db/Mutation';
  import { type ArchiveQuery, type CreateQuery, type DiscardQuery, type MoveQuery, type Operation, type PublishQuery, type UnpublishQuery, type UpdateQuery, type UploadQuery } from 'alinea/core/db/Operation';
  export abstract class WriteableGraph extends Graph {
      abstract mutate(mutations: Array<Mutation>): Promise<{
          sha: string;
      }>;
      abstract prepareUpload(file: string): Promise<UploadResponse>;
      create<Definition>(create: CreateQuery<Definition>): Promise<EntryFields & Infer<Type<Definition>>>;
      update<Definition>(update: UpdateQuery<Definition>): Promise<EntryFields & Infer<Type<Definition>>>;
      remove(...entryIds: Array<string>): Promise<void>;
      publish(publish: PublishQuery): Promise<void>;
      unpublish(unpublish: UnpublishQuery): Promise<void>;
      archive(archive: ArchiveQuery): Promise<void>;
      move(query: MoveQuery): Promise<{
          index: string;
      }>;
      discard(query: DiscardQuery): Promise<void>;
      upload(query: UploadQuery): Promise<{
          _id: string;
          _type: string;
          _index: string;
          _workspace: string;
          _root: string;
          _status: import("alinea/core/Entry").EntryStatus;
          _parentId: string | null;
          _locale: string | null;
          _path: string;
          _url: string;
          _active: boolean;
          title: string;
          path: string;
          location: string;
          previewUrl: string;
          extension: string;
          size: number;
          hash: string;
          width: number;
          height: number;
          preview: string;
          averageColor: string;
          focus: {
              x: number;
              y: number;
          };
          thumbHash: string;
      }>;
      commit(...operations: Array<Operation>): Promise<void>;
  }
  
}

declare module 'alinea/core/Doc' {

  import * as Y from 'yjs';
  import type { Entry } from 'alinea/core/Entry';
  import { Type } from 'alinea/core/Type';
  export const DOC_KEY = "#root";
  export function createYDoc(type: Type, entry: Entry | null): Y.Doc;
  export function applyEntryData(doc: Y.Doc, type: Type, entry: Entry): void;
  export function parseYDoc(type: Type, doc: Y.Doc): {
      path: any;
      title: any;
      data: Record<string, any>;
  };
  
}

declare module 'alinea/core/Document' {

  import { type MetadataField } from 'alinea/field/metadata';
  import { type PathField } from 'alinea/field/path';
  import { type TextField } from 'alinea/field/text';
  import { type FieldsDefinition, type Type, type TypeConfig } from 'alinea/core/Type';
  export type Document = {
      title: TextField;
      path: PathField;
      metadata: MetadataField;
  };
  export function document<Fields extends FieldsDefinition>(label: string, { fields, ...config }: TypeConfig<Fields>): Type<Document & Fields>;
  
}

declare module 'alinea/core/Draft' {

  export interface Draft {
      entryId: string;
      locale: string | null;
      fileHash: string;
      draft: Uint8Array;
  }
  export type DraftKey = string & {
      __brand: 'DraftKey';
  };
  export function formatDraftKey(entry: {
      id: string;
      locale: string | null;
  }): DraftKey;
  export function parseDraftKey(key: DraftKey): {
      entryId: string;
      locale: string | null;
  };
  
}

declare module 'alinea/core/Entry' {

  import { Expr } from 'alinea/core/Expr';
  export type EntryStatus = 'draft' | 'published' | 'archived';
  export const entryStatuses: EntryStatus[];
  export const ALT_STATUS: Array<EntryStatus>;
  export interface Entry<Data extends object = Record<string, unknown>> {
      id: string;
      status: EntryStatus;
      title: string;
      type: string;
      seeded: string | null;
      workspace: string;
      root: string;
      level: number;
      filePath: string;
      parentDir: string;
      childrenDir: string;
      index: string;
      parentId: string | null;
      parents: Array<string>;
      locale: string | null;
      rowHash: string;
      active: boolean;
      main: boolean;
      path: string;
      fileHash: string;
      url: string;
      data: Data;
      searchableText: string;
  }
  export const Entry: {
      id: Expr<string>;
      status: Expr<EntryStatus>;
      title: Expr<string>;
      type: Expr<string>;
      seeded: Expr<string | null>;
      workspace: Expr<string>;
      root: Expr<string>;
      level: Expr<number>;
      filePath: Expr<string>;
      parentDir: Expr<string>;
      childrenDir: Expr<string>;
      index: Expr<string>;
      parentId: Expr<string | null>;
      parents: Expr<string[]>;
      locale: Expr<string | null>;
      rowHash: Expr<string>;
      active: Expr<boolean>;
      main: Expr<boolean>;
      path: Expr<string>;
      fileHash: Expr<string>;
      url: Expr<string>;
      data: Expr<Record<string, any>>;
      searchableText: Expr<string>;
  };
  
}

declare module 'alinea/core/EntryFields' {

  import type { EntryStatus } from 'alinea/core/Entry';
  export interface EntryFields {
      _id: string;
      _type: string;
      _index: string;
      _workspace: string;
      _root: string;
      _status: EntryStatus;
      _parentId: string | null;
      _locale: string | null;
      _path: string;
      _url: string;
      _active: boolean;
  }
  export const EntryFields: {
      _id: import("alinea/core/Expr").Expr<string>;
      _type: import("alinea/core/Expr").Expr<string>;
      _index: import("alinea/core/Expr").Expr<string>;
      _workspace: import("alinea/core/Expr").Expr<string>;
      _root: import("alinea/core/Expr").Expr<string>;
      _status: import("alinea/core/Expr").Expr<EntryStatus>;
      _parentId: import("alinea/core/Expr").Expr<string | null>;
      _locale: import("alinea/core/Expr").Expr<string | null>;
      _path: import("alinea/core/Expr").Expr<string>;
      _url: import("alinea/core/Expr").Expr<string>;
      _active: import("alinea/core/Expr").Expr<boolean>;
  };
  
}

declare module 'alinea/core/EntryLocation' {

  export interface EntryLocation {
      entryId?: string;
      workspace?: string;
      root?: string;
      locale?: string;
  }
  
}

declare module 'alinea/core/EntryRecord' {

  import type { EntryStatus } from 'alinea/core/Entry';
  import type { Entry } from 'alinea/core/Entry';
  export interface EntryMeta {
      _id: string;
      _type: string;
      _index: string;
      _root?: string;
      _seeded?: string;
  }
  export interface EntryRecord extends EntryMeta {
      [field: string]: unknown;
  }
  export namespace EntryRecord {
      const id = "_id";
      const type = "_type";
      const index = "_index";
      const root = "_root";
      const seeded = "_seeded";
  }
  export interface RequiredEntryFields extends Partial<Entry> {
      id: string;
      type: string;
      index: string;
      data: Record<string, any>;
  }
  export function parseRecord(record: EntryRecord): {
      meta: {
          id: string;
          type: string;
          index: string;
          root: string | undefined;
          seeded: string | undefined;
      };
      data: {
          [field: string]: unknown;
      };
      v0Id: string | undefined;
  };
  export function createRecord(entry: RequiredEntryFields, status: EntryStatus): EntryRecord;
  
}

declare module 'alinea/core/EntrySearch' {

  import { type InferSelectModel } from 'rado';
  export const EntrySearch: import("rado").Table<{
      title: import("rado").RequiredColumn<string | null>;
      searchableText: import("rado").RequiredColumn<string | null>;
      rank: import("rado").RequiredColumn<number | null>;
      rowid: import("rado").RequiredColumn<number | null>;
  }, "EntrySearch">;
  export type EntrySearch = InferSelectModel<typeof EntrySearch>;
  
}

declare module 'alinea/core/Expr' {

  import { type HasExpr, internalExpr } from 'alinea/core/Internal';
  const brand: unique symbol;
  export class Expr<Value = unknown> implements HasExpr {
      [brand]: Value;
      [internalExpr]: ExprInternal;
      constructor(data: ExprInternal);
  }
  export type ExprInternal = {
      type: 'field';
  } | {
      type: 'entryField';
      name: string;
  } | {
      type: 'call';
      method: string;
      args: Array<Expr>;
  } | {
      type: 'value';
      value: unknown;
  };
  export {};
  
}

declare module 'alinea/core/Field' {

  import type { LinkResolver } from 'alinea/core/db/LinkResolver';
  import { Expr } from 'alinea/core/Expr';
  import { type HasField, internalField } from 'alinea/core/Internal';
  import type { Shape } from 'alinea/core/Shape';
  import type { View } from 'alinea/core/View';
  export interface FieldOptions<StoredValue> {
      /** A description of the field */
      label: string;
      /** Hide this field in the dashboard */
      hidden?: boolean;
      /** Mark this field as read-only */
      readOnly?: boolean;
      /** The initial value of the field */
      initialValue?: StoredValue;
      /** The value of this field is shared across all languages */
      shared?: boolean;
      /** Providing a value for this field is required */
      required?: boolean;
      /** Validate the given value */
      validate?(value: StoredValue): boolean | string | undefined;
  }
  export type WithoutLabel<Options extends FieldOptions<any>> = Omit<Options, 'label'>;
  export interface FieldMeta<StoredValue, QueryValue, Mutator, Options> {
      options: Options & FieldOptions<StoredValue>;
      view: View<{
          field: Field<StoredValue, QueryValue, Mutator, Options>;
      }>;
      postProcess?: (value: StoredValue, loader: LinkResolver) => Promise<void>;
  }
  export interface FieldData<StoredValue, QueryValue, Mutator, Options> extends FieldMeta<StoredValue, QueryValue, Mutator, Options> {
      shape: Shape<StoredValue, Mutator>;
      referencedViews: Array<string>;
  }
  export interface FieldInternal extends FieldData<any, any, any, any> {
      ref: symbol;
  }
  const brand: unique symbol;
  export class Field<StoredValue = any, QueryValue = any, Mutator = any, Options = any> extends Expr<QueryValue> implements HasField {
      [brand]: [StoredValue, QueryValue, Mutator, Options];
      [internalField]: FieldInternal;
      constructor(data: FieldData<StoredValue, QueryValue, Mutator, Options>);
  }
  export namespace Field {
      function ref(field: HasField): symbol;
      function shape(field: HasField): Shape;
      function label(field: HasField): string;
      function initialValue(field: HasField): unknown;
      function view<StoredValue, QueryValue, Mutator, Options extends FieldOptions<StoredValue>>(field: Field<StoredValue, QueryValue, Mutator, Options>): View<{
          field: Field<StoredValue, QueryValue, Mutator, Options>;
      }>;
      function referencedViews(field: Field): Array<string>;
      function options<StoredValue, QueryValue, Options extends FieldOptions<StoredValue>>(field: Field<StoredValue, QueryValue, any, Options>): Options;
      function isField(value: any): value is Field;
  }
  export {};
  
}

declare module 'alinea/core/field/CreateField' {

  import type { Field, FieldOptions, WithoutLabel } from 'alinea/core/Field';
  import type { Expand } from 'alinea/core/util/Types';
  import type { View } from 'alinea/core/View';
  import { ScalarField } from 'alinea/core/field/ScalarField';
  export interface Create<Value, Options = object> extends ScalarField<Value, FieldOptions<Value> & Options> {
  }
  export type Options<F> = Expand<F extends Field<any, any, any, infer Options> ? WithoutLabel<Options & FieldOptions<any>> : WithoutLabel<FieldOptions<any>>>;
  export interface CreateConfig<Value, Options> {
      label: string;
      options: Options;
      view: View<{
          field: ScalarField<Value, Options>;
      }>;
  }
  export function create<Value, Options>({ label, options, view }: CreateConfig<Value, Options>): Create<Value, Options>;
  
}

declare module 'alinea/core/field/ListField' {

  import { Field, type FieldMeta, type FieldOptions } from 'alinea/core/Field';
  import { Schema } from 'alinea/core/Schema';
  import { type ListMutator, type ListRow } from 'alinea/core/shape/ListShape';
  import type { RecordShape } from 'alinea/core/shape/RecordShape';
  export class ListField<StoredValue extends ListRow, QueryValue, Options extends FieldOptions<Array<unknown>>> extends Field<Array<StoredValue>, Array<QueryValue>, ListMutator<StoredValue>, Options> {
      constructor(schema: Schema, shapes: Record<string, RecordShape<any>>, meta: FieldMeta<Array<StoredValue>, Array<QueryValue>, ListMutator<StoredValue>, Options>);
  }
  export type ListRowInput<Row extends ListRow, Key extends Row['_type']> = Omit<Extract<Row, {
      _type: Key;
  }>, '_type' | '_id' | '_index'>;
  export class ListEditor<StoredRow extends ListRow> {
      private rows;
      constructor(rows?: Array<StoredRow>);
      insertAt<Key extends StoredRow['_type']>(insertAt: number, type: Key, row: ListRowInput<StoredRow, Key>): this;
      add<Key extends StoredRow['_type']>(type: Key, row: ListRowInput<StoredRow, Key>): this;
      removeAt(index: number): this;
      value(): StoredRow[];
  }
  
}

declare module 'alinea/core/field/RecordField' {

  import { Field, type FieldMeta, type FieldOptions } from 'alinea/core/Field';
  import { Type } from 'alinea/core/Type';
  import type { RecordMutator } from 'alinea/core/shape/RecordShape';
  export class RecordField<Row, Options extends FieldOptions<Row>> extends Field<Row, Row, RecordMutator<Row>, Options> {
      constructor(type: Type, meta: FieldMeta<Row, Row, RecordMutator<Row>, Options>);
  }
  
}

declare module 'alinea/core/field/RichTextField' {

  import { Field, type FieldMeta, type FieldOptions } from 'alinea/core/Field';
  import { Schema } from 'alinea/core/Schema';
  import type { TextDoc } from 'alinea/core/TextDoc';
  import { type RichTextMutator } from 'alinea/core/shape/RichTextShape';
  export class RichTextField<Blocks, Options extends FieldOptions<TextDoc<Blocks>> & {
      searchable?: boolean;
  }> extends Field<TextDoc<Blocks>, TextDoc<Blocks>, RichTextMutator<Blocks>, Options> {
      constructor(schema: Schema | undefined, meta: FieldMeta<TextDoc<Blocks>, TextDoc<Blocks>, RichTextMutator<Blocks>, Options>);
  }
  export class RichTextEditor<Blocks> {
      private doc;
      constructor(doc?: TextDoc<Blocks>);
      addHtml(html: string): this;
      value(): TextDoc<Blocks>;
  }
  export function parseHTML(html: string): TextDoc<any>;
  
}

declare module 'alinea/core/field/RichTextField.test' {

  export {};
  
}

declare module 'alinea/core/field/ScalarField' {

  import { Field, type FieldMeta } from 'alinea/core/Field';
  export class ScalarField<Value, Options> extends Field<Value, Value, (value: Value) => void, Options> {
      constructor(meta: FieldMeta<Value, Value, (value: Value) => void, Options>);
  }
  
}

declare module 'alinea/core/field/UnionField' {

  import { Field, type FieldMeta, type FieldOptions } from 'alinea/core/Field';
  import { Schema } from 'alinea/core/Schema';
  import type { RecordShape } from 'alinea/core/shape/RecordShape';
  import { type UnionMutator, type UnionRow } from 'alinea/core/shape/UnionShape';
  export class UnionField<StoredValue extends UnionRow, QueryValue, Options extends FieldOptions<StoredValue>> extends Field<StoredValue, QueryValue, UnionMutator<StoredValue>, Options> {
      constructor(schema: Schema, shapes: Record<string, RecordShape<any>>, meta: FieldMeta<StoredValue, QueryValue, UnionMutator<StoredValue>, Options>);
  }
  
}

declare module 'alinea/core/Filter' {

  type Primitive = string | number | boolean | null;
  export interface Ops<Value = unknown> {
      is?: Value;
      isNot?: Value;
      in?: ReadonlyArray<Value>;
      notIn?: ReadonlyArray<Value>;
      gt?: Value;
      gte?: Value;
      lt?: Value;
      lte?: Value;
      startsWith?: string;
      or?: Condition<Value> | Array<Condition<Value>>;
  }
  interface ObjectOps<Fields> {
      has?: Filter<Fields>;
  }
  interface ArrayOps<Fields> {
      includes?: Filter<Fields>;
  }
  type FieldOps<Fields> = {
      [K in keyof Fields]?: Condition<Fields[K]>;
  };
  export interface AnyCondition<Value> extends Ops<Value>, ArrayOps<Value>, ObjectOps<Value> {
  }
  export type Condition<Value> = [Value] extends [Primitive] ? Ops<Value> | Value : [Value] extends [Array<any>] ? ArrayOps<Value[0]> : ObjectOps<Value>;
  type AndCondition<Fields> = {
      and: Array<Filter<Fields> | undefined>;
  };
  type OrCondition<Fields> = {
      or: Array<Filter<Fields> | undefined>;
  };
  export type Filter<Fields = unknown> = AndCondition<Fields> | OrCondition<Fields> | FieldOps<Fields>;
  export {};
  
}

declare module 'alinea/core/Graph' {

  import type { Root, Workspace } from 'alinea/types';
  import type { Config } from 'alinea/core/Config';
  import type { EntryFields } from 'alinea/core/EntryFields';
  import type { Expr } from 'alinea/core/Expr';
  import type { Condition, Filter } from 'alinea/core/Filter';
  import type { Infer, StoredRow } from 'alinea/core/Infer';
  import type { HasField } from 'alinea/core/Internal';
  import type { Page } from 'alinea/core/Page';
  import type { PreviewRequest } from 'alinea/core/Preview';
  import type { Type } from 'alinea/core/Type';
  import type { Expand } from 'alinea/core/util/Types';
  export type Location = Root | Workspace | Page | Array<string>;
  type FieldsOf<Types> = StoredRow<Types extends Type<infer V> ? V : Types extends Array<any> ? Types[number] : unknown>;
  export interface EdgeTranslations {
      edge: 'translations';
      includeSelf?: boolean;
  }
  export interface EdgeChildren {
      edge: 'children';
      depth?: number;
  }
  export interface EdgeParents {
      edge: 'parents';
      depth?: number;
  }
  export interface EdgeSiblings {
      edge: 'siblings';
      includeSelf?: boolean;
  }
  export interface EdgeParent {
      edge: 'parent';
  }
  export interface EdgeNext {
      edge: 'next';
  }
  export interface EdgePrevious {
      edge: 'previous';
  }
  export interface EdgeEntries {
      edge: 'entryMultiple';
      field: HasField & Expr;
  }
  export interface EdgeEntry {
      edge: 'entrySingle';
      field: HasField & Expr;
  }
  export type Edge = EdgeTranslations | EdgeChildren | EdgeParents | EdgeSiblings | EdgeParent | EdgeNext | EdgePrevious | EdgeEntries | EdgeEntry;
  export type EdgeQuery<Selection = unknown, Types = unknown, Include = unknown> = GraphQuery<Selection, Types, Include> & Edge;
  type SelectContent = Expr<any> | EdgeQuery<SelectObject | Expr<any>, Type | Array<Type>>;
  interface SelectObject {
      [key: string]: Projection;
  }
  export type Projection = SelectContent | SelectObject;
  export type InferProjection<Selection> = InferSelection<Selection>;
  export interface Order {
      asc?: Expr<any>;
      desc?: Expr<any>;
      caseSensitive?: boolean;
  }
  type InferSelection<Selection> = Selection extends GraphQuery & Edge ? Expand<AnyQueryResult<Selection>> : Selection extends Expr<infer V> ? V : {
      [K in keyof Selection]: Selection[K] extends Type<infer V> ? Type.Infer<V> : InferSelection<Selection[K]>;
  };
  type InferResult<Selection, Types, Include> = Selection extends undefined ? Types extends undefined ? EntryFields & (Include extends undefined ? {} : InferSelection<Include>) : EntryFields & Infer<Types> & (Include extends undefined ? {} : InferSelection<Include>) : Selection extends Expr<infer Value> ? Value : InferSelection<Selection>;
  export type QueryResult<Selection, Types, Include> = Expand<InferResult<Selection, Types, Include>>;
  interface CountQuery<Selection, Types, Include> extends GraphQuery<Selection, Types, Include> {
      count: true;
  }
  type FirstQuery<Selection, Types, Include> = (GraphQuery<Selection, Types, Include> & {
      first: true;
  }) | (GraphQuery<Selection, Types, Include> & {
      edge: 'parent';
  }) | (GraphQuery<Selection, Types, Include> & {
      edge: 'next';
  }) | (GraphQuery<Selection, Types, Include> & {
      edge: 'previous';
  });
  interface GetQuery<Selection, Types, Include> extends GraphQuery<Selection, Types, Include> {
      get: true;
  }
  export type AnyQueryResult<Query extends GraphQuery> = Query extends CountQuery<any, any, any> ? number : Query extends GetQuery<infer S, infer T, infer I> ? QueryResult<S, T, I> : Query extends FirstQuery<infer S, infer T, infer I> ? QueryResult<S, T, I> | null : Query extends GraphQuery<infer S, infer T, infer I> ? Array<QueryResult<S, T, I>> : unknown;
  export type Status = 
  /** Only published entries */
  'published'
  /** Only drafts */
   | 'draft'
  /** Only archived entries */
   | 'archived'
  /** Prefer drafts, then published, then archived */
   | 'preferDraft'
  /** Prefer published, then archived, then drafts */
   | 'preferPublished'
  /** All statuses */
   | 'all';
  export class QuerySettings {
      /** Find a single entry or null */
      first?: true;
      /** Find a single entry */
      get?: true;
      /** Return the count of results found */
      count?: true;
      /** Filter by id */
      id?: Condition<string>;
      /** Filter by parentId */
      parentId?: Condition<string | null>;
      /** Filter by path */
      path?: Condition<string>;
      /** Filter by url */
      url?: Condition<string>;
      /** Filter by workspace */
      workspace?: Condition<string> | Workspace;
      /** Filter by root */
      root?: Condition<string> | Root;
      /** Filter by level */
      level?: Condition<number>;
      /** Filter results by location */
      location?: Location;
      /** Filter by locale, for absolute match */
      locale?: string | null;
      /** Filter by preferred locale */
      preferredLocale?: string;
      /** Filter by fields */
      filter?: Filter<EntryFields>;
      /** Filter by search terms */
      search?: string | Array<string>;
      /** The time in seconds to poll for updates to content */
      syncInterval?: number;
      /** Disable polling for updates to content */
      disableSync?: boolean;
      /** Skip the first N results */
      skip?: number;
      /** Return the first N results */
      take?: number;
      /** Group results by one or more fields */
      groupBy?: Expr<any> | Array<Expr<any>>;
      /** Order results by one or more fields */
      orderBy?: Order | Array<Order>;
      /** Change status to include drafts or archived entries */
      status?: Status;
      /** Preview an entry */
      preview?: PreviewRequest;
  }
  export interface QueryBase<Selection, Types, Include> extends QuerySettings {
      type?: Types;
      select?: Selection;
      include?: Include;
      filter?: Filter<EntryFields & FieldsOf<Types>>;
  }
  export interface QueryWithResult<Result> extends QuerySettings {
      select: Result extends object ? {
          [K in keyof Result]: Expr<Result[K]>;
      } : Expr<Result>;
  }
  export interface QueryInput<Selection, Types> extends QuerySettings {
      select?: Selection;
      filter?: Filter<EntryFields & FieldsOf<Types>>;
  }
  export interface GraphQuery<Selection = unknown, Types = unknown, Include = unknown> extends QueryBase<Selection, Types, Include> {
  }
  export type SelectionGuard = Projection | undefined;
  export type TypeGuard = Type | Array<Type> | undefined;
  export type IncludeGuard = SelectObject | undefined;
  export abstract class Graph {
      abstract config: Config;
      abstract resolve<Query extends GraphQuery>(query: Query): Promise<AnyQueryResult<Query>>;
      find<Selection extends SelectionGuard = undefined, const Type extends TypeGuard = undefined, Include extends IncludeGuard = undefined>(query: GraphQuery<Selection, Type, Include>): Promise<Array<QueryResult<Selection, Type, Include>>>;
      first<Selection extends SelectionGuard = undefined, const Type extends TypeGuard = undefined, Include extends IncludeGuard = undefined>(query: GraphQuery<Selection, Type, Include>): Promise<QueryResult<Selection, Type, Include> | null>;
      get<Selection extends SelectionGuard = undefined, const Type extends TypeGuard = undefined, Include extends IncludeGuard = undefined>(query: GraphQuery<Selection, Type, Include>): Promise<QueryResult<Selection, Type, Include>>;
      count<Selection extends SelectionGuard = undefined, const Type extends TypeGuard = undefined, Include extends IncludeGuard = undefined>(query: GraphQuery<Selection, Type, Include>): Promise<number>;
  }
  export function querySource(query: unknown): "children" | "parent" | "next" | "parents" | "entrySingle" | "translations" | "siblings" | "previous" | "entryMultiple" | undefined;
  export {};
  
}

declare module 'alinea/core/HttpError' {

  /**
   * @see {@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes}
   */
  export enum ErrorCode {
      BadRequest = 400,
      Unauthorized = 401,
      PaymentRequired = 402,
      Forbidden = 403,
      NotFound = 404,
      MethodNotAllowed = 405,
      Gone = 410,
      NotAcceptable = 406,
      Timeout = 408,
      Conflict = 409,
      PayloadTooLarge = 413,
      UnsupportedMediaType = 415,
      OutOfRange = 416,
      ExpectationFailed = 417,
      I_am_a_Teapot = 418,
      AuthenticationTimeout = 419,
      UnprocessableEntity = 422,
      TooManyRequests = 429,
      InternalError = 500,
      NotImplemented = 501,
      ServiceUnavailable = 503,
      InsufficientStorage = 507,
      BandwidthLimitExceeded = 509
  }
  export class HttpError extends Error {
      name: string;
      code: ErrorCode;
      constructor(code: number | ErrorCode, message?: string, options?: ErrorOptions);
  }
  export function isHttpError(error: Error): error is HttpError;
  
}

declare module 'alinea/core/Id' {

  export function validateId(id: string): boolean;
  export function createId(): string;
  
}

declare module 'alinea/core/Infer' {

  import type { Expand, UnionOfValues } from 'alinea/core/util/Types';
  import type { EntryFields } from 'alinea/core/EntryFields';
  import type { Expr } from 'alinea/core/Expr';
  import type { Field } from 'alinea/core/Field';
  import type { InferProjection } from 'alinea/core/Graph';
  import type { ListRow } from 'alinea/core/shape/ListShape';
  import type { Type } from 'alinea/core/Type';
  type QueryList<T> = Expand<UnionOfValues<{
      [K in keyof T]: {
          _type: K;
      } & Type.Infer<T[K]>;
  }>>;
  export type InferQueryValue<T> = T extends Array<Type<infer X>> ? InferQueryValue<X> : T extends Type<infer Fields> ? Type.Infer<Fields> : T extends Expr<infer QueryValue> ? QueryValue : T extends Record<string, Type> ? QueryList<T> : InferProjection<T>;
  type StoredList<T> = Expand<UnionOfValues<{
      [K in keyof T]: {
          _type: K;
      } & StoredRow<T[K]>;
  }>>;
  export type StoredRow<Definition> = {
      [K in keyof Definition as Definition[K] extends Field<any> ? K : never]: Definition[K] extends Field<infer T> ? T : never;
  };
  export type InferStoredValue<T> = T extends Type<infer Fields> ? StoredRow<Fields> : T extends Field<infer StoredValue> ? StoredValue : T extends Record<string, Type> ? StoredList<T> : {};
  export type Infer<T> = InferQueryValue<T>;
  export namespace Infer {
      type Entry<T extends Type, TypeName extends string = string> = InferQueryValue<T> & Omit<EntryFields, '_type'> & {
          _type: TypeName;
      };
      type ListItem<T extends Type, TypeName extends string = string> = InferQueryValue<T> & Omit<ListRow, '_type'> & {
          _type: TypeName;
      };
  }
  export {};
  
}

declare module 'alinea/core/Internal' {

  import type { ExprInternal } from 'alinea/core/Expr';
  import type { FieldInternal } from 'alinea/core/Field';
  import type { RootInternal } from 'alinea/core/Root';
  import type { TypeInternal } from 'alinea/core/Type';
  import type { WorkspaceInternal } from 'alinea/core/Workspace';
  export const internalRoot: unique symbol;
  export type HasRoot = {
      readonly [internalRoot]: RootInternal;
  };
  export const hasRoot: (obj: object) => obj is HasRoot;
  export const getRoot: (obj: HasRoot) => RootInternal;
  export const internalType: unique symbol;
  export class HasType {
      get [internalType](): TypeInternal;
  }
  export const hasType: (obj: object) => obj is HasType;
  export const getType: (obj: HasType) => TypeInternal;
  export const internalField: unique symbol;
  export type HasField = {
      readonly [internalField]: FieldInternal;
  };
  export const hasField: (obj: object) => obj is HasField;
  export const getField: (obj: HasField) => FieldInternal;
  export const internalWorkspace: unique symbol;
  export type HasWorkspace = {
      [internalWorkspace]: WorkspaceInternal;
  };
  export const hasWorkspace: (obj: object) => obj is HasWorkspace;
  export const getWorkspace: (obj: HasWorkspace) => WorkspaceInternal;
  export const internalExpr: unique symbol;
  export type HasExpr = {
      readonly [internalExpr]: ExprInternal;
  };
  export const hasExpr: (obj: object) => obj is HasExpr;
  export const getExpr: (obj: HasExpr) => ExprInternal;
  
}

declare module 'alinea/core/Label' {

  export namespace Label {
      type Data = {
          [language: string]: string;
      };
  }
  export type Label = string;
  
}

declare module 'alinea/core/media/CreatePreview.browser' {

  import type { ImagePreviewDetails } from 'alinea/core/media/CreatePreview';
  export type { ImagePreviewDetails };
  export function createPreview(blob: Blob): Promise<ImagePreviewDetails>;
  
}

declare module 'alinea/core/media/CreatePreview' {

  export interface ImagePreviewDetails {
      width: number;
      height: number;
      averageColor: string;
      focus: {
          x: number;
          y: number;
      };
      thumbHash: string;
      preview: string;
  }
  export function createPreview(blob: Blob): Promise<ImagePreviewDetails>;
  
}

declare module 'alinea/core/media/IsImage' {

  export const imageExtensions: string[];
  export function isImage(pathOrExtension: string): boolean | "" | undefined;
  
}

declare module 'alinea/core/media/MediaLocation' {

  export const MEDIA_LOCATION = "@alinea.location";
  
}

declare module 'alinea/core/media/MediaRoot' {

  import type { Page } from 'alinea/core/Page';
  import { type Root } from 'alinea/core/Root';
  export type MediaRoot<Children extends Record<string, Page>> = Root<Children>;
  export function createMediaRoot<Children extends Record<string, Page>>(children?: Children): MediaRoot<Children>;
  
}

declare module 'alinea/core/media/MediaTypes' {

  import { type Type } from 'alinea/core/Type';
  export type MediaLibrary = Type.Infer<typeof MediaLibrary>;
  export const MediaLibrary: Type<{
      title: import("alinea/field/hidden").HiddenField<string>;
      path: import("alinea/field/hidden").HiddenField<string>;
  }>;
  export type MediaFile = Type.Infer<typeof MediaFile>;
  export const MediaFile: Type<{
      title: import("alinea/field/text/TextField").TextField;
      path: import("alinea/field/hidden").HiddenField<string>;
      location: import("alinea/field/hidden").HiddenField<string>;
      previewUrl: import("alinea/field/hidden").HiddenField<string>;
      extension: import("alinea/field/hidden").HiddenField<string>;
      size: import("alinea/field/hidden").HiddenField<number>;
      hash: import("alinea/field/hidden").HiddenField<string>;
      width: import("alinea/field/hidden").HiddenField<number>;
      height: import("alinea/field/hidden").HiddenField<number>;
      preview: import("alinea/field/hidden").HiddenField<string>;
      averageColor: import("alinea/field/hidden").HiddenField<string>;
      focus: import("alinea/field/hidden").HiddenField<{
          x: number;
          y: number;
      }>;
      thumbHash: import("alinea/field/hidden").HiddenField<string>;
  }>;
  
}

declare module 'alinea/core/media/Summary' {

  import type { Schema } from 'alinea/core/Schema';
  export function summarySelection(schema: Schema): {
      id: import("alinea/core/Expr").Expr<string>;
      locale: import("alinea/core/Expr").Expr<string | null>;
      type: import("alinea/core/Expr").Expr<string>;
      workspace: import("alinea/core/Expr").Expr<string>;
      root: import("alinea/core/Expr").Expr<string>;
      title: import("alinea/core/Expr").Expr<string>;
      path: import("alinea/core/Expr").Expr<string>;
      url: import("alinea/core/Expr").Expr<string>;
      extension: import("alinea/field/hidden").HiddenField<string>;
      size: import("alinea/field/hidden").HiddenField<number>;
      preview: import("alinea/field/hidden").HiddenField<string>;
      thumbHash: import("alinea/field/hidden").HiddenField<string>;
      averageColor: import("alinea/field/hidden").HiddenField<string>;
      focus: import("alinea/field/hidden").HiddenField<{
          x: number;
          y: number;
      }>;
      width: import("alinea/field/hidden").HiddenField<number>;
      height: import("alinea/field/hidden").HiddenField<number>;
      parents: {
          edge: "parents";
          select: {
              id: import("alinea/core/Expr").Expr<string>;
              title: import("alinea/core/Expr").Expr<string>;
          };
      };
      childrenAmount: {
          edge: "children";
          count: true;
      };
  };
  export type SummaryProps = {
      id: string;
      type: string;
      workspace: string;
      root: string;
      title: string;
      path: string;
      url: string;
      extension: string;
      size: number;
      preview: string;
      thumbHash: string;
      averageColor: string;
      focus: {
          x: number;
          y: number;
      };
      width: number;
      height: number;
      parents: Array<{
          id: string;
          title: string;
      }>;
      childrenAmount: number;
  };
  
}

declare module 'alinea/core/OrderBy' {

  import type { Expr } from 'alinea/core/Expr';
  export type OrderBy = {
      asc: Expr<any>;
  } | {
      desc: Expr<any>;
  };
  
}

declare module 'alinea/core/Outcome' {

  export type Outcome<T = unknown> = [T, undefined] | [undefined, Error];
  export function outcome<T>(promised: Promise<T>): Promise<Outcome<T>>;
  export function outcome<T>(run: () => Promise<T>): Promise<Outcome<T>>;
  export function outcome<T>(run: () => T): Outcome<T>;
  
}

declare module 'alinea/core/Page' {

  import type { FieldsDefinition, Type } from 'alinea/core/Type';
  export interface PageData {
      type: Type;
      fields: Record<string, any>;
  }
  export type Page<Children extends Record<string, Page> = Record<string, never>> = Children & {
      [Page.Data]: PageData;
  };
  export namespace Page {
      const Data: unique symbol;
      function data(page: Page): PageData;
      function isPage(page: any): page is Page;
  }
  export interface PageConfig<Definition, Children> {
      type: Type<Definition>;
      fields?: Partial<Type.Infer<Definition>>;
      children?: Children;
  }
  export function page<Fields extends FieldsDefinition, Children extends Record<string, Page>>(config: PageConfig<Fields, Children>): Page<Children>;
  
}

declare module 'alinea/core/pages/PostProcess' {

  import type { LinkResolver } from 'alinea/core/db/LinkResolver';
  export interface PostProcess<Value> {
      (value: Value, loader: LinkResolver): Promise<void>;
  }
  
}

declare module 'alinea/core/pages/Snippet' {

  import { Expr } from 'alinea/core/Expr';
  export function snippet(start?: string, end?: string, cutOff?: string, limit?: number): Expr<string>;
  
}

declare module 'alinea/core/Picker' {

  import type { ComponentType } from 'react';
  import type { Label } from 'alinea/core/Label';
  import type { Reference } from 'alinea/core/Reference';
  import type { Type } from 'alinea/core/Type';
  import type { PostProcess } from 'alinea/core/pages/PostProcess';
  import type { RecordShape } from 'alinea/core/shape/RecordShape';
  export interface PickerProps<T = any> {
      type: string;
      options: T;
      selection: Array<Reference> | undefined;
      onConfirm(value: Array<Reference> | undefined): void;
      onCancel(): void;
  }
  export interface PickerRow {
      id: string;
      type: string;
      entry?: string;
      url?: string;
      description?: string;
      target?: string;
  }
  export interface Picker<StoredValue extends Reference, Options extends {} = {}> {
      shape: RecordShape;
      fields: Type<any> | undefined;
      label: Label;
      handlesMultiple: boolean;
      options: Options;
      view?: ComponentType<PickerProps<Options>>;
      viewRow?: ComponentType<{
          reference: StoredValue;
      }>;
      postProcess?: PostProcess<StoredValue>;
  }
  export function pickerWithView<R extends Reference, T extends {}, C extends (...args: Array<any>) => Picker<R, T>>(create: C, views: {
      view: ComponentType<PickerProps<T>>;
      viewRow: ComponentType<{
          reference: R;
      }>;
  }): C;
  
}

declare module 'alinea/core/Preview' {

  import type { ComponentType } from 'react';
  import type { Entry } from 'alinea/core/Entry';
  export type Preview = boolean | ComponentType<{
      entry: Entry;
  }>;
  export interface PreviewPayload {
      payload: string;
  }
  export type PreviewRequest = PreviewPayload | {
      entry: Entry;
  };
  export interface PreviewUpdate {
      locale: string | null;
      entryId: string;
      contentHash: string;
      status: string;
      patch: Uint8Array;
  }
  export interface PreviewMetadata {
      title: string;
      description?: string;
      language?: string;
      robots?: string;
      canonical?: string;
      'og:url'?: string;
      'og:site_name'?: string;
      'og:title'?: string;
      'og:description'?: string;
      'og:image'?: string;
      'og:image:width'?: string;
      'og:image:height'?: string;
      'twitter:card'?: string;
      'twitter:title'?: string;
      'twitter:image'?: string;
      'twitter:image:width'?: string;
      'twitter:image:height'?: string;
  }
  
}

declare module 'alinea/core/Reference' {

  export interface Reference {
      _id: string;
      _type: string;
  }
  export namespace Reference {
      const id = "_id";
      const type = "_type";
  }
  
}

declare module 'alinea/core/Resolver' {

  import type { AnyQueryResult, GraphQuery } from 'alinea/core/Graph';
  export interface Resolver {
      resolve<Query extends GraphQuery>(query: Query): Promise<AnyQueryResult<Query>>;
  }
  
}

declare module 'alinea/core/Root' {

  import type { ComponentType } from 'react';
  import { type HasRoot } from 'alinea/core/Internal';
  import type { Label } from 'alinea/core/Label';
  import type { OrderBy } from 'alinea/core/OrderBy';
  import type { Page } from 'alinea/core/Page';
  import type { Preview } from 'alinea/core/Preview';
  import { Schema } from 'alinea/core/Schema';
  import { Type } from 'alinea/core/Type';
  import type { View } from 'alinea/core/View';
  export interface RootI18n {
      locales: ReadonlyArray<string>;
  }
  export interface RootMeta {
      /** Accepts entries of these types as children */
      contains?: Array<string | Type>;
      /** Order children entries in the sidebar content tree */
      orderChildrenBy?: OrderBy | Array<OrderBy>;
      icon?: ComponentType;
      i18n?: RootI18n;
      /** Point to a React component used to view this root in the dashboard */
      view?: View<{
          root: RootData;
      }>;
      isMediaRoot?: boolean;
      preview?: Preview;
  }
  export interface ChildrenDefinition {
      [key: string]: Page;
  }
  export interface RootData extends RootMeta {
      label: string;
  }
  export type Root<Children extends ChildrenDefinition = ChildrenDefinition> = Children & HasRoot;
  export namespace Root {
      function label(root: Root): Label;
      function contains(root: Root): Array<string | Type>;
      function data(root: Root): RootData;
      function preview(root: Root): Preview | undefined;
      function defaultLocale(root: Root): string | undefined;
      function isRoot(value: any): value is Root;
      function isMediaRoot(root: Root): boolean;
      function validate(root: Root, workspaceLabel: string, schema: Schema): void;
      function referencedViews(root: Root): Array<string>;
  }
  export interface RootOptions<Children> extends RootMeta {
      children?: Children;
  }
  export interface RootInternal extends RootOptions<ChildrenDefinition> {
      label: string;
  }
  export function root<Entries extends ChildrenDefinition>(label: string, config?: RootOptions<Entries>): Root<Entries>;
  
}

declare module 'alinea/core/Schema' {

  import { Type } from 'alinea/core/Type';
  import type { RecordShape } from 'alinea/core/shape/RecordShape';
  export interface Schema<Definitions = {}> extends Record<string, Type> {
  }
  export namespace Schema {
      function referencedViews(schema: Schema): Array<string>;
      function validate(schema: Schema): void;
      function shapes(schema: Schema): Record<string, RecordShape>;
      function typeNames(schema: Schema): Map<Type, string>;
      function contained(schema: Schema, contains: Array<string | Type>): Array<string>;
  }
  export interface SchemaTypes {
      [key: string]: Type;
  }
  export interface SchemaOptions<Definition> {
      types: Definition;
  }
  export function schema<Definition extends SchemaTypes>(options: SchemaOptions<Definition>): Definition;
  
}

declare module 'alinea/core/Scope' {

  import type { Workspace } from 'alinea/types';
  import type { Config } from 'alinea/core/Config';
  import { Expr } from 'alinea/core/Expr';
  import type { Field } from 'alinea/core/Field';
  import { type HasRoot, type HasWorkspace } from 'alinea/core/Internal';
  import type { Page } from 'alinea/core/Page';
  import type { Root } from 'alinea/core/Root';
  import type { Type } from 'alinea/core/Type';
  export type Entity = Workspace | Root | Type | Field | Expr | Page;
  export const ScopeKey: {
      workspace(workspace: string): string;
      root(workspace: string, root: string): string;
      page(workspace: string, root: string, page: string): string;
      type(type: string): string;
      field(type: string, field: string): string;
      entry(entryId: string): string;
  };
  export class Scope {
      #private;
      constructor(config: Config);
      workspaceOf(root: HasRoot): HasWorkspace;
      keyOf(entity: Entity): string;
      locationOf(entity: Entity): string[] | undefined;
      nameOf(entity: Entity): string | undefined;
      stringify(input: any): string;
      parse<Result>(input: string): Result;
  }
  export function getScope(config: Config): Scope;
  
}

declare module 'alinea/core/Section' {

  import type { ComponentType } from 'react';
  import { Field } from 'alinea/core/Field';
  import type { View } from 'alinea/core/View';
  export interface SectionDefinition {
      [key: string]: Field<any, any> | Section;
  }
  export interface SectionData {
      definition: SectionDefinition;
      fields: Record<string, Field>;
      sections: Array<Section>;
      view?: View<{
          section: Section;
      }>;
  }
  export interface SectionI extends Record<string, Field> {
  }
  export class SectionI {
      get [Section.Data](): SectionData;
  }
  export type Section<Fields = object> = Fields & SectionI;
  export type SectionView<Fields> = ComponentType<{
      section: Section<Fields>;
  }>;
  export namespace Section {
      const Data: unique symbol;
      function view(section: Section): View<{
          section: Section;
      }> | undefined;
      function referencedViews(section: Section): Array<string>;
      function definition(section: Section): SectionDefinition;
      function fields(section: Section): Record<string, Field<any, any, any, any>>;
      function isSection(value: any): value is Section;
  }
  interface SectionOptions extends Omit<SectionData, 'fields' | 'sections'> {
      fields?: Record<string, Field>;
      sections?: Array<Section>;
  }
  export function section<Fields>(data: SectionOptions): Section<Fields>;
  export {};
  
}

declare module 'alinea/core/Session' {

  import type { BrowserConnection } from 'alinea/core/Connection';
  import type { User } from 'alinea/core/User';
  export interface Session {
      cnx: BrowserConnection;
      user: User;
  }
  
}

declare module 'alinea/core/Shape' {

  import type { LinkResolver } from 'alinea/core/db/LinkResolver';
  import type * as Y from 'yjs';
  import type { Label } from 'alinea/core/Label';
  type YType = Y.Map<any>;
  export interface Shape<Value = any, Mutator = any> {
      initialValue?: Value;
      label: Label;
      create(): Value;
      toY(value: Value): any;
      fromY(yValue: any): Value;
      applyY(value: Value, parent: YType, key: string): void;
      init(parent: YType, key: string): void;
      watch(parent: YType, key: string): (fun: () => void) => () => void;
      mutator(parent: YType, key: string): Mutator;
      applyLinks(value: Value, loader: LinkResolver): Promise<void>;
      toV1(value: any): Value;
      searchableText(value: Value): string;
  }
  export {};
  
}

declare module 'alinea/core/shape/ListShape' {

  import type { LinkResolver } from 'alinea/core/db/LinkResolver';
  import * as Y from 'yjs';
  import type { Label } from 'alinea/core/Label';
  import type { Shape } from 'alinea/core/Shape';
  import type { PostProcess } from 'alinea/core/pages/PostProcess';
  import { RecordShape } from 'alinea/core/shape/RecordShape';
  export interface ListRow {
      _id: string;
      _type: string;
      _index: string;
  }
  export namespace ListRow {
      const id = "_id";
      const index = "_index";
      const type = "_type";
  }
  export interface ListMutator<Row> {
      replace(id: string, row: Row): void;
      push(row: Omit<Row, '_id' | '_index'>, insertAt?: number): void;
      remove(id: string): void;
      move(oldIndex: number, newIndex: number): void;
      read(id: string): Row | undefined;
  }
  export class ListShape<Row extends ListRow> implements Shape<Array<Row>, ListMutator<Row>> {
      label: Label;
      initialValue?: Array<Row> | undefined;
      protected postProcess?: PostProcess<Array<Row>> | undefined;
      shapes: Record<string, RecordShape>;
      constructor(label: Label, shapes: Record<string, RecordShape>, initialValue?: Array<Row> | undefined, postProcess?: PostProcess<Array<Row>> | undefined);
      create(): Row[];
      toV1(value: any): Row[];
      private normalizeRow;
      toY(value: Array<Row>): Y.Map<unknown>;
      fromY(map: Y.Map<any>): Array<Row>;
      applyY(value: Row[], parent: Y.Map<any>, key: string): void;
      init(parent: Y.Map<any>, key: string): void;
      watch(parent: Y.Map<any>, key: string): (fun: () => void) => () => void;
      mutator(parent: Y.Map<any>, key: string): {
          replace: (id: string, row: Row) => void;
          push: (row: Omit<Row, "_id" | "_index">, insertAt?: number) => void;
          remove(id: string): void;
          move: (oldIndex: number, newIndex: number) => void;
          read: (id: string) => Row | undefined;
      };
      applyLinks(value: Array<Row>, loader: LinkResolver): Promise<void>;
      searchableText(value: Array<Row>): string;
  }
  
}

declare module 'alinea/core/shape/ListShape.test' {

  export {};
  
}

declare module 'alinea/core/shape/RecordShape' {

  import type { LinkResolver } from 'alinea/core/db/LinkResolver';
  import * as Y from 'yjs';
  import type { Label } from 'alinea/core/Label';
  import type { Shape } from 'alinea/core/Shape';
  export type RecordMutator<T> = {
      set: <K extends keyof T>(k: K, v: T[K]) => void;
  };
  export class RecordShape<T = {}> implements Shape<T, RecordMutator<T>> {
      label: Label;
      shapes: Record<string, Shape>;
      initialValue?: T | undefined;
      constructor(label: Label, shapes: Record<string, Shape>, initialValue?: T | undefined);
      concat<X>(that: RecordShape<X> | undefined): RecordShape<T & X>;
      create(): T;
      toY(value: T): Y.Map<unknown>;
      fromY(map: Y.Map<any>): T;
      applyY(value: T, map: Y.Doc | Y.Map<any>, key: string): undefined;
      init(parent: Y.Map<any>, key: string): void;
      watch(parent: Y.Map<any>, key: string): (fun: () => void) => () => any;
      mutator(parent: Y.Map<any>, key: string): {
          set: <K extends keyof T>(k: K, v: T[K]) => void;
      };
      applyLinks(value: T, loader: LinkResolver): Promise<void>;
      toV1(value: any): T;
      searchableText(value: T): string;
  }
  
}

declare module 'alinea/core/shape/RecordShape.test' {

  export {};
  
}

declare module 'alinea/core/shape/RichTextShape' {

  import type { LinkResolver } from 'alinea/core/db/LinkResolver';
  import * as Y from 'yjs';
  import type { Label } from 'alinea/core/Label';
  import type { Shape } from 'alinea/core/Shape';
  import { Node, type TextDoc } from 'alinea/core/TextDoc';
  import { RecordShape } from 'alinea/core/shape/RecordShape';
  export enum RichTextElements {
      h1 = "h1",
      h2 = "h2",
      h3 = "h3",
      h4 = "h4",
      h5 = "h5",
      h6 = "h6",
      p = "p",
      b = "b",
      i = "i",
      ul = "ul",
      ol = "ol",
      li = "li",
      a = "a",
      blockquote = "blockquote",
      hr = "hr",
      br = "br",
      small = "small",
      sup = "sup",
      sub = "sub",
      table = "table",
      tbody = "tbody",
      td = "td",
      th = "th",
      tr = "tr"
  }
  export type RichTextMutator<R> = {
      map: Y.Map<any>;
      fragment: Y.XmlFragment;
      insert: (id: string, block: string) => void;
  };
  export interface TextDocStorage<Blocks> {
      doc: TextDoc<Blocks>;
      linked: Array<string>;
  }
  export interface TextDocSelected<Blocks> {
      doc: TextDoc<Blocks>;
      linked: Array<{
          id: string;
          url: string;
      }>;
  }
  export class RichTextShape<Blocks> implements Shape<TextDoc<Blocks>, RichTextMutator<Blocks>> {
      label: Label;
      shapes?: Record<string, RecordShape> | undefined;
      initialValue?: TextDoc<Blocks> | undefined;
      searchable?: boolean | undefined;
      blocks: Record<string, RecordShape>;
      constructor(label: Label, shapes?: Record<string, RecordShape> | undefined, initialValue?: TextDoc<Blocks> | undefined, searchable?: boolean | undefined);
      create(): TextDoc<Blocks>;
      toXml(rows: TextDoc<Blocks>): (Y.XmlElement<{
          [key: string]: string;
      }> | Y.XmlText)[];
      toV1(value: any): TextDoc<Blocks>;
      private normalizeRow;
      toY(value: TextDoc<Blocks>): Y.Map<unknown>;
      fromY(map: Y.Map<any>): TextDoc<Blocks>;
      applyY(value: TextDoc<Blocks>, parent: Y.Map<any>, key: string): void;
      init(parent: Y.Map<any>, key: string): void;
      watch(parent: Y.Map<any>, key: string): (fun: () => void) => () => void;
      mutator(parent: Y.Map<any>, key: string): {
          map: any;
          fragment: any;
          insert: (id: string, block: string) => void;
      };
      applyLinks(doc: TextDoc<Blocks>, loader: LinkResolver): Promise<void>;
      searchableText(value: TextDoc<Blocks>): string;
      textOf(node: Node): string;
  }
  
}

declare module 'alinea/core/shape/RichTextShape.test' {

  export {};
  
}

declare module 'alinea/core/shape/ScalarShape' {

  import type * as Y from 'yjs';
  import type { Label } from 'alinea/core/Label';
  import type { Shape } from 'alinea/core/Shape';
  export type ScalarMutator<T> = (value: T) => void;
  export class ScalarShape<T> implements Shape<T, ScalarMutator<T>> {
      label: Label;
      initialValue?: T | undefined;
      searchable?: boolean | undefined;
      constructor(label: Label, initialValue?: T | undefined, searchable?: boolean | undefined);
      create(): T;
      toY(value: T): T;
      toV1(value: any): T;
      fromY(yValue: any): any;
      applyY(value: T, parent: Y.Map<any>, key: string): void;
      init(parent: Y.Map<any>, key: string): void;
      watch(parent: Y.Map<any>, key: string): (fun: () => void) => () => void;
      mutator(parent: Y.Map<any>, key: string): (value: T) => void;
      applyLinks(): Promise<void>;
      searchableText(value: T): string;
  }
  
}

declare module 'alinea/core/shape/ScalarShape.test' {

  export {};
  
}

declare module 'alinea/core/shape/UnionShape' {

  import type { LinkResolver } from 'alinea/core/db/LinkResolver';
  import * as Y from 'yjs';
  import type { Label } from 'alinea/core/Label';
  import type { Shape } from 'alinea/core/Shape';
  import type { PostProcess } from 'alinea/core/pages/PostProcess';
  import { RecordShape } from 'alinea/core/shape/RecordShape';
  export interface UnionRow {
      _id: string;
      _type: string;
  }
  export namespace UnionRow {
      const id = "_id";
      const type = "_type";
  }
  export interface UnionMutator<T extends UnionRow> {
      replace: (v: T | undefined) => void;
  }
  export class UnionShape<T extends UnionRow> implements Shape<T, UnionMutator<T>> {
      label: Label;
      initialValue?: T | undefined;
      protected postProcess?: PostProcess<T> | undefined;
      shapes: Record<string, RecordShape>;
      constructor(label: Label, shapes: Record<string, RecordShape>, initialValue?: T | undefined, postProcess?: PostProcess<T> | undefined);
      create(): T;
      toY(value: T): Y.Map<unknown>;
      fromY(map: Y.Map<any>): T;
      applyY(value: T, parent: Y.Map<any>, key: string): void;
      init(parent: Y.Map<any>, key: string): void;
      watch(parent: Y.Map<any>, key: string): (fun: () => void) => () => void;
      mutator(parent: Y.Map<any>, key: string): UnionMutator<T>;
      applyLinks(value: T, loader: LinkResolver): Promise<void>;
      toV1(value: any): T;
      searchableText(value: T): string;
  }
  
}

declare module 'alinea/core/shape/UnionShape.test' {

  export {};
  
}

declare module 'alinea/core/source/Change' {

  export type Change = AddChange | DeleteChange;
  export interface ChangeFile {
      path: string;
      sha: string;
  }
  export interface AddChange extends ChangeFile {
      op: 'add';
      contents?: Uint8Array;
  }
  export interface DeleteChange extends ChangeFile {
      op: 'delete';
  }
  export interface ChangesBatch {
      fromSha: string;
      changes: Array<Change>;
  }
  
}

declare module 'alinea/core/source/CombinedSource' {

  import type { ChangesBatch } from 'alinea/core/source/Change';
  import type { Source } from 'alinea/core/source/Source';
  import { ReadonlyTree } from 'alinea/core/source/Tree';
  export class CombinedSource implements Source {
      #private;
      constructor(sources: Record<string, Source>);
      getTree(): Promise<ReadonlyTree>;
      getTreeIfDifferent(sha: string): Promise<ReadonlyTree | undefined>;
      getBlobs(shas: Array<string>): AsyncGenerator<[sha: string, blob: Uint8Array]>;
      applyChanges(batch: ChangesBatch): Promise<void>;
  }
  
}

declare module 'alinea/core/source/CombinedSource.test' {

  export {};
  
}

declare module 'alinea/core/source/FilePatch' {

  /**
   * Creates a Git-delta based patch for transforming `base` into `updated`.
   * Format:
   * - 20 bytes: SHA-1(base)
   * - N bytes: Git delta payload
   * - 20 bytes: SHA-1(updated)
   */
  export function createFilePatch(base: string, updated: string): Promise<Uint8Array>;
  /**
   * Applies a patch created by `createFilePatch` and returns the updated string.
   */
  export function applyFilePatch(base: string, patch: Uint8Array): Promise<string>;
  
}

declare module 'alinea/core/source/FilePatch.test' {

  export {};
  
}

declare module 'alinea/core/source/FSSource' {

  import type { ChangesBatch } from 'alinea/core/source/Change';
  import type { Source } from 'alinea/core/source/Source';
  import { ReadonlyTree, WriteableTree } from 'alinea/core/source/Tree';
  export class FSSource implements Source {
      #private;
      constructor(cwd: string);
      getTree(): Promise<ReadonlyTree>;
      getFile(current: ReadonlyTree, builder: WriteableTree, file: string): Promise<readonly [string, Buffer] | undefined>;
      getTreeIfDifferent(sha: string): Promise<ReadonlyTree | undefined>;
      getBlobs(shas: Array<string>): AsyncGenerator<[sha: string, blob: Uint8Array]>;
      applyChanges(batch: ChangesBatch): Promise<void>;
  }
  export class CachedFSSource extends FSSource {
      #private;
      constructor(cwd: string);
      refresh: () => Promise<ReadonlyTree>;
      getTree(): Promise<ReadonlyTree>;
      getFile(current: ReadonlyTree, builder: WriteableTree, file: string): Promise<readonly [string, Buffer] | undefined>;
      getBlobs(shas: Array<string>): AsyncGenerator<[sha: string, blob: Uint8Array]>;
  }
  
}

declare module 'alinea/core/source/FSSource.test' {

  export {};
  
}

declare module 'alinea/core/source/GitDelta' {

  /**
   * Creates Git-compatible delta data (the payload format used by OBJ_REF_DELTA
   * and OBJ_OFS_DELTA entries in pack files).
   */
  export function createGitDelta(base: Uint8Array, target: Uint8Array): Uint8Array;
  /**
   * Applies Git delta data onto a base object and returns the reconstructed
   * target object bytes.
   */
  export function applyGitDelta(base: Uint8Array, delta: Uint8Array): Uint8Array;
  
}

declare module 'alinea/core/source/GitDelta.test' {

  export {};
  
}

declare module 'alinea/core/source/GithubSource' {

  import type { ChangesBatch } from 'alinea/core/source/Change';
  import type { Source } from 'alinea/core/source/Source';
  import { ReadonlyTree } from 'alinea/core/source/Tree';
  export interface GithubSourceOptions {
      authToken: string;
      owner: string;
      repo: string;
      branch: string;
      rootDir: string;
      contentDir: string;
  }
  export class GithubSource implements Source {
      #private;
      constructor(options: GithubSourceOptions);
      protected get contentLocation(): string;
      getTree(): Promise<ReadonlyTree>;
      shaAt(ref: string): Promise<string>;
      getTreeIfDifferent(sha: string): Promise<ReadonlyTree | undefined>;
      getBlobs(shas: Array<string>): AsyncGenerator<[sha: string, blob: Uint8Array]>;
      applyChanges(batch: ChangesBatch): Promise<void>;
  }
  
}

declare module 'alinea/core/source/GithubSource.test' {

  export {};
  
}

declare module 'alinea/core/source/GitUtils' {

  import type { Entry } from 'alinea/core/source/Tree';
  /**
   * Serializes a TreeData object into a Git tree object as a Uint8Array.
   */
  export function serializeTreeEntries(entries: Array<Entry>): Uint8Array;
  /**
   * Parses a Git tree object from a Uint8Array into a TreeEntry object.
   */
  export function parseTreeEntries(data: Uint8Array): Array<Entry>;
  /**
   * Computes the SHA-1 hash of a Git object from its type and content.
   */
  export function hashObject(type: string, data: Uint8Array): Promise<string>;
  /**
   * Computes the SHA-1 hash of a serialized tree object.
   */
  export function hashTree(serializedTree: Uint8Array): Promise<string>;
  /**
   * Computes the SHA-1 hash of a blob object from its content.
   */
  export function hashBlob(data: Uint8Array): Promise<string>;
  
}

declare module 'alinea/core/source/GitUtils.test' {

  export {};
  
}

declare module 'alinea/core/source/IndexedDBSource' {

  import type { ChangesBatch } from 'alinea/core/source/Change';
  import type { Source } from 'alinea/core/source/Source';
  import { ReadonlyTree } from 'alinea/core/source/Tree';
  export class IndexedDBSource implements Source {
      #private;
      constructor(indexedDB: IDBFactory, name: string);
      getTree(): Promise<ReadonlyTree>;
      getTreeIfDifferent(sha: string): Promise<ReadonlyTree | undefined>;
      getBlobs(shas: Array<string>): AsyncGenerator<[sha: string, blob: Uint8Array]>;
      applyChanges(batch: ChangesBatch): Promise<void>;
  }
  
}

declare module 'alinea/core/source/IndexedDBSource.test' {

  export {};
  
}

declare module 'alinea/core/source/MemorySource' {

  import type { ChangesBatch } from 'alinea/core/source/Change';
  import type { Source } from 'alinea/core/source/Source';
  import { ReadonlyTree } from 'alinea/core/source/Tree';
  export class MemorySource implements Source {
      #private;
      constructor(tree?: ReadonlyTree, blobs?: Map<string, Uint8Array>);
      getTree(): Promise<ReadonlyTree>;
      getTreeIfDifferent(sha: string): Promise<ReadonlyTree | undefined>;
      getBlobs(shas: Array<string>): AsyncGenerator<[sha: string, blob: Uint8Array]>;
      addBlob(contents: Uint8Array): Promise<string>;
      applyChanges(batch: ChangesBatch): Promise<void>;
  }
  
}

declare module 'alinea/core/source/MemorySource.test' {

  export {};
  
}

declare module 'alinea/core/source/ShaMismatchError' {

  import { HttpError } from 'alinea/core/HttpError';
  export class ShaMismatchError extends HttpError {
      actual: string;
      expected: string;
      constructor(actual: string, expected: string, message?: string);
  }
  
}

declare module 'alinea/core/source/Source' {

  import type { ChangesBatch } from 'alinea/core/source/Change';
  import type { ReadonlyTree } from 'alinea/core/source/Tree';
  export interface RemoteSource {
      getTreeIfDifferent(sha: string): Promise<ReadonlyTree | undefined>;
      getBlobs(shas: Array<string>): AsyncGenerator<[sha: string, blob: Uint8Array]>;
  }
  export interface Source extends RemoteSource {
      getTree(): Promise<ReadonlyTree>;
      applyChanges(batch: ChangesBatch): Promise<void>;
  }
  export function bundleContents(source: RemoteSource, batch: ChangesBatch): Promise<ChangesBatch>;
  export function diff(source: Source, remote: RemoteSource): Promise<ChangesBatch>;
  export function syncWith(source: Source, remote: RemoteSource): Promise<ChangesBatch>;
  export function transaction(source: Source): Promise<SourceTransaction>;
  export class SourceTransaction {
      #private;
      constructor(source: Source, from: ReadonlyTree);
      add(path: string, contents: Uint8Array): this;
      remove(path: string): this;
      rename(from: string, to: string): this;
      compile(): Promise<{
          from: ReadonlyTree;
          into: ReadonlyTree;
          changes: (import("alinea/core/source/Change").DeleteChange | {
              contents: Uint8Array | undefined;
              op: "add";
              path: string;
              sha: string;
          })[];
      }>;
  }
  
}

declare module 'alinea/core/source/SourceExport' {

  import { MemorySource } from 'alinea/core/source/MemorySource';
  import type { Source } from 'alinea/core/source/Source';
  import { type Tree } from 'alinea/core/source/Tree';
  export interface ExportedSource {
      tree: Tree;
      blobs: string;
  }
  export function exportSource(source: Source): Promise<ExportedSource>;
  export function importSource(exported: ExportedSource): Promise<MemorySource>;
  
}

declare module 'alinea/core/source/SourceExport.test' {

  export {};
  
}

declare module 'alinea/core/source/Tree' {

  import type { ChangesBatch } from 'alinea/core/source/Change';
  export interface BaseEntry {
      sha: string;
      mode: string;
  }
  export interface FlatTreeEntry extends BaseEntry {
      type: string;
      path: string;
  }
  export interface FlatTree {
      sha: string;
      tree: Array<FlatTreeEntry>;
  }
  export interface Tree {
      sha: string;
      entries: Array<Entry>;
  }
  export interface Entry extends BaseEntry {
      name: string;
      entries?: Array<Entry>;
  }
  export class Leaf {
      readonly type: "blob";
      readonly sha: string;
      readonly mode: string;
      constructor({ sha, mode }: BaseEntry);
      clone(): Leaf;
      toJSON(): BaseEntry;
  }
  class TreeBase<Node extends TreeBase<Node>> {
      readonly type: "tree";
      readonly mode: string;
      sha: string | undefined;
      protected nodes: Map<string, Leaf | Node>;
      constructor(sha?: string);
      get(path: string): Node | Leaf | undefined;
      getNode(path: string): Node;
      getLeaf(path: string): Leaf;
      has(path: string): boolean;
      [Symbol.iterator](): IterableIterator<[string, Node | Leaf]>;
      paths(): Iterable<string>;
      index(): Map<string, string>;
      fileIndex(prefix: string): [string, string][];
      equals(other: ReadonlyTree | WriteableTree): boolean;
  }
  export class ReadonlyTree extends TreeBase<ReadonlyTree> {
      #private;
      readonly sha: string;
      static readonly EMPTY: ReadonlyTree;
      constructor({ sha, entries }: Tree);
      get isEmpty(): boolean;
      get entries(): Array<Entry>;
      get shas(): ReadonlySet<string>;
      hasSha(sha: string): boolean;
      clone(): WriteableTree;
      toJSON(): {
          sha: string;
          mode: string;
          entries: Entry[];
      };
      flat(): {
          sha: string;
          tree: FlatTreeEntry[];
      };
      withChanges(batch: ChangesBatch): Promise<ReadonlyTree>;
      static fromFlat(tree: FlatTree): ReadonlyTree;
      diff(that: TreeBase<any>): ChangesBatch;
  }
  export class WriteableTree extends TreeBase<WriteableTree> {
      #private;
      constructor({ sha, entries }?: Tree);
      add(path: string, input: {
          clone(): WriteableTree | Leaf;
      } | string): void;
      remove(path: string): boolean;
      rename(from: string, to: string): void;
      applyChanges(batch: ChangesBatch): void;
      getSha(): Promise<string>;
      compile(previous?: ReadonlyTree): Promise<ReadonlyTree>;
      clone(): WriteableTree;
  }
  export {};
  
}

declare module 'alinea/core/source/Tree.test' {

  export {};
  
}

declare module 'alinea/core/source/Utils' {

  /**
   * Computes the SHA-1 hash bytes of the input data.
   */
  export function sha1Bytes(data: Uint8Array): Promise<Uint8Array>;
  /**
   * Computes the SHA-1 hash of the input data.
   */
  export function sha1Hash(data: Uint8Array): Promise<string>;
  /**
   * Concatenates multiple Uint8Arrays into a single Uint8Array.
   */
  export function concatUint8Arrays(arrays: Uint8Array[]): Uint8Array;
  /**
   * Converts a hexadecimal string to a Uint8Array.
   */
  export function hexToBytes(hex: string): Uint8Array;
  /**
   * Converts a Uint8Array to a hexadecimal string.
   */
  export function bytesToHex(bytes: Uint8Array): string;
  /**
   * Compares two strings for sorting.
   * See: https://stackoverflow.com/a/40355107/2168416
   */
  export function compareStrings(a: string, b: string): number;
  export function splitPath(path: string): [name: string, rest: string | undefined];
  
}

declare module 'alinea/core/source/Utils.test' {

  export {};
  
}

declare module 'alinea/core/TextDoc' {

  export type TextDoc<T = {}> = Array<Node>;
  export type Node = TextNode | ElementNode | BlockNode;
  export namespace Node {
      const type = "_type";
      function isText(node: any): node is TextNode;
      function isElement(node: any): node is ElementNode;
      function isBlock(node: any): node is BlockNode;
  }
  export interface Mark {
      _type: string;
      [attr: string]: string | undefined;
  }
  export namespace Mark {
      const type = "_type";
  }
  export interface LinkMark extends Mark {
      _type: 'link';
      _id: string;
      _link: 'entry' | 'file' | 'url';
      _entry?: string;
  }
  export namespace LinkMark {
      const id = "_id";
      const link = "_link";
      const entry = "_entry";
  }
  export interface TextNode {
      _type: 'text';
      text?: string;
      marks?: Array<Mark>;
  }
  export namespace TextNode {
      const text = "text";
      const marks = "marks";
  }
  export interface ElementNode {
      _type: string;
      content?: TextDoc;
      [key: string]: any;
  }
  export namespace ElementNode {
      const content = "content";
  }
  export interface BlockNode {
      _id: string;
      _type: string;
  }
  export namespace BlockNode {
      const id = "_id";
  }
  
}

declare module 'alinea/core/Tracker' {

  import { Field, type FieldOptions } from 'alinea/core/Field';
  export interface FieldGetter {
      <Value>(field: Field<Value>): Value;
  }
  export interface OptionsTracker<Options = any> {
      (getter: FieldGetter): Partial<Options> | Promise<Partial<Options>>;
  }
  export interface ValueTracker<Value = any> {
      (getter: FieldGetter): Value;
  }
  export function optionTrackerOf(field: Field): OptionsTracker<any> | undefined;
  export function valueTrackerOf(field: Field): ValueTracker<any> | undefined;
  export namespace track {
      function options<StoredValue, QueryValue, OnChange, Options>(field: Field<StoredValue, QueryValue, OnChange, Options>, tracker: OptionsTracker<Options & FieldOptions<StoredValue>>): Field<StoredValue, QueryValue, OnChange, Options>;
      function value<StoredValue, QueryValue, OnChange, Options>(field: Field<StoredValue, QueryValue, OnChange, Options>, tracker: ValueTracker<StoredValue>): Field<StoredValue, QueryValue, OnChange, Options>;
  }
  
}

declare module 'alinea/core/Trigger' {

  export interface Trigger<T> extends Promise<T> {
      resolve(value: T): void;
      reject(reason?: any): void;
  }
  export function trigger<T>(): Trigger<T>;
  
}

declare module 'alinea/core/Trigger.test' {

  export {};
  
}

declare module 'alinea/core/Type' {

  import type { EntryEditProps } from 'alinea/dashboard/view/EntryEdit';
  import type { ComponentType } from 'react';
  import type { EntryStatus } from 'alinea/core/Entry';
  import type { Expr } from 'alinea/core/Expr';
  import { Field } from 'alinea/core/Field';
  import { type HasType } from 'alinea/core/Internal';
  import type { Label } from 'alinea/core/Label';
  import type { OrderBy } from 'alinea/core/OrderBy';
  import type { Preview } from 'alinea/core/Preview';
  import { Section } from 'alinea/core/Section';
  import type { View } from 'alinea/core/View';
  import type { SummaryProps } from 'alinea/core/media/Summary';
  import { RecordShape } from 'alinea/core/shape/RecordShape';
  import type { Expand } from 'alinea/core/util/Types';
  export interface EntryUrlMeta {
      status: EntryStatus;
      path: string;
      parentPaths: Array<string>;
      locale?: string | null;
  }
  export type Type<Definition = object> = Definition & HasType;
  type TypeRow<Definition> = Expand<{
      [K in keyof Definition as Definition[K] extends Expr<any> ? K : never]: Definition[K] extends Expr<infer T> ? T : never;
  }>;
  export namespace Type {
      type Infer<Definition> = TypeRow<Definition>;
      function label(type: Type): Label;
      function contains(type: Type): Array<string | Type>;
      function insertOrder(type: Type): 'first' | 'last' | 'free';
      function isHidden(type: Type): boolean;
      function shape(type: Type): RecordShape;
      function searchableText(type: Type, value: any): string;
      function sections(type: Type): Section[];
      function isContainer(type: Type): boolean;
      function field(type: Type, name: string): Field | undefined;
      function isType(type: any): type is Type;
      function sharedData(type: Type, entryData: Record<string, unknown>): Record<string, unknown> | undefined;
      function initialValue(type: Type): Record<string, unknown>;
      function preview(type: Type): Preview | undefined;
      function validate(type: Type): void;
      function referencedViews(type: Type): Array<string>;
  }
  export interface FieldsDefinition {
      [key: string]: Field;
  }
  export interface TypeConfig<Definition> {
      fields: Definition;
      /** Accepts entries of these types as children */
      contains?: Array<string | Type>;
      /** Order children entries in the sidebar content tree */
      orderChildrenBy?: OrderBy | Array<OrderBy>;
      /** Entries do not show up in the sidebar content tree */
      hidden?: true;
      /** An icon (React component) to represent this type in the dashboard */
      icon?: ComponentType;
      /** A React component used to view an entry of this type in the dashboard */
      view?: View<EntryEditProps & {
          type: Type;
      }>;
      /** A React component used to view a row of this type in the dashboard */
      summaryRow?: View<SummaryProps>;
      /** A React component used to view a thumbnail of this type in the dashboard */
      summaryThumb?: View<SummaryProps>;
      /** The position where new children will be inserted */
      insertOrder?: 'first' | 'last' | 'free';
      entryUrl?: (meta: EntryUrlMeta) => string;
      preview?: Preview;
  }
  export interface TypeInternal extends TypeConfig<FieldsDefinition> {
      label: string;
      allFields: Record<string, Field>;
      sections: Array<Section>;
      shape: RecordShape;
  }
  /** Create a new type */
  export function type<Fields extends FieldsDefinition>(label: string, config: TypeConfig<Fields>): Type<Fields>;
  export {};
  
}

declare module 'alinea/core/Type.test' {

  export {};
  
}

declare module 'alinea/core/User' {

  export interface User {
      sub: string;
      email?: string;
      name?: string;
  }
  export const localUser: {
      sub: string;
      name: string;
  };
  
}

declare module 'alinea/core/util/ArrayBuffers' {

  export function arrayBufferToHex(arrayBuffer: ArrayBuffer): string;
  export function concat(...arrays: Uint8Array[]): Uint8Array;
  
}

declare module 'alinea/core/util/Assert' {

  export function assert(value: unknown, message?: string): asserts value;
  
}

declare module 'alinea/core/util/Async' {

  /** Accumulate all entries of an AsyncGenerator into an array */
  export function accumulate<T>(gen: AsyncGenerator<T>): Promise<Array<T>>;
  export function toGenerator<T>(iterable: Iterable<T>): AsyncGenerator<T>;
  export function genEffect<T, TReturn>(gen: AsyncIterable<T, TReturn>, effect: (result: T) => void): AsyncIterable<T>;
  
}

declare module 'alinea/core/util/BufferToBase64' {

  /**
   * Given a base64 string, optionally decompress it and returns its `ArrayBuffer` representation.
   * @param {string} btoa a previously encoded base64 representation of a buffer.
   * @param {CompressionFormat | ''} format an optional compression format with `deflate` as default.
   * @returns {Promise<ArrayBuffer>} the buffer representing the optionally decompressed base64.
   */
  export const decode: (btoa: string, format?: CompressionFormat | "") => Promise<ArrayBuffer>;
  /**
   * Given a generic buffer, optionally compress it and returns its `base64` representation.
   * @param {ArrayBuffer | Uint8Array} buffer a generic buffer to optionally compress and return as base64.
   * @param {CompressionFormat | ''} format an optional compression format with `deflate` as default.
   * @returns {Promise<string>} the base64 representation of the optionally compressed buffer.
   */
  export const encode: (buffer: ArrayBuffer | Uint8Array, format?: CompressionFormat | "") => Promise<string>;
  
}

declare module 'alinea/core/util/Callable' {

  export class Callable {
      constructor(fn: Function);
  }
  class ClearFunctionProto {
      get name(): unknown;
      get length(): unknown;
      get call(): unknown;
      get caller(): unknown;
      get apply(): unknown;
      get bind(): unknown;
      get prototype(): unknown;
      get arguments(): unknown;
  }
  export interface Callable extends ClearFunctionProto {
  }
  export {};
  
}

declare module 'alinea/core/util/Checks' {

  import * as cito from 'cito';
  export function hasExact(allowed: Array<string>): cito.Type<object>;
  
}

declare module 'alinea/core/util/CodeGen' {

  export function code(): Code;
  export function code(input: string): Code;
  export function code(input: ReadonlyArray<string>, ...inserts: Array<any>): Code;
  export class Code {
      strings: ReadonlyArray<string>;
      inserts: Array<string | number | Code>;
      constructor(strings: ReadonlyArray<string>, inserts: Array<string | number | Code>);
      valueOf(): string;
      push(...strings: Array<string | Code>): void;
      toString(): string;
  }
  
}

declare module 'alinea/core/util/CodeGen.test' {

  export {};
  
}

declare module 'alinea/core/util/ContentHash' {

  import type { Entry } from 'alinea/core/Entry';
  export function toHex(buffer: ArrayBuffer): string;
  export function createFileHash(data: Uint8Array): Promise<string>;
  export function createRowHash(entry: Omit<Entry, 'rowHash'>): Promise<string>;
  
}

declare module 'alinea/core/util/Debounce' {

  export function debounce<T extends (...args: any[]) => void>(func: T, delay: number): (...args: Parameters<T>) => void;
  
}

declare module 'alinea/core/util/Encoding' {

  export interface Encoding {
      bits: number;
      chars: string;
      codes?: {
          [char: string]: number;
      };
  }
  export interface ParseOptions {
      loose?: boolean;
      out?: new (size: number) => {
          [index: number]: number;
      };
  }
  export interface StringifyOptions {
      pad?: boolean;
  }
  export function parse(string: string, encoding: Encoding, opts?: ParseOptions): Uint8Array;
  export function stringify(data: ArrayLike<number>, encoding: Encoding, opts?: StringifyOptions): string;
  export const base16: {
      parse(string: string, opts?: ParseOptions): Uint8Array;
      stringify(data: ArrayLike<number>, opts?: StringifyOptions): string;
  };
  export const base32: {
      parse(string: string, opts?: ParseOptions): Uint8Array;
      stringify(data: ArrayLike<number>, opts?: StringifyOptions): string;
  };
  export const base32hex: {
      parse(string: string, opts?: ParseOptions): Uint8Array;
      stringify(data: ArrayLike<number>, opts?: StringifyOptions): string;
  };
  export const base64: {
      parse(string: string, opts?: ParseOptions): Uint8Array;
      stringify(data: ArrayLike<number>, opts?: StringifyOptions): string;
  };
  export const base62: {
      parse(string: string, opts?: ParseOptions): Uint8Array;
      stringify(data: ArrayLike<number>, opts?: StringifyOptions): string;
  };
  export const base64url: {
      parse(string: string, opts?: ParseOptions): Uint8Array;
      stringify(data: ArrayLike<number>, opts?: StringifyOptions): string;
  };
  export const base85: {
      parse(string: string, opts?: ParseOptions): Uint8Array;
      stringify(data: ArrayLike<number>, opts?: StringifyOptions): string;
  };
  export const codec: {
      parse: typeof parse;
      stringify: typeof stringify;
  };
  export function btoa(input: string): string;
  export function atob(input: string): string;
  
}

declare module 'alinea/core/util/EntryFilenames' {

  import type { Config } from 'alinea/core/Config';
  import { type EntryStatus } from 'alinea/core/Entry';
  import { type Entry } from 'alinea/core/Entry';
  import type { EntryUrlMeta, Type } from 'alinea/core/Type';
  export function workspaceMediaDir(config: Config, workspace: string): string;
  export function entryInfo(fileName: string): [name: string, status: EntryStatus];
  export function entryChildrenDir(config: Config, entry: {
      workspace: string;
      root: string;
      locale: string | null;
      path: string;
      status: EntryStatus;
  }, parentPaths: Array<string>): string;
  export function entryFilepath(config: Config, entry: {
      workspace: string;
      root: string;
      locale: string | null;
      path: string;
      status: EntryStatus;
  }, parentPaths: Array<string>): string;
  export function entryFileName(config: Config, entry: {
      workspace: string;
      root: string;
      locale: string | null;
      path: string;
      status: EntryStatus;
  }, parentPaths: Array<string>): string;
  export function entryFile(config: Config, entry: Entry): string;
  export function entryUrl(type: Type, meta: EntryUrlMeta): string;
  export function pathSuffix(path: string, conflictingPaths: Array<string>): number | undefined;
  export function applySuffix(path: string, suffix: number): string;
  export function fileVersions(file: string): string[];
  
}

declare module 'alinea/core/util/EntryRows' {

  import type { Config } from 'alinea/core/Config';
  import type { EntryStatus } from 'alinea/core/Entry';
  import type { Entry } from 'alinea/core/Entry';
  export function createEntryRow<T extends Entry>(config: Config, input: Omit<T, 'rowHash' | 'fileHash'>, status: EntryStatus): Promise<T>;
  
}

declare module 'alinea/core/util/FractionalIndexing' {

  export const BASE_62_DIGITS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
  export function validateOrderKey(key: string): void;
  export function isValidOrderKey(key: string): boolean;
  /**
   * @param {string | null} a
   * @param {string | null} b
   * @param {string=} digits
   * @return {string}
   */
  export function generateKeyBetween(a: string | null, b: string | null, digits?: string): string;
  /**
   * same preconditions as generateKeysBetween.
   * n >= 0.
   * Returns an array of n distinct keys in sorted order.
   * If a and b are both null, returns [a0, a1, ...]
   * If one or the other is null, returns consecutive "integer"
   * keys.  Otherwise, returns relatively short keys between
   * a and b.
   */
  export function generateNKeysBetween(a: string | null, b: string | null, n: number, digits?: string): string[];
  
}

declare module 'alinea/core/util/GetRandomColor' {

  export function getRandomColor(sub: string): string;
  
}

declare module 'alinea/core/util/Identifiers' {

  export function isValidIdentifier(identifier: string): boolean;
  
}

declare module 'alinea/core/util/JWT' {

  const algorithms: {
      ES256: {
          name: string;
          namedCurve: string;
          hash: {
              name: string;
          };
      };
      ES384: {
          name: string;
          namedCurve: string;
          hash: {
              name: string;
          };
      };
      ES512: {
          name: string;
          namedCurve: string;
          hash: {
              name: string;
          };
      };
      HS256: {
          name: string;
          hash: {
              name: string;
          };
      };
      HS384: {
          name: string;
          hash: {
              name: string;
          };
      };
      HS512: {
          name: string;
          hash: {
              name: string;
          };
      };
      RS256: {
          name: string;
          hash: {
              name: string;
          };
      };
      RS384: {
          name: string;
          hash: {
              name: string;
          };
      };
      RS512: {
          name: string;
          hash: {
              name: string;
          };
      };
  };
  type Algorithm = keyof typeof algorithms;
  type JWTHeader = {
      alg: Algorithm;
      kid?: string;
      typ?: string;
      cty?: string;
      crit?: string[];
      [key: string]: any;
  };
  type JWTPayload = Record<string, any>;
  type JWT = {
      header: JWTHeader;
      payload: JWTPayload;
      signature: Uint8Array;
  };
  export function importKey(secret: string | JsonWebKey, algorithm: (typeof algorithms)[Algorithm], use: 'sign' | 'verify'): Promise<CryptoKey>;
  /**
   * Options for signing a JWT.
   * @property algorithm - The algorithm to use for signing (e.g., 'HS256').
   * @property header - Optional custom header fields to include in the JWT header.
   */
  export type SignOptions = {
      /** The algorithm to use for signing (e.g., 'HS256'). */
      algorithm: Algorithm;
      /** Optional custom header fields to include in the JWT header. */
      header?: Record<string, any>;
  };
  /**
   * Signs a JWT payload and returns the token string.
   * @param payload - The payload to include in the JWT.
   * @param secret - The secret or key to sign the JWT with.
   * @param options - Options for signing, including algorithm and header.
   * @returns The signed JWT as a string.
   */
  export function sign(payload: JWTPayload, secret: string | JsonWebKey, options?: SignOptions): Promise<string>;
  /**
   * Options for verifying a JWT.
   * @property algorithms - Allowed algorithms for verification.
   * @property clockTolerance - Allowed clock skew in seconds.
   * @property clockTimestamp - Override the current time for verification.
   */
  export type VerifyOptions = {
      /** Allowed algorithms for verification. */
      algorithms?: Array<Algorithm>;
      /** Allowed clock skew in seconds. */
      clockTolerance?: number;
      /** Override the current time for verification. */
      clockTimestamp?: number;
  };
  /**
   * Verifies a JWT token using a secret or public key.
   * @param token - The JWT token string to verify.
   * @param secret - The secret to verify the JWT with.
   * @param options - Verification options.
   * @returns The decoded JWT payload if verification succeeds.
   */
  export function verify<T = JWTPayload>(token: string, secret: string, options?: VerifyOptions): Promise<T>;
  /**
   * Verifies a JWT token using a public key.
   * @param token - The JWT token string to verify.
   * @param publicKey - The public key to verify the JWT with.
   * @param options - Verification options.
   * @returns The decoded JWT payload if verification succeeds.
   */
  export function verify<T = JWTPayload>(token: string, publicKey: JsonWebKey, options?: VerifyOptions): Promise<T>;
  /**
   * Decodes a JWT token into its header, payload, and signature components.
   * @param token - The JWT token string to decode.
   * @returns The decoded JWT object.
   */
  export function decode(token: string): JWT;
  export {};
  
}

declare module 'alinea/core/util/JWT.test' {

  export {};
  
}

declare module 'alinea/core/util/Lazy' {

  export type Lazy<T> = T | (() => T);
  export namespace Lazy {
      function get<T>(lazy: Lazy<T>): T;
  }
  
}

declare module 'alinea/core/util/LazyRecord' {

  import { Lazy } from 'alinea/core/util/Lazy';
  export type LazyRecord<V> = Lazy<{
      [key: string]: Lazy<V>;
  }>;
  export namespace LazyRecord {
      function iterate<V>(collection: LazyRecord<V>): Array<[string, V]>;
      function concat<A, B>(a: LazyRecord<A>, b: LazyRecord<B>): LazyRecord<A & B>;
      function resolve<V>(collection: LazyRecord<V>): {
          [key: string]: V;
      };
      function keys<V>(collection: LazyRecord<V>): Array<string>;
      function get<V>(collection: LazyRecord<V>, key: string): V;
  }
  
}

declare module 'alinea/core/util/Logger' {

  interface Log {
      args: Array<any>;
      time: number;
  }
  export interface Report {
      name: string;
      duration: number;
      logs: Array<Log | Report>;
  }
  export namespace Report {
      function toConsole(report: Report, prefix?: string): void;
      function toServerTiming(report: Report, index?: number): string;
  }
  export interface LoggerResult<T> {
      result: T;
      logger: Logger;
  }
  export class Logger {
      name: string;
      logs: Array<Log | Report>;
      started: number;
      operations: Array<Logger>;
      startProgress: number | undefined;
      constructor(name: string);
      time(name: string, justTime?: boolean): () => void;
      log(...args: Array<any>): void;
      progress(message: string): void;
      summary(message: string): void;
      result<T>(result: Promise<T>): Promise<LoggerResult<T>>;
      report(): {
          name: string;
          duration: number;
          logs: (Log | Report)[];
      };
  }
  export {};
  
}

declare module 'alinea/core/util/Objects' {

  export const entries: {
      <T>(o: {
          [s: string]: T;
      } | ArrayLike<T>): [string, T][];
      (o: {}): [string, any][];
  }, fromEntries: {
      <T = any>(entries: Iterable<readonly [PropertyKey, T]>): {
          [k: string]: T;
      };
      (entries: Iterable<readonly any[]>): any;
  }, keys: {
      (o: object): string[];
      (o: {}): string[];
  }, values: {
      <T>(o: {
          [s: string]: T;
      } | ArrayLike<T>): T[];
      (o: {}): any[];
  }, assign: {
      <T extends {}, U>(target: T, source: U): T & U;
      <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
      <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
      (target: object, ...sources: any[]): any;
  }, create: {
      (o: object | null): any;
      (o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
  }, defineProperty: <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T, defineProperties: <T>(o: T, properties: PropertyDescriptorMap & ThisType<any>) => T, getOwnPropertyDescriptor: (o: any, p: PropertyKey) => PropertyDescriptor | undefined, getOwnPropertyDescriptors: <T>(o: T) => { [P in keyof T]: TypedPropertyDescriptor<T[P]>; } & {
      [x: string]: PropertyDescriptor;
  }, getOwnPropertyNames: (o: any) => string[], getOwnPropertySymbols: (o: any) => symbol[], getPrototypeOf: (o: any) => any, setPrototypeOf: (o: any, proto: object | null) => any, is: (value1: any, value2: any) => boolean, preventExtensions: <T>(o: T) => T, seal: <T>(o: T) => T, freeze: {
      <T extends Function>(f: T): T;
      <T extends {
          [idx: string]: U | null | undefined | object;
      }, U extends string | bigint | number | boolean | symbol>(o: T): Readonly<T>;
      <T>(o: T): Readonly<T>;
  }, isExtensible: (o: any) => boolean, isSealed: (o: any) => boolean, isFrozen: (o: any) => boolean, hasOwnProperty: (v: PropertyKey) => boolean, propertyIsEnumerable: (v: PropertyKey) => boolean, isPrototypeOf: (v: Object) => boolean;
  
}

declare module 'alinea/core/util/Paths' {

  export function isAbsolute(path: string): boolean;
  export function normalize(path: string): string;
  export function dirname(path: string): string;
  export function basename(path: string, ext?: string): string;
  export function join(...args: Array<string | undefined>): string;
  export function extname(path: string): string;
  export function resolve(...args: Array<string>): string;
  export function relative(from: string, to: string): string;
  export function contains(parent: string, child: string): boolean;
  
}

declare module 'alinea/core/util/Paths.test' {

  export {};
  
}

declare module 'alinea/core/util/RowId' {

  export function rowId(): string;
  export function isRowId(input: string): boolean;
  
}

declare module 'alinea/core/util/Slugs' {

  export function isSeparator(char: string): boolean;
  export function slugify(input: string): string;
  
}

declare module 'alinea/core/util/Slugs.test' {

  export {};
  
}

declare module 'alinea/core/util/Timer' {

  export function timer(name: string): (msg?: string) => void;
  
}

declare module 'alinea/core/util/Types' {

  export type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) extends (x: infer R) => any ? R : never;
  export function unreachable(value: never): never;
  type CommonKeys<T extends object> = keyof T;
  type AllKeys<T> = T extends any ? keyof T : never;
  type Subtract<A, C> = A extends C ? never : A;
  type NonCommonKeys<T extends object> = Subtract<AllKeys<T>, CommonKeys<T>>;
  type PickType<T, K extends AllKeys<T>> = T extends {
      [k in K]?: any;
  } ? T[K] : undefined;
  type PickTypeOf<T, K extends string | number | symbol> = K extends AllKeys<T> ? PickType<T, K> : never;
  export type Merge<T extends object> = {
      [k in CommonKeys<T>]: PickTypeOf<T, k>;
  } & {
      [k in NonCommonKeys<T>]?: PickTypeOf<T, k>;
  };
  export type IsStrictlyAny<T> = (T extends never ? true : false) extends false ? false : true;
  export type ObjectUnion<T> = {
      [K in T extends unknown ? keyof T : never]: T extends {
          [_ in K]: infer V;
      } ? V : never;
  };
  export type Expand<T> = {
      [K in keyof T]: T[K];
  } & {};
  export type UnionOfValues<T> = T[keyof T];
  export {};
  
}

declare module 'alinea/core/util/Urls' {

  export function joinPaths(...paths: Array<string | undefined>): string;
  
}

declare module 'alinea/core/View' {

  import type { ComponentType, ReactNode } from 'react';
  export type View<Props> = string | ((props: Props) => ReactNode);
  export function resolveView<Props>(viewMap: Record<string, ComponentType<any>>, view: View<Props>): ComponentType<Props> | undefined;
  
}

declare module 'alinea/core/Workspace' {

  import type { Preview } from 'alinea/core/Preview';
  import type { ComponentType } from 'react';
  import { type HasWorkspace } from 'alinea/core/Internal';
  import { Root } from 'alinea/core/Root';
  import type { Schema } from 'alinea/core/Schema';
  export interface WorkspaceMeta {
      /** A directory which contains the json entry files */
      source: string;
      /** The directory where media files are placed in case a file backend is used */
      mediaDir?: string;
      /** The main theme color used in the dashboard */
      color?: string;
      icon?: ComponentType;
      preview?: Preview;
  }
  type Roots = Record<string, Root>;
  export interface RootsDefinition {
      [key: string]: Root;
  }
  export type Workspace<Definition extends Roots = Roots> = Definition & HasWorkspace;
  export namespace Workspace {
      function data(workspace: Workspace): WorkspaceInternal;
      function roots(workspace: Workspace): Roots;
      function label(workspace: Workspace): string;
      function preview(workspace: Workspace): Preview | undefined;
      function isWorkspace(value: any): value is Workspace;
      function defaultMediaRoot(workspace: Workspace): string;
      function defaultRoot(workspace: Workspace): string;
      function validate(workspace: Workspace, schema: Schema): void;
      function referencedViews(workspace: Workspace): string[];
  }
  export interface WorkspaceConfig<Definition> extends WorkspaceMeta {
      roots: Definition;
  }
  export interface WorkspaceInternal extends WorkspaceConfig<RootsDefinition> {
      label: string;
      color: string;
  }
  /** Create a workspace */
  export function workspace<Roots extends RootsDefinition>(
  /** The name of the workspace */
  label: string, config: WorkspaceConfig<Roots>): Workspace<Roots>;
  export {};
  
}

declare module 'alinea/dashboard' {

  export * from 'alinea/dashboard/atoms/FormAtoms';
  export * from 'alinea/dashboard/editor/UseField';
  export * from 'alinea/dashboard/view/InputLabel';
  
}

declare module 'alinea/dashboard/App' {

  import { Config } from 'alinea/core/Config';
  import type { LocalConnection } from 'alinea/core/Connection';
  import { type ComponentType } from 'react';
  import type { QueryClient } from 'react-query';
  import type { WorkerDB } from 'alinea/dashboard/boot/WorkerDB';
  export interface AppProps {
      db: WorkerDB;
      config: Config;
      views: Record<string, ComponentType>;
      client: LocalConnection;
      queryClient?: QueryClient;
      fullPage?: boolean;
      local?: boolean;
      alineaDev?: boolean;
  }
  export function App(props: AppProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/atoms/DashboardAtoms' {

  import type { LocalConnection } from 'alinea/core/Connection';
  import type { Session } from 'alinea/core/Session';
  import { QueryClient } from 'react-query';
  import type { AppProps } from 'alinea/dashboard/App';
  export const sessionAtom: import("jotai").PrimitiveAtom<Session | undefined> & {
      init: Session | undefined;
  };
  export const dashboardOptionsAtom: import("jotai").PrimitiveAtom<AppProps> & {
      init: AppProps;
  };
  export function useSetDashboardOptions(options: AppProps): void;
  export const queryClientAtom: import("jotai").PrimitiveAtom<QueryClient> & {
      init: QueryClient;
  };
  export const clientAtom: import("jotai").Atom<LocalConnection>;
  export const configAtom: import("jotai").Atom<import("alinea/core/Config").Config>;
  export const useSession: () => Session | undefined;
  export const useConfig: () => import("alinea/core/Config").Config;
  
}

declare module 'alinea/dashboard/atoms/DbAtoms' {

  export const dbAtom: import("jotai").Atom<import("alinea/dashboard/boot/WorkerDB").WorkerDB>;
  export const dbMetaAtom: import("jotai").Atom<Promise<string>>;
  export const pendingAtom: import("jotai").WritableAtom<number, [], () => void>;
  export const entryRevisionAtoms: import("jotai/vanilla/utils/atomFamily").AtomFamily<string, import("jotai").WritableAtom<number, [], void>>;
  export function useDbUpdater(everySeconds?: number): void;
  
}

declare module 'alinea/dashboard/atoms/Edits' {

  import type { Entry } from 'alinea/core';
  import { Type } from 'alinea/core/Type';
  import * as Y from 'yjs';
  export class Edits {
      #private;
      /** The mutable doc that we are editing */
      doc: Y.Doc;
      /** The state vector of the source doc */
      sourceVector: Uint8Array | undefined;
      sourceUpdate: Uint8Array | undefined;
      /** The root map containing field data */
      root: Y.Map<unknown>;
      /** Did we make any local changes? */
      hasChanges: import("jotai").PrimitiveAtom<boolean> & {
          init: boolean;
      };
      /** Clear local changes, reset to source */
      resetChanges: import("jotai").WritableAtom<null, [], void> & {
          init: null;
      };
      yUpdate: import("jotai").Atom<Uint8Array>;
      constructor(type: Type, entry: Entry);
      hasData(): boolean;
      /** A Y.js update that contains our own edits */
      getLocalUpdate(): Uint8Array;
      /** Update entry field data */
      applyEntryData(entryData: Record<string, any>): void;
      /** The field data */
      getEntryData(type: Type): Record<string, any>;
  }
  export const entryEditsAtoms: import("jotai/vanilla/utils/atomFamily").AtomFamily<Entry<Record<string, unknown>>, import("jotai").Atom<Edits>>;
  
}

declare module 'alinea/dashboard/atoms/EntryAtoms' {

  import type { DragTarget, ItemInstance, TreeDataLoader } from '@headless-tree/core';
  import type { EntryStatus } from 'alinea/core/Entry';
  export const ROOT_ID = "@alinea/root";
  export interface EntryTreeItem {
      id: string;
      index: string;
      type: string;
      entries: Array<{
          id: string;
          type: string;
          title: string;
          status: EntryStatus;
          locale: string | null;
          workspace: string;
          root: string;
          path: string;
          parents: Array<{
              path: string;
              type: string;
          }>;
          main: boolean;
      }>;
      isFolder?: boolean;
      isRoot?: boolean;
      canDrag?: boolean;
      hasChildren: boolean;
      children: Promise<Array<string>>;
  }
  export function useEntryTreeProvider(): TreeDataLoader<EntryTreeItem> & {
      canDrag(item: Array<ItemInstance<EntryTreeItem>>): boolean;
      canDrop(items: Array<ItemInstance<EntryTreeItem>>, target: DragTarget<EntryTreeItem>): boolean;
      onDrop(items: Array<ItemInstance<EntryTreeItem>>, target: DragTarget<EntryTreeItem>): void;
  };
  
}

declare module 'alinea/dashboard/atoms/EntryEditorAtoms' {

  import type { Config } from 'alinea/core/Config';
  import type { Connection } from 'alinea/core/Connection';
  import { Entry, type EntryStatus } from 'alinea/core/Entry';
  import { Type } from 'alinea/core/Type';
  import { FormAtoms } from 'alinea/dashboard/atoms/FormAtoms';
  import { type Edits } from 'alinea/dashboard/atoms/Edits';
  export enum EditMode {
      Editing = "editing",
      Diff = "diff"
  }
  export type Version = Entry & {
      parents: Array<string>;
  };
  interface EntryEditorParams {
      id: string | undefined;
      locale: string | null;
  }
  export enum EntryTransition {
      SaveDraft = 0,
      SaveTranslation = 1,
      PublishEdits = 2,
      RestoreRevision = 3,
      PublishDraft = 4,
      UnpublishDraft = 5,
      DiscardDraft = 6,
      ArchivePublished = 7,
      PublishArchived = 8,
      DeleteFile = 9,
      DeleteEntry = 10
  }
  export const entryEditorAtoms: import("jotai/vanilla/utils/atomFamily").AtomFamily<EntryEditorParams, import("jotai").Atom<Promise<{
      transition: import("jotai").PrimitiveAtom<EntryTransition | undefined> & {
          init: EntryTransition | undefined;
      };
      revisionId: string;
      activeStatus: EntryStatus;
      statusInUrl: import("jotai").Atom<EntryStatus | undefined>;
      selectedStatus: import("jotai").Atom<EntryStatus>;
      entryData: EntryData;
      editMode: import("jotai").PrimitiveAtom<EditMode> & {
          init: EditMode;
      };
      activeVersion: Version;
      type: Type;
      previewPayload: import("jotai").Atom<Promise<string>>;
      activeTitle: import("jotai").Atom<string>;
      hasChanges: import("jotai").PrimitiveAtom<boolean> & {
          init: boolean;
      };
      draftEntry: import("jotai").Atom<Promise<Entry<Record<string, unknown>>>> & {
          current: import("jotai").Atom<Entry<Record<string, unknown>> | undefined>;
      };
      saveDraft: import("jotai").WritableAtom<null, [], Promise<void>> & {
          init: null;
      };
      publishEdits: import("jotai").WritableAtom<null, [], Promise<void>> & {
          init: null;
      };
      restoreRevision: import("jotai").WritableAtom<null, [], Promise<void>> & {
          init: null;
      };
      publishDraft: import("jotai").WritableAtom<null, [], Promise<void>> & {
          init: null;
      };
      discardDraft: import("jotai").WritableAtom<null, [], Promise<void>> & {
          init: null;
      };
      unPublish: import("jotai").WritableAtom<null, [], Promise<void>> & {
          init: null;
      };
      archive: import("jotai").WritableAtom<null, [], Promise<void>> & {
          init: null;
      };
      publishArchived: import("jotai").WritableAtom<null, [], Promise<void>> & {
          init: null;
      };
      deleteFile: import("jotai").WritableAtom<null, [], Promise<void>> & {
          init: null;
      };
      deleteMediaLibrary: import("jotai").WritableAtom<null, [], Promise<void>> & {
          init: null;
      };
      deleteEntry: import("jotai").WritableAtom<null, [], Promise<void>> & {
          init: null;
      };
      saveTranslation: import("jotai").WritableAtom<null, [locale: string], Promise<void>> & {
          init: null;
      };
      discardEdits: import("jotai").WritableAtom<null, [], void> & {
          init: null;
      };
      showHistory: import("jotai").WritableAtom<boolean, [value: boolean], void>;
      revisionsAtom: import("jotai").Atom<Promise<import("alinea/core/Connection").Revision[]>>;
      previewToken: import("jotai").Atom<Promise<string>>;
      previewRevision: import("jotai").PrimitiveAtom<{
          ref: string;
          file: string;
      } | undefined> & {
          init: {
              ref: string;
              file: string;
          } | undefined;
      };
      preview: import("alinea/core/Preview").Preview | undefined;
      form: import("jotai").Atom<FormAtoms<object>>;
      view: import("alinea/core/View").View<import("alinea/dashboard/view/EntryEdit").EntryEditProps & {
          type: Type;
      }> | undefined;
      parents: Array<{
          id: string;
          path: string;
          status: EntryStatus;
          main: boolean;
      }>;
      client: Connection;
      config: Config;
      entryId: string;
      versions: Array<Version>;
      statuses: Record<EntryStatus, Version>;
      availableStatuses: Array<EntryStatus>;
      translations: Array<{
          locale: string;
          entryId: string;
      }>;
      untranslated: boolean;
      canPublish: boolean;
      canDelete: boolean;
      parentNeedsTranslation: boolean;
      edits: Edits;
  } | undefined>>>;
  export interface EntryData {
      parents: Array<{
          id: string;
          path: string;
          status: EntryStatus;
          main: boolean;
      }>;
      client: Connection;
      config: Config;
      entryId: string;
      versions: Array<Version>;
      statuses: Record<EntryStatus, Version>;
      availableStatuses: Array<EntryStatus>;
      translations: Array<{
          locale: string;
          entryId: string;
      }>;
      untranslated: boolean;
      canPublish: boolean;
      canDelete: boolean;
      parentNeedsTranslation: boolean;
      edits: Edits;
  }
  export type EntryEditor = ReturnType<typeof createEntryEditor>;
  export function createEntryEditor(entryData: EntryData): {
      transition: import("jotai").PrimitiveAtom<EntryTransition | undefined> & {
          init: EntryTransition | undefined;
      };
      revisionId: string;
      activeStatus: EntryStatus;
      statusInUrl: import("jotai").Atom<EntryStatus | undefined>;
      selectedStatus: import("jotai").Atom<EntryStatus>;
      entryData: EntryData;
      editMode: import("jotai").PrimitiveAtom<EditMode> & {
          init: EditMode;
      };
      activeVersion: Version;
      type: Type;
      previewPayload: import("jotai").Atom<Promise<string>>;
      activeTitle: import("jotai").Atom<string>;
      hasChanges: import("jotai").PrimitiveAtom<boolean> & {
          init: boolean;
      };
      draftEntry: import("jotai").Atom<Promise<Entry<Record<string, unknown>>>> & {
          current: import("jotai").Atom<Entry<Record<string, unknown>> | undefined>;
      };
      saveDraft: import("jotai").WritableAtom<null, [], Promise<void>> & {
          init: null;
      };
      publishEdits: import("jotai").WritableAtom<null, [], Promise<void>> & {
          init: null;
      };
      restoreRevision: import("jotai").WritableAtom<null, [], Promise<void>> & {
          init: null;
      };
      publishDraft: import("jotai").WritableAtom<null, [], Promise<void>> & {
          init: null;
      };
      discardDraft: import("jotai").WritableAtom<null, [], Promise<void>> & {
          init: null;
      };
      unPublish: import("jotai").WritableAtom<null, [], Promise<void>> & {
          init: null;
      };
      archive: import("jotai").WritableAtom<null, [], Promise<void>> & {
          init: null;
      };
      publishArchived: import("jotai").WritableAtom<null, [], Promise<void>> & {
          init: null;
      };
      deleteFile: import("jotai").WritableAtom<null, [], Promise<void>> & {
          init: null;
      };
      deleteMediaLibrary: import("jotai").WritableAtom<null, [], Promise<void>> & {
          init: null;
      };
      deleteEntry: import("jotai").WritableAtom<null, [], Promise<void>> & {
          init: null;
      };
      saveTranslation: import("jotai").WritableAtom<null, [locale: string], Promise<void>> & {
          init: null;
      };
      discardEdits: import("jotai").WritableAtom<null, [], void> & {
          init: null;
      };
      showHistory: import("jotai").WritableAtom<boolean, [value: boolean], void>;
      revisionsAtom: import("jotai").Atom<Promise<import("alinea/core/Connection").Revision[]>>;
      previewToken: import("jotai").Atom<Promise<string>>;
      previewRevision: import("jotai").PrimitiveAtom<{
          ref: string;
          file: string;
      } | undefined> & {
          init: {
              ref: string;
              file: string;
          } | undefined;
      };
      preview: import("alinea/core/Preview").Preview | undefined;
      form: import("jotai").Atom<FormAtoms<object>>;
      view: import("alinea/core/View").View<import("alinea/dashboard/view/EntryEdit").EntryEditProps & {
          type: Type;
      }> | undefined;
      parents: Array<{
          id: string;
          path: string;
          status: EntryStatus;
          main: boolean;
      }>;
      client: Connection;
      config: Config;
      entryId: string;
      versions: Array<Version>;
      statuses: Record<EntryStatus, Version>;
      availableStatuses: Array<EntryStatus>;
      translations: Array<{
          locale: string;
          entryId: string;
      }>;
      untranslated: boolean;
      canPublish: boolean;
      canDelete: boolean;
      parentNeedsTranslation: boolean;
      edits: Edits;
  };
  export {};
  
}

declare module 'alinea/dashboard/atoms/EntrySummaryAtoms' {

  import DataLoader from 'dataloader';
  export interface EntrySummary {
      id: string;
      locale: string | null;
      type: string;
      workspace: string;
      root: string;
      title: string;
      parents: Array<{
          id: string;
          title: string;
      }>;
      childrenAmount: number;
  }
  export const entrySummaryLoaderAtom: import("jotai").Atom<DataLoader<string, Record<string, EntrySummary>, string>>;
  interface EntryKeys {
      id: string;
      locale: string | null;
  }
  export const entrySummaryAtoms: import("jotai/vanilla/utils/atomFamily").AtomFamily<EntryKeys, import("jotai").Atom<Promise<EntrySummary | undefined>>>;
  export {};
  
}

declare module 'alinea/dashboard/atoms/ErrorAtoms' {

  export const errorMessageAtom: import("jotai").PrimitiveAtom<string | null> & {
      init: string | null;
  };
  export const errorAtom: import("jotai").WritableAtom<string | null, [message: string | null, cause?: Error | undefined], void>;
  
}

declare module 'alinea/dashboard/atoms/FormAtoms' {

  import { Field } from 'alinea/core/Field';
  import { Type } from 'alinea/core/Type';
  import { type Atom } from 'jotai';
  import { type PropsWithChildren } from 'react';
  import * as Y from 'yjs';
  export interface FieldInfo<StoredValue = any, QueryValue = any, Mutator = any, Options = any> {
      key: string;
      field: Field<StoredValue, QueryValue, Mutator, Options>;
      value: Atom<StoredValue>;
      options: Atom<Options | Promise<Options>>;
      error: Atom<boolean | string | undefined>;
      mutator: Mutator;
  }
  export class FormAtoms<T = any> {
      type: Type<T>;
      container: Y.Map<any>;
      path: string;
      options: {
          parent?: FormAtoms;
          readOnly?: boolean;
      };
      private fields;
      private errorMap;
      errors: import("jotai").WritableAtom<Map<string, {
          field: Field;
          error: boolean | string;
      }>, [path: string, field: Field<any, any, any, any>, error: string | boolean | undefined], void>;
      hasErrors: Atom<boolean>;
      constructor(type: Type<T>, container: Y.Map<any>, path?: string, options?: {
          parent?: FormAtoms;
          readOnly?: boolean;
      });
      data(): Type.Infer<T>;
      private getter;
      private valueAtom;
      fieldByKey(key: string): Field;
      keyOf(field: Field): string;
      fieldInfo<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options>): FieldInfo<StoredValue, QueryValue, Mutator, Options>;
  }
  export interface UseFormOptions<T> {
      doc?: Y.Doc;
      initialValue?: Partial<Type.Infer<T>>;
  }
  export function useForm<T>(type: Type<T>, options?: UseFormOptions<T>): FormAtoms<T>;
  export function useFormContext(): FormAtoms<any>;
  export interface FieldAtomsProviderProps {
      form: FormAtoms;
  }
  export function FormProvider({ children, form }: PropsWithChildren<FieldAtomsProviderProps>): import("react/jsx-runtime").JSX.Element;
  export interface FormRowProps {
      field: Field;
      rowId?: string;
      type: Type;
      readOnly?: boolean;
  }
  export function FormRow({ children, field, type, rowId, readOnly }: PropsWithChildren<FormRowProps>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/atoms/LocationAtoms' {

  export const hashAtom: import("jotai").WritableAtom<string, [hash: string], void> & {
      init: string;
  };
  export const locationAtom: import("jotai").WritableAtom<URL, [url: string], void>;
  interface Matcher {
      keys: Array<string>;
      pattern: RegExp;
  }
  export function createParams(matcher: Matcher, match: RegExpExecArray): Record<string, string>;
  interface MatchOptions {
      route: string;
      loose?: boolean;
  }
  export const matchAtoms: import("jotai/vanilla/utils/atomFamily").AtomFamily<MatchOptions, import("jotai").Atom<Record<string, string> | undefined>>;
  export function useMatch(route: string, loose?: boolean): [Record<string, string> | undefined, never];
  export const useHash: () => [string, (hash: string) => void];
  export function useLocation(): URL;
  export function useSearchParams(): URLSearchParams;
  export function useNavigate(): (url: string) => void;
  export function link(url: string | undefined): {
      href: string;
  } | {
      href?: undefined;
  };
  export {};
  
}

declare module 'alinea/dashboard/atoms/NavigationAtoms' {

  import { type EntryLocation } from 'alinea/dashboard/DashboardNav';
  export const workspaceAtom: import("jotai").Atom<{
      label: string;
      color: string;
      roots: import("alinea/core/Workspace").RootsDefinition;
      source: string;
      mediaDir?: string;
      icon?: import("react").ComponentType;
      preview?: import("alinea/core/Preview").Preview;
      name: string;
  }>;
  export const rootAtom: import("jotai").Atom<{
      label: string;
      contains?: Array<string | import("alinea").Type>;
      orderChildrenBy?: import("alinea/core/OrderBy").OrderBy | Array<import("alinea/core/OrderBy").OrderBy>;
      icon?: import("react").ComponentType;
      i18n?: import("alinea/core/Root").RootI18n;
      view?: import("alinea/core/View").View<{
          root: import("alinea/core/Root").RootData;
      }>;
      isMediaRoot?: boolean;
      preview?: import("alinea/core/Preview").Preview;
      name: string;
  }>;
  export const preferredLanguageAtom: import("jotai").WritableAtom<string | null, [string | typeof import("jotai/utils").RESET | ((prev: string | null) => string | typeof import("jotai/utils").RESET | null) | null], void>;
  export const localeAtom: import("jotai").Atom<string | null>;
  export const entryLocationAtom: import("jotai").Atom<EntryLocation>;
  export const navAtom: import("jotai").Atom<{
      matchEntry: "/entry/*";
      matchEntryId: "/:action/:workspace/:root?/:id?";
      matchWorkspace: "/:action/:workspace";
      matchRoot: "/:action/:workspace/:root";
      root: ({ id, ...location }: EntryLocation) => string;
      entry: (location: EntryLocation) => string;
      draft: (location: EntryLocation) => string;
      create: (location: EntryLocation) => string;
  }>;
  export const usePreferredLanguage: () => [string | null, (args_0: string | typeof import("jotai/utils").RESET | ((prev: string | null) => string | typeof import("jotai/utils").RESET | null) | null) => void];
  
}

declare module 'alinea/dashboard/atoms/PreferencesAtoms' {

  export type ColorScheme = 'light' | 'dark' | undefined;
  export type Language = 'en' | undefined;
  export interface Preferences {
      scheme: ColorScheme;
      workspace: string | undefined;
      size: number;
      language: Language;
  }
  export const preferencesAtom: import("jotai").WritableAtom<Preferences, [Preferences | typeof import("jotai/utils").RESET | ((prev: Preferences) => Preferences | typeof import("jotai/utils").RESET)], void>;
  export const schemePreferenceAtom: import("jotai").WritableAtom<ColorScheme, [scheme: ColorScheme], void>;
  export const toggleSchemePreferenceAtom: import("jotai").WritableAtom<null, [], void> & {
      init: null;
  };
  export const workspacePreferenceAtom: import("jotai").WritableAtom<string | undefined, [workspace: string | undefined], void>;
  export const sizePreferenceAtom: import("jotai").WritableAtom<number, [size: number], void>;
  export const languagePreferenceAtom: import("jotai").WritableAtom<Language, [language: Language], void>;
  
}

declare module 'alinea/dashboard/atoms/RouterAtoms' {

  import { type Atom, type PrimitiveAtom } from 'jotai';
  import { type FunctionComponent, type PropsWithChildren, type ReactNode } from 'react';
  export interface RouteData<T> {
      path: string;
      loader?: (params: Record<string, string>) => Atom<Promise<T>>;
      component: FunctionComponent<T>;
  }
  export class Route<T = any> {
      data: RouteData<T>;
      constructor(data: RouteData<T>);
      get component(): FunctionComponent<T>;
  }
  export interface RouterData {
      routes: Array<Route>;
  }
  export class Router {
      data: RouterData;
      matchers: Array<{
          route: Route;
          matcher: Atom<Record<string, string> | undefined>;
      }>;
      constructor(data: RouterData);
      matchingRoute: Atom<{
          route: Route<any>;
          params: Record<string, string>;
      } | undefined>;
      matchingRouteWithData: Atom<Promise<Match>>;
      currentRoute: PrimitiveAtom<Match> & {
          init: Match;
      };
      prevLocation: PrimitiveAtom<URL | undefined> & {
          init: URL | undefined;
      };
      blockers: PrimitiveAtom<Set<PrimitiveAtom<BlockingResponse>>> & {
          init: Set<PrimitiveAtom<BlockingResponse>>;
      };
      expected: Promise<Match> | undefined;
      cancelled: PrimitiveAtom<boolean> & {
          init: boolean;
      };
      match: import("jotai").WritableAtom<Match | Promise<Match>, [Promise<Match>, Match], void>;
  }
  export interface RouterProviderProps {
      router: Router;
  }
  export function RouterProvider({ children, router }: PropsWithChildren<RouterProviderProps>): import("react/jsx-runtime").JSX.Element;
  export function useRouter(): Router;
  export interface RouteMatch<T = any> {
      route: Route<T>;
      data: T;
      params: Record<string, string>;
  }
  type Match = RouteMatch | undefined;
  type BlockingResponse = {
      nextRoute: Match;
      confirm(): void;
      cancel(): void;
  } | undefined;
  export type UseBlockerData = {
      isBlocking: true;
      nextRoute?: Match;
      confirm(): void;
      cancel(): void;
  } | {
      isBlocking: false;
      nextRoute: undefined;
      confirm: undefined;
      cancel: undefined;
  };
  export function useRouteBlocker(message: string, when: boolean): UseBlockerData;
  export function useRouteMatch(): Match;
  export function useRouteParams(): Record<string, string>;
  export function useRouteRender(): ReactNode;
  export interface RouteViewProps {
      fallback?: ReactNode;
  }
  export function RouteView({ fallback }: RouteViewProps): import("react/jsx-runtime").JSX.Element;
  export {};
  
}

declare module 'alinea/dashboard/atoms/StyleAtoms' {

  export const accentColorAtom: import("jotai").Atom<string>;
  
}

declare module 'alinea/dashboard/atoms/YAtom' {

  import type * as Y from 'yjs';
  export function yAtom<T>(yType: Y.AbstractType<any>, get: () => T): import("jotai").Atom<T>;
  
}

declare module 'alinea/dashboard/boot/Boot' {

  import type { Client } from 'alinea/core/Client';
  import type { Config } from 'alinea/core/Config';
  import type { ComponentType } from 'react';
  export interface ConfigBatch {
      local: boolean;
      revision: string;
      config: Config;
      client: Client;
      views: Record<string, ComponentType>;
      alineaDev?: boolean;
  }
  export type ConfigGenerator = AsyncGenerator<ConfigBatch>;
  export function boot(gen: ConfigGenerator): Promise<void>;
  
}

declare module 'alinea/dashboard/boot/BootDev' {

  export function bootDev(): Promise<void>;
  
}

declare module 'alinea/dashboard/boot/BootProd' {

  import type { CMS } from 'alinea/core/CMS';
  import type { ComponentType } from 'react';
  export function bootProd(handlerUrl: string, cms: CMS, views: Record<string, ComponentType>): Promise<void>;
  
}

declare module 'alinea/dashboard/boot/DashboardWorker' {

  import type { Config } from 'alinea/core/Config';
  import type { LocalConnection } from 'alinea/core/Connection';
  import { LocalDB } from 'alinea/core/db/LocalDB';
  import type { Mutation } from 'alinea/core/db/Mutation';
  import type { Source } from 'alinea/core/source/Source';
  export class MutateEvent extends Event {
      id: string;
      status: 'success' | 'failure';
      error?: Error | undefined;
      static readonly type = "mutate";
      constructor(id: string, status: 'success' | 'failure', error?: Error | undefined);
  }
  export class DashboardWorker extends EventTarget {
      #private;
      constructor(source: Source);
      get db(): LocalDB | Promise<LocalDB>;
      sync(): Promise<string>;
      queue(id: string, mutations: Array<Mutation>): Promise<string>;
      resolve(raw: string): Promise<unknown>;
      load(revision: string, config: Config, client: LocalConnection): Promise<void>;
  }
  
}

declare module 'alinea/dashboard/boot/LoadWorker' {

  import type { ConfigGenerator } from 'alinea/dashboard/boot/Boot';
  export function loadWorker(gen: ConfigGenerator): Promise<void>;
  
}

declare module 'alinea/dashboard/boot/WorkerDB' {

  import type { Config } from 'alinea/core/Config';
  import type { Connection, UploadResponse } from 'alinea/core/Connection';
  import type { AnyQueryResult, GraphQuery } from 'alinea/core/Graph';
  import type { Mutation } from 'alinea/core/db/Mutation';
  import { WriteableGraph } from 'alinea/core/db/WriteableGraph';
  import type { DashboardWorker } from 'alinea/dashboard/boot/DashboardWorker';
  export class WorkerDB extends WriteableGraph {
      #private;
      config: Config;
      events: EventTarget;
      constructor(config: Config, worker: DashboardWorker, client: Connection, events: EventTarget);
      mutate(mutations: Array<Mutation>): Promise<{
          id: string;
          sha: string;
      }>;
      resolve<Query extends GraphQuery>(query: Query): Promise<AnyQueryResult<Query>>;
      sync(): Promise<string>;
      prepareUpload(file: string): Promise<UploadResponse>;
  }
  
}

declare module 'alinea/dashboard/DashboardNav' {

  export type EntryLocation = {
      id?: string;
      workspace?: string;
      root?: string;
      locale?: string | null;
  };
  export const navMatchers: {
      readonly matchEntry: "/entry/*";
      readonly matchEntryId: "/:action/:workspace/:root?/:id?";
      readonly matchWorkspace: "/:action/:workspace";
      readonly matchRoot: "/:action/:workspace/:root";
  };
  export function dashboardNav(defaults: Partial<EntryLocation>): {
      matchEntry: "/entry/*";
      matchEntryId: "/:action/:workspace/:root?/:id?";
      matchWorkspace: "/:action/:workspace";
      matchRoot: "/:action/:workspace/:root";
      root: ({ id, ...location }: EntryLocation) => string;
      entry: (location: EntryLocation) => string;
      draft: (location: EntryLocation) => string;
      create: (location: EntryLocation) => string;
  };
  
}

declare module 'alinea/dashboard/DashboardProvider' {

  import type { Config } from 'alinea/core/Config';
  import type { LocalConnection } from 'alinea/core/Connection';
  import type { ComponentType, PropsWithChildren } from 'react';
  import { type QueryClient } from 'react-query';
  import type { WorkerDB } from 'alinea/dashboard/boot/WorkerDB';
  export interface DashboardProps {
      db: WorkerDB;
      config: Config;
      views: Record<string, ComponentType<any>>;
      client: LocalConnection;
      queryClient?: QueryClient;
      fullPage?: boolean;
      dev?: boolean;
      alineaDev?: boolean;
  }
  export function DashboardProvider(props: PropsWithChildren<DashboardProps>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/editor/DefaultViews' {

  import { CheckInput } from 'alinea/field/check/CheckField.view';
  import { CodeInput } from 'alinea/field/code/CodeField.view';
  import { MultipleLinksInput, SingleLinkInput } from 'alinea/field/link/LinkField.view';
  import { ListInput } from 'alinea/field/list/ListField.view';
  import { MetadataInput } from 'alinea/field/metadata/MetadataField.view';
  import { NumberInput } from 'alinea/field/number/NumberField.view';
  import { ObjectInput } from 'alinea/field/object/ObjectField.view';
  import { PathInput } from 'alinea/field/path/PathField.view';
  import { RichTextInput } from 'alinea/field/richtext/RichTextField.view';
  import { SelectInput } from 'alinea/field/select/SelectField.view';
  import { TabsView } from 'alinea/field/tabs/Tabs.view';
  import { TextInput } from 'alinea/field/text/TextField.view';
  import { TimeInput } from 'alinea/field/time/TimeField.view';
  import { MediaExplorer } from 'alinea/dashboard/view/MediaExplorer';
  import { FileEntry } from 'alinea/dashboard/view/media/FileEntry';
  import { FileSummaryRow } from 'alinea/dashboard/view/media/FileSummary';
  export const defaultViews: {
      [x: string]: typeof CheckInput | typeof CodeInput | typeof SingleLinkInput | typeof MultipleLinksInput | typeof ListInput | typeof MetadataInput | typeof NumberInput | typeof ObjectInput | typeof PathInput | typeof RichTextInput | typeof SelectInput | typeof TabsView | typeof TextInput | typeof TimeInput | typeof MediaExplorer | typeof FileEntry | typeof FileSummaryRow;
  };
  
}

declare module 'alinea/dashboard/editor/InputForm' {

  import { Field } from 'alinea/core/Field';
  import { Type } from 'alinea/core/Type';
  import { type FormAtoms } from 'alinea/dashboard/atoms/FormAtoms';
  export type InputFormProps = {
      border?: boolean;
  } & ({
      type: Type;
      form?: undefined;
  } | {
      form: FormAtoms<any>;
      type?: undefined;
  });
  export function InputForm(props: InputFormProps): import("react/jsx-runtime").JSX.Element;
  export interface FieldsProps {
      fields: Record<string, Field>;
      border?: boolean;
  }
  export function Fields({ fields, border }: FieldsProps): import("react/jsx-runtime").JSX.Element | null;
  export interface MissingViewProps {
      field: Field<any, any>;
  }
  export function MissingView({ field }: MissingViewProps): import("react/jsx-runtime").JSX.Element;
  export interface InputFieldProps<V, M> {
      field: Field<V, M>;
  }
  export function InputField<V, M>({ field }: InputFieldProps<V, M>): import("react/jsx-runtime").JSX.Element | null;
  
}

declare module 'alinea/dashboard/editor/UseField' {

  import type { Field, FieldOptions } from 'alinea/core/Field';
  export function useField<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options> | string): {
      fieldKey: string;
      label: string;
      options: Options & FieldOptions<StoredValue>;
      value: Awaited<StoredValue>;
      mutator: Mutator;
      error: string | boolean | undefined;
  };
  export function useFieldKey<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options>): string;
  export function useFieldOptions<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options>): Options & FieldOptions<StoredValue>;
  export function useFieldError<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options>): string | boolean | undefined;
  export function useFieldValue<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options>): Awaited<StoredValue>;
  export function useFieldMutator<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options>): Mutator;
  
}

declare module 'alinea/dashboard/editor/ViewKeys' {

  export const viewKeys: {
      CheckInput: string;
      CodeInput: string;
      DateInput: string;
      HiddenInput: string;
      JsonInput: string;
      SingleLinkInput: string;
      MultipleLinksInput: string;
      ListInput: string;
      MetadataInput: string;
      NumberInput: string;
      ObjectInput: string;
      PathInput: string;
      RichTextInput: string;
      SelectInput: string;
      TabsView: string;
      TextInput: string;
      TimeInput: string;
      MediaExplorer: string;
      MediaFile: string;
      FileSummaryRow: string;
      FileSummaryThumb: string;
  };
  
}

declare module 'alinea/dashboard/hook/UseConfig' {

  export const useConfig: () => import("alinea/core/Config").Config;
  
}

declare module 'alinea/dashboard/hook/UseDashboard' {

  export const useDashboard: () => import("alinea/dashboard/App").AppProps;
  
}

declare module 'alinea/dashboard/hook/UseDb' {

  import type { WriteableGraph } from 'alinea/core/db/WriteableGraph';
  export function useDb(): WriteableGraph;
  
}

declare module 'alinea/dashboard/hook/UseDebounce' {

  export function useDebounce<T>(value: T, delay: number): T;
  
}

declare module 'alinea/dashboard/hook/UseEntryEditor' {

  import { type PropsWithChildren } from 'react';
  import type { EntryEditor } from 'alinea/dashboard/atoms/EntryEditorAtoms';
  export function useEntryEditor(): EntryEditor | undefined;
  export interface EntryEditorProviderProps {
      editor: EntryEditor;
  }
  export function EntryEditorProvider({ children, editor }: PropsWithChildren<EntryEditorProviderProps>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/hook/UseEntryLocation' {

  export const useEntryLocation: () => import("alinea/dashboard/DashboardNav").EntryLocation;
  
}

declare module 'alinea/dashboard/hook/UseEntrySummary' {

  export function useEntrySummary(id: string): import("alinea/dashboard/atoms/EntrySummaryAtoms").EntrySummary | undefined;
  
}

declare module 'alinea/dashboard/hook/UseExplorer' {

  import type { Reference } from 'alinea/core/Reference';
  import type { ExporerItemSelect } from 'alinea/dashboard/view/explorer/Explorer';
  type ExplorerContext = {
      selectable?: Array<string> | boolean;
      selection: Array<Reference>;
      onSelect: (entry: ExporerItemSelect) => void;
      onNavigate?: (id: string) => void;
      showMedia?: boolean;
      withNavigation?: boolean;
      border?: boolean;
  };
  export function useExplorer(): ExplorerContext;
  export const ExplorerProvider: import("react").Provider<ExplorerContext | undefined>;
  export {};
  
}

declare module 'alinea/dashboard/hook/UseFocusList' {

  import { type KeyboardEvent, type PropsWithChildren, type Ref } from 'react';
  type FocusListParams = {
      onClear: () => void;
  };
  export function useFocusList({ onClear }: FocusListParams): {
      focusProps: {
          ref: Ref<any>;
          onKeyDown: (event: KeyboardEvent<HTMLElement>) => void;
          onBlur(): void;
      };
      Container: ({ children }: PropsWithChildren<{}>) => import("react/jsx-runtime").JSX.Element;
  };
  export function useFocusListItem<Element extends HTMLElement = HTMLElement>(onSelect: () => void): Ref<Element>;
  export {};
  
}

declare module 'alinea/dashboard/hook/UseGraph' {

  import type { Graph } from 'alinea/core/Graph';
  export function useGraph(): Graph;
  
}

declare module 'alinea/dashboard/hook/UseLocale' {

  export const useLocale: () => string | null;
  
}

declare module 'alinea/dashboard/hook/UseNav' {

  export const useNav: () => {
      matchEntry: "/entry/*";
      matchEntryId: "/:action/:workspace/:root?/:id?";
      matchWorkspace: "/:action/:workspace";
      matchRoot: "/:action/:workspace/:root";
      root: ({ id, ...location }: import("alinea/dashboard/DashboardNav").EntryLocation) => string;
      entry: (location: import("alinea/dashboard/DashboardNav").EntryLocation) => string;
      draft: (location: import("alinea/dashboard/DashboardNav").EntryLocation) => string;
      create: (location: import("alinea/dashboard/DashboardNav").EntryLocation) => string;
  };
  
}

declare module 'alinea/dashboard/hook/UsePreferences' {

  export const usePreferences: () => import("alinea/dashboard/atoms/PreferencesAtoms").Preferences;
  export const useSchemePreference: () => import("alinea/dashboard/atoms/PreferencesAtoms").ColorScheme;
  export const useToggleSchemePreference: () => () => void;
  export const useWorkspacePreference: () => string | undefined;
  export const useSizePreference: () => number;
  export const useLanguagePreference: () => import("alinea/dashboard/atoms/PreferencesAtoms").Language;
  
}

declare module 'alinea/dashboard/hook/UseRoot' {

  export const useRoot: () => {
      label: string;
      contains?: Array<string | import("alinea").Type>;
      orderChildrenBy?: import("alinea/core/OrderBy").OrderBy | Array<import("alinea/core/OrderBy").OrderBy>;
      icon?: import("react").ComponentType;
      i18n?: import("alinea/core/Root").RootI18n;
      view?: import("alinea/core/View").View<{
          root: import("alinea/core/Root").RootData;
      }>;
      isMediaRoot?: boolean;
      preview?: import("alinea/core/Preview").Preview;
      name: string;
  };
  
}

declare module 'alinea/dashboard/hook/UseSession' {

  export const useSession: () => import("alinea/core/Session").Session;
  
}

declare module 'alinea/dashboard/hook/UseUploads' {

  import type { UploadResponse } from 'alinea/core/Connection';
  import { Entry } from 'alinea/core/Entry';
  export enum UploadStatus {
      Queued = 0,
      CreatingPreview = 1,
      Uploading = 2,
      Uploaded = 3,
      Done = 4
  }
  export interface UploadDestination {
      entryId?: string;
      parentId?: string;
      workspace: string;
      root: string;
      directory: string;
  }
  export interface Upload {
      id: string;
      file: File;
      to: UploadDestination;
      status: UploadStatus;
      info?: UploadResponse;
      preview?: string;
      averageColor?: string;
      focus?: {
          x: number;
          y: number;
      };
      thumbHash?: string;
      width?: number;
      height?: number;
      result?: Entry;
      error?: Error;
      replace?: {
          entry: Entry;
          entryFile: string;
      };
  }
  export function useUploads(onSelect?: (entry: Entry) => void): {
      upload: (files: Array<File>, to: UploadDestination, replaceId?: string) => Promise<void>;
      uploads: Upload[];
  };
  
}

declare module 'alinea/dashboard/hook/UseWorkspace' {

  export const useWorkspace: () => {
      label: string;
      color: string;
      roots: import("alinea/core/Workspace").RootsDefinition;
      source: string;
      mediaDir?: string;
      icon?: import("react").ComponentType;
      preview?: import("alinea/core/Preview").Preview;
      name: string;
  };
  
}

declare module 'alinea/dashboard/pages/ContentView' {

  import type { EntryEditor } from 'alinea/dashboard/atoms/EntryEditorAtoms';
  export interface ContentViewProps {
      editor?: EntryEditor;
  }
  export function ContentView({ editor }: ContentViewProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/Routes' {

  import { Entry } from 'alinea/core/Entry';
  import { Route, Router } from 'alinea/dashboard/atoms/RouterAtoms';
  export const entryRoute: Route<{
      editor: {
          transition: import("jotai").PrimitiveAtom<import("alinea/dashboard/atoms/EntryEditorAtoms").EntryTransition | undefined> & {
              init: import("alinea/dashboard/atoms/EntryEditorAtoms").EntryTransition | undefined;
          };
          revisionId: string;
          activeStatus: import("alinea/core/Entry").EntryStatus;
          statusInUrl: import("jotai").Atom<import("alinea/core/Entry").EntryStatus | undefined>;
          selectedStatus: import("jotai").Atom<import("alinea/core/Entry").EntryStatus>;
          entryData: import("alinea/dashboard/atoms/EntryEditorAtoms").EntryData;
          editMode: import("jotai").PrimitiveAtom<import("alinea/dashboard/atoms/EntryEditorAtoms").EditMode> & {
              init: import("alinea/dashboard/atoms/EntryEditorAtoms").EditMode;
          };
          activeVersion: import("alinea/dashboard/atoms/EntryEditorAtoms").Version;
          type: import("alinea").Type;
          previewPayload: import("jotai").Atom<Promise<string>>;
          activeTitle: import("jotai").Atom<string>;
          hasChanges: import("jotai").PrimitiveAtom<boolean> & {
              init: boolean;
          };
          draftEntry: import("jotai").Atom<Promise<Entry<Record<string, unknown>>>> & {
              current: import("jotai").Atom<Entry<Record<string, unknown>> | undefined>;
          };
          saveDraft: import("jotai").WritableAtom<null, [], Promise<void>> & {
              init: null;
          };
          publishEdits: import("jotai").WritableAtom<null, [], Promise<void>> & {
              init: null;
          };
          restoreRevision: import("jotai").WritableAtom<null, [], Promise<void>> & {
              init: null;
          };
          publishDraft: import("jotai").WritableAtom<null, [], Promise<void>> & {
              init: null;
          };
          discardDraft: import("jotai").WritableAtom<null, [], Promise<void>> & {
              init: null;
          };
          unPublish: import("jotai").WritableAtom<null, [], Promise<void>> & {
              init: null;
          };
          archive: import("jotai").WritableAtom<null, [], Promise<void>> & {
              init: null;
          };
          publishArchived: import("jotai").WritableAtom<null, [], Promise<void>> & {
              init: null;
          };
          deleteFile: import("jotai").WritableAtom<null, [], Promise<void>> & {
              init: null;
          };
          deleteMediaLibrary: import("jotai").WritableAtom<null, [], Promise<void>> & {
              init: null;
          };
          deleteEntry: import("jotai").WritableAtom<null, [], Promise<void>> & {
              init: null;
          };
          saveTranslation: import("jotai").WritableAtom<null, [locale: string], Promise<void>> & {
              init: null;
          };
          discardEdits: import("jotai").WritableAtom<null, [], void> & {
              init: null;
          };
          showHistory: import("jotai").WritableAtom<boolean, [value: boolean], void>;
          revisionsAtom: import("jotai").Atom<Promise<import("alinea/core/Connection").Revision[]>>;
          previewToken: import("jotai").Atom<Promise<string>>;
          previewRevision: import("jotai").PrimitiveAtom<{
              ref: string;
              file: string;
          } | undefined> & {
              init: {
                  ref: string;
                  file: string;
              } | undefined;
          };
          preview: import("alinea/core/Preview").Preview | undefined;
          form: import("jotai").Atom<import("alinea/dashboard").FormAtoms<object>>;
          view: import("alinea/core/View").View<import("alinea/dashboard/view/EntryEdit").EntryEditProps & {
              type: import("alinea").Type;
          }> | undefined;
          parents: Array<{
              id: string;
              path: string;
              status: import("alinea/core/Entry").EntryStatus;
              main: boolean;
          }>;
          client: import("alinea/core/Connection").Connection;
          config: import("alinea/core/Config").Config;
          entryId: string;
          versions: Array<import("alinea/dashboard/atoms/EntryEditorAtoms").Version>;
          statuses: Record<import("alinea/core/Entry").EntryStatus, import("alinea/dashboard/atoms/EntryEditorAtoms").Version>;
          availableStatuses: Array<import("alinea/core/Entry").EntryStatus>;
          translations: Array<{
              locale: string;
              entryId: string;
          }>;
          untranslated: boolean;
          canPublish: boolean;
          canDelete: boolean;
          parentNeedsTranslation: boolean;
          edits: import("alinea/dashboard/atoms/Edits").Edits;
      } | undefined;
  }>;
  export const editRoute: Route<{
      locale: string | undefined;
      id: string;
      root: string;
      workspace: string;
  } | null>;
  export const router: Router;
  
}

declare module 'alinea/dashboard/util/Atoms' {

  import { type Atom } from 'jotai';
  export function peek<T>(readable: Atom<T>): Atom<T>;
  
}

declare module 'alinea/dashboard/util/DebounceAtom' {

  import { type Atom } from 'jotai';
  export function debounceAtom<Value>(readable: Atom<Value>, delay: number): Atom<Value>;
  
}

declare module 'alinea/dashboard/util/HashRouter' {

  export * from 'alinea/dashboard/atoms/LocationAtoms';
  
}

declare module 'alinea/dashboard/util/Head' {

  import type { PropsWithChildren } from 'react';
  export function Head({ children }: PropsWithChildren<{}>): import("react").ReactPortal;
  
}

declare module 'alinea/dashboard/util/KeepInView' {

  import { type PropsWithChildren } from 'react';
  export function KeepInView({ children }: PropsWithChildren<{}>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/util/KeepPreviousData' {

  import { type Atom } from 'jotai';
  interface KeepDataOptions<Value> {
      initialValue?: Value;
      compare?: (a: Value, b: Value) => boolean;
  }
  export function keepPreviousData<Value>(asyncAtom: Atom<Promise<Value>>, options?: KeepDataOptions<Value>): Atom<Promise<Value>> & {
      current: Atom<Value | undefined>;
  };
  export {};
  
}

declare module 'alinea/dashboard/util/Loader' {

  import { type Atom } from 'jotai';
  export interface LoaderState<T> {
      data?: T;
      error?: Error;
      isError: boolean;
      isLoading: boolean;
      isSuccess: boolean;
  }
  export function loader<Value>(asynAtom: Atom<Promise<Value>>): import("jotai").WritableAtom<(get: <Value_1>(atom: Atom<Value_1>) => Value_1, { setSelf }: {
      readonly signal: AbortSignal;
      readonly setSelf: <A extends unknown[]>(...args: A) => unknown;
  }) => LoaderState<Value>, [value: Value], void> & {
      init: (get: <Value_1>(atom: Atom<Value_1>) => Value_1, { setSelf }: {
          readonly signal: AbortSignal;
          readonly setSelf: <A extends unknown[]>(...args: A) => unknown;
      }) => LoaderState<Value>;
  };
  
}

declare module 'alinea/dashboard/util/SuspenseBoundary' {

  import { type SuspenseProps } from 'react';
  export function SuspenseBoundary(props: SuspenseProps & {
      name: string;
  }): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/util/WithResolvers' {

  import '@ungap/with-resolvers';
  export const withResolvers: any;
  
}

declare module 'alinea/dashboard/view/AlineaLogo' {

  import type { SVGProps } from 'react';
  export function AlineaLogo(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/Breadcrumbs' {

  import { type PropsWithChildren } from 'react';
  export function Breadcrumbs({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
  export function BreadcrumbsItem({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/Create' {

  import type { ComponentType, HTMLAttributes, HTMLProps } from 'react';
  export namespace Create {
      interface RootProps extends HTMLAttributes<HTMLDivElement> {
          disabled?: boolean;
      }
      function Root({ disabled, ...props }: RootProps): import("react/jsx-runtime").JSX.Element;
      type Props = {
          icon?: ComponentType;
          mod?: 'paste';
      };
      function Link({ children, icon: Icon, ...props }: HTMLProps<HTMLAnchorElement> & Props): import("react/jsx-runtime").JSX.Element;
      function Button({ children, icon: Icon, mod, ...props }: HTMLAttributes<HTMLButtonElement> & Props): import("react/jsx-runtime").JSX.Element;
  }
  
}

declare module 'alinea/dashboard/view/diff/ChangeBox' {

  import { IcOutlineArrowCircleRight } from 'alinea/ui/icons/IcOutlineArrowCircleRight';
  import { IcRoundAddCircleOutline } from 'alinea/ui/icons/IcRoundAddCircleOutline';
  import { IcRoundRemoveCircleOutline } from 'alinea/ui/icons/IcRoundRemoveCircleOutline';
  import type { PropsWithChildren } from 'react';
  const icons: {
      keep: typeof IcOutlineArrowCircleRight;
      addition: typeof IcRoundAddCircleOutline;
      removal: typeof IcRoundRemoveCircleOutline;
  };
  export type ChangeBoxProps = PropsWithChildren<{
      change: keyof typeof icons | 'equal';
  }>;
  export function ChangeBox({ change, children }: ChangeBoxProps): import("react/jsx-runtime").JSX.Element;
  export {};
  
}

declare module 'alinea/dashboard/view/diff/DiffUtils' {

  import type { RecordShape } from 'alinea/core/shape/RecordShape';
  export function equals(a: any, b: any): boolean;
  export function computeLcs<T>(a: Array<T>, b: Array<T>, equals: (valueA: T, valueB: T) => boolean): Array<Array<number>>;
  export type Change<T> = {
      type: 'addition';
      value: T;
  } | {
      type: 'removal';
      value: T;
  } | {
      type: 'keep';
      old: T;
      value: T;
  };
  export function diffList<T>(a: Array<T>, b: Array<T>, equals: (a: T, b: T) => boolean): Array<Change<T>>;
  export function diffRecord(kind: RecordShape, targetA: any, targetB: any): [string, import("alinea/core/Shape").Shape<any, any>][];
  
}

declare module 'alinea/dashboard/view/diff/DiffUtils.test' {

  export {};
  
}

declare module 'alinea/dashboard/view/diff/EntryDiff' {

  import type { Entry } from 'alinea/core/Entry';
  export type EntryDiffProps = {
      entryA: Entry;
      entryB: Entry;
  };
  export function EntryDiff({ entryA, entryB }: EntryDiffProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/diff/FieldDiff' {

  import type { Shape } from 'alinea/core/Shape';
  import type { ComponentType } from 'react';
  import type { FieldsDiffProps } from 'alinea/dashboard/view/diff/FieldsDiff';
  export type FieldDiffProps = {
      FieldsDiff: ComponentType<FieldsDiffProps>;
      shape: Shape;
      valueA: any;
      valueB: any;
  };
  export function FieldDiff({ FieldsDiff, shape, valueA, valueB }: FieldDiffProps): import("react/jsx-runtime").JSX.Element | null;
  
}

declare module 'alinea/dashboard/view/diff/FieldsDiff' {

  import type { Shape } from 'alinea/core/Shape';
  export type FieldsDiffProps = {
      changes: Array<[key: string, shape: Shape]>;
      targetA: Record<string, any>;
      targetB: Record<string, any>;
  };
  export function FieldsDiff({ changes, targetA, targetB }: FieldsDiffProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/diff/ListDiff' {

  import { ListRow, type ListShape } from 'alinea/core/shape/ListShape';
  import type { ComponentType } from 'react';
  import type { FieldsDiffProps } from 'alinea/dashboard/view/diff/FieldsDiff';
  export type ListDiffProps = {
      FieldsDiff: ComponentType<FieldsDiffProps>;
      shape: ListShape<any>;
      valueA: Array<ListRow>;
      valueB: Array<ListRow>;
  };
  export function ListDiff({ FieldsDiff, shape, valueA, valueB }: ListDiffProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/diff/RichTextDiff' {

  import { type TextDoc } from 'alinea/core/TextDoc';
  import type { RichTextShape } from 'alinea/core/shape/RichTextShape';
  import { type ComponentType } from 'react';
  import type { FieldsDiffProps } from 'alinea/dashboard/view/diff/FieldsDiff';
  export type RichTextDiffProps = {
      FieldsDiff: ComponentType<FieldsDiffProps>;
      shape: RichTextShape<any>;
      valueA: TextDoc<any>;
      valueB: TextDoc<any>;
  };
  export function RichTextDiff({ FieldsDiff, shape, valueA, valueB }: RichTextDiffProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/diff/ScalarDiff' {

  export type ScalarDiffProps<T> = {
      valueA: T;
      valueB: T;
  };
  export function ScalarDiff<T>({ valueA, valueB }: ScalarDiffProps<T>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/entry/EditModeToggle' {

  export enum EditMode {
      Editing = "editing",
      Diff = "diff"
  }
  export interface EditModeToggleProps {
      mode: EditMode;
      onChange: (mode: EditMode) => void;
  }
  export function EditModeToggle({ mode, onChange }: EditModeToggleProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/entry/EntryHeader' {

  import { type EntryEditor } from 'alinea/dashboard/atoms/EntryEditorAtoms';
  export interface EntryHeaderProps {
      editable?: boolean;
      editor: EntryEditor;
  }
  export function EntryHeader({ editor, editable }: EntryHeaderProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/entry/EntryHistory' {

  import type { EntryEditProps } from 'alinea/dashboard/view/EntryEdit';
  export function EntryHistory({ editor }: EntryEditProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/entry/EntryNotice' {

  import type { ComponentType, PropsWithChildren, ReactNode } from 'react';
  export interface EntryNoticeProps {
      icon?: ComponentType;
      title: ReactNode;
      variant: 'draft' | 'published' | 'archived' | 'transition' | 'untranslated';
  }
  export function EntryNotice({ icon, title, variant, children }: PropsWithChildren<EntryNoticeProps>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/entry/EntryPreview' {

  import { Config } from 'alinea/core/Config';
  import type { EntryEditor } from 'alinea/dashboard/atoms/EntryEditorAtoms';
  export interface EntryPreviewProps {
      editor: EntryEditor;
      preview: Config['preview'];
  }
  export interface LivePreview {
      preview(payload: string): void;
  }
  export function EntryPreview({ editor, preview }: EntryPreviewProps): import("react/jsx-runtime").JSX.Element | null;
  
}

declare module 'alinea/dashboard/view/entry/EntrySummary' {

  import type { SummaryProps } from 'alinea/core/media/Summary';
  export function EntrySummaryRow({ id, title, path, url, type: typeName, parents }: SummaryProps): import("react/jsx-runtime").JSX.Element | null;
  export function EntrySummaryThumb({ id, title, type: typeName, parents }: SummaryProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/entry/EntryTitle' {

  import type { PropsWithChildren } from 'react';
  import type { EntryEditor } from 'alinea/dashboard/atoms/EntryEditorAtoms';
  export interface EntryTitleProps {
      editor: EntryEditor;
      backLink?: string;
  }
  export function EntryTitle({ children, editor, backLink }: PropsWithChildren<EntryTitleProps>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/entry/FieldToolbar' {

  import type { HTMLProps } from 'react';
  export namespace FieldToolbar {
      const Provider: import("react").ComponentType<{
          children?: import("react").ReactNode | undefined;
      }>, Portal: import("react").ComponentType<HTMLProps<HTMLDivElement>>, Slot: import("react").ComponentType<{
          children?: import("react").ReactNode | undefined;
      }>, useSlots: () => {
          shown: boolean;
      };
      function Root(props: HTMLProps<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
  }
  
}

declare module 'alinea/dashboard/view/entry/LangSwitch' {

  export interface LangswitchProps {
      locales: ReadonlyArray<string>;
      selected: string;
      onChange: (locale: string) => void;
      inline?: boolean;
  }
  export function Langswitch({ selected, locales, onChange, inline }: LangswitchProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/entry/NewEntry' {

  export type NewEntryProps = {
      parentId?: string;
  };
  export function NewEntry({ parentId }: NewEntryProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/entry/RootHeader' {

  export interface RootHeaderProps {
      active?: boolean;
  }
  export function RootHeader({ active }: RootHeaderProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/EntryEdit' {

  import type { EntryEditor } from 'alinea/dashboard/atoms/EntryEditorAtoms';
  export interface EntryEditProps {
      editor: EntryEditor;
  }
  export function EntryEdit({ editor }: EntryEditProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/EntryTree' {

  export interface EntryTreeProps {
      selectedId?: string;
      expanded?: Array<string>;
  }
  export function EntryTree({ selectedId, expanded }: EntryTreeProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/ErrorBoundary' {

  import { type PropsWithChildren } from 'react';
  type ErrorBoundaryProps = PropsWithChildren<{
      dependencies?: ReadonlyArray<any>;
  }>;
  export function ErrorBoundary({ children, dependencies }: ErrorBoundaryProps): import("react/jsx-runtime").JSX.Element;
  export {};
  
}

declare module 'alinea/dashboard/view/explorer/Explorer' {

  import type { QueryWithResult } from 'alinea/core/Graph';
  import type { Reference } from 'alinea/core/Reference';
  export interface ExporerItemSelect {
      id: string;
      type: string;
      workspace: string;
      root: string;
      title: string;
      childrenAmount?: number;
  }
  export interface ExplorerProps {
      query: QueryWithResult<ExporerItemSelect>;
      type: 'row' | 'thumb';
      virtualized?: boolean;
      max?: number;
      selectable?: Array<string> | boolean;
      selection?: Array<Reference>;
      toggleSelect?: (entry: ExporerItemSelect) => void;
      onNavigate?: (id: string) => void;
      showMedia?: boolean;
      withNavigation?: boolean;
      border?: boolean;
  }
  export function Explorer({ type, query, virtualized, max, selectable, selection, toggleSelect, onNavigate, withNavigation, showMedia, border }: ExplorerProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/explorer/ExplorerItem' {

  import type { SummaryProps } from 'alinea/core/media/Summary';
  import type { Schema } from 'alinea/core/Schema';
  import type { ComponentType } from 'react';
  import type { ExporerItemSelect } from 'alinea/dashboard/view/explorer/Explorer';
  export interface ExplorerItemProps {
      schema: Schema;
      entry: ExporerItemSelect;
      summaryView: 'summaryRow' | 'summaryThumb';
      defaultView: ComponentType<SummaryProps>;
  }
  export function ExplorerItem({ schema, entry, summaryView, defaultView }: ExplorerItemProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/explorer/ExplorerRow' {

  import type { QueryWithResult } from 'alinea/core/Graph';
  import type { Schema } from 'alinea/core/Schema';
  import type { SummaryProps } from 'alinea/core/media/Summary';
  import { type ComponentType } from 'react';
  import type { ExporerItemSelect } from 'alinea/dashboard/view/explorer/Explorer';
  export type ExplorerRowProps = {
      schema: Schema;
      query: QueryWithResult<ExporerItemSelect>;
      batchSize: number;
      amount: number;
      from: number;
      summaryView: 'summaryRow' | 'summaryThumb';
      defaultView: ComponentType<SummaryProps>;
  };
  export const ExplorerRow: import("react").NamedExoticComponent<ExplorerRowProps>;
  
}

declare module 'alinea/dashboard/view/IconButton' {

  import { type ComponentType, type HTMLAttributes, type HTMLProps } from 'react';
  export type IconButtonProps = HTMLAttributes<HTMLButtonElement> & {
      icon: ComponentType;
      size?: number;
      active?: boolean;
      disabled?: boolean;
  };
  export const IconButton: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLButtonElement> & {
      icon: ComponentType;
      size?: number;
      active?: boolean;
      disabled?: boolean;
  } & import("react").RefAttributes<HTMLButtonElement>>;
  export type IconLinkProps = HTMLProps<HTMLAnchorElement> & {
      icon: ComponentType;
      active?: boolean;
  };
  export const IconLink: import("react").ForwardRefExoticComponent<Omit<IconLinkProps, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
  
}

declare module 'alinea/dashboard/view/InputLabel' {

  import { type ComponentType, type PropsWithChildren, type ReactNode } from 'react';
  export type LabelHeaderProps = {
      label: ReactNode;
      help?: ReactNode;
      size?: 'small' | 'medium' | 'large';
      focused?: boolean;
      icon?: ComponentType;
      shared?: boolean;
      readOnly?: boolean;
      required?: boolean;
      error?: boolean | string;
      isFolded?: boolean;
      toggleFold?: () => void;
  };
  export const LabelHeader: import("react").NamedExoticComponent<LabelHeaderProps>;
  export interface InputLabelProps extends PropsWithChildren {
      label?: ReactNode;
      asLabel?: boolean;
      help?: ReactNode;
      width?: number;
      inline?: boolean;
      collection?: boolean;
      focused?: boolean;
      size?: 'small' | 'medium' | 'large';
      icon?: ComponentType;
      empty?: boolean;
      shared?: boolean;
      readOnly?: boolean;
      className?: string;
      error?: boolean | string;
      required?: boolean;
      isFolded?: boolean;
      toggleFold?: () => void;
  }
  /** Label for an input */
  export const InputLabel: import("react").ForwardRefExoticComponent<InputLabelProps & import("react").RefAttributes<HTMLElement>>;
  
}

declare module 'alinea/dashboard/view/media/CardOverview' {

  export function CardOverview(): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/media/FileEntry' {

  import type { MediaFile } from 'alinea/core/media/MediaTypes';
  import type { EntryEditProps } from 'alinea/dashboard/view/EntryEdit';
  export function IcTwotonePinDrop(): import("react/jsx-runtime").JSX.Element;
  export function FileEntry(props: EntryEditProps & {
      type: typeof MediaFile;
  }): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/media/FileSummary' {

  import type { SummaryProps } from 'alinea/core/media/Summary';
  export function FileSummaryRow(file: SummaryProps): import("react/jsx-runtime").JSX.Element;
  export function FileSummaryThumb(file: SummaryProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/media/FileUploader' {

  import type { Entry } from 'alinea/core/Entry';
  import { type UploadDestination } from 'alinea/dashboard/hook/UseUploads';
  export interface FileUploaderProps {
      onlyImages?: boolean;
      destination?: UploadDestination;
      max?: number;
      toggleSelect?: (id: Entry) => void;
      position?: 'left' | 'right';
  }
  export function FileUploader({ onlyImages, destination, max, toggleSelect, position }: FileUploaderProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/media/FileUploadRow' {

  import { type Upload } from 'alinea/dashboard/hook/UseUploads';
  export function FileUploadRow(upload: Upload): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/media/MediaThumbnail' {

  export type MediaThumbnailProps = {
      file: {
          id: string;
          title: string;
          extension: string;
          size: number;
          preview: string;
          averageColor: string;
      };
  };
  export function MediaThumbnail({ file }: MediaThumbnailProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/MediaExplorer' {

  import type { RootData } from 'alinea/core/Root';
  import type { EntryEditor } from 'alinea/dashboard/atoms/EntryEditorAtoms';
  export interface MediaExplorerProps {
      editor?: EntryEditor;
      root?: RootData;
  }
  export function MediaExplorer({ editor }: MediaExplorerProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/Modal' {

  import { type PropsWithChildren } from 'react';
  export type ModalProps = PropsWithChildren<{
      open?: boolean;
      onClose: () => void;
      className?: string;
  }>;
  export function Modal({ children, ...props }: ModalProps): import("react/jsx-runtime").JSX.Element | null;
  export function ModalPortal(): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/PageHeader' {

  import type { HTMLProps } from 'react';
  export function PageHeader(props: HTMLProps<HTMLElement>): import("react/jsx-runtime").JSX.Element;
  export namespace PageHeader {
      function Content(props: HTMLProps<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
  }
  
}

declare module 'alinea/dashboard/view/Preview' {

  import type { PropsWithChildren } from 'react';
  export type PreviewProps = PropsWithChildren<{}>;
  export function Preview({ children }: PreviewProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/preview/BrowserPreview' {

  import type { PreviewMetadata } from 'alinea/core/Preview';
  import { type PropsWithChildren } from 'react';
  import type { LivePreview } from 'alinea/dashboard/view/entry/EntryPreview';
  export interface BrowserPreviewProps {
      url: string;
      registerLivePreview(api: LivePreview): void;
  }
  export const BrowserPreviewMetaProvider: React.FC<PropsWithChildren<{
      entryId: string;
  }>>;
  export function usePreviewMetadata(): PreviewMetadata | undefined;
  export function BrowserPreview({ url, registerLivePreview }: BrowserPreviewProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/RootOverview' {

  import type { RootData } from 'alinea/core/Root';
  export interface RootOverviewProps {
      root: RootData;
  }
  export function RootOverview({ root }: RootOverviewProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/SearchBox' {

  export function SearchBox(): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/Sidebar' {

  import { type HTMLProps, type PropsWithChildren } from 'react';
  export namespace Sidebar {
      function use(): {
          isNavOpen: boolean;
          isPreviewOpen: boolean;
          toggleNav: () => void;
          togglePreview: () => void;
      };
      function Provider({ children }: PropsWithChildren<{}>): import("react/jsx-runtime").JSX.Element;
      function Tree({ children, ...props }: PropsWithChildren<HTMLProps<HTMLElement>>): import("react/jsx-runtime").JSX.Element;
      function Preview({ children }: PropsWithChildren<{}>): import("react/jsx-runtime").JSX.Element;
      function Nav({ children }: PropsWithChildren<{}>): import("react/jsx-runtime").JSX.Element;
      namespace Nav {
          type ItemProps = PropsWithChildren<HTMLProps<HTMLAnchorElement> & {
              selected?: boolean;
              badge?: number;
          }>;
          function Item({ children, selected, badge, ...props }: ItemProps): import("react/jsx-runtime").JSX.Element;
      }
  }
  export const useSidebar: typeof Sidebar.use;
  
}

declare module 'alinea/dashboard/view/sidebar/SidebarSettings' {

  export function SidebarSettings(): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/view/Toolbar' {

  import type { ComponentType } from 'react';
  export namespace Toolbar {
      const Provider: ComponentType<{
          children?: import("react").ReactNode | undefined;
      }>, Portal: ComponentType<import("react").HTMLProps<HTMLDivElement>>, Slot: ComponentType<{
          children?: import("react").ReactNode | undefined;
      }>;
      function Root(): import("react/jsx-runtime").JSX.Element;
  }
  
}

declare module 'alinea/dashboard/view/Viewport' {

  import { type HTMLProps, type PropsWithChildren } from 'react';
  type ViewportProps = PropsWithChildren<{
      color?: string;
      contain?: boolean;
      attachToBody?: boolean;
  } & HTMLProps<HTMLDivElement>>;
  export function Viewport({ children, color, contain, attachToBody, ...props }: ViewportProps): import("react/jsx-runtime").JSX.Element;
  export {};
  
}

declare module 'alinea/dashboard/view/WorkspaceLabel' {

  import type { ComponentType } from 'react';
  export type WorkspaceLabelProps = {
      color?: string;
      label: string;
      icon?: ComponentType;
  };
  export function WorkspaceLabel({ label, color, icon }: WorkspaceLabelProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/dashboard/Welcome' {

  export function Welcome(): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/edit' {

  import type { Reference } from 'alinea/core/Reference';
  import type { TextDoc } from 'alinea/core/TextDoc';
  import { ListEditor, type ListField } from 'alinea/core/field/ListField';
  import { RichTextEditor, type RichTextField } from 'alinea/core/field/RichTextField';
  import type { ListRow } from 'alinea/core/shape/ListShape';
  import { LinkEditor, LinksEditor } from 'alinea/field/link/LinkEditor';
  import type { LinkField, LinksField } from 'alinea/field/link/LinkField';
  export { update, create, upload, move, publish, archive, remove } from 'alinea/core/db/Operation';
  export function list<StoredValue extends ListRow, QueryValue extends ListRow>(field: ListField<StoredValue, QueryValue, any>, current?: Array<StoredValue>): ListEditor<StoredValue>;
  export function richText<Blocks = unknown>(field?: RichTextField<Blocks, any>, current?: TextDoc<Blocks>): RichTextEditor<Blocks>;
  export function link<StoredValue extends Reference, QueryValue>(field: LinkField<StoredValue, QueryValue>): LinkEditor<StoredValue>;
  export function links<StoredValue extends ListRow, QueryValue>(field: LinksField<StoredValue, QueryValue>): LinksEditor<StoredValue>;
  
}

declare module 'alinea/field' {

  export * from 'alinea/core/field/CreateField';
  export { check } from 'alinea/field/check';
  export { code } from 'alinea/field/code';
  export { date } from 'alinea/field/date';
  export { json } from 'alinea/field/json';
  export { entry } from 'alinea/field/link/EntryLink';
  export { file } from 'alinea/field/link/FileLink';
  export { image } from 'alinea/field/link/ImageLink';
  export { link } from 'alinea/field/link/Link';
  export { url } from 'alinea/field/link/UrlLink';
  export { list } from 'alinea/field/list';
  export { metadata } from 'alinea/field/metadata';
  export { number } from 'alinea/field/number';
  export { object } from 'alinea/field/object';
  export { path } from 'alinea/field/path';
  export { richText } from 'alinea/field/richtext';
  export { select } from 'alinea/field/select';
  export { tab, tabs } from 'alinea/field/tabs';
  export { text } from 'alinea/field/text';
  export { time } from 'alinea/field/time';
  export { view } from 'alinea/field/view';
  
}

declare module 'alinea/field/check' {

  export * from 'alinea/field/check/CheckField';
  
}

declare module 'alinea/field/check/CheckField' {

  import type { FieldOptions, WithoutLabel } from 'alinea/core/Field';
  import { ScalarField } from 'alinea/core/field/ScalarField';
  import type { ReactNode } from 'react';
  /** Optional settings to configure a text field */
  export interface CheckOptions extends FieldOptions<boolean> {
      /** Description displayed next to the checkbox */
      description?: string;
      /** Width of the field in the dashboard UI (0-1) */
      width?: number;
      /** Add instructional text to a field */
      help?: ReactNode;
      /** Display a minimal version */
      inline?: boolean;
      /** Focus this input automatically */
      autoFocus?: boolean;
  }
  /** Internal representation of a text field */
  export class CheckField extends ScalarField<boolean, CheckOptions> {
  }
  /** Create a text field configuration */
  export function check(label: string, options?: WithoutLabel<CheckOptions>): CheckField;
  
}

declare module 'alinea/field/check/CheckField.stories' {

  export function CheckField(): import("react/jsx-runtime").JSX.Element;
  const _default: {
      title: string;
  };
  export default _default;
  
}

declare module 'alinea/field/check/CheckField.view' {

  import type { CheckField } from 'alinea/field/check/CheckField';
  export interface CheckInputProps {
      field: CheckField;
  }
  export function CheckInput({ field }: CheckInputProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/field/code' {

  export * from 'alinea/field/code/CodeField';
  
}

declare module 'alinea/field/code/CodeField' {

  import type { FieldOptions, WithoutLabel } from 'alinea/core';
  import { ScalarField } from 'alinea/core/field/ScalarField';
  import type { ReactNode } from 'react';
  export interface CodeFieldOptions extends FieldOptions<string> {
      width?: number;
      help?: ReactNode;
      inline?: boolean;
      language?: string;
  }
  export class CodeField extends ScalarField<string, CodeFieldOptions> {
  }
  export function code(label: string, options?: WithoutLabel<CodeFieldOptions>): CodeField;
  
}

declare module 'alinea/field/code/CodeField.stories' {

  export function CodeField(): import("react/jsx-runtime").JSX.Element;
  const _default: {
      title: string;
  };
  export default _default;
  
}

declare module 'alinea/field/code/CodeField.view' {

  import type { CodeField } from 'alinea/field/code/CodeField';
  export interface CodeInputProps {
      field: CodeField;
  }
  export function CodeInput({ field }: CodeInputProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/field/date' {

  export * from 'alinea/field/date/DateField';
  
}

declare module 'alinea/field/date/DateField' {

  import type { FieldOptions, WithoutLabel } from 'alinea/core';
  import { ScalarField } from 'alinea/core/field/ScalarField';
  import type { ReactNode } from 'react';
  /** Optional settings to configure a text field */
  export interface DateOptions extends FieldOptions<string> {
      /** Width of the field in the dashboard UI (0-1) */
      width?: number;
      /** Add instructional text to a field */
      help?: ReactNode;
      /** Display a minimal version */
      inline?: boolean;
      /** Focus this input automatically */
      autoFocus?: boolean;
  }
  /** Internal representation of a date field */
  export class DateField extends ScalarField<string, DateOptions> {
  }
  /** Create a date field configuration */
  export function date(label: string, options?: WithoutLabel<DateOptions>): DateField;
  
}

declare module 'alinea/field/date/DateField.stories' {

  export function DateField(): import("react/jsx-runtime").JSX.Element;
  const _default: {
      title: string;
  };
  export default _default;
  
}

declare module 'alinea/field/date/DateField.view' {

  import type { DateField } from 'alinea/field/date/DateField';
  export interface DateInputProps {
      field: DateField;
  }
  export function DateInput({ field }: DateInputProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/field/hidden' {

  export * from 'alinea/field/hidden/HiddenField';
  
}

declare module 'alinea/field/hidden/HiddenField' {

  import type { FieldOptions, WithoutLabel } from 'alinea/core/Field';
  import { ScalarField } from 'alinea/core/field/ScalarField';
  /** Internal representation of a text field */
  export class HiddenField<T> extends ScalarField<T, FieldOptions<T>> {
  }
  /** Create a hidden field configuration */
  export function hidden<T>(label: string, options?: WithoutLabel<FieldOptions<T>>): HiddenField<T>;
  
}

declare module 'alinea/field/hidden/HiddenField.view' {

  export function HiddenInput(): null;
  
}

declare module 'alinea/field/json' {

  export * from 'alinea/field/json/JsonField';
  
}

declare module 'alinea/field/json/JsonField' {

  import type { FieldOptions, WithoutLabel } from 'alinea/core';
  import { ScalarField } from 'alinea/core/field/ScalarField';
  import type { ReactNode } from 'react';
  /** Optional settings to configure a JSON field */
  export interface JsonOptions<T> extends FieldOptions<T> {
      /** Width of the field in the dashboard UI (0-1) */
      width?: number;
      /** Add instructional text to a field */
      help?: ReactNode;
      /** Display a minimal version */
      inline?: boolean;
      /** Focus this input automatically */
      autoFocus?: boolean;
  }
  /** Internal representation of a text field */
  export class JsonField<T> extends ScalarField<T, JsonOptions<T>> {
  }
  /** Create a text field configuration */
  export function json<T>(label: string, options?: WithoutLabel<JsonOptions<T>>): JsonField<T>;
  
}

declare module 'alinea/field/json/JsonField.stories' {

  export function JsonField(): import("react/jsx-runtime").JSX.Element;
  const _default: {
      title: string;
  };
  export default _default;
  
}

declare module 'alinea/field/json/JsonField.view' {

  import type { JsonField } from 'alinea/field/json/JsonField';
  export interface JsonInputProps<T> {
      field: JsonField<T>;
  }
  export function JsonInput<T>({ field }: JsonInputProps<T>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/field/link' {

  export * from 'alinea/field/link/EntryLink';
  export * from 'alinea/field/link/FileLink';
  export * from 'alinea/field/link/ImageLink';
  export * from 'alinea/field/link/Link';
  export * from 'alinea/field/link/UrlLink';
  
}

declare module 'alinea/field/link/EntryLink' {

  import type { WithoutLabel } from 'alinea/core/Field';
  import type { InferStoredValue } from 'alinea/core/Infer';
  import type { Label } from 'alinea/core/Label';
  import type { Type } from 'alinea/core/Type';
  import type { ListRow } from 'alinea/core/shape/ListShape';
  import { type LinkFieldOptions } from 'alinea/field/link/LinkField';
  import { type EntryPickerOptions } from 'alinea/picker/entry';
  import type { EntryReference } from 'alinea/picker/entry/EntryReference';
  export interface EntryLink<InferredFields = undefined> extends EntryReference {
      entryId: string;
      entryType: string;
      title: string;
      path: string;
      href: string;
      fields: InferredFields;
  }
  export namespace EntryLink {
      const entryId: import("alinea/core/Expr").Expr<string>;
      const title: import("alinea/core/Expr").Expr<string>;
      const entryType: import("alinea/core/Expr").Expr<string>;
      const url: import("alinea/core/Expr").Expr<string>;
      const href: import("alinea/core/Expr").Expr<string>;
      const path: import("alinea/core/Expr").Expr<string>;
  }
  interface EntryOptions<Fields> extends LinkFieldOptions<EntryReference & InferStoredValue<Fields>>, Omit<EntryPickerOptions<Fields>, 'label' | 'selection'> {
  }
  export function entry<Fields = undefined>(label: Label, options?: WithoutLabel<EntryOptions<Fields>>): import("alinea/field/link/LinkField").LinkField<EntryReference & InferStoredValue<Fields>, EntryLink<{ [K_1 in keyof Fields as Fields[K_1] extends import("alinea/core/Expr").Expr<any> ? K_1 : never]: Fields[K_1] extends import("alinea/core/Expr").Expr<infer T_1> ? T_1 : never; } extends infer T ? { [K in keyof T]: { [K_1 in keyof Fields as Fields[K_1] extends import("alinea/core/Expr").Expr<any> ? K_1 : never]: Fields[K_1] extends import("alinea/core/Expr").Expr<infer T_1> ? T_1 : never; }[K]; } : never>>;
  export namespace entry {
      type EntryRow<Fields> = EntryLink<Type.Infer<Fields>> & ListRow;
      interface EntryOptions<Fields> extends LinkFieldOptions<Array<EntryReference & ListRow & InferStoredValue<Fields>>>, Omit<EntryPickerOptions<Fields>, 'label' | 'selection'> {
      }
      export function multiple<Fields = undefined>(label: Label, options?: WithoutLabel<EntryOptions<Fields>>): import("alinea/field/link/LinkField").LinksField<EntryReference & ListRow, EntryRow<Fields>>;
      export {};
  }
  export {};
  
}

declare module 'alinea/field/link/FileLink' {

  import type { WithoutLabel } from 'alinea/core/Field';
  import type { InferStoredValue } from 'alinea/core/Infer';
  import type { Label } from 'alinea/core/Label';
  import type { ListRow } from 'alinea/core/shape/ListShape';
  import { type LinkFieldOptions } from 'alinea/field/link/LinkField';
  import { type EntryPickerOptions } from 'alinea/picker/entry';
  import type { EntryReference } from 'alinea/picker/entry/EntryReference';
  export interface FileLink<InferredFields = undefined> extends EntryReference {
      title: string;
      href: string;
      extension: string;
      size: number;
      fields: InferredFields;
  }
  export namespace FileLink {
      const title: import("alinea/core/Expr").Expr<string>;
      const url: import("alinea/field/hidden").HiddenField<string>;
      const href: import("alinea/field/hidden").HiddenField<string>;
      const extension: import("alinea/field/hidden").HiddenField<string>;
      const size: import("alinea/field/hidden").HiddenField<number>;
  }
  export function filePicker<Fields>(multiple: boolean, options: Omit<EntryPickerOptions<Fields>, 'selection'>): import("alinea/core/Picker").Picker<EntryReference, EntryPickerOptions<Fields>>;
  export interface FileOptions<Fields> extends LinkFieldOptions<EntryReference & InferStoredValue<Fields>>, Omit<EntryPickerOptions<Fields>, 'label' | 'selection'> {
  }
  export function file<Fields = undefined>(label: Label, options?: WithoutLabel<FileOptions<Fields>>): import("alinea/field/link/LinkField").LinkField<EntryReference & InferStoredValue<Fields>, FileLink<{ [K_1 in keyof Fields as Fields[K_1] extends import("alinea/core/Expr").Expr<any> ? K_1 : never]: Fields[K_1] extends import("alinea/core/Expr").Expr<infer T_1> ? T_1 : never; } extends infer T ? { [K in keyof T]: { [K_1 in keyof Fields as Fields[K_1] extends import("alinea/core/Expr").Expr<any> ? K_1 : never]: Fields[K_1] extends import("alinea/core/Expr").Expr<infer T_1> ? T_1 : never; }[K]; } : never>>;
  export namespace file {
      interface FilesOptions<Fields> extends LinkFieldOptions<Array<EntryReference & ListRow & InferStoredValue<Fields>>>, Omit<EntryPickerOptions<Fields>, 'label' | 'selection'> {
      }
      function multiple<Fields = undefined>(label: Label, options?: WithoutLabel<FilesOptions<Fields>>): import("alinea/field/link/LinkField").LinksField<EntryReference & ListRow & InferStoredValue<Fields>, FileLink<{ [K_1 in keyof Fields as Fields[K_1] extends import("alinea/core/Expr").Expr<any> ? K_1 : never]: Fields[K_1] extends import("alinea/core/Expr").Expr<infer T_1> ? T_1 : never; } extends infer T ? { [K in keyof T]: { [K_1 in keyof Fields as Fields[K_1] extends import("alinea/core/Expr").Expr<any> ? K_1 : never]: Fields[K_1] extends import("alinea/core/Expr").Expr<infer T_1> ? T_1 : never; }[K]; } : never>>;
  }
  
}

declare module 'alinea/field/link/ImageLink' {

  import type { WithoutLabel } from 'alinea/core/Field';
  import type { InferStoredValue } from 'alinea/core/Infer';
  import type { Label } from 'alinea/core/Label';
  import type { Type } from 'alinea/core/Type';
  import type { ListRow } from 'alinea/core/shape/ListShape';
  import { type LinkField, type LinkFieldOptions, type LinksField } from 'alinea/field/link/LinkField';
  import { type EntryPickerOptions } from 'alinea/picker/entry';
  import type { EntryReference } from 'alinea/picker/entry/EntryReference';
  export interface ImageLink<InferredFields = undefined> extends EntryReference {
      title: string;
      src: string;
      url: string;
      extension: string;
      size: number;
      hash: string;
      width: number;
      height: number;
      averageColor: string;
      thumbHash: string;
      focus: {
          x: number;
          y: number;
      };
      fields: InferredFields;
  }
  export namespace ImageLink {
      const title: import("alinea/core/Expr").Expr<string>;
      const src: import("alinea/field/hidden").HiddenField<string>;
      const extension: import("alinea/field/hidden").HiddenField<string>;
      const size: import("alinea/field/hidden").HiddenField<number>;
      const hash: import("alinea/field/hidden").HiddenField<string>;
      const width: import("alinea/field/hidden").HiddenField<number>;
      const height: import("alinea/field/hidden").HiddenField<number>;
      const averageColor: import("alinea/field/hidden").HiddenField<string>;
      const thumbHash: import("alinea/field/hidden").HiddenField<string>;
      const focus: import("alinea/field/hidden").HiddenField<{
          x: number;
          y: number;
      }>;
  }
  export interface ImageField<Fields = undefined> extends LinkField<EntryReference & InferStoredValue<Fields>, ImageLink<Type.Infer<Fields>>> {
  }
  export interface ImageOptions<Fields> extends LinkFieldOptions<EntryReference & InferStoredValue<Fields>>, Omit<EntryPickerOptions<Fields>, 'label' | 'selection'> {
  }
  export function image<Fields = undefined>(label: Label, options?: WithoutLabel<ImageOptions<Fields>>): ImageField<Fields>;
  export interface ImagesField<Fields = undefined> extends LinksField<EntryReference & ListRow & InferStoredValue<Fields>, ImageLink<Type.Infer<Fields>>> {
  }
  export namespace image {
      interface ImagesOptions<Fields> extends LinkFieldOptions<Array<EntryReference & ListRow & InferStoredValue<Fields>>>, Omit<EntryPickerOptions<Fields>, 'label' | 'selection'> {
      }
      function multiple<Fields = undefined>(label: Label, options?: WithoutLabel<ImagesOptions<Fields>>): ImagesField<Fields>;
  }
  
}

declare module 'alinea/field/link/Link' {

  import type { WithoutLabel } from 'alinea/core/Field';
  import type { Label } from 'alinea/core/Label';
  import type { Type } from 'alinea/core/Type';
  import type { ListRow } from 'alinea/core/shape/ListShape';
  import { type FileLink } from 'alinea/field/link/FileLink';
  import { type LinkField, type LinkFieldOptions, type LinksField } from 'alinea/field/link/LinkField';
  import { type EntryPickerConditions } from 'alinea/picker/entry';
  import type { EntryReference } from 'alinea/picker/entry/EntryReference';
  import { type UrlReference } from 'alinea/picker/url';
  import { EntryLink } from 'alinea/field/link/EntryLink';
  import type { UrlLink } from 'alinea/field/link/UrlLink';
  export type Link<InferredFields> = EntryLink<InferredFields> | UrlLink<InferredFields> | FileLink<InferredFields>;
  export interface LinkOptions<Definition, Row> extends LinkFieldOptions<Row>, EntryPickerConditions {
      fields?: Definition | Type<Definition>;
  }
  export type LinkRow = (EntryReference | UrlReference) & ListRow;
  export function link<Fields>(label: Label, options?: WithoutLabel<LinkOptions<Fields, LinkRow>>): LinkField<LinkRow, Link<Type.Infer<Fields>>>;
  export namespace link {
      function multiple<Fields>(label: Label, options?: WithoutLabel<LinkOptions<Fields, Array<LinkRow>>>): LinksField<LinkRow, Link<Type.Infer<Fields>>>;
  }
  
}

declare module 'alinea/field/link/LinkEditor' {

  import { Reference } from 'alinea/core/Reference';
  import { ListEditor } from 'alinea/core/field/ListField';
  import type { ListRow } from 'alinea/core/shape/ListShape';
  export class LinkEditor<StoredValue extends Reference> {
      row?: StoredValue;
      add(type: StoredValue['_type'], value: Omit<StoredValue, '_type' | '_id'>): this;
      addUrl(data: {
          url: string;
          title: string;
          target?: string;
      }, fields?: Record<string, unknown>): this;
      addEntry(entryId: string, fields?: Record<string, unknown>): this;
      addImage(entryId: string, fields?: Record<string, unknown>): this;
      addFile(entryId: string, fields?: Record<string, unknown>): this;
      value(): StoredValue;
  }
  export class LinksEditor<StoredValue extends ListRow> extends ListEditor<StoredValue> {
      addUrl(data: {
          url: string;
          title: string;
          target?: string;
      }, fields?: Record<string, unknown>): this;
      addEntry(entryId: string, fields?: Record<string, unknown>): this;
      addImage(entryId: string, fields?: Record<string, unknown>): this;
      addFile(entryId: string, fields?: Record<string, unknown>): this;
  }
  
}

declare module 'alinea/field/link/LinkField' {

  import type { FieldOptions, WithoutLabel } from 'alinea/core/Field';
  import { ListField } from 'alinea/core/field/ListField';
  import { UnionField } from 'alinea/core/field/UnionField';
  import type { EdgeEntries, EdgeEntry, GraphQuery, IncludeGuard, SelectionGuard, TypeGuard } from 'alinea/core/Graph';
  import type { Picker } from 'alinea/core/Picker';
  import { Reference } from 'alinea/core/Reference';
  import { ListRow } from 'alinea/core/shape/ListShape';
  import type { ReactNode } from 'react';
  /** Optional settings to configure a link field */
  export interface LinkFieldOptions<Value> extends FieldOptions<Value> {
      /** Width of the field in the dashboard UI (0-1) */
      width?: number;
      /** Add instructional text to a field */
      help?: ReactNode;
      /** Display a minimal version */
      inline?: boolean;
      max?: number;
  }
  export interface LinkOptions<Value> extends LinkFieldOptions<Value> {
      pickers: Record<string, Picker<any, any>>;
  }
  export class LinkField<StoredValue extends Reference, QueryValue> extends UnionField<StoredValue, QueryValue, LinkOptions<StoredValue>> {
      first<Selection extends SelectionGuard = undefined, const Type extends TypeGuard = undefined, Include extends IncludeGuard = undefined>(query: GraphQuery<Selection, Type, Include>): GraphQuery<Selection, Type, Include> & EdgeEntry & {
          first: true;
      };
  }
  export function createLink<StoredValue extends Reference, QueryValue>(label: string, options: WithoutLabel<LinkOptions<StoredValue>>): LinkField<StoredValue, QueryValue>;
  /** Internal representation of a link field */
  export class LinksField<StoredValue extends ListRow, QueryValue> extends ListField<StoredValue, QueryValue, LinkOptions<Array<StoredValue>>> {
      find<Selection extends SelectionGuard = undefined, Type extends TypeGuard = undefined, Include extends IncludeGuard = undefined>(query: GraphQuery<Selection, Type, Include>): GraphQuery<Selection, Type, Include> & EdgeEntries;
      first<Selection extends SelectionGuard = undefined, const Type extends TypeGuard = undefined, Include extends IncludeGuard = undefined>(query?: GraphQuery<Selection, Type, Include>): GraphQuery<Selection, Type, Include> & EdgeEntries & {
          first: true;
      };
      count<Selection extends SelectionGuard = undefined, const Type extends TypeGuard = undefined, Include extends IncludeGuard = undefined>(query?: GraphQuery<Selection, Type, Include>): GraphQuery<Selection, Type, Include> & EdgeEntries & {
          count: true;
      };
  }
  /** Create a link field configuration */
  export function createLinks<StoredValue extends ListRow, QueryValue>(label: string, options: WithoutLabel<LinkOptions<Array<StoredValue>>>): LinksField<StoredValue, QueryValue>;
  
}

declare module 'alinea/field/link/LinkField.stories' {

  export function LinkField(): import("react/jsx-runtime").JSX.Element;
  const _default: {
      title: string;
  };
  export default _default;
  
}

declare module 'alinea/field/link/LinkField.view' {

  import { Reference } from 'alinea/core/Reference';
  import { ListRow } from 'alinea/core/shape/ListShape';
  import type { LinkField, LinksField } from 'alinea/field/link/LinkField';
  export type * from 'alinea/field/link/LinkField';
  export interface LinkInputProps<Row> {
      field: LinkField<Reference, Row>;
  }
  export function SingleLinkInput<Row>({ field }: LinkInputProps<Row>): import("react/jsx-runtime").JSX.Element;
  export interface LinksInputProps<Row> {
      field: LinksField<ListRow, Row>;
  }
  export function MultipleLinksInput<Row>({ field }: LinksInputProps<Row>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/field/link/UrlLink' {

  import type { WithoutLabel } from 'alinea/core/Field';
  import type { InferStoredValue } from 'alinea/core/Infer';
  import type { Label } from 'alinea/core/Label';
  import type { Type } from 'alinea/core/Type';
  import type { ListRow } from 'alinea/core/shape/ListShape';
  import { type LinkFieldOptions } from 'alinea/field/link/LinkField';
  import { type UrlPickerOptions, type UrlReference } from 'alinea/picker/url';
  export interface UrlLink<InferredFields = undefined> extends UrlReference {
      href: string;
      title: string;
      target: string;
      fields: InferredFields;
  }
  export namespace UrlLink {
  }
  export interface UrlOptions<Fields> extends LinkFieldOptions<UrlReference & InferStoredValue<Fields>>, UrlPickerOptions<Fields> {
  }
  export function url<Fields>(label: Label, options?: WithoutLabel<UrlOptions<Fields>>): import("alinea/field/link/LinkField").LinkField<UrlReference & InferStoredValue<Fields>, UrlLink<{ [K_1 in keyof Fields as Fields[K_1] extends import("alinea/core/Expr").Expr<any> ? K_1 : never]: Fields[K_1] extends import("alinea/core/Expr").Expr<infer T_1> ? T_1 : never; } extends infer T ? { [K in keyof T]: { [K_1 in keyof Fields as Fields[K_1] extends import("alinea/core/Expr").Expr<any> ? K_1 : never]: Fields[K_1] extends import("alinea/core/Expr").Expr<infer T_1> ? T_1 : never; }[K]; } : never>>;
  export namespace url {
      type UrlRows<Fields> = UrlLink<Type.Infer<Fields>> & ListRow;
      export interface UrlOptions<Fields> extends LinkFieldOptions<Array<UrlReference & ListRow & InferStoredValue<Fields>>>, UrlPickerOptions<Fields> {
      }
      export function multiple<Fields>(label: Label, options?: WithoutLabel<UrlOptions<Fields>>): import("alinea/field/link/LinkField").LinksField<UrlReference & ListRow & InferStoredValue<Fields>, UrlRows<Fields>>;
      export {};
  }
  
}

declare module 'alinea/field/list' {

  export * from 'alinea/field/list/ListField';
  
}

declare module 'alinea/field/list/ListField' {

  import type { FieldOptions, WithoutLabel } from 'alinea/core/Field';
  import type { InferQueryValue, InferStoredValue } from 'alinea/core/Infer';
  import { Schema } from 'alinea/core/Schema';
  import { ListField } from 'alinea/core/field/ListField';
  import { ListRow } from 'alinea/core/shape/ListShape';
  import type { ReactNode } from 'react';
  /** Optional settings to configure a list field */
  export interface ListOptions<Definitions extends Schema> extends FieldOptions<Array<InferStoredValue<Definitions>>> {
      /** Allow these types of blocks to be created */
      schema: Definitions;
      /** Width of the field in the dashboard UI (0-1) */
      width?: number;
      /** Add instructional text to a field */
      help?: ReactNode;
      /** Display a minimal version */
      inline?: boolean;
      /** Hide this list field */
      hidden?: boolean;
      /** The initial value of the field */
      initialValue?: Array<InferStoredValue<Definitions>>;
      /** Validate the given value */
      validate?(value: Array<InferStoredValue<Definitions> & ListRow>): boolean | string | undefined;
  }
  /** Create a list field configuration */
  export function list<Definitions extends Schema>(label: string, options: WithoutLabel<ListOptions<Definitions>>): ListField<InferStoredValue<Definitions> & ListRow, InferQueryValue<Definitions> & ListRow, ListOptions<Definitions>>;
  
}

declare module 'alinea/field/list/ListField.stories' {

  export function ListField(): import("react/jsx-runtime").JSX.Element;
  const _default: {
      title: string;
  };
  export default _default;
  
}

declare module 'alinea/field/list/ListField.view' {

  import type { ListField } from 'alinea/core/field/ListField';
  import type { Schema } from 'alinea/core/Schema';
  import { ListRow } from 'alinea/core/shape/ListShape';
  import type { ListOptions } from 'alinea/field/list/ListField';
  export interface ListInputProps {
      field: ListField<ListRow, ListRow, ListOptions<Schema>>;
  }
  export function ListInput({ field }: ListInputProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/field/metadata' {

  export * from 'alinea/field/metadata/MetadataField';
  
}

declare module 'alinea/field/metadata/MetadataField' {

  import type { FieldOptions, WithoutLabel } from 'alinea/core';
  import { RecordField } from 'alinea/core/field/RecordField';
  import { type Type } from 'alinea/core/Type';
  import { type ImageField, type ImageLink } from 'alinea/field/link';
  import { type ObjectField } from 'alinea/field/object';
  import { type TextField } from 'alinea/field/text';
  export interface MetadataOptions extends FieldOptions<Metadata> {
      inferTitleFrom?: string;
      inferDescriptionFrom?: string;
      inferImageFrom?: string;
  }
  export interface MetadataFields {
      title: TextField;
      description: TextField;
      openGraph: ObjectField<{
          image: ImageField;
          title: TextField;
          description: TextField;
      }>;
  }
  export interface Metadata {
      title: string;
      description: string;
      openGraph: {
          image: ImageLink;
          title: string;
          description: string;
      };
  }
  export class MetadataField extends RecordField<Metadata, MetadataOptions & {
      fields: Type<MetadataFields>;
  }> {
  }
  export function metadata(label?: string, options?: WithoutLabel<MetadataOptions>): MetadataField;
  
}

declare module 'alinea/field/metadata/MetadataField.stories' {

  export function MetadataField(): import("react/jsx-runtime").JSX.Element;
  const _default: {
      title: string;
  };
  export default _default;
  
}

declare module 'alinea/field/metadata/MetadataField.view' {

  import type { MetadataField } from 'alinea/field/metadata/MetadataField';
  export interface MetadataInputProps {
      field: MetadataField;
  }
  export function MetadataInput({ field }: MetadataInputProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/field/number' {

  export * from 'alinea/field/number/NumberField';
  
}

declare module 'alinea/field/number/NumberField' {

  import type { FieldOptions, WithoutLabel } from 'alinea/core';
  import { ScalarField } from 'alinea/core/field/ScalarField';
  import type { ReactNode } from 'react';
  export interface NumberOptions extends FieldOptions<number | null> {
      /** Width of the field in the dashboard UI (0-1) */
      width?: number;
      /** Add instructional text to a field */
      help?: ReactNode;
      /** Display a minimal version */
      inline?: boolean;
      /** A minimum value */
      minValue?: number;
      /** A maximum value */
      maxValue?: number;
      /** Specifies the legal number intervals */
      step?: number;
  }
  export class NumberField extends ScalarField<number | null, NumberOptions> {
  }
  export function number(label: string, options?: WithoutLabel<NumberOptions>): NumberField;
  
}

declare module 'alinea/field/number/NumberField.stories' {

  export function NumberField(): import("react/jsx-runtime").JSX.Element;
  const _default: {
      title: string;
  };
  export default _default;
  
}

declare module 'alinea/field/number/NumberField.view' {

  import type { NumberField } from 'alinea/field/number/NumberField';
  export interface NumberInputProps {
      field: NumberField;
  }
  export function NumberInput({ field }: NumberInputProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/field/object' {

  export * from 'alinea/field/object/ObjectField';
  
}

declare module 'alinea/field/object/ObjectField' {

  import type { FieldOptions, WithoutLabel } from 'alinea/core/Field';
  import { type FieldsDefinition, type Type } from 'alinea/core/Type';
  import { RecordField } from 'alinea/core/field/RecordField';
  import type { ReactNode } from 'react';
  export interface ObjectOptions<Definition> extends FieldOptions<Type.Infer<Definition>> {
      /** Width of the field in the dashboard UI (0-1) */
      width?: number;
      /** Add instructional text to a field */
      help?: ReactNode;
      /** Display a minimal version */
      inline?: boolean;
  }
  export class ObjectField<Definition> extends RecordField<Type.Infer<Definition>, ObjectOptions<Definition> & {
      fields: Type<Definition>;
  }> {
  }
  export function object<Fields extends FieldsDefinition>(label: string, options: WithoutLabel<ObjectOptions<Fields> & {
      fields: Fields;
  }>): ObjectField<Fields> & Fields;
  
}

declare module 'alinea/field/object/ObjectField.stories' {

  export function ObjectField(): import("react/jsx-runtime").JSX.Element;
  const _default: {
      title: string;
  };
  export default _default;
  
}

declare module 'alinea/field/object/ObjectField.view' {

  import type { ObjectField } from 'alinea/field/object/ObjectField';
  export interface ObjectInputProps<Definition> {
      field: ObjectField<Definition>;
  }
  export function ObjectInput<Definition>({ field }: ObjectInputProps<Definition>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/field/path' {

  export * from 'alinea/field/path/PathField';
  
}

declare module 'alinea/field/path/PathField' {

  import type { FieldOptions, WithoutLabel } from 'alinea/core/Field';
  import { ScalarField } from 'alinea/core/field/ScalarField';
  import type { ReactNode } from 'react';
  export interface PathOptions extends FieldOptions<string> {
      width?: number;
      from?: string;
      help?: ReactNode;
      inline?: boolean;
  }
  export class PathField extends ScalarField<string, PathOptions> {
  }
  export function path(label: string, options?: WithoutLabel<PathOptions>): PathField;
  
}

declare module 'alinea/field/path/PathField.stories' {

  export function PathField(): import("react/jsx-runtime").JSX.Element;
  const _default: {
      title: string;
  };
  export default _default;
  
}

declare module 'alinea/field/path/PathField.view' {

  import type { PathField } from 'alinea/field/path/PathField';
  export interface PathInputProps {
      field: PathField;
  }
  export function PathInput({ field }: PathInputProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/field/richtext' {

  export * from 'alinea/field/richtext/RichTextField';
  
}

declare module 'alinea/field/richtext/extensions/Link' {

  import { Mark } from '@tiptap/core';
  interface LinkAttributes {
      'data-id'?: string;
      'data-entry'?: string;
      'data-link'?: string;
      href?: string;
      target?: string;
      title?: string;
  }
  export interface LinkOptions {
      /**
       * A list of HTML attributes to be rendered.
       */
      HTMLAttributes: Record<string, any>;
  }
  module '@tiptap/core' {
      interface Commands<ReturnType> {
          link: {
              /**
               * Set a link mark
               */
              setLink: (attributes: LinkAttributes) => ReturnType;
              /**
               * Toggle a link mark
               */
              toggleLink: (attributes: LinkAttributes) => ReturnType;
              /**
               * Unset a link mark
               */
              unsetLink: () => ReturnType;
          };
      }
  }
  export const Link: Mark<LinkOptions, any>;
  export {};
  
}

declare module 'alinea/field/richtext/extensions/Small' {

  import { Mark } from '@tiptap/core';
  export interface SmallOptions {
      HTMLAttributes: Record<string, any>;
  }
  module '@tiptap/core' {
      interface Commands<ReturnType> {
          small: {
              /**
               * Set a small mark
               */
              setSmall: () => ReturnType;
              /**
               * Toggle a small mark
               */
              toggleSmall: () => ReturnType;
              /**
               * Unset a small mark
               */
              unsetSmall: () => ReturnType;
          };
      }
  }
  const Small: Mark<SmallOptions, any>;
  export default Small;
  
}

declare module 'alinea/field/richtext/PickTextLink' {

  import { Reference } from 'alinea/core/Reference';
  export type PickerValue = {
      link?: Reference;
      description?: string;
      title?: string;
      blank?: boolean;
  };
  export type PickerOptions = PickerValue & {
      requireDescription?: boolean;
      hasLink?: boolean;
  };
  export function usePickTextLink(): {
      options: Partial<PickerOptions> | undefined;
      open: boolean;
      onClose: () => void;
      resolve: (value: PickerValue | undefined) => void;
      pickLink: (options: Partial<PickerOptions>) => Promise<PickerValue | undefined>;
  };
  export type PickTextLinkState = ReturnType<typeof usePickTextLink>;
  export type PickTextLinkFunc = PickTextLinkState['pickLink'];
  export type PickTextLinkProps = {
      picker: PickTextLinkState;
  };
  export function PickTextLinkForm({ open, onClose, resolve, options }: PickTextLinkState): import("react/jsx-runtime").JSX.Element;
  export function PickTextLink({ picker }: PickTextLinkProps): import("react/jsx-runtime").JSX.Element | null;
  
}

declare module 'alinea/field/richtext/ReferenceLink' {

  import { Reference } from 'alinea/core/Reference';
  import type { HTMLProps } from 'react';
  interface Anchor extends HTMLProps<HTMLAnchorElement> {
      'data-id'?: string;
      'data-entry'?: string;
      'data-link'?: 'entry' | 'file' | 'url';
  }
  export function referenceToAttributes(reference: Reference): Anchor;
  export function attributesToReference(attributes: Anchor): Reference | undefined;
  export {};
  
}

declare module 'alinea/field/richtext/RichText.stories' {

  export function RichTextField(): import("react/jsx-runtime").JSX.Element;
  const _default: {
      title: string;
  };
  export default _default;
  
}

declare module 'alinea/field/richtext/RichTextField' {

  import type { FieldOptions, WithoutLabel } from 'alinea/core/Field';
  import type { Schema } from 'alinea/core/Schema';
  import type { TextDoc } from 'alinea/core/TextDoc';
  import { RichTextField } from 'alinea/core/field/RichTextField';
  import type { ReactNode } from 'react';
  /** Optional settings to configure a rich text field */
  export interface RichTextOptions<Blocks extends Schema> extends FieldOptions<TextDoc<Blocks>> {
      /** Allow these blocks to be created between text fragments */
      schema?: Blocks;
      /** Width of the field in the dashboard UI (0-1) */
      width?: number;
      /** Add instructional text to a field */
      help?: ReactNode;
      /** Display a minimal version */
      inline?: boolean;
      /** Index the text value of this field */
      searchable?: boolean;
      /** Enable inserting and editing tables */
      enableTables?: boolean;
  }
  /** Create a rich text field configuration */
  export function richText<Blocks extends Schema = {}>(label: string, options?: WithoutLabel<RichTextOptions<Blocks>>): RichTextField<Blocks, RichTextOptions<Blocks>>;
  
}

declare module 'alinea/field/richtext/RichTextField.view' {

  import type { Schema } from 'alinea/core/Schema';
  import type { RichTextField } from 'alinea/core/field/RichTextField';
  import type { RichTextOptions } from 'alinea/field/richtext/RichTextField';
  export interface RichTextInputProps<Blocks extends Schema> {
      field: RichTextField<Blocks, RichTextOptions<Blocks>>;
  }
  export function RichTextInput<Blocks extends Schema>({ field }: RichTextInputProps<Blocks>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/field/richtext/RichTextKit' {

  import { Extension } from '@tiptap/core';
  export const RichTextKit: Extension<any, any>;
  
}

declare module 'alinea/field/richtext/RichTextToolbar' {

  import type { Editor } from '@tiptap/react';
  import type { PickTextLinkFunc } from 'alinea/field/richtext/PickTextLink';
  export type RichTextToolbarProps = {
      editor: Editor;
      focusToggle: (target: EventTarget | null) => void;
      pickLink: PickTextLinkFunc;
      enableTables?: boolean;
  };
  export const RichTextToolbar: import("react").ForwardRefExoticComponent<RichTextToolbarProps & import("react").RefAttributes<HTMLDivElement>>;
  
}

declare module 'alinea/field/select' {

  export * from 'alinea/field/select/SelectField';
  
}

declare module 'alinea/field/select/SelectField' {

  import type { FieldOptions, WithoutLabel } from 'alinea/core';
  import { ScalarField } from 'alinea/core/field/ScalarField';
  import type { ReactNode } from 'react';
  /** A string record with option labels */
  export type SelectItems<T extends string> = Record<T, string>;
  /** Optional settings to configure a select field */
  export interface SelectConfig<Key> extends FieldOptions<Key> {
      /** Width of the field in the dashboard UI (0-1) */
      width?: number;
      /** Add instructional text to a field */
      help?: ReactNode;
      /** Display a minimal version */
      inline?: boolean;
      /** Choose a custom placeholder (eg. 'Select an option')  */
      placeholder?: string;
  }
  export interface SelectOptions<Key extends string> extends SelectConfig<Key> {
      options: Record<Key, string>;
  }
  export class SelectField<Key extends string | null> extends ScalarField<Key, SelectOptions<NonNullable<Key>>> {
  }
  type AddNullable<Keys, Initial> = Initial extends undefined ? Keys | null : Keys;
  export function select<const Items extends Record<string, string>, Initial extends keyof Items | undefined = undefined>(label: string, options: WithoutLabel<{
      options: Items;
  } & SelectConfig<Extract<keyof Items, string>>> & {
      initialValue?: Initial;
  }): SelectField<AddNullable<Extract<keyof Items, string>, Initial>>;
  export {};
  
}

declare module 'alinea/field/select/SelectField.stories' {

  export function SelectField(): import("react/jsx-runtime").JSX.Element;
  const _default: {
      title: string;
  };
  export default _default;
  
}

declare module 'alinea/field/select/SelectField.view' {

  import type { SelectField } from 'alinea/field/select/SelectField';
  export interface SelectInputProps<Key extends string> {
      field: SelectField<Key>;
  }
  export function SelectInput<Key extends string>({ field }: SelectInputProps<Key>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/field/tabs' {

  export * from 'alinea/field/tabs/Tabs';
  
}

declare module 'alinea/field/tabs/Tabs' {

  import { Field } from 'alinea/core/Field';
  import { type Section, type SectionData, type SectionDefinition } from 'alinea/core/Section';
  import { Type, type } from 'alinea/core/Type';
  export class TabsSection implements SectionData {
      types: Array<Type>;
      view: string;
      definition: SectionDefinition;
      fields: Record<string, Field>;
      sections: Array<Section>;
      constructor(types: Array<Type>);
  }
  type Cast<From, To> = From extends To ? From : never;
  type FoldIntoIntersection<T extends readonly {}[], Acc extends {} = {}> = T extends readonly [infer H, ...infer HS] ? FoldIntoIntersection<Cast<HS, readonly {}[]>, Acc & H> : Acc;
  /** Create tabs */
  export function tabs<const Types extends Array<Type>>(...types: Types): FoldIntoIntersection<Types>;
  /** Create a tab */
  export const tab: typeof type;
  export {};
  
}

declare module 'alinea/field/tabs/Tabs.stories' {

  export function TabsField(): import("react/jsx-runtime").JSX.Element;
  const _default: {
      title: string;
  };
  export default _default;
  
}

declare module 'alinea/field/tabs/Tabs.view' {

  import { Section } from 'alinea/core/Section';
  interface TabsViewProps {
      section: Section;
  }
  export interface TabsHeaderProps {
      section: Section;
      backdrop?: boolean;
  }
  export function TabsHeader({ section, backdrop }: TabsHeaderProps): import("react/jsx-runtime").JSX.Element | null;
  export function TabsView({ section }: TabsViewProps): import("react/jsx-runtime").JSX.Element | null;
  export {};
  
}

declare module 'alinea/field/text' {

  export * from 'alinea/field/text/TextField';
  
}

declare module 'alinea/field/text/TextField' {

  import type { FieldOptions, WithoutLabel } from 'alinea/core/Field';
  import { ScalarField } from 'alinea/core/field/ScalarField';
  import type { ComponentType, ReactNode } from 'react';
  /** Optional settings to configure a text field */
  export interface TextOptions extends FieldOptions<string> {
      /** Width of the field in the dashboard UI (0-1) */
      width?: number;
      /** Add instructional text to a field */
      help?: ReactNode;
      /** Allow line breaks */
      multiline?: boolean;
      /** Display a minimal version */
      inline?: boolean;
      /** An icon (React component) to display on the left side of the input */
      iconLeft?: ComponentType;
      /** An icon (React component) to display on the right side of the input */
      iconRight?: ComponentType;
      /** Focus this input automatically */
      autoFocus?: boolean;
      /** Index the text value of this field */
      searchable?: boolean;
      /** Short hint that describes the expected value */
      placeholder?: string;
      /** Determines which data the field accepts */
      type?: 'email' | 'tel' | 'text' | 'url';
  }
  export class TextField extends ScalarField<string, TextOptions> {
  }
  /** Create a text field */
  export function text(label: string, options?: WithoutLabel<TextOptions>): TextField;
  
}

declare module 'alinea/field/text/TextField.stories' {

  export function TextField(): import("react/jsx-runtime").JSX.Element;
  const _default: {
      title: string;
  };
  export default _default;
  
}

declare module 'alinea/field/text/TextField.view' {

  import type { TextField } from 'alinea/field/text/TextField';
  export interface TextInputProps {
      field: TextField;
  }
  export function TextInput({ field }: TextInputProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/field/time' {

  export * from 'alinea/field/time/TimeField';
  
}

declare module 'alinea/field/time/TimeField' {

  import type { FieldOptions, WithoutLabel } from 'alinea/core';
  import { ScalarField } from 'alinea/core/field/ScalarField';
  import type { ReactNode } from 'react';
  /** Optional settings to configure a time field */
  export interface TimeOptions extends FieldOptions<string> {
      /** Width of the field in the dashboard UI (0-1) */
      width?: number;
      /** Add instructional text to a field */
      help?: ReactNode;
      /** Display a minimal version */
      inline?: boolean;
      /** Focus this input automatically */
      autoFocus?: boolean;
      /** A minimum value */
      minValue?: string;
      /** A maximum value */
      maxValue?: string;
      /** Specifies the legal time intervals */
      step?: number;
  }
  /** Internal representation of a date field */
  export class TimeField extends ScalarField<string, TimeOptions> {
  }
  /** Create a time field configuration */
  export function time(label: string, options?: WithoutLabel<TimeOptions>): TimeField;
  
}

declare module 'alinea/field/time/TimeField.stories' {

  export function TimeField(): import("react/jsx-runtime").JSX.Element;
  const _default: {
      title: string;
  };
  export default _default;
  
}

declare module 'alinea/field/time/TimeField.view' {

  import type { TimeField } from 'alinea/field/time/TimeField';
  export interface TimeInputProps {
      field: TimeField;
  }
  export function TimeInput({ field }: TimeInputProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/field/view' {

  export * from 'alinea/field/view/View';
  
}

declare module 'alinea/field/view/View' {

  import type { Field } from 'alinea/core/Field';
  import { type Section, type SectionData, type SectionDefinition } from 'alinea/core/Section';
  import type { View } from 'alinea/core/View';
  import type { ReactNode } from 'react';
  export class ViewSection implements SectionData {
      view: View<{
          section: Section;
      }>;
      definition: SectionDefinition;
      fields: Record<string, Field>;
      sections: never[];
      constructor(view: View<{
          section: Section;
      }>);
  }
  export function view(view: string | ReactNode): import("alinea/core/Section").SectionI;
  
}

declare module 'alinea' {

  export * as Config from 'alinea/config';
  export * as Edit from 'alinea/edit';
  export * as Field from 'alinea/field';
  export * as Query from 'alinea/query';
  export type * from 'alinea/types';
  
}

declare module 'alinea/next' {

  export { createCMS } from 'alinea/adapter/next/cms';
  export { createHandler } from 'alinea/adapter/next/handler';
  export { withAlinea } from 'alinea/adapter/next/with-alinea';
  
}

declare module 'alinea/next.edge' {

  export { createCMS } from 'alinea/adapter/next/cms';
  export { createHandler } from 'alinea/adapter/next/handler';
  
}

declare module 'alinea/picker/entry' {

  export * from 'alinea/picker/entry/EntryPicker';
  
}

declare module 'alinea/picker/entry/EntryPicker.browser' {

  import { type PickerProps } from 'alinea/core/Picker';
  import { type EntryPickerOptions, entryPicker as createEntryPicker } from 'alinea/picker/entry/EntryPicker';
  export * from 'alinea/picker/entry/EntryPicker';
  export const entryPicker: typeof createEntryPicker;
  export interface EntryPickerModalProps extends PickerProps<EntryPickerOptions> {
  }
  export function EntryPickerModal({ type, options, selection, onConfirm, onCancel }: EntryPickerModalProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/picker/entry/EntryPicker' {

  import type { EntryFields } from 'alinea/core/EntryFields';
  import type { Filter } from 'alinea/core/Filter';
  import type { Graph, Projection } from 'alinea/core/Graph';
  import type { Label } from 'alinea/core/Label';
  import type { Picker } from 'alinea/core/Picker';
  import { Type } from 'alinea/core/Type';
  import { EntryReference } from 'alinea/picker/entry/EntryReference';
  export interface EditorInfo {
      graph: Graph;
      entry: {
          id: string;
          type: string;
          workspace: string;
          root: string;
          parentId: string | null;
          locale: string | null;
      };
  }
  export interface EditorLocation {
      parentId?: string;
      workspace: string;
      root: string;
  }
  type DynamicOption<T> = T | ((info: EditorInfo) => T | Promise<T>);
  export interface EntryPickerConditions {
      /** Choose from a flat list of direct children of the currently edited entry */
      pickChildren?: boolean;
      /** Set the initial location in which the entry picker is opened */
      location?: DynamicOption<EditorLocation>;
      /** Filter entries by a condition, this results in a flat list of options */
      condition?: DynamicOption<Filter<EntryFields>>;
      /** @internal Enable entry picker navigation */
      enableNavigation?: boolean;
  }
  export interface EntryPickerOptions<Definition = {}> extends EntryPickerConditions {
      selection: Projection;
      defaultView?: 'row' | 'thumb';
      showMedia?: boolean;
      max?: number;
      label?: string;
      title?: Label;
      fields?: Definition | Type<Definition>;
  }
  export function entryPicker<Ref extends EntryReference, Fields>(options: EntryPickerOptions<Fields>): Picker<Ref, EntryPickerOptions<Fields>>;
  export {};
  
}

declare module 'alinea/picker/entry/EntryPicker.stories' {

  export function ImagePicker(): import("react/jsx-runtime").JSX.Element;
  export function EntryPicker(): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/picker/entry/EntryPickerRow' {

  import { EntryReference } from 'alinea/picker/entry/EntryReference';
  export interface EntryPickerRowProps {
      reference: EntryReference;
  }
  export function EntryPickerRow({ reference }: EntryPickerRowProps): import("react/jsx-runtime").JSX.Element | null;
  
}

declare module 'alinea/picker/entry/EntryReference' {

  import type { Reference } from 'alinea/core/Reference';
  export interface EntryReference extends Reference {
      _type: 'entry' | 'image' | 'file';
      _entry: string;
  }
  export namespace EntryReference {
      const entry = "_entry";
      function isEntryReference(value: any): value is EntryReference;
  }
  
}

declare module 'alinea/picker/url' {

  export * from 'alinea/picker/url/UrlPicker';
  
}

declare module 'alinea/picker/url/UrlPicker.browser' {

  import { type PickerProps } from 'alinea/core/Picker';
  import { urlPicker as createUrlPicker } from 'alinea/picker/url/UrlPicker';
  export * from 'alinea/picker/url/UrlPicker';
  export const urlPicker: typeof createUrlPicker;
  export function UrlPickerForm({ selection, options, onConfirm, onCancel }: PickerProps): import("react/jsx-runtime").JSX.Element;
  export function UrlPickerModal(props: PickerProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/picker/url/UrlPicker' {

  import type { Picker } from 'alinea/core/Picker';
  import { Reference } from 'alinea/core/Reference';
  import { Type } from 'alinea/core/Type';
  export interface UrlReference extends Reference {
      _type: 'url';
      _url: string;
      _title: string;
      _target: string;
  }
  export namespace UrlReference {
      const url = "_url";
      const title = "_title";
      const target = "_target";
      function isUrl(value: any): value is UrlReference;
  }
  export interface UrlPickerOptions<Definition> {
      fields?: Definition | Type<Definition>;
  }
  export function urlPicker<Fields>(options: UrlPickerOptions<Fields>): Picker<UrlReference>;
  
}

declare module 'alinea/picker/url/UrlPicker.stories' {

  export function PickerForm(): import("react/jsx-runtime").JSX.Element;
  const _default: {
      title: string;
  };
  export default _default;
  
}

declare module 'alinea/picker/url/UrlPickerRow' {

  import type { UrlReference } from 'alinea/picker/url/UrlPicker';
  export interface UrlPickerRowProps {
      reference: UrlReference;
  }
  export function UrlPickerRow({ reference }: UrlPickerRowProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/preview/ChunkCookieValue' {

  type Cookie = {
      name: string;
      value: string;
  };
  export const MAX_COOKIE_LENGTH = 4096;
  export function chunkCookieValue(cookieName: string, cookieValue: string, maxLength?: number): Array<Cookie>;
  export function parseChunkedCookies(cookieName: string, allCookies: Array<Cookie>): string | undefined;
  export {};
  
}

declare module 'alinea/preview/ChunkCookieValue.test' {

  export {};
  
}

declare module 'alinea/preview/PreviewCookies' {

  export const PREVIEW_COOKIE_NAME = "@a/p";
  export function setPreviewCookies(payload: string, expiresIn?: number): Promise<boolean>;
  export function getPreviewPayloadFromCookies(allCookies: Array<{
      name: string;
      value: string;
  }>): string | undefined;
  
}

declare module 'alinea/preview/PreviewMessage' {

  import type { PreviewMetadata, PreviewPayload } from 'alinea/core/Preview';
  export enum PreviewAction {
      Ping = "[alinea-ping]",
      Pong = "[alinea-pong]",
      Reload = "[alinea-reload]",
      Refetch = "[alinea-refetch]",
      Previous = "[alinea-previous]",
      Next = "[alinea-next]",
      Preview = "[alinea-preview]",
      Meta = "[alinea-meta]"
  }
  export type PreviewMessage = {
      action: PreviewAction.Ping;
  } | {
      action: PreviewAction.Pong;
  } | {
      action: PreviewAction.Reload;
  } | {
      action: PreviewAction.Refetch;
  } | {
      action: PreviewAction.Previous;
  } | {
      action: PreviewAction.Next;
  } | ({
      action: PreviewAction.Preview;
  } & PreviewPayload) | ({
      action: PreviewAction.Meta;
  } & PreviewMetadata);
  
}

declare module 'alinea/preview/PreviewPayload' {

  import type { PreviewUpdate } from 'alinea/core/Preview';
  export function encodePreviewPayload(update: PreviewUpdate): Promise<string>;
  export function decodePreviewPayload(payload: string): Promise<PreviewUpdate>;
  
}

declare module 'alinea/preview/PreviewPayload.test' {

  export {};
  
}

declare module 'alinea/preview/react' {

  import { type PreviewApi } from 'alinea/preview/RegisterPreview';
  export function usePreview(api: Omit<PreviewApi, 'setIsPreviewing'>): {
      isPreviewing: boolean;
  };
  
}

declare module 'alinea/preview/RegisterPreview' {

  import type { PreviewPayload } from 'alinea/core/Preview';
  export interface PreviewApi {
      preview(update: PreviewPayload): Promise<void>;
      setIsPreviewing(isPreviewing: boolean): void;
  }
  export function registerPreview(api: PreviewApi): (() => void) | undefined;
  
}

declare module 'alinea/preview/widget' {

  import type { DOMAttributes } from 'react';
  export function registerPreviewWidget(): void;
  global {
      namespace JSX {
          interface IntrinsicElements {
              'alinea-preview': DOMAttributes<HTMLElement> & {
                  adminUrl: string;
                  editUrl: string;
                  livePreview?: 'connected' | 'warning' | 'loading';
              };
          }
      }
  }
  
}

declare module 'alinea/query' {

  import type { GraphQuery, IncludeGuard, SelectionGuard, TypeGuard } from 'alinea/core/Graph';
  export const id: import("alinea/core/Expr").Expr<string>;
  export const title: import("alinea/core/Expr").Expr<string>;
  export const type: import("alinea/core/Expr").Expr<string>;
  export const index: import("alinea/core/Expr").Expr<string>;
  export const workspace: import("alinea/core/Expr").Expr<string>;
  export const root: import("alinea/core/Expr").Expr<string>;
  export const status: import("alinea/core/Expr").Expr<import("alinea/core/Entry").EntryStatus>;
  export const parentId: import("alinea/core/Expr").Expr<string | null>;
  export const locale: import("alinea/core/Expr").Expr<string | null>;
  export const path: import("alinea/core/Expr").Expr<string>;
  export const url: import("alinea/core/Expr").Expr<string>;
  export { snippet } from 'alinea/core/pages/Snippet';
  export function children<Selection extends SelectionGuard = undefined, Type extends TypeGuard = undefined, Include extends IncludeGuard = undefined>(query: GraphQuery<Selection, Type, Include> & {
      depth?: number;
  }): {
      type?: Type | undefined;
      select?: Selection | undefined;
      include?: Include | undefined;
      filter?: import("alinea/core/Filter").Filter<import("alinea/core/EntryFields").EntryFields & import("alinea/core/Infer").StoredRow<Type extends import("alinea/core/Type").Type<infer V> ? V : Type extends any[] ? Type[number] : unknown>> | undefined;
      first?: true;
      get?: true;
      count?: true;
      id?: import("alinea/core/Filter").Condition<string>;
      parentId?: import("alinea/core/Filter").Condition<string | null>;
      path?: import("alinea/core/Filter").Condition<string>;
      url?: import("alinea/core/Filter").Condition<string>;
      workspace?: import("alinea/core/Filter").Condition<string> | import("alinea/core/Workspace").Workspace;
      root?: import("alinea/core/Filter").Condition<string> | import("alinea/core/Root").Root;
      level?: import("alinea/core/Filter").Condition<number>;
      location?: import("alinea/core/Graph").Location;
      locale?: string | null;
      preferredLocale?: string;
      search?: string | Array<string>;
      syncInterval?: number;
      disableSync?: boolean;
      skip?: number;
      take?: number;
      groupBy?: import("alinea/core/Expr").Expr<any> | Array<import("alinea/core/Expr").Expr<any>>;
      orderBy?: import("alinea/core/Graph").Order | Array<import("alinea/core/Graph").Order>;
      status?: import("alinea/core/Graph").Status;
      preview?: import("alinea/core/Preview").PreviewRequest;
      depth?: number;
      edge: "children";
  };
  export function parents<Selection extends SelectionGuard = undefined, Type extends TypeGuard = undefined, Include extends IncludeGuard = undefined>(query: GraphQuery<Selection, Type, Include> & {
      depth?: number;
  }): {
      type?: Type | undefined;
      select?: Selection | undefined;
      include?: Include | undefined;
      filter?: import("alinea/core/Filter").Filter<import("alinea/core/EntryFields").EntryFields & import("alinea/core/Infer").StoredRow<Type extends import("alinea/core/Type").Type<infer V> ? V : Type extends any[] ? Type[number] : unknown>> | undefined;
      first?: true;
      get?: true;
      count?: true;
      id?: import("alinea/core/Filter").Condition<string>;
      parentId?: import("alinea/core/Filter").Condition<string | null>;
      path?: import("alinea/core/Filter").Condition<string>;
      url?: import("alinea/core/Filter").Condition<string>;
      workspace?: import("alinea/core/Filter").Condition<string> | import("alinea/core/Workspace").Workspace;
      root?: import("alinea/core/Filter").Condition<string> | import("alinea/core/Root").Root;
      level?: import("alinea/core/Filter").Condition<number>;
      location?: import("alinea/core/Graph").Location;
      locale?: string | null;
      preferredLocale?: string;
      search?: string | Array<string>;
      syncInterval?: number;
      disableSync?: boolean;
      skip?: number;
      take?: number;
      groupBy?: import("alinea/core/Expr").Expr<any> | Array<import("alinea/core/Expr").Expr<any>>;
      orderBy?: import("alinea/core/Graph").Order | Array<import("alinea/core/Graph").Order>;
      status?: import("alinea/core/Graph").Status;
      preview?: import("alinea/core/Preview").PreviewRequest;
      depth?: number;
      edge: "parents";
  };
  export function translations<Selection extends SelectionGuard = undefined, Type extends TypeGuard = undefined, Include extends IncludeGuard = undefined>(query: GraphQuery<Selection, Type, Include> & {
      includeSelf?: boolean;
  }): {
      type?: Type | undefined;
      select?: Selection | undefined;
      include?: Include | undefined;
      filter?: import("alinea/core/Filter").Filter<import("alinea/core/EntryFields").EntryFields & import("alinea/core/Infer").StoredRow<Type extends import("alinea/core/Type").Type<infer V> ? V : Type extends any[] ? Type[number] : unknown>> | undefined;
      first?: true;
      get?: true;
      count?: true;
      id?: import("alinea/core/Filter").Condition<string>;
      parentId?: import("alinea/core/Filter").Condition<string | null>;
      path?: import("alinea/core/Filter").Condition<string>;
      url?: import("alinea/core/Filter").Condition<string>;
      workspace?: import("alinea/core/Filter").Condition<string> | import("alinea/core/Workspace").Workspace;
      root?: import("alinea/core/Filter").Condition<string> | import("alinea/core/Root").Root;
      level?: import("alinea/core/Filter").Condition<number>;
      location?: import("alinea/core/Graph").Location;
      locale?: string | null;
      preferredLocale?: string;
      search?: string | Array<string>;
      syncInterval?: number;
      disableSync?: boolean;
      skip?: number;
      take?: number;
      groupBy?: import("alinea/core/Expr").Expr<any> | Array<import("alinea/core/Expr").Expr<any>>;
      orderBy?: import("alinea/core/Graph").Order | Array<import("alinea/core/Graph").Order>;
      status?: import("alinea/core/Graph").Status;
      preview?: import("alinea/core/Preview").PreviewRequest;
      includeSelf?: boolean;
      edge: "translations";
  };
  export function siblings<Selection extends SelectionGuard = undefined, Type extends TypeGuard = undefined, Include extends IncludeGuard = undefined>(query: GraphQuery<Selection, Type, Include> & {
      includeSelf?: boolean;
  }): {
      type?: Type | undefined;
      select?: Selection | undefined;
      include?: Include | undefined;
      filter?: import("alinea/core/Filter").Filter<import("alinea/core/EntryFields").EntryFields & import("alinea/core/Infer").StoredRow<Type extends import("alinea/core/Type").Type<infer V> ? V : Type extends any[] ? Type[number] : unknown>> | undefined;
      first?: true;
      get?: true;
      count?: true;
      id?: import("alinea/core/Filter").Condition<string>;
      parentId?: import("alinea/core/Filter").Condition<string | null>;
      path?: import("alinea/core/Filter").Condition<string>;
      url?: import("alinea/core/Filter").Condition<string>;
      workspace?: import("alinea/core/Filter").Condition<string> | import("alinea/core/Workspace").Workspace;
      root?: import("alinea/core/Filter").Condition<string> | import("alinea/core/Root").Root;
      level?: import("alinea/core/Filter").Condition<number>;
      location?: import("alinea/core/Graph").Location;
      locale?: string | null;
      preferredLocale?: string;
      search?: string | Array<string>;
      syncInterval?: number;
      disableSync?: boolean;
      skip?: number;
      take?: number;
      groupBy?: import("alinea/core/Expr").Expr<any> | Array<import("alinea/core/Expr").Expr<any>>;
      orderBy?: import("alinea/core/Graph").Order | Array<import("alinea/core/Graph").Order>;
      status?: import("alinea/core/Graph").Status;
      preview?: import("alinea/core/Preview").PreviewRequest;
      includeSelf?: boolean;
      edge: "siblings";
  };
  export function parent<Selection extends SelectionGuard = undefined, Type extends TypeGuard = undefined, Include extends IncludeGuard = undefined>(query: GraphQuery<Selection, Type, Include>): {
      type?: Type | undefined;
      select?: Selection | undefined;
      include?: Include | undefined;
      filter?: import("alinea/core/Filter").Filter<import("alinea/core/EntryFields").EntryFields & import("alinea/core/Infer").StoredRow<Type extends import("alinea/core/Type").Type<infer V> ? V : Type extends any[] ? Type[number] : unknown>> | undefined;
      first?: true;
      get?: true;
      count?: true;
      id?: import("alinea/core/Filter").Condition<string>;
      parentId?: import("alinea/core/Filter").Condition<string | null>;
      path?: import("alinea/core/Filter").Condition<string>;
      url?: import("alinea/core/Filter").Condition<string>;
      workspace?: import("alinea/core/Filter").Condition<string> | import("alinea/core/Workspace").Workspace;
      root?: import("alinea/core/Filter").Condition<string> | import("alinea/core/Root").Root;
      level?: import("alinea/core/Filter").Condition<number>;
      location?: import("alinea/core/Graph").Location;
      locale?: string | null;
      preferredLocale?: string;
      search?: string | Array<string>;
      syncInterval?: number;
      disableSync?: boolean;
      skip?: number;
      take?: number;
      groupBy?: import("alinea/core/Expr").Expr<any> | Array<import("alinea/core/Expr").Expr<any>>;
      orderBy?: import("alinea/core/Graph").Order | Array<import("alinea/core/Graph").Order>;
      status?: import("alinea/core/Graph").Status;
      preview?: import("alinea/core/Preview").PreviewRequest;
      edge: "parent";
  };
  export function next<Selection extends SelectionGuard = undefined, Type extends TypeGuard = undefined, Include extends IncludeGuard = undefined>(query: GraphQuery<Selection, Type, Include>): {
      type?: Type | undefined;
      select?: Selection | undefined;
      include?: Include | undefined;
      filter?: import("alinea/core/Filter").Filter<import("alinea/core/EntryFields").EntryFields & import("alinea/core/Infer").StoredRow<Type extends import("alinea/core/Type").Type<infer V> ? V : Type extends any[] ? Type[number] : unknown>> | undefined;
      first?: true;
      get?: true;
      count?: true;
      id?: import("alinea/core/Filter").Condition<string>;
      parentId?: import("alinea/core/Filter").Condition<string | null>;
      path?: import("alinea/core/Filter").Condition<string>;
      url?: import("alinea/core/Filter").Condition<string>;
      workspace?: import("alinea/core/Filter").Condition<string> | import("alinea/core/Workspace").Workspace;
      root?: import("alinea/core/Filter").Condition<string> | import("alinea/core/Root").Root;
      level?: import("alinea/core/Filter").Condition<number>;
      location?: import("alinea/core/Graph").Location;
      locale?: string | null;
      preferredLocale?: string;
      search?: string | Array<string>;
      syncInterval?: number;
      disableSync?: boolean;
      skip?: number;
      take?: number;
      groupBy?: import("alinea/core/Expr").Expr<any> | Array<import("alinea/core/Expr").Expr<any>>;
      orderBy?: import("alinea/core/Graph").Order | Array<import("alinea/core/Graph").Order>;
      status?: import("alinea/core/Graph").Status;
      preview?: import("alinea/core/Preview").PreviewRequest;
      edge: "next";
  };
  export function previous<Selection extends SelectionGuard = undefined, Type extends TypeGuard = undefined, Include extends IncludeGuard = undefined>(query: GraphQuery<Selection, Type, Include>): {
      type?: Type | undefined;
      select?: Selection | undefined;
      include?: Include | undefined;
      filter?: import("alinea/core/Filter").Filter<import("alinea/core/EntryFields").EntryFields & import("alinea/core/Infer").StoredRow<Type extends import("alinea/core/Type").Type<infer V> ? V : Type extends any[] ? Type[number] : unknown>> | undefined;
      first?: true;
      get?: true;
      count?: true;
      id?: import("alinea/core/Filter").Condition<string>;
      parentId?: import("alinea/core/Filter").Condition<string | null>;
      path?: import("alinea/core/Filter").Condition<string>;
      url?: import("alinea/core/Filter").Condition<string>;
      workspace?: import("alinea/core/Filter").Condition<string> | import("alinea/core/Workspace").Workspace;
      root?: import("alinea/core/Filter").Condition<string> | import("alinea/core/Root").Root;
      level?: import("alinea/core/Filter").Condition<number>;
      location?: import("alinea/core/Graph").Location;
      locale?: string | null;
      preferredLocale?: string;
      search?: string | Array<string>;
      syncInterval?: number;
      disableSync?: boolean;
      skip?: number;
      take?: number;
      groupBy?: import("alinea/core/Expr").Expr<any> | Array<import("alinea/core/Expr").Expr<any>>;
      orderBy?: import("alinea/core/Graph").Order | Array<import("alinea/core/Graph").Order>;
      status?: import("alinea/core/Graph").Status;
      preview?: import("alinea/core/Preview").PreviewRequest;
      edge: "previous";
  };
  
}

declare module 'alinea/test/broken-index.test' {

  export {};
  
}

declare module 'alinea/test/cms' {

  import * as schema from 'alinea/test/schema/index';
  export const cms: import("alinea/adapter/core/cms").CoreCMS<{
      schema: typeof schema;
      workspaces: {
          demo: import("alinea").Workspace<{
              pages: import("alinea").Root<import("alinea/core/Root").ChildrenDefinition>;
              media: import("alinea/core/media/MediaRoot").MediaRoot<import("alinea/core/Root").ChildrenDefinition>;
          }>;
      };
      baseUrl: {
          production: string;
          development: string;
      };
      handlerUrl: string;
      dashboardFile: string;
      preview: true;
  }>;
  
}

declare module 'alinea/test/drafts.test' {

  export {};
  
}

declare module 'alinea/test/example' {

  import { LocalDB } from 'alinea/core/db/LocalDB';
  export const config: {
      schema: {
          Fields: import("alinea").Type<import("alinea/core/Document").Document & {
              text: import("alinea/field/text").TextField;
              hello: import("alinea/field/text").TextField;
              richText: import("alinea/core/field/RichTextField").RichTextField<{}, import("alinea/field/richtext/RichTextField").RichTextOptions<{}>>;
              select: import("alinea/field/select").SelectField<"a" | "b" | null>;
              number: import("alinea/field/number").NumberField;
              check: import("alinea/field/check").CheckField;
              date: import("alinea/field/date").DateField;
              code: import("alinea/field/code").CodeField;
              externalLink: import("alinea/field/link/LinkField").LinkField<import("alinea").UrlReference, import("alinea").UrlLink<{}>>;
              entry: import("alinea/field/link/LinkField").LinkField<import("alinea").EntryReference, import("alinea").EntryLink<undefined>>;
              entryWithCondition: import("alinea/field/link/LinkField").LinkField<import("alinea").EntryReference, import("alinea").EntryLink<undefined>>;
              linkMultiple: import("alinea/field/link/LinkField").LinksField<import("alinea/field/link").LinkRow, import("alinea").Link<{}>>;
              image: import("alinea/field/link").ImageField<undefined>;
              images: import("alinea/field/link").ImagesField<undefined>;
              file: import("alinea/field/link/LinkField").LinkField<import("alinea").EntryReference, import("alinea").EntryLink<undefined>>;
              withFields: import("alinea/field/link/LinkField").LinkField<import("alinea/field/link").LinkRow, import("alinea").Link<{
                  fieldA: string;
                  fieldB: string;
              }>>;
              multipleWithFields: import("alinea/field/link/LinkField").LinksField<import("alinea/field/link").LinkRow, import("alinea").Link<{
                  fieldA: string;
                  fieldB: string;
              }>>;
              list: import("alinea/core/field/ListField").ListField<({
                  _type: "Image";
                  image: import("alinea").EntryReference;
              } | {
                  _type: "Text";
                  title: string;
                  text: import("alinea").TextDoc<{}>;
              }) & import("alinea/core/shape/ListShape").ListRow, ({
                  _type: "Image";
                  image: import("alinea").ImageLink<undefined>;
              } | {
                  _type: "Text";
                  title: string;
                  text: import("alinea").TextDoc<{}>;
              }) & import("alinea/core/shape/ListShape").ListRow, import("alinea/field/list").ListOptions<{
                  Text: import("alinea").Type<{
                      title: import("alinea/field/text").TextField;
                      text: import("alinea/core/field/RichTextField").RichTextField<{}, import("alinea/field/richtext/RichTextField").RichTextOptions<{}>>;
                  }>;
                  Image: import("alinea").Type<{
                      image: import("alinea/field/link").ImageField<undefined>;
                  }>;
              }>>;
              withInitial: import("alinea/core/field/RichTextField").RichTextField<{}, import("alinea/field/richtext/RichTextField").RichTextOptions<{}>>;
              nested: import("alinea/core/field/RichTextField").RichTextField<{
                  Inner: import("alinea").Type<{
                      checkbox1: import("alinea/field/check").CheckField;
                      checkbox2: import("alinea/field/check").CheckField;
                      title: import("alinea/field/text").TextField;
                      content: import("alinea/core/field/RichTextField").RichTextField<{}, import("alinea/field/richtext/RichTextField").RichTextOptions<{}>>;
                  }>;
                  NestLayout: import("alinea").Type<{
                      tabA: import("alinea/field/text").TextField;
                      tabB: import("alinea/field/text").TextField;
                      object: import("alinea/field/object").ObjectField<{
                          fieldA: import("alinea/field/text").TextField;
                          fieldB: import("alinea/field/text").TextField;
                      }> & {
                          fieldA: import("alinea/field/text").TextField;
                          fieldB: import("alinea/field/text").TextField;
                      };
                  }>;
              }, import("alinea/field/richtext/RichTextField").RichTextOptions<{
                  Inner: import("alinea").Type<{
                      checkbox1: import("alinea/field/check").CheckField;
                      checkbox2: import("alinea/field/check").CheckField;
                      title: import("alinea/field/text").TextField;
                      content: import("alinea/core/field/RichTextField").RichTextField<{}, import("alinea/field/richtext/RichTextField").RichTextOptions<{}>>;
                  }>;
                  NestLayout: import("alinea").Type<{
                      tabA: import("alinea/field/text").TextField;
                      tabB: import("alinea/field/text").TextField;
                      object: import("alinea/field/object").ObjectField<{
                          fieldA: import("alinea/field/text").TextField;
                          fieldB: import("alinea/field/text").TextField;
                      }> & {
                          fieldA: import("alinea/field/text").TextField;
                          fieldB: import("alinea/field/text").TextField;
                      };
                  }>;
              }>>;
          }>;
          Page: import("alinea").Type<import("alinea/core/Document").Document & {
              name: import("alinea/field/path").PathField & import("alinea/field/text").TextField;
              entryLink: import("alinea/field/link/LinkField").LinksField<import("alinea/field/link").LinkRow, import("alinea").Link<{}>>;
              list: import("alinea/core/field/ListField").ListField<{
                  _type: "item";
                  itemId: string;
              } & import("alinea/core/shape/ListShape").ListRow, {
                  _type: "item";
                  itemId: string;
              } & import("alinea/core/shape/ListShape").ListRow, import("alinea/field/list").ListOptions<{
                  item: import("alinea").Type<{
                      itemId: import("alinea/field/text").TextField;
                  }>;
              }>>;
              name2: import("alinea/field/text").TextField;
              title: import("alinea/field/text").TextField;
              path: import("alinea/field/path").PathField;
          }>;
          Container: import("alinea").Type<{
              title: import("alinea/field/text").TextField;
              path: import("alinea/field/path").PathField;
              name: import("alinea/field/text").TextField;
          }>;
      };
      workspaces: {
          main: import("alinea").Workspace<{
              pages: import("alinea").Root<{
                  entry1: import("alinea/core/Page").Page<Record<string, never>>;
                  entry2: import("alinea/core/Page").Page<{
                      entry3: never;
                  }>;
                  container1: import("alinea/core/Page").Page<Record<string, never>>;
              }>;
              multiLanguage: import("alinea").Root<{
                  localised1: import("alinea/core/Page").Page<Record<string, never>>;
                  localised2: import("alinea/core/Page").Page<{
                      localised3: never;
                  }>;
              }>;
              media: import("alinea/core/media/MediaRoot").MediaRoot<{
                  dir: import("alinea/core/Page").Page<{
                      'file1.png': never;
                  }>;
              }>;
          }>;
      };
  };
  export function createExample(): Promise<LocalDB>;
  
}

declare module 'alinea/test/insert-order.test' {

  export {};
  
}

declare module 'alinea/test/locales.test' {

  export {};
  
}

declare module 'alinea/test/moves.test' {

  export {};
  
}

declare module 'alinea/test/mutate.test' {

  export {};
  
}

declare module 'alinea/test/query.test' {

  export {};
  
}

declare module 'alinea/test/renames.test' {

  export {};
  
}

declare module 'alinea/test/schema/DemoHome' {

  export const DemoHome: import("alinea").Type<{
      title: import("alinea/field/text").TextField;
      path: import("alinea/field/path").PathField;
      hero: import("alinea/field/object").ObjectField<{
          header: import("alinea/field/object").ObjectField<{
              image: import("alinea/field/link").ImageField<undefined>;
              credit: import("alinea/core/field/RichTextField").RichTextField<{}, import("alinea/field/richtext/RichTextField").RichTextOptions<{}>>;
          }> & {
              image: import("alinea/field/link").ImageField<undefined>;
              credit: import("alinea/core/field/RichTextField").RichTextField<{}, import("alinea/field/richtext/RichTextField").RichTextOptions<{}>>;
          };
          title: import("alinea/field/text").TextField;
          text: import("alinea/core/field/RichTextField").RichTextField<{}, import("alinea/field/richtext/RichTextField").RichTextOptions<{}>>;
      }> & {
          header: import("alinea/field/object").ObjectField<{
              image: import("alinea/field/link").ImageField<undefined>;
              credit: import("alinea/core/field/RichTextField").RichTextField<{}, import("alinea/field/richtext/RichTextField").RichTextOptions<{}>>;
          }> & {
              image: import("alinea/field/link").ImageField<undefined>;
              credit: import("alinea/core/field/RichTextField").RichTextField<{}, import("alinea/field/richtext/RichTextField").RichTextOptions<{}>>;
          };
          title: import("alinea/field/text").TextField;
          text: import("alinea/core/field/RichTextField").RichTextField<{}, import("alinea/field/richtext/RichTextField").RichTextOptions<{}>>;
      };
  }>;
  
}

declare module 'alinea/test/schema/DemoRecipe' {

  export const DemoRecipe: import("alinea").Type<{
      title: import("alinea/field/text").TextField;
      path: import("alinea/field/path").PathField;
      header: import("alinea/field/object").ObjectField<{
          image: import("alinea/field/link").ImageField<undefined>;
          credit: import("alinea/core/field/RichTextField").RichTextField<{}, import("alinea/field/richtext/RichTextField").RichTextOptions<{}>>;
      }> & {
          image: import("alinea/field/link").ImageField<undefined>;
          credit: import("alinea/core/field/RichTextField").RichTextField<{}, import("alinea/field/richtext/RichTextField").RichTextOptions<{}>>;
      };
      intro: import("alinea/core/field/RichTextField").RichTextField<{}, import("alinea/field/richtext/RichTextField").RichTextOptions<{}>>;
      ingredients: import("alinea/core/field/RichTextField").RichTextField<{}, import("alinea/field/richtext/RichTextField").RichTextOptions<{}>>;
      instructions: import("alinea/core/field/RichTextField").RichTextField<{}, import("alinea/field/richtext/RichTextField").RichTextOptions<{}>>;
  }>;
  
}

declare module 'alinea/test/schema/DemoRecipes' {

  export const DemoRecipes: import("alinea").Type<{
      title: import("alinea/field/text").TextField;
      path: import("alinea/field/path").PathField;
  }>;
  
}

declare module 'alinea/test/schema/index' {

  export * from 'alinea/test/schema/DemoHome';
  export * from 'alinea/test/schema/DemoRecipe';
  export * from 'alinea/test/schema/DemoRecipes';
  
}

declare module 'alinea/test/seeding.test' {

  export {};
  
}

declare module 'alinea/test/shared.test' {

  export {};
  
}

declare module 'alinea/test/status.test' {

  export {};
  
}

declare module 'alinea/test/uploads.test' {

  export {};
  
}

declare module 'alinea/types' {

  export type { Infer } from 'alinea/core/Infer';
  export type { Root } from 'alinea/core/Root';
  export type { Schema } from 'alinea/core/Schema';
  export type { TextDoc } from 'alinea/core/TextDoc';
  export type { Type } from 'alinea/core/Type';
  export type { Workspace } from 'alinea/core/Workspace';
  export type { EntryLink } from 'alinea/field/link/EntryLink';
  export type { FileLink } from 'alinea/field/link/FileLink';
  export type { ImageLink } from 'alinea/field/link/ImageLink';
  export type { Link } from 'alinea/field/link/Link';
  export type { UrlLink } from 'alinea/field/link/UrlLink';
  export type { EntryReference } from 'alinea/picker/entry/EntryReference';
  export type { UrlReference } from 'alinea/picker/url';
  
}

declare module 'alinea/ui' {

  export * from 'alinea/ui/Button';
  export * from 'alinea/ui/Chip';
  export * from 'alinea/ui/ErrorMessage';
  export * from 'alinea/ui/Icon';
  export * from 'alinea/ui/Loader';
  export * from 'alinea/ui/RichText';
  export * from 'alinea/ui/Stack';
  export * from 'alinea/ui/TextLabel';
  export * from 'alinea/ui/Typo';
  export * from 'alinea/ui/util/ImageBlurUrl';
  export * from 'alinea/ui/util/Units';
  
}

declare module 'alinea/ui/AppBar' {

  import type { ComponentType, HTMLAttributes } from 'react';
  import type { PropsWithAs } from 'alinea/ui/util/PropsWithAs';
  export namespace AppBar {
      interface RootProps extends HTMLAttributes<HTMLElement> {
          variant?: 'draft' | 'editing' | 'published' | 'archived' | 'untranslated' | 'revision' | 'transition' | 'unpublished';
      }
      function Root({ variant, ...props }: RootProps): import("react/jsx-runtime").JSX.Element;
      type ItemProps = PropsWithAs<{
          icon?: ComponentType;
          full?: boolean;
          active?: boolean;
      } & HTMLAttributes<HTMLDivElement>>;
      function Item({ children, as: Tag, full, icon, active, ...props }: ItemProps): import("react/jsx-runtime").JSX.Element;
  }
  
}

declare module 'alinea/ui/Avatar' {

  import type { User } from 'alinea/core/User';
  type AvatarProps = {
      user: User;
  };
  export function Avatar({ user }: AvatarProps): import("react/jsx-runtime").JSX.Element;
  export {};
  
}

declare module 'alinea/ui/Badge' {

  import type { PropsWithChildren } from 'react';
  export type BadgeProps = PropsWithChildren<{
      amount?: number;
      top?: number | string;
      right?: number | string;
      bottom?: number | string;
      left?: number | string;
  }>;
  export function Badge({ children, amount, top, right, bottom, left }: BadgeProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/branding/FavIcon' {

  type FavIconProps = {
      color: string;
  };
  export function FavIcon({ color }: FavIconProps): import("react/jsx-runtime").JSX.Element;
  export {};
  
}

declare module 'alinea/ui/branding/LogoShape' {

  import type { HTMLProps } from 'react';
  export interface LogoShapeProps extends HTMLProps<HTMLDivElement> {
      foreground?: string;
      background?: string;
  }
  export function LogoShape({ children, foreground, background, ...props }: LogoShapeProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/Button' {

  import type { ComponentProps, ComponentType, ElementType, PropsWithChildren } from 'react';
  export type ButtonProps<T extends ElementType> = PropsWithChildren<{
      as?: T;
      icon?: ComponentType;
      iconRight?: ComponentType;
      size?: 'small' | 'medium' | 'large';
      outline?: boolean;
  } & Omit<ComponentProps<T>, 'as'>>;
  export function Button<T extends ElementType = 'button'>({ as, children, size, icon, iconRight, outline, disabled, variant, ...props }: ButtonProps<T>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/Button.stories' {

  export function Buttons(): import("react/jsx-runtime").JSX.Element;
  const _default: {
      title: string;
      decorators: ((Story: import("react").FunctionComponent) => import("react/jsx-runtime").JSX.Element)[];
  };
  export default _default;
  
}

declare module 'alinea/ui/Chip' {

  import type { ComponentType } from 'react';
  import { type StackProps } from 'alinea/ui/Stack';
  export type ChipProps = StackProps & {
      icon?: ComponentType;
      accent?: boolean;
      variant?: 'info' | 'success' | 'disabled' | 'progress';
  };
  export function Chip({ children, icon, accent, variant, ...props }: ChipProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/DropdownMenu' {

  import { type ButtonHTMLAttributes, type HTMLAttributes } from 'react';
  export namespace DropdownMenu {
      function Root({ top, bottom, left, right, ...props }: HTMLAttributes<HTMLDivElement> & {
          top?: boolean;
          bottom?: boolean;
          left?: boolean;
          right?: boolean;
      }): import("react/jsx-runtime").JSX.Element;
      function Trigger(props: HTMLAttributes<HTMLButtonElement>): import("react/jsx-runtime").JSX.Element;
      function Items(props: HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
      function Item(props: ButtonHTMLAttributes<HTMLButtonElement>): import("react/jsx-runtime").JSX.Element;
  }
  
}

declare module 'alinea/ui/Ellipsis' {

  import { type HTMLProps } from 'react';
  export const Ellipsis: import("react").NamedExoticComponent<HTMLProps<HTMLDivElement>>;
  
}

declare module 'alinea/ui/ErrorMessage' {

  export type ErrorMessageProps = {
      error: Error | string;
  };
  export function ErrorMessage({ error }: ErrorMessageProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/hook/UseAutoHide' {

  import { type RefObject } from 'react';
  export type AutoHideOptions = {
      scrollRef?: RefObject<HTMLElement>;
      addToHeight?: number;
  };
  export const useAutoHide: <E extends HTMLElement = HTMLElement>(options?: AutoHideOptions) => {
      ref: RefObject<E>;
  };
  
}

declare module 'alinea/ui/hook/UseColorScheme' {

  export type ColorScheme = 'light' | 'dark' | undefined;
  export type ColorSchemeContext = [ColorScheme, () => void];
  export function useColorScheme(): ColorSchemeContext;
  export const ColorSchemeProvider: import("react").Provider<ColorSchemeContext | undefined>;
  
}

declare module 'alinea/ui/hook/UseContrastColor' {

  export function useContrastColor(color?: string): string | undefined;
  
}

declare module 'alinea/ui/hook/UseElementSize' {

  import { type RefObject } from 'react';
  export const useElementSize: <T extends HTMLElement>(ref?: RefObject<T>) => {
      height: number | undefined;
      width: number | undefined;
      ref: RefObject<T>;
  };
  
}

declare module 'alinea/ui/hook/UseForceUpdate' {

  export function useForceUpdate(): import("react").DispatchWithoutAction;
  
}

declare module 'alinea/ui/hook/UseHash' {

  export function useHash(): readonly [string, (newHash: string) => void];
  
}

declare module 'alinea/ui/hook/UseInitialEffect' {

  import { useEffect } from 'react';
  export const useInitialEffect: typeof useEffect;
  
}

declare module 'alinea/ui/hook/UseLocalStorage' {

  export function useLocalStorage<T>(key: string, initialValue: T): readonly [T, (value: T) => void];
  
}

declare module 'alinea/ui/hook/UseNonInitialEffect' {

  import { useEffect } from 'react';
  export const useNonInitialEffect: typeof useEffect;
  
}

declare module 'alinea/ui/hook/UseTrigger' {

  export function useTrigger<T, O = undefined>(): {
      options: O | undefined;
      isActive: boolean;
      request(options: O): Promise<T | undefined>;
      resolve(value: T | undefined): void;
      reject(): void;
  };
  
}

declare module 'alinea/ui/Icon' {

  import type { ComponentType, HTMLAttributes, ReactNode } from 'react';
  export type IconProps = {
      icon: ComponentType | ReactNode;
      size?: number;
      active?: boolean;
      round?: boolean;
      variant?: 'info' | 'success' | 'disabled' | 'progress';
  } & HTMLAttributes<HTMLSpanElement>;
  export function Icon({ icon, size, round, active, variant, ...props }: IconProps): import("react/jsx-runtime").JSX.Element | null;
  
}

declare module 'alinea/ui/icons/IcAlignCenter' {

  import type { SVGProps } from 'react';
  export function IcAlignCenter(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcAlignJustify' {

  import type { SVGProps } from 'react';
  export function IcAlignJustify(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  export default IcAlignJustify;
  
}

declare module 'alinea/ui/icons/IcAlignLeft' {

  import type { SVGProps } from 'react';
  export function IcAlignLeft(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcAlignRight' {

  import type { SVGProps } from 'react';
  export function IcAlignRight(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcBaselineAccountCircle' {

  import type { SVGProps } from 'react';
  export function IcBaselineAccountCircle(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcBaselineContentCopy' {

  import type { SVGProps } from 'react';
  export function IcBaselineContentCopy(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcBaselineContentPasteGo' {

  import type { SVGProps } from 'react';
  export function IcBaselineContentPasteGo(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcBaselineDesktopMac' {

  import type { SVGProps } from 'react';
  export function IcBaselineDesktopMac(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcBaselineErrorOutline' {

  import type { SVGProps } from 'react';
  export function IcBaselineErrorOutline(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcBaselinePause' {

  import type { SVGProps } from 'react';
  export function IcBaselinePause(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcBaselinePhoneIphone' {

  import type { SVGProps } from 'react';
  export function IcBaselinePhoneIphone(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcBaselineWifiTethering' {

  import type { SVGProps } from 'react';
  export function IcBaselineWifiTethering(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcOutlineArchive' {

  import type { SVGProps } from 'react';
  export function IcOutlineArchive(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcOutlineArrowCircleRight' {

  import type { SVGProps } from 'react';
  export function IcOutlineArrowCircleRight(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcOutlineAvTimer' {

  import type { SVGProps } from 'react';
  export function IcOutlineAvTimer(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcOutlineCloudUpload' {

  import type { SVGProps } from 'react';
  export function IcOutlineCloudUpload(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcOutlineDarkMode' {

  import type { SVGProps } from 'react';
  export function IcOutlineDarkMode(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcOutlineDescription' {

  import type { SVGProps } from 'react';
  export function IcOutlineDescription(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcOutlineDrafts' {

  import type { SVGProps } from 'react';
  export function IcOutlineDrafts(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcOutlineFolder' {

  import type { SVGProps } from 'react';
  export function IcOutlineFolder(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcOutlineGridView' {

  import type { SVGProps } from 'react';
  export function IcOutlineGridView(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  export default IcOutlineGridView;
  
}

declare module 'alinea/ui/icons/IcOutlineInsertDriveFile' {

  import type { SVGProps } from 'react';
  export function IcOutlineInsertDriveFile(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcOutlineKeyboardTab' {

  import type { SVGProps } from 'react';
  export function IcOutlineKeyboardTab(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcOutlineLightMode' {

  import type { SVGProps } from 'react';
  export function IcOutlineLightMode(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcOutlineList' {

  import type { SVGProps } from 'react';
  export function IcOutlineList(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  export default IcOutlineList;
  
}

declare module 'alinea/ui/icons/IcOutlineLock' {

  import type { SVGProps } from 'react';
  export function IcOutlineLock(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcOutlineMoreHoriz' {

  import type { SVGProps } from 'react';
  export function IcOutlineMoreHoriz(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  export default IcOutlineMoreHoriz;
  
}

declare module 'alinea/ui/icons/IcOutlinePreview' {

  import type { SVGProps } from 'react';
  export function IcOutlinePreview(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcOutlineRemoveRedEye' {

  import type { SVGProps } from 'react';
  export function IcOutlineRemoveRedEye(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcOutlineScreenshot' {

  import type { SVGProps } from 'react';
  export function IcOutlineScreenshot(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcOutlineSettings' {

  import type { SVGProps } from 'react';
  export function IcOutlineSettings(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  export default IcOutlineSettings;
  
}

declare module 'alinea/ui/icons/IcOutlineTableRows' {

  import type { SVGProps } from 'react';
  export function IcOutlineTableRows(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundAccountTree' {

  import type { SVGProps } from 'react';
  export function IcRoundAccountTree(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundAdd' {

  import type { SVGProps } from 'react';
  export function IcRoundAdd(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundAddCircle' {

  import type { SVGProps } from 'react';
  export function IcRoundAddCircle(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  export default IcRoundAddCircle;
  
}

declare module 'alinea/ui/icons/IcRoundAddCircleOutline' {

  import type { SVGProps } from 'react';
  export function IcRoundAddCircleOutline(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundArchive' {

  import type { SVGProps } from 'react';
  export function IcRoundArchive(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundArrowBack' {

  import type { SVGProps } from 'react';
  export function IcRoundArrowBack(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundArrowDownward' {

  import type { SVGProps } from 'react';
  export function IcRoundArrowDownward(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundArrowDropDown' {

  import type { SVGProps } from 'react';
  export function IcRoundArrowDropDown(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  export default IcRoundArrowDropDown;
  
}

declare module 'alinea/ui/icons/IcRoundArrowDropDownCircle' {

  import type { SVGProps } from 'react';
  export function IcRoundArrowDropDownCircle(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  export default IcRoundArrowDropDownCircle;
  
}

declare module 'alinea/ui/icons/IcRoundArrowDropUp' {

  import type { SVGProps } from 'react';
  export function IcRoundArrowDropUp(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  export default IcRoundArrowDropUp;
  
}

declare module 'alinea/ui/icons/IcRoundArrowForward' {

  import type { SVGProps } from 'react';
  export function IcRoundArrowForward(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundArrowUpward' {

  import type { SVGProps } from 'react';
  export function IcRoundArrowUpward(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundCheck' {

  import type { SVGProps } from 'react';
  export function IcRoundCheck(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundCheckBox' {

  import type { SVGProps } from 'react';
  export function IcRoundCheckBox(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundCheckBoxOutlineBlank' {

  import type { SVGProps } from 'react';
  export function IcRoundCheckBoxOutlineBlank(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundChevronRight' {

  import type { SVGProps } from 'react';
  export function IcRoundChevronRight(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundClose' {

  import type { SVGProps } from 'react';
  export function IcRoundClose(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundCode' {

  import type { SVGProps } from 'react';
  export function IcRoundCode(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundDateRange' {

  import type { SVGProps } from 'react';
  export function IcRoundDateRange(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  export default IcRoundDateRange;
  
}

declare module 'alinea/ui/icons/IcRoundDelete' {

  import type { SVGProps } from 'react';
  export function IcRoundDelete(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundDescription' {

  import type { SVGProps } from 'react';
  export function IcRoundDescription(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundDragHandle' {

  import type { SVGProps } from 'react';
  export function IcRoundDragHandle(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  export default IcRoundDragHandle;
  
}

declare module 'alinea/ui/icons/IcRoundEdit' {

  import type { SVGProps } from 'react';
  export function IcRoundEdit(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundExitToApp' {

  import type { SVGProps } from 'react';
  export function IcRoundExitToApp(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundFeed' {

  import type { SVGProps } from 'react';
  export function IcRoundFeed(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundFormatBold' {

  import type { SVGProps } from 'react';
  export function IcRoundFormatBold(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  export default IcRoundFormatBold;
  
}

declare module 'alinea/ui/icons/IcRoundFormatClear' {

  import type { SVGProps } from 'react';
  export function IcRoundFormatClear(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  export default IcRoundFormatClear;
  
}

declare module 'alinea/ui/icons/IcRoundFormatItalic' {

  import type { SVGProps } from 'react';
  export function IcRoundFormatItalic(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  export default IcRoundFormatItalic;
  
}

declare module 'alinea/ui/icons/IcRoundFormatListBulleted' {

  import type { SVGProps } from 'react';
  export function IcRoundFormatListBulleted(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  export default IcRoundFormatListBulleted;
  
}

declare module 'alinea/ui/icons/IcRoundFormatListNumbered' {

  import type { SVGProps } from 'react';
  export function IcRoundFormatListNumbered(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  export default IcRoundFormatListNumbered;
  
}

declare module 'alinea/ui/icons/IcRoundHamburger' {

  import type { SVGProps } from 'react';
  export function IcRoundHamburger(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  export default IcRoundHamburger;
  
}

declare module 'alinea/ui/icons/IcRoundHdrStrong' {

  import type { SVGProps } from 'react';
  export function IcRoundHdrStrong(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  export default IcRoundHdrStrong;
  
}

declare module 'alinea/ui/icons/IcRoundHorizontalRule' {

  import type { SVGProps } from 'react';
  export function IcRoundHorizontalRule(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  export default IcRoundHorizontalRule;
  
}

declare module 'alinea/ui/icons/IcRoundInsertDriveFile' {

  import type { SVGProps } from 'react';
  export function IcRoundInsertDriveFile(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundKeyboardArrowDown' {

  import type { SVGProps } from 'react';
  export function IcRoundKeyboardArrowDown(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundKeyboardArrowLeft' {

  import type { SVGProps } from 'react';
  export function IcRoundKeyboardArrowLeft(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  export default IcRoundKeyboardArrowLeft;
  
}

declare module 'alinea/ui/icons/IcRoundKeyboardArrowRight' {

  import type { SVGProps } from 'react';
  export function IcRoundKeyboardArrowRight(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundKeyboardArrowUp' {

  import type { SVGProps } from 'react';
  export function IcRoundKeyboardArrowUp(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundLanguage' {

  import type { SVGProps } from 'react';
  export function IcRoundLanguage(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundLastPage' {

  import type { SVGProps } from 'react';
  export function IcRoundLastPage(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundLink' {

  import type { SVGProps } from 'react';
  export function IcRoundLink(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundLock' {

  import type { SVGProps } from 'react';
  export function IcRoundLock(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  export default IcRoundLock;
  
}

declare module 'alinea/ui/icons/IcRoundMenu' {

  import type { SVGProps } from 'react';
  export function IcRoundMenu(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundMoreHoriz' {

  import type { SVGProps } from 'react';
  export function IcRoundMoreHoriz(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundMoreVert' {

  import type { SVGProps } from 'react';
  export function IcRoundMoreVert(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundNorthEast' {

  import type { SVGProps } from 'react';
  export function IcRoundNorthEast(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundNotes' {

  import type { SVGProps } from 'react';
  export function IcRoundNotes(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundNumbers' {

  import type { SVGProps } from 'react';
  export function IcRoundNumbers(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundOpenInNew' {

  import type { SVGProps } from 'react';
  export function IcRoundOpenInNew(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundPermMedia' {

  import type { SVGProps } from 'react';
  export function IcRoundPermMedia(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundPublish' {

  import type { SVGProps } from 'react';
  export function IcRoundPublish(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundPublishedWithChanges' {

  import type { SVGProps } from 'react';
  export function IcRoundPublishedWithChanges(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundQuote' {

  import type { SVGProps } from 'react';
  export function IcRoundQuote(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundRedo' {

  import type { SVGProps } from 'react';
  export function IcRoundRedo(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  export default IcRoundRedo;
  
}

declare module 'alinea/ui/icons/IcRoundRefresh' {

  import type { SVGProps } from 'react';
  export function IcRoundRefresh(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  export default IcRoundRefresh;
  
}

declare module 'alinea/ui/icons/IcRoundRemoveCircleOutline' {

  import type { SVGProps } from 'react';
  export function IcRoundRemoveCircleOutline(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundRotateLeft' {

  import type { SVGProps } from 'react';
  export function IcRoundRotateLeft(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundSave' {

  import type { SVGProps } from 'react';
  export function IcRoundSave(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundSearch' {

  import type { SVGProps } from 'react';
  export function IcRoundSearch(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundSend' {

  import type { SVGProps } from 'react';
  export function IcRoundSend(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundShare' {

  import type { SVGProps } from 'react';
  export function IcRoundShare(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundSouthWest' {

  import type { SVGProps } from 'react';
  export function IcRoundSouthWest(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundSubscript' {

  import type { SVGProps } from 'react';
  export function IcRoundSubscript(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundSuperscript' {

  import type { SVGProps } from 'react';
  export function IcRoundSuperscript(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundSync' {

  import type { SVGProps } from 'react';
  export function IcRoundSync(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundTabletMac' {

  import type { SVGProps } from 'react';
  export function IcRoundTabletMac(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundTextFields' {

  import type { SVGProps } from 'react';
  export function IcRoundTextFields(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundTranslate' {

  import type { SVGProps } from 'react';
  export function IcRoundTranslate(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundUndo' {

  import type { SVGProps } from 'react';
  export function IcRoundUndo(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  export default IcRoundUndo;
  
}

declare module 'alinea/ui/icons/IcRoundUnfoldLess' {

  import type { SVGProps } from 'react';
  export function IcRoundUnfoldLess(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundUnfoldMore' {

  import type { SVGProps } from 'react';
  export function IcRoundUnfoldMore(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundUploadFile' {

  import type { SVGProps } from 'react';
  export function IcRoundUploadFile(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  export default IcRoundUploadFile;
  
}

declare module 'alinea/ui/icons/IcRoundVisibilityOff' {

  import type { SVGProps } from 'react';
  export function IcRoundVisibilityOff(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcRoundWarning' {

  import type { SVGProps } from 'react';
  export function IcRoundWarning(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcSharpBrightnessMedium' {

  import type { SVGProps } from 'react';
  export function IcSharpBrightnessMedium(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcSharpVerticalAlignCenter' {

  import type { SVGProps } from 'react';
  export function IcSharpVerticalAlignCenter(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcTwotoneDescription' {

  import type { SVGProps } from 'react';
  export function IcTwotoneDescription(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcTwotoneFolder' {

  import type { SVGProps } from 'react';
  export function IcTwotoneFolder(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/IcTwotoneInsertDriveFile' {

  import type { SVGProps } from 'react';
  export function IcTwotoneInsertDriveFile(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/MaterialSymbolsDatabase' {

  import type { SVGProps } from 'react';
  export function MaterialSymbolsDatabase(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/MdiGithub' {

  import type { SVGProps } from 'react';
  export function MdiGithub(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  export default MdiGithub;
  
}

declare module 'alinea/ui/icons/MdiSourceBranch' {

  import type { SVGProps } from 'react';
  export function MdiSourceBranch(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/MdiTwitterCircle' {

  import type { SVGProps } from 'react';
  export function MdiTwitterCircle(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/MiLayers' {

  import type { SVGProps } from 'react';
  export function MiLayers(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  export default MiLayers;
  
}

declare module 'alinea/ui/icons/PhGlobe' {

  import type { SVGProps } from 'react';
  export function PhGlobe(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/RiFlashlightFill' {

  import type { SVGProps } from 'react';
  export function RiFlashlightFill(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/TableDelete' {

  import type { SVGProps } from 'react';
  export function TableDelete(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/TableDeleteColumn' {

  import type { SVGProps } from 'react';
  export function TableDeleteColumn(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/TableDeleteRow' {

  import type { SVGProps } from 'react';
  export function TableDeleteRow(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/TableHeaderCell' {

  import type { SVGProps } from 'react';
  export function TableHeaderCell(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/TableHeaderColumn' {

  import type { SVGProps } from 'react';
  export function TableHeaderColumn(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/TableHeaderRow' {

  import type { SVGProps } from 'react';
  export function TableHeaderRow(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/TableInsert' {

  import type { SVGProps } from 'react';
  export function TableInsert(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/TableInsertColumnAfter' {

  import type { SVGProps } from 'react';
  export function TableInsertColumnAfter(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/TableInsertColumnBefore' {

  import type { SVGProps } from 'react';
  export function TableInsertColumnBefore(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/TableInsertRowAfter' {

  import type { SVGProps } from 'react';
  export function TableInsertRowAfter(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/TableInsertRowBefore' {

  import type { SVGProps } from 'react';
  export function TableInsertRowBefore(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/TableMergeCells' {

  import type { SVGProps } from 'react';
  export function TableMergeCells(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/icons/TableSplitCell' {

  import type { SVGProps } from 'react';
  export function TableSplitCell(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/Lift' {

  import type { HTMLProps } from 'react';
  export function Lift(props: HTMLProps<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
  export function LiftHeader(props: HTMLProps<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/Link' {

  import type { LinkHTMLAttributes } from 'react';
  export type LinkProps = {
      href: string;
      external?: boolean;
  } & LinkHTMLAttributes<HTMLAnchorElement>;
  export function Link({ href, external, children, ...props }: LinkProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/Loader' {

  import type { HTMLAttributes } from 'react';
  type LoaderProps = {
      light?: boolean;
      absolute?: boolean;
      size?: number;
  } & HTMLAttributes<HTMLDivElement>;
  export function Loader({ light, absolute, size, ...props }: LoaderProps): import("react/jsx-runtime").JSX.Element;
  export {};
  
}

declare module 'alinea/ui/Main' {

  import { type HTMLProps, type ReactNode, type Ref } from 'react';
  export interface MainProps extends HTMLProps<HTMLDivElement> {
      head?: ReactNode;
      scrollRef?: Ref<HTMLDivElement>;
      scrollable?: boolean;
      isLoading?: boolean;
  }
  function MainContainer(props: HTMLProps<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
  export const Main: import("react").ForwardRefExoticComponent<Omit<MainProps, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
      Container: typeof MainContainer;
  };
  export {};
  
}

declare module 'alinea/ui/Pane' {

  import { type HTMLAttributes } from 'react';
  export type PaneProps = {
      id: string;
      defaultWidth?: number;
      minWidth?: number;
      maxWidth?: number;
      resizable: 'left' | 'right';
  } & HTMLAttributes<HTMLDivElement>;
  export function Pane({ id, children, resizable, defaultWidth, minWidth, maxWidth, ...props }: PaneProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/PopoverMenu' {

  import { type PopoverButtonProps } from '@headlessui/react';
  import type { HTMLAttributes, PropsWithChildren } from 'react';
  export namespace PopoverMenu {
      function Root(props: HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
      function Trigger(props: PopoverButtonProps<'button'>): import("react/jsx-runtime").JSX.Element;
      function Items({ left, right, ...props }: HTMLAttributes<HTMLDivElement> & {
          left?: boolean;
          right?: boolean;
      }): import("react/jsx-runtime").JSX.Element;
      function Header({ children }: PropsWithChildren<{}>): import("react/jsx-runtime").JSX.Element;
      function Footer({ children }: PropsWithChildren<{}>): import("react/jsx-runtime").JSX.Element;
  }
  
}

declare module 'alinea/ui/Property' {

  export { InputLabel as Property } from 'alinea/dashboard';
  
}

declare module 'alinea/ui/RichText' {

  import type { Infer } from 'alinea/core/Infer';
  import type { Schema } from 'alinea/core/Schema';
  import { type TextDoc } from 'alinea/core/TextDoc';
  import type { RichTextElements } from 'alinea/core/shape/RichTextShape';
  import { type ComponentType, type ReactElement } from 'react';
  export type RichTextProps<Blocks extends Schema> = {
      doc: TextDoc<Blocks>;
      text?: ComponentType<{
          children: string;
      }>;
  } & {
      [K in keyof typeof RichTextElements]?: ComponentType<JSX.IntrinsicElements[K]> | ReactElement;
  } & {
      [K in keyof Blocks]?: ComponentType<Infer<Blocks[K]>>;
  };
  export function RichText<Blocks extends Schema>({ doc, ...views }: RichTextProps<Blocks>): import("react/jsx-runtime").JSX.Element | null;
  
}

declare module 'alinea/ui/Sink' {

  import type { HTMLProps, PropsWithChildren } from 'react';
  export namespace Sink {
      function Root(props: PropsWithChildren<HTMLProps<HTMLDivElement>>): import("react/jsx-runtime").JSX.Element;
      function Row(props: PropsWithChildren<HTMLProps<HTMLDivElement>>): import("react/jsx-runtime").JSX.Element;
      function Content(props: PropsWithChildren<HTMLProps<HTMLDivElement>>): import("react/jsx-runtime").JSX.Element;
      function Options(props: PropsWithChildren<HTMLProps<HTMLDivElement>>): import("react/jsx-runtime").JSX.Element;
      function Header(props: PropsWithChildren<HTMLProps<HTMLDivElement>>): import("react/jsx-runtime").JSX.Element;
      function Title(props: PropsWithChildren<HTMLProps<HTMLDivElement>>): import("react/jsx-runtime").JSX.Element;
  }
  
}

declare module 'alinea/ui/Stack' {

  import { type CSSProperties, type HTMLAttributes, type HTMLProps, type PropsWithChildren, type PropsWithRef } from 'react';
  export type StackProps = PropsWithRef<Omit<HTMLProps<HTMLDivElement>, 'wrap'> & {
      gap?: number | string;
      direction?: CSSProperties['flexDirection'];
      align?: CSSProperties['alignItems'];
      justify?: CSSProperties['justifyContent'];
      horizontal?: boolean;
      wrap?: boolean;
      center?: boolean;
      full?: boolean;
      autoWidth?: boolean;
  }>;
  export const VStack: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<HTMLProps<HTMLDivElement>, "wrap"> & {
      gap?: number | string;
      direction?: CSSProperties["flexDirection"];
      align?: CSSProperties["alignItems"];
      justify?: CSSProperties["justifyContent"];
      horizontal?: boolean;
      wrap?: boolean;
      center?: boolean;
      full?: boolean;
      autoWidth?: boolean;
  }, "ref"> & {
      ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
  }, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
  export const HStack: typeof VStack;
  export namespace Stack {
      function Left(props: PropsWithChildren<HTMLAttributes<HTMLDivElement>>): import("react/jsx-runtime").JSX.Element;
      function Center(props: PropsWithChildren<HTMLAttributes<HTMLDivElement>>): import("react/jsx-runtime").JSX.Element;
      function Right(props: PropsWithChildren<HTMLAttributes<HTMLDivElement>>): import("react/jsx-runtime").JSX.Element;
      function Bottom(props: PropsWithChildren<HTMLAttributes<HTMLDivElement>>): import("react/jsx-runtime").JSX.Element;
  }
  
}

declare module 'alinea/ui/Statusbar' {

  import type { ComponentType } from 'react';
  import type { PropsWithChildren } from 'react';
  export namespace Statusbar {
      const Provider: ComponentType<{
          children?: import("react").ReactNode | undefined;
      }>, Portal: ComponentType<import("react").HTMLProps<HTMLDivElement>>, Slot: ComponentType<{
          children?: import("react").ReactNode | undefined;
      }>;
      function Root({ children }: PropsWithChildren<{}>): import("react/jsx-runtime").JSX.Element;
      interface StatusProps extends PropsWithChildren {
          icon?: ComponentType;
          onClick?: () => void;
      }
      function Status({ children, icon, onClick }: StatusProps): import("react/jsx-runtime").JSX.Element;
  }
  
}

declare module 'alinea/ui/Tabs' {

  import { Tab } from '@headlessui/react';
  import type { ComponentPropsWithoutRef, PropsWithChildren } from 'react';
  export namespace Tabs {
      const Root: typeof Tab.Group;
      function List({ backdrop, ...props }: PropsWithChildren<ComponentPropsWithoutRef<typeof Tab> & {
          backdrop?: boolean;
      }>): import("react/jsx-runtime").JSX.Element;
      function Trigger(props: PropsWithChildren<ComponentPropsWithoutRef<typeof Tab>>): import("react/jsx-runtime").JSX.Element;
      const Panels: typeof Tab.Panels;
      const Panel: typeof Tab.Panel;
  }
  
}

declare module 'alinea/ui/TextLabel' {

  import type { HTMLProps } from 'react';
  export type TextLabelProps = {
      label: string;
  } & Omit<HTMLProps<HTMLSpanElement>, 'label'>;
  export function TextLabel({ label, ...props }: TextLabelProps): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/Typo' {

  export const Typo: (({ children, align }: import("react").PropsWithChildren<{
      align?: "left" | "right" | "center";
  }>) => import("react/jsx-runtime").JSX.Element) & {
      H1: import("alinea/ui/util/PropsWithAs").ComponentWithAs<{
          flat?: boolean;
          light?: boolean;
      }, "h1">;
      H2: import("alinea/ui/util/PropsWithAs").ComponentWithAs<{
          flat?: boolean;
          light?: boolean;
      }, "h2">;
      H3: import("alinea/ui/util/PropsWithAs").ComponentWithAs<{
          flat?: boolean;
          light?: boolean;
      }, "h3">;
      H4: import("alinea/ui/util/PropsWithAs").ComponentWithAs<{
          flat?: boolean;
          light?: boolean;
      }, "h4">;
      H5: import("alinea/ui/util/PropsWithAs").ComponentWithAs<{
          flat?: boolean;
          light?: boolean;
      }, "h5">;
      P: import("alinea/ui/util/PropsWithAs").ComponentWithAs<{
          flat?: boolean;
          light?: boolean;
      }, "p">;
      Link: import("react").ForwardRefExoticComponent<Omit<import("react").HTMLProps<HTMLAnchorElement>, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
      link: import("@alinea/styler").GenericStyles | import("@alinea/styler").Styler<string>;
      Monospace: import("alinea/ui/util/PropsWithAs").ComponentWithAs<{}, "span">;
      Small: import("alinea/ui/util/PropsWithAs").ComponentWithAs<{
          flat?: boolean;
          light?: boolean;
      }, "small">;
  };
  
}

declare module 'alinea/ui/UIStory' {

  import type { FunctionComponent, PropsWithChildren } from 'react';
  import 'alinea/global.css';
  export interface UIStoryProps extends PropsWithChildren<{}> {
      fullWidth?: boolean;
      fullHeight?: boolean;
  }
  export function UIStory({ fullWidth, fullHeight, children }: UIStoryProps): import("react/jsx-runtime").JSX.Element;
  export function uiDecorator(props?: UIStoryProps): ((Story: FunctionComponent) => import("react/jsx-runtime").JSX.Element)[];
  
}

declare module 'alinea/ui/util/ContrastColor' {

  export function contrastColor(color?: string): string | undefined;
  
}

declare module 'alinea/ui/util/CreateTypo' {

  import { type GenericStyles, type Styler } from '@alinea/styler';
  import { type ComponentType, type HTMLProps, type PropsWithChildren } from 'react';
  type TypoStyles = {
      root: Styler;
      link: Styler;
      small: Styler;
      h1: Styler;
      h2: Styler;
      h3: Styler;
      h4: Styler;
      h5: Styler;
      p: Styler;
      hyphenate: Styler;
      monospace: Styler;
  } | Record<string, GenericStyles>;
  interface Overrides {
      a?: ComponentType<any>;
      h1?: ComponentType<any>;
      h2?: ComponentType<any>;
      h3?: ComponentType<any>;
      h4?: ComponentType<any>;
      h5?: ComponentType<any>;
      p?: ComponentType<any>;
      link?: ComponentType<any>;
      small?: ComponentType<any>;
  }
  export function createTypo(styles: TypoStyles, overrides?: Overrides): (({ children, align }: PropsWithChildren<{
      align?: "left" | "right" | "center";
  }>) => import("react/jsx-runtime").JSX.Element) & {
      H1: import("alinea/ui/util/PropsWithAs").ComponentWithAs<{
          flat?: boolean;
          light?: boolean;
      }, "h1">;
      H2: import("alinea/ui/util/PropsWithAs").ComponentWithAs<{
          flat?: boolean;
          light?: boolean;
      }, "h2">;
      H3: import("alinea/ui/util/PropsWithAs").ComponentWithAs<{
          flat?: boolean;
          light?: boolean;
      }, "h3">;
      H4: import("alinea/ui/util/PropsWithAs").ComponentWithAs<{
          flat?: boolean;
          light?: boolean;
      }, "h4">;
      H5: import("alinea/ui/util/PropsWithAs").ComponentWithAs<{
          flat?: boolean;
          light?: boolean;
      }, "h5">;
      P: import("alinea/ui/util/PropsWithAs").ComponentWithAs<{
          flat?: boolean;
          light?: boolean;
      }, "p">;
      Link: import("react").ForwardRefExoticComponent<Omit<HTMLProps<HTMLAnchorElement>, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
      link: GenericStyles | Styler<string>;
      Monospace: import("alinea/ui/util/PropsWithAs").ComponentWithAs<{}, "span">;
      Small: import("alinea/ui/util/PropsWithAs").ComponentWithAs<{
          flat?: boolean;
          light?: boolean;
      }, "small">;
  };
  export {};
  
}

declare module 'alinea/ui/util/Elevation' {

  import { type PropsWithChildren } from 'react';
  type Parent = 'sink' | 'lift';
  interface Elevation {
      level: number;
      parent?: Parent;
  }
  export const useElevation: () => Elevation;
  export interface ElevationProviderProps {
      type: Parent;
  }
  export function ElevationProvider({ children, type }: PropsWithChildren<ElevationProviderProps>): import("react/jsx-runtime").JSX.Element;
  export {};
  
}

declare module 'alinea/ui/util/ImageBlurUrl' {

  interface HasThumbHash {
      thumbHash?: string;
  }
  export function imageBlurUrl({ thumbHash }: HasThumbHash): string | undefined;
  export {};
  
}

declare module 'alinea/ui/util/PropsWithAs' {

  import { type ForwardRefRenderFunction } from 'react';
  export type As<Props = any> = React.ElementType<Props>;
  export type PropsWithAs<Props = {}, Type extends As = As> = Props & Omit<React.ComponentProps<Type>, 'as' | keyof Props> & {
      as?: Type;
  };
  export type ComponentWithAs<Props, DefaultType extends As> = {
      <Type extends As>(props: PropsWithAs<Props, Type> & {
          as: Type;
      }): JSX.Element;
      (props: PropsWithAs<Props, DefaultType>): JSX.Element;
  };
  export function forwardRefWithAs<Props, DefaultType extends As>(component: ForwardRefRenderFunction<any, any>): ComponentWithAs<Props, DefaultType>;
  
}

declare module 'alinea/ui/util/Slots' {

  import { type ComponentType, type HTMLProps, type PropsWithChildren } from 'react';
  type Slots = {
      Provider: ComponentType<PropsWithChildren<{}>>;
      Portal: ComponentType<HTMLProps<HTMLDivElement>>;
      Slot: ComponentType<PropsWithChildren<{}>>;
      useSlots: () => {
          shown: boolean;
      };
  };
  export function createSlots(): Slots;
  export {};
  
}

declare module 'alinea/ui/util/TextareaAutosize' {

  import type { HTMLProps } from 'react';
  export function TextareaAutosize(props: HTMLProps<HTMLTextAreaElement>): import("react/jsx-runtime").JSX.Element;
  
}

declare module 'alinea/ui/util/Units' {

  export const px: (pixels: number | string) => string;
  
}

declare module 'alinea/ui/util/UseId' {

  export function useId(): string;
  
}

declare module 'alinea/yjs' {

  export * from 'yjs-src';
  
}

