@prismicio/types-internal
Version:
Prismic types for Custom Types and Prismic Data
39 lines (32 loc) • 708 B
text/typescript
import * as t from "io-ts"
import { StringOrNull } from "../../../validators"
import { RichTextNodeType } from "./RichText"
export const TableFieldType = "Table"
const TableConfig = t.exact(
t.partial({
label: StringOrNull,
}),
)
export type TableConfig = t.TypeOf<typeof TableConfig>
export const Table = t.exact(
t.intersection([
t.type({
type: t.literal(TableFieldType),
}),
t.partial({
config: TableConfig,
}),
]),
)
export type Table = t.TypeOf<typeof Table>
export const TableCell = {
type: "StructuredText" as const,
config: {
multi: [
RichTextNodeType.paragraph,
RichTextNodeType.strong,
RichTextNodeType.em,
RichTextNodeType.hyperlink,
].join(","),
},
}