UNPKG

seyfert

Version:

The most advanced framework for discord bots

55 lines (54 loc) 1.67 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Separator = void 0; const types_1 = require("../types"); const Base_1 = require("./Base"); /** * Represents a separator component builder. * Used to add visual spacing or dividers between components. * @example * ```ts * // A simple separator for spacing * const spacingSeparator = new Separator().setSpacing(Spacing.Small); * * // A separator acting as a visual divider * const dividerSeparator = new Separator().setDivider(true); * ``` */ class Separator extends Base_1.BaseComponentBuilder { /** * Constructs a new Separator component. * @param data Optional initial data for the separator component. */ constructor(data = {}) { super({ type: types_1.ComponentType.Separator, ...data }); } /** * Sets the ID for the separator component. * @param id The ID to set. * @returns The updated Separator instance. */ setId(id) { this.data.id = id; return this; } /** * Sets whether this separator should act as a visual divider. * @param divider Whether to render as a divider (defaults to false). * @returns The updated Separator instance. */ setDivider(divider = false) { this.data.divider = divider; return this; } /** * Sets the amount of spacing this separator provides. * @param spacing The desired spacing level ('None', 'Small', 'Medium', 'Large'). * @returns The updated Separator instance. */ setSpacing(spacing) { this.data.spacing = spacing; return this; } } exports.Separator = Separator;