@prismicio/types-internal
Version:
Prismic types for Custom Types and Prismic Data
22 lines (21 loc) • 709 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BooleanField = exports.BooleanConfig = exports.BooleanFieldType = void 0;
const tslib_1 = require("tslib");
const t = (0, tslib_1.__importStar)(require("io-ts"));
const validators_1 = require("../../../validators");
exports.BooleanFieldType = "Boolean";
exports.BooleanConfig = t.exact(t.partial({
label: validators_1.StringOrNull,
default_value: t.boolean,
placeholder_true: t.string,
placeholder_false: t.string,
}));
exports.BooleanField = t.exact(t.intersection([
t.type({
type: t.literal(exports.BooleanFieldType),
}),
t.partial({
config: exports.BooleanConfig,
}),
]));