@prismicio/types-internal
Version:
Prismic types for Custom Types and Prismic Data
25 lines (24 loc) • 941 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Number = exports.NumberConfig = exports.NumberFieldType = void 0;
const tslib_1 = require("tslib");
const t = (0, tslib_1.__importStar)(require("io-ts"));
const NumberFromString_1 = require("io-ts-types/lib/NumberFromString");
const validators_1 = require("../../../validators");
exports.NumberFieldType = "Number";
exports.NumberConfig = t.exact(t.partial({
label: validators_1.StringOrNull,
placeholder: t.string,
min: t.union([t.number, NumberFromString_1.NumberFromString]),
max: t.union([t.number, NumberFromString_1.NumberFromString]),
step: t.union([t.number, NumberFromString_1.NumberFromString]),
}));
exports.Number = t.exact(t.intersection([
t.type({
type: t.literal(exports.NumberFieldType),
}),
t.partial({
fieldset: validators_1.StringOrNull,
config: exports.NumberConfig,
}),
]));