import type { FieldState, AnyRegularField } from "./types"; import type { GroupField } from "./group"; import type { SliceZone } from "./sliceZone"; import type { ContentRelationshipField } from "./contentRelationship"; import type { LinkToMediaField } from "./linkToMedia"; /** * Link Types */ export declare const LinkType: { readonly Any: "Any"; readonly Document: "Document"; readonly Media: "Media"; readonly Web: "Web"; }; /** * For link fields that haven't been filled * * @typeParam Type - The type of link. */ export type EmptyLinkField = { link_type: Type | string; }; /** * Link that points to external website */ export interface FilledLinkToWebField { link_type: typeof LinkType.Web; url: string; target?: string; } /** * Link Field * * @typeParam TypeEnum - Type API ID of the document. * @typeParam LangEnum - Language API ID of the document. * @typeParam DataInterface - Data fields for the document (filled in via * GraphQuery of `fetchLinks`). * @typeParam State - State of the field which determines its shape. */ export type LinkField | unknown = unknown, State extends FieldState = FieldState> = State extends "empty" ? EmptyLinkField : ContentRelationshipField | FilledLinkToWebField | LinkToMediaField;