import { GroupField } from "./group.js"; import { SliceZone } from "./sliceZone.js"; import { FilledContentRelationshipField } from "./contentRelationship.js"; import { FilledLinkToMediaField } from "./linkToMedia.js"; import { AnyRegularField, FieldState } from "./types.js"; //#region src/types/value/link.d.ts /** Link types */ declare const LinkType: { readonly Any: "Any"; readonly Document: "Document"; readonly Media: "Media"; readonly Web: "Web"; }; /** * A 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 via the `fetchLinks` or * `graphQuery` query parameter). * @typeParam State - State of the field which determines its shape. * @typeParam Variant - Variants of the link. */ type LinkField | unknown = unknown, State extends FieldState = FieldState, Variant = string> = State extends "empty" ? EmptyLinkField : FilledLinkField; /** * A link field that is filled. * * @typeParam TypeEnum - Type API ID of the document. * @typeParam LangEnum - Language API ID of the document. * @typeParam DataInterface - Data fields for the document (filled via the `fetchLinks` or * `graphQuery` query parameter). * @typeParam Variant - Variants of the link. */ type FilledLinkField | unknown = unknown, Variant = string> = (FilledContentRelationshipField & OptionalLinkProperties) | FilledLinkToMediaField | FilledLinkToWebField; /** * A link field that is not filled. * * @typeParam _Unused - THIS PARAMETER IS NOT USED. If you are passing a type, * **please remove it**. * @typeParam Variant - Variants of the link. */ type EmptyLinkField<_Unused extends (typeof LinkType)[keyof typeof LinkType] = typeof LinkType.Any, Variant = string> = { link_type: "Any"; } & OptionalLinkProperties; /** * A link field pointing to a relative or absolute URL. * * @typeParam Variant - Variants of the link. */ type FilledLinkToWebField = { link_type: "Web"; url: string; target?: string; } & OptionalLinkProperties; /** * Optional properties available to link fields. It is used to augment existing link-like fields * (like content relationship fields) with field-specific properties. * * @typeParam Variant - Variants of the link. * @internal */ type OptionalLinkProperties = { text?: string; variant?: Variant; }; //#endregion export { EmptyLinkField, FilledLinkField, FilledLinkToWebField, LinkField, LinkType, OptionalLinkProperties }; //# sourceMappingURL=link.d.ts.map