UNPKG

@metamask/snaps-sdk

Version:

A library containing the core functionality for building MetaMask Snaps

27 lines 1.02 kB
import { assign, object, optional, string, union } from "@metamask/superstruct"; import { enumValue, literal } from "../../internals/index.mjs"; import { LiteralStruct, NodeType } from "../nodes.mjs"; /** * This replicates the available input types from the metamask extension. * https://github.com/MetaMask/metamask-extension/main/ui/components/component-library/input/input.constants.js */ export var InputType; (function (InputType) { InputType["Text"] = "text"; InputType["Number"] = "number"; InputType["Password"] = "password"; })(InputType || (InputType = {})); export const InputStruct = assign(LiteralStruct, object({ type: literal(NodeType.Input), value: optional(string()), name: string(), inputType: optional(union([ enumValue(InputType.Text), enumValue(InputType.Password), enumValue(InputType.Number), ])), placeholder: optional(string()), label: optional(string()), error: optional(string()), })); //# sourceMappingURL=input.mjs.map