import { DateField } from "../types/value/date.js"; import { TimestampField } from "../types/value/timestamp.js"; //#region src/helpers/asDate.d.ts /** The return type of `asDate()`. */ type AsDateReturnType = Field extends DateField<"filled"> | TimestampField<"filled"> ? Date : null; /** * Converts a date or timestamp field to a JavaScript Date object. * * @example * ;```ts * const date = asDate(document.data.release_date) * // => Date object or null * ``` * * @param dateOrTimestampField - A date or timestamp field from Prismic. * @returns A Date object, or `null` if the field is empty. * @see Learn about date and timestamp fields: {@link https://prismic.io/docs/fields/date} */ declare const asDate: (dateOrTimestampField: Field) => AsDateReturnType; //#endregion export { asDate }; //# sourceMappingURL=asDate.d.ts.map