import { ConsentCategory, ConsentCategory as ConsentCategory$1, ConsentState, ConsentState as ConsentState$1 } from "@platform-modules/content/privacy";
import { ContentEntry, ContentEntry as ContentEntry$1, ContentInput, ContentInput as ContentInput$1, ContentStatus, ContentVisibility, ContentVisibility as ContentVisibility$1, EntityRef, EntityRef as EntityRef$1, ListQuery, ListQuery as ListQuery$1 } from "@platform-modules/content";
//#region src/client.d.ts
/**
 * Injected data seam for browser-side content authoring.
 * The consumer wires each method to its authenticated API route — identity is server-derived.
 */
interface ContentClient {
  list(query?: ListQuery$1): Promise<ContentEntry$1[]>;
  getBySlug(type: string, slug: string): Promise<ContentEntry$1 | null>;
  put(input: ContentInput$1): Promise<ContentEntry$1>;
  publish(id: string): Promise<EntityRef$1>;
  schedule(id: string, at: string): Promise<EntityRef$1>;
  unpublish(id: string): Promise<EntityRef$1>;
  setVisibility(id: string, visibility: ContentVisibility$1): Promise<EntityRef$1>;
  trash(id: string): Promise<EntityRef$1>;
  restore(id: string): Promise<EntityRef$1>;
  remove(id: string): Promise<EntityRef$1>;
}
//#endregion
//#region src/errors.d.ts
/** Typed boundary error when a workflow action requires a persisted entry id. */
declare class ContentEntryNotSavedError extends Error {
  readonly action: string;
  readonly name = "ContentEntryNotSavedError";
  constructor(action: string);
}
declare function isContentEntryNotSavedError(e: unknown): e is ContentEntryNotSavedError;
//#endregion
//#region src/useContentList.d.ts
declare function useContentList(client: ContentClient, query?: ListQuery$1): {
  entries: ContentEntry$1[];
  loading: boolean;
  error: Error | null;
  reload: () => void;
};
//#endregion
//#region src/useContentEntry.d.ts
declare function useContentEntry(client: ContentClient, ref: ContentEntry$1 | null): {
  entry: ContentEntry$1 | null;
  loading: boolean;
  error: Error | null;
  save: (input?: ContentInput$1) => Promise<ContentEntry$1 | undefined>;
  publish: () => Promise<EntityRef$1 | undefined>;
  schedule: (at: string) => Promise<EntityRef$1 | undefined>;
  unpublish: () => Promise<EntityRef$1 | undefined>;
  trash: () => Promise<EntityRef$1 | undefined>;
  restore: () => Promise<EntityRef$1 | undefined>;
  setVisibility: (visibility: ContentVisibility$1) => Promise<EntityRef$1 | undefined>;
  remove: () => Promise<EntityRef$1 | undefined>;
};
type UseContentEntryResult = ReturnType<typeof useContentEntry>;
//#endregion
//#region src/useAutosave.d.ts
type AutosaveState = 'idle' | 'saving' | 'saved' | 'error';
declare function useAutosave(save: (value: string) => Promise<unknown>, value: string, opts?: {
  delayMs?: number;
}): {
  state: AutosaveState;
};
//#endregion
//#region src/ContentEditorForm.d.ts
interface ContentEditorFormProps {
  client: ContentClient;
  /** Edit an existing entry, or `null` for a new one. */
  entry: ContentEntry$1 | null;
  onSaved?: (entry: ContentEntry$1) => void;
  className?: string;
}
declare function ContentEditorForm({ client, entry, onSaved, className }: ContentEditorFormProps): import("react").JSX.Element;
//#endregion
//#region src/useConsent.d.ts
/**
 * Persistence seam for consent. Sync (localStorage/cookie are sync) — an async seam would force
 * loading-state complexity for an adapter that does not exist (YAGNI). Inject a custom impl for
 * cookie/server persistence; the default below uses localStorage.
 */
interface ConsentStorage {
  load(): string | null;
  save(value: string): void;
}
/**
 * Default localStorage-backed storage. LAZY: constructs with no `localStorage` access (safe to evaluate
 * as a default during SSR); touches `window.localStorage` only inside load()/save(), each guarded so a
 * SecurityError (storage disabled / private mode) degrades to null / no-op, never a throw.
 */
declare function createLocalStorageConsentStorage(key?: string): ConsentStorage;
interface UseConsentOptions {
  /** The CONFIGURED policy version. Stored consent whose version ≠ this is treated as absent (re-prompt). */
  version: string;
  /** Defaults to a localStorage-backed store. */
  storage?: ConsentStorage;
}
interface UseConsentResult {
  /** false during SSR + first client render; true after the mount effect (prevents hydration mismatch). */
  ready: boolean;
  /** version-matched stored consent, else null. */
  consent: ConsentState$1 | null;
  save(categories: Record<ConsentCategory$1, boolean>): ConsentState$1;
  acceptAll(): ConsentState$1;
  rejectAll(): ConsentState$1;
}
declare function useConsent(options: UseConsentOptions): UseConsentResult;
//#endregion
//#region src/ConsentBanner.d.ts
interface ConsentBannerLabels {
  title?: string;
  description?: string;
  acceptAll?: string;
  rejectAll?: string;
  save?: string;
  policyLink?: string;
  categoryLabels?: Partial<Record<ConsentCategory$1, string>>;
}
interface ConsentBannerProps {
  version: string;
  storage?: ConsentStorage;
  /** NON-necessary categories shown. Default: analytics, marketing, preferences. */
  categories?: ConsentCategory$1[];
  policyHref?: string;
  labels?: ConsentBannerLabels;
  /** Controlled override for re-consent ("Manage cookies"). show = open ?? (ready && !consent). */
  open?: boolean;
  onChange?: (state: ConsentState$1) => void;
  className?: string;
}
declare function ConsentBanner({ version, storage, categories, policyHref, labels, open, onChange, className }: ConsentBannerProps): import("react").JSX.Element | null;
//#endregion
export { type AutosaveState, ConsentBanner, type ConsentBannerLabels, type ConsentBannerProps, type ConsentCategory, type ConsentState, type ConsentStorage, type ContentClient, ContentEditorForm, type ContentEditorFormProps, type ContentEntry, ContentEntryNotSavedError, type ContentInput, type ContentStatus, type ContentVisibility, type EntityRef, type ListQuery, type UseConsentOptions, type UseConsentResult, type UseContentEntryResult, createLocalStorageConsentStorage, isContentEntryNotSavedError, useAutosave, useConsent, useContentEntry, useContentList };