import { BooleanField } from "./boolean.js"; import { ColorField } from "./color.js"; import { GroupField } from "./group.js"; import { ContentRelationshipField } from "./contentRelationship.js"; import { DateField } from "./date.js"; import { GeoPointField } from "./geoPoint.js"; import { ImageField } from "./image.js"; import { IntegrationField } from "./integration.js"; import { KeyTextField } from "./keyText.js"; import { LinkToMediaField } from "./linkToMedia.js"; import { LinkField } from "./link.js"; import { NumberField } from "./number.js"; import { SelectField } from "./select.js"; import { TableField } from "./table.js"; import { TimestampField } from "./timestamp.js"; import { TitleField } from "./title.js"; import { EmbedField } from "./embed.js"; import { RichTextField } from "./richText.js"; //#region src/types/value/types.d.ts /** Empty state for object-shaped fields. */ type EmptyObjectField = Record; /** Valid states for fields. Not all fields use this type (e.g. BooleanField). */ type FieldState = "empty" | "filled"; /** Any regular field that can be nested in a group-like field. */ type AnyRegularField = TitleField | RichTextField | ImageField | ContentRelationshipField | LinkField | Repeatable | LinkToMediaField | EmbedField | DateField | TimestampField | ColorField | NumberField | KeyTextField | SelectField | BooleanField | GeoPointField | IntegrationField | TableField; /** Any field that can be used in a slice's primary section. */ type AnySlicePrimaryField = GroupField | AnyRegularField; /** A list of repeatable fields. */ type Repeatable = State extends "empty" ? [] : [WithKey, ...WithKey[]]; /** Wrapper to add a key to a field when inside a repeatable. */ type WithKey = Field & { key: string; }; /** * Useful to flatten the type output to improve type hints shown in editors. And also to transform * an interface into a type to aide with assignability. * * Taken from the `type-fest` package. * * @typeParam T - The type to simplify. * @see https://github.com/sindresorhus/type-fest/blob/cbd7ec510bd136ac045bbc74e391ee686b8a9a2f/source/simplify.d.ts */ type Simplify = { [P in keyof T]: T[P] }; //#endregion export { AnyRegularField, AnySlicePrimaryField, EmptyObjectField, FieldState, Repeatable, Simplify }; //# sourceMappingURL=types.d.ts.map