1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var type_validate_1 = require("../type-validate");
|
4 | var ContextualSaveBar_1 = require("../../actions/ContextualSaveBar");
|
5 | exports.ActionType = ContextualSaveBar_1.ActionType;
|
6 | var utils_1 = require("../utils");
|
7 | exports.contextSaveBarSchema = type_validate_1.makeOptional(type_validate_1.matchesObject({
|
8 | discardAction: type_validate_1.makeOptional(type_validate_1.matchesObject({
|
9 | disabled: type_validate_1.makeOptional(type_validate_1.matchesBoolean()),
|
10 | discardConfirmationModal: type_validate_1.makeOptional(type_validate_1.matchesBoolean()),
|
11 | })),
|
12 | saveAction: type_validate_1.makeOptional(type_validate_1.matchesObject({
|
13 | disabled: type_validate_1.makeOptional(type_validate_1.matchesBoolean()),
|
14 | })),
|
15 | }));
|
16 | function validateProps(props) {
|
17 | return type_validate_1.validate(props, exports.contextSaveBarSchema);
|
18 | }
|
19 | exports.validateProps = validateProps;
|
20 | function validateAction(action) {
|
21 | var validator = utils_1.createActionValidator(ContextualSaveBar_1.ActionType, exports.contextSaveBarSchema);
|
22 | return type_validate_1.validate(action, validator);
|
23 | }
|
24 | exports.validateAction = validateAction;
|