@prismicio/client
Version:
The official JavaScript + TypeScript client library for Prismic
34 lines (33 loc) • 1.49 kB
TypeScript
import { GroupField } from "./group.js";
import { SliceZone } from "./sliceZone.js";
import { AnyRegularField, FieldState } from "./types.js";
//#region src/types/value/contentRelationship.d.ts
/**
* Field for related documents
*
* @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.
*/
type ContentRelationshipField<TypeEnum = string, LangEnum = string, DataInterface extends Record<string, AnyRegularField | GroupField | SliceZone> | unknown = unknown, State extends FieldState = FieldState> = State extends "empty" ? EmptyContentRelationshipField : FilledContentRelationshipField<TypeEnum, LangEnum, DataInterface>;
type EmptyContentRelationshipField = {
link_type: "Any";
};
/** Links that refer to documents */
interface FilledContentRelationshipField<TypeEnum = string, LangEnum = string, DataInterface extends Record<string, AnyRegularField | GroupField | SliceZone> | unknown = unknown> {
link_type: "Document";
id: string;
uid?: string;
type: TypeEnum;
tags: string[];
lang: LangEnum;
url?: string;
slug?: string;
isBroken?: boolean;
data?: DataInterface;
}
//#endregion
export { ContentRelationshipField, EmptyContentRelationshipField, FilledContentRelationshipField };
//# sourceMappingURL=contentRelationship.d.ts.map