UNPKG

@prismicio/client

Version:

The official JavaScript + TypeScript client library for Prismic

199 lines (198 loc) 8.17 kB
import { ColorField } from "../types/value/color.js"; import { GroupField, NestedGroupField } from "../types/value/group.js"; import { SharedSlice } from "../types/value/sharedSlice.js"; import { Slice } from "../types/value/slice.js"; import { SliceZone } from "../types/value/sliceZone.js"; import { ContentRelationshipField, EmptyContentRelationshipField } from "../types/value/contentRelationship.js"; import { DateField } from "../types/value/date.js"; import { AnyOEmbed, EmbedField } from "../types/value/embed.js"; import { GeoPointField } from "../types/value/geoPoint.js"; import { ImageField, ImageFieldImage } from "../types/value/image.js"; import { KeyTextField } from "../types/value/keyText.js"; import { LinkToMediaField } from "../types/value/linkToMedia.js"; import { LinkField } from "../types/value/link.js"; import { NumberField } from "../types/value/number.js"; import { RichTextField } from "../types/value/richText.js"; import { SelectField } from "../types/value/select.js"; import { TableField } from "../types/value/table.js"; import { TimestampField } from "../types/value/timestamp.js"; import { TitleField } from "../types/value/title.js"; import { AnyRegularField, Repeatable } from "../types/value/types.js"; import { IntegrationField, IntegrationFieldData } from "../types/value/integration.js"; //#region src/helpers/isFilled.d.ts declare namespace isFilled_d_exports { export { color, contentRelationship, date, embed, geoPoint, group, image, imageThumbnail, integration, integrationField, integrationFields, keyText, link, linkToMedia, number, repeatable, richText, select, sliceZone, table, timestamp, title }; } /** * Determines if a rich text field is filled. * * @param field - rich text field to check. * * @returns `true` if `field` is filled, `false` otherwise. */ declare const richText: (field: RichTextField | null | undefined) => field is RichTextField<"filled">; /** * Determines if a title field is filled. * * @param field - Title field to check. * * @returns `true` if `field` is filled, `false` otherwise. */ declare const title: (field: TitleField | null | undefined) => field is TitleField<"filled">; /** * Determines if an image thumbnail is filled. * * @param thumbnail - Image thumbnail to check. * * @returns `true` if the thumbnail is filled, `false` otherwise. */ declare const imageThumbnail: (thumbnail: ImageFieldImage | null | undefined) => thumbnail is ImageFieldImage<"filled">; /** * Determines if an image field is filled. * * @param field - Image field to check. * * @returns `true` if `field` is filled, `false` otherwise. */ declare const image: <ThumbnailNames extends string | null = never>(field: ImageField<ThumbnailNames> | null | undefined) => field is ImageField<ThumbnailNames, "filled">; /** * Determines if a link field is filled. * * @param field - Link field to check. * * @returns `true` if `field` is filled, `false` otherwise. */ declare const link: <TypeEnum = string, LangEnum = string, DataInterface extends Record<string, AnyRegularField | GroupField | SliceZone> | unknown = unknown>(field: LinkField<TypeEnum, LangEnum, DataInterface> | null | undefined) => field is LinkField<TypeEnum, LangEnum, DataInterface, "filled">; /** * Determines if a link to media field is filled. * * @param field - Link to media field to check. * * @returns `true` if `field` is filled, `false` otherwise. */ declare const linkToMedia: (field: LinkToMediaField | null | undefined) => field is LinkToMediaField<"filled">; /** * Determines if a content relationship field is filled. * * @param field - Content relationship field to check. * * @returns `true` if the field is filled, `false` otherwise. */ declare const contentRelationship: <Field extends ContentRelationshipField>(field: Field | null | undefined) => field is Exclude<Field, EmptyContentRelationshipField>; /** * Determines if a date field is filled. * * @param field - Date field to check. * * @returns `true` if `field` is filled, `false` otherwise. */ declare const date: (field: DateField | null | undefined) => field is DateField<"filled">; /** * Determines if a timestamp field is filled. * * @param field - Timestamp field to check. * * @returns `true` if `field` is filled, `false` otherwise. */ declare const timestamp: (field: TimestampField | null | undefined) => field is TimestampField<"filled">; /** * Determines if a color field is filled. * * @param field - Color field to check. * * @returns `true` if `field` is filled, `false` otherwise. */ declare const color: (field: ColorField | null | undefined) => field is ColorField<"filled">; /** * Determines if a number field is filled. * * @param field - Number field to check. * * @returns `true` if `field` is filled, `false` otherwise. */ declare const number: (field: NumberField | null | undefined) => field is NumberField<"filled">; /** * Determines if a key text field is filled. * * @param field - Key text field to check. * * @returns `true` if the field is filled, `false` otherwise. */ declare const keyText: (field: KeyTextField | null | undefined) => field is KeyTextField<"filled">; /** * Determines if a select field is filled. * * @param field - Select field to check. * * @returns `true` if `field` is filled, `false` otherwise. */ declare const select: <Enum extends string>(field: SelectField<Enum> | null | undefined) => field is SelectField<Enum, "filled">; /** * Determines if an embed field is filled. * * @param field - Embed field to check. * * @returns `true` if `field` is filled, `false` otherwise. */ declare const embed: <Field extends EmbedField<AnyOEmbed>>(field: Field | null | undefined) => field is Extract<Field, EmbedField<AnyOEmbed, "filled">>; /** * Determines if a geopoint field is filled. * * @param field - Geopoint field to check. * * @returns `true` if the field is filled, `false` otherwise. */ declare const geoPoint: (field: GeoPointField | null | undefined) => field is GeoPointField<"filled">; /** * Determines if a table field is filled. * * @param field - Table field to check. * * @returns `true` if `field` is filled, `false` otherwise. */ declare const table: (field: TableField | null | undefined) => field is TableField<"filled">; /** * Determines if an integration field is filled. * * @param field - Integration field to check. * * @returns `true` if `field` is filled, `false` otherwise. */ declare const integration: <Data extends IntegrationFieldData>(field: IntegrationField<Data> | null | undefined) => field is IntegrationField<Data, "filled">; /** * @deprecated Renamed to `integration`. */ declare const integrationField: <Data extends IntegrationFieldData>(field: IntegrationField<Data> | null | undefined) => field is IntegrationField<Data, "filled">; /** * @deprecated Renamed to `integrationField`. */ declare const integrationFields: <Data extends IntegrationFieldData>(field: IntegrationField<Data> | null | undefined) => field is IntegrationField<Data, "filled">; /** * Determines if a repeatable field has at least one item. * * @param repeatable - Repeatable to check. * * @returns `true` if `repeatable` contains at least one item, `false` * otherwise. */ declare const repeatable: <T extends LinkField>(repeatable: Repeatable<T> | null | undefined) => repeatable is Repeatable<T, "filled">; /** * Determines if a group has at least one item. * * @param group - Group to check. * * @returns `true` if the group contains at least one item, `false` otherwise. */ declare const group: <Fields extends Record<string, AnyRegularField | NestedGroupField>>(group: GroupField<Fields> | null | undefined) => group is GroupField<Fields, "filled">; /** * Determines if a slice zone has at least one slice. * * @param slices - Slice zone to check. * * @returns `true` if the slice zone contains at least one slice, `false` * otherwise. */ declare const sliceZone: <Slices extends Slice | SharedSlice>(slices: SliceZone<Slices> | null | undefined) => slices is SliceZone<Slices, "filled">; //#endregion export { isFilled_d_exports }; //# sourceMappingURL=isFilled.d.ts.map