@metamask/snaps-sdk
Version:
A library containing the core functionality for building MetaMask Snaps
28 lines • 1.3 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RowStruct = exports.RowVariant = void 0;
const superstruct_1 = require("@metamask/superstruct");
const address_1 = require("./address.cjs");
const image_1 = require("./image.cjs");
const text_1 = require("./text.cjs");
const internals_1 = require("../../internals/index.cjs");
const nodes_1 = require("../nodes.cjs");
var RowVariant;
(function (RowVariant) {
RowVariant["Default"] = "default";
RowVariant["Critical"] = "critical";
RowVariant["Warning"] = "warning";
})(RowVariant || (exports.RowVariant = RowVariant = {}));
// A subset of components made available to the row
const RowComponentStruct = (0, superstruct_1.union)([image_1.ImageStruct, text_1.TextStruct, address_1.AddressStruct]);
exports.RowStruct = (0, superstruct_1.assign)(nodes_1.LiteralStruct, (0, superstruct_1.object)({
type: (0, internals_1.literal)(nodes_1.NodeType.Row),
variant: (0, superstruct_1.optional)((0, superstruct_1.union)([
(0, internals_1.enumValue)(RowVariant.Default),
(0, internals_1.enumValue)(RowVariant.Critical),
(0, internals_1.enumValue)(RowVariant.Warning),
])),
label: (0, superstruct_1.string)(),
value: RowComponentStruct,
}));
//# sourceMappingURL=row.cjs.map