@prismicio/client
Version:
The official JavaScript + TypeScript client library for Prismic
37 lines (35 loc) • 1.5 kB
text/typescript
import { GroupField } from "./group.cjs";
import { SliceZone } from "./sliceZone.cjs";
import { AnyRegularField, FieldState } from "./types.cjs";
//#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.cts.map