UNPKG

@metamask/snaps-sdk

Version:

A library containing the core functionality for building MetaMask Snaps

28 lines 1.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.heading = exports.HeadingStruct = void 0; const superstruct_1 = require("@metamask/superstruct"); const internals_1 = require("../../internals/index.cjs"); const builder_1 = require("../builder.cjs"); const nodes_1 = require("../nodes.cjs"); exports.HeadingStruct = (0, superstruct_1.assign)(nodes_1.LiteralStruct, (0, superstruct_1.object)({ type: (0, internals_1.literal)(nodes_1.NodeType.Heading), value: (0, superstruct_1.string)(), })); /** * Create a {@link Heading} node. * * @param args - The node arguments. This can either be a string, or an object * with the `value` property. * @param args.value - The heading text. * @returns The heading node as object. * @deprecated Snaps component functions are deprecated, in favor of the new JSX * components. This function will be removed in a future release. * @example * const node = heading({ value: 'Hello, world!' }); * const node = heading('Hello, world!'); */ exports.heading = (0, builder_1.createBuilder)(nodes_1.NodeType.Heading, exports.HeadingStruct, [ 'value', ]); //# sourceMappingURL=heading.cjs.map