@metamask/snaps-sdk
Version:
A library containing the core functionality for building MetaMask Snaps
25 lines • 999 B
JavaScript
import { assign, object, string, optional, union } from "@metamask/superstruct";
import { AddressStruct } from "./address.mjs";
import { ImageStruct } from "./image.mjs";
import { TextStruct } from "./text.mjs";
import { enumValue, literal } from "../../internals/index.mjs";
import { LiteralStruct, NodeType } from "../nodes.mjs";
export var RowVariant;
(function (RowVariant) {
RowVariant["Default"] = "default";
RowVariant["Critical"] = "critical";
RowVariant["Warning"] = "warning";
})(RowVariant || (RowVariant = {}));
// A subset of components made available to the row
const RowComponentStruct = union([ImageStruct, TextStruct, AddressStruct]);
export const RowStruct = assign(LiteralStruct, object({
type: literal(NodeType.Row),
variant: optional(union([
enumValue(RowVariant.Default),
enumValue(RowVariant.Critical),
enumValue(RowVariant.Warning),
])),
label: string(),
value: RowComponentStruct,
}));
//# sourceMappingURL=row.mjs.map