@prismicio/types-internal
Version:
Prismic types for Custom Types and Prismic Data
26 lines (21 loc) • 506 B
text/typescript
import * as t from "io-ts"
import { StringOrNull } from "../../../validators"
export const GeoPointFieldType = "GeoPoint"
export const GeoPointConfig = t.exact(
t.partial({
label: StringOrNull,
}),
)
export type GeoPointConfig = t.TypeOf<typeof GeoPointConfig>
export const GeoPoint = t.exact(
t.intersection([
t.type({
type: t.literal(GeoPointFieldType),
}),
t.partial({
fieldset: StringOrNull,
config: GeoPointConfig,
}),
]),
)
export type GeoPoint = t.TypeOf<typeof GeoPoint>