import type { BaseMetadata, ThreadData } from "@liveblocks/client"; import type { useThreads as useLiveblocksThreads, UseThreadsOptions } from "@liveblocks/react"; import { type MediaAssetType } from "@prismicio/editor-ui"; import type { Content, Editor, Extension } from "@tiptap/core"; import { type ReactNode } from "react"; import type { APIExplorerEvents } from "./core/APIExplorer/components/APIExplorerContext"; import type { MetadataType } from "./core/service"; export type EditorConfig = { baseUrl: URL; embedApiEndpoint: URL; unsplashApiBaseUrl: URL; authStrategy: AuthStrategy; collaboration?: Collaboration; } & OptionalConfigs; type OptionalConfigs = SearchDocuments & MediaLibrary & UIDField & Analytics & ErrorTracking & IntegrationFields & LayoutConfig & UserService & AISeoMetadata; type UserService = { userServiceBaseUrl?: URL; }; type MediaLibrary = { mediaLibrary?: never; } | { mediaLibrary: true; assetsApiBaseUrl: URL; repository: string; coreApiBaseUrl: URL; userServiceBaseUrl: URL; }; type UIDField = { uidField?: never; } | { uidField: true; coreApiBaseUrl: URL; documentId?: string; localeId: string; customTypeId: string; }; type SearchDocuments = { searchDocuments?: never; } | { searchDocuments: true; coreApiBaseUrl: URL; customTypesApiBaseUrl: URL; repository: string; status: "published" | "release" | "archived" | "unclassified"; localeId?: string; customTypeId?: string; documentSearchBaseUrl: URL; }; type IntegrationFields = { integrationFields?: never; } | { integrationFields: true; integrationFieldsApiBaseUrl: URL; repository: string; }; type AISeoMetadata = { aiSeoMetadataEnabled?: never; } | { aiSeoMetadataEnabled: boolean; documentBaseUrl: URL; repository: string; trackMetadataGeneration: (args: { documentId: string; locale: string; suggestion: string; type: MetadataType; }) => void; }; interface LayoutConfig { /** * Teaches fields about their containing scrolling element. */ scrollOffsetTop?: number; } interface OnAnalyticsEvent { (event: "Media Library Search", args: { assetType: MediaAssetType; mode: "browse" | "select"; searchQuery: string; numberOfWords: string; numberOfResults: string; timeToGetResults: string; tags: string; }): void; (event: "Media Added To Page", args: { assetType: MediaAssetType; searchQuery: string; numberOfWords: string; numberOfResults: string; searchPosition: string; mediaIds: string; timeToAddMediaToPage: string; tags: string; }): void; (event: "Generic Link Added", args: { type: "web" | "media" | "document"; isInSlice: string; isInGroup: string; isInRepeatable: string; customTypeFormat: "page" | "custom"; }): void; (event: "Unsplash Image Searched" | "Unsplash Image Added"): void; (event: "Table Limit Reached", args: { type: "row" | "column"; }): void; (...params: APIExplorerEvents): void; } interface Analytics { onAnalyticsEvent?: OnAnalyticsEvent; } interface ErrorTracking { /** Asks the editor to track this Error in its Error monitoring solution. */ onTrackError?: (error: Error) => void; } export type Collaboration = { hasSharedCollaborativeHistory: boolean; Presence: CollaborationPresence; comments: { useThreads: UseThreads; useIsActiveThread: UseIsActiveThread; ThreadLink: ThreadLink; }; richText?: { useComments: UseRichTextComments; useThreads: UseThreads; CustomThreads: CustomThreads; }; }; interface UseRichTextCommentsArgs { field?: string; initialContent?: Content; } type UseRichTextComments = (args: UseRichTextCommentsArgs) => Extension; type UseIsActiveThread = (threadId?: string) => boolean; type UseThreads = (options?: UseThreadsOptions | undefined) => ReturnType; type CustomThreads = (props: { editor: Editor; threads: ThreadData[] | undefined; }) => JSX.Element; type CollaborationPresence = (props: { children: ReactNode; id: string; }) => JSX.Element; type ThreadLink = (props: { children: ReactNode; threadId: string; }) => JSX.Element; export type AuthStrategy = "cookie" | "token"; export declare const EditorConfigContext: import("react").Context; export declare function useEditorConfig(): EditorConfig; export declare function useCollaborationPresenceComponent(): CollaborationPresence; export declare function throwConfigError(configKey: string): never; export declare function suppressErrors(): void; export {};