import { FieldSchema, StructureSchema } from '@ephox/boulder';
import * as Fields from '../data/Fields';
const base = (partSchemas, partUidsSchemas) => {
    const ps = partSchemas.length > 0 ? [
        FieldSchema.requiredObjOf('parts', partSchemas)
    ] : [];
    return ps.concat([
        FieldSchema.required('uid'),
        FieldSchema.defaulted('dom', {}),
        FieldSchema.defaulted('components', []),
        Fields.snapshot('originalSpec'),
        FieldSchema.defaulted('debug.sketcher', {})
    ]).concat(partUidsSchemas);
};
const asRawOrDie = (label, schema, spec, partSchemas, partUidsSchemas) => {
    const baseS = base(partSchemas, partUidsSchemas);
    return StructureSchema.asRawOrDie(label + ' [SpecSchema]', StructureSchema.objOfOnly(baseS.concat(schema)), spec);
};
export { asRawOrDie };
//# sourceMappingURL=SpecSchema.js.map