import { type RequestButtonRouteBinding, type RequestButtonScope, type RequestButtonStyle } from "./request-button.js"; export declare const COMPONENT_LAYOUT_KINDS: readonly ["container", "link-row", "request-row", "separator", "text"]; export declare const COMPONENT_SEPARATOR_SPACING: readonly ["large", "small"]; export declare const COMPONENT_LAYOUT_LIMITS: Readonly<{ componentId: 4294967295; components: 40; serializedBytes: 16384; textCharacters: 4000; }>; export declare const DISCORD_COMPONENT_TYPES: Readonly<{ actionRow: 1; button: 2; container: 17; separator: 14; textDisplay: 10; }>; export declare const DISCORD_BUTTON_STYLES: Readonly<{ danger: number; primary: number; secondary: number; success: number; link: 5; }>; export declare const DISCORD_SEPARATOR_SPACING: Readonly<{ large: 2; small: 1; }>; export type ComponentLayoutKind = typeof COMPONENT_LAYOUT_KINDS[number]; export type ComponentSeparatorSpacing = typeof COMPONENT_SEPARATOR_SPACING[number]; export interface ComponentTextInput { content: string; kind: "text"; } export interface ComponentSeparatorInput { divider?: boolean; kind: "separator"; spacing?: ComponentSeparatorSpacing; } export interface ComponentLinkButtonInput { label: string; url: string; } export interface ComponentLinkRowInput { buttons: readonly ComponentLinkButtonInput[]; kind: "link-row"; } export interface ComponentRequestButtonInput { label: string; style?: RequestButtonStyle; } export interface ComponentRequestRowInput { buttons: readonly ComponentRequestButtonInput[]; kind: "request-row"; } export interface ComponentContainerInput { accentColor?: number; components: readonly (ComponentLinkRowInput | ComponentRequestRowInput | ComponentTextInput | ComponentSeparatorInput)[]; kind: "container"; spoiler?: boolean; } export type ComponentLayoutInput = ComponentContainerInput | ComponentLinkRowInput | ComponentRequestRowInput | ComponentSeparatorInput | ComponentTextInput; export interface NormalizedComponentText { content: string; kind: "text"; } export interface NormalizedComponentSeparator { divider: boolean; kind: "separator"; spacing: ComponentSeparatorSpacing; } export interface NormalizedComponentLinkButton { label: string; url: string; } export interface NormalizedComponentLinkRow { buttons: NormalizedComponentLinkButton[]; kind: "link-row"; } export interface NormalizedComponentRequestButton { label: string; style: RequestButtonStyle; } export interface NormalizedComponentRequestRow { buttons: NormalizedComponentRequestButton[]; kind: "request-row"; } export interface NormalizedComponentContainer { accentColor: number | null; components: (NormalizedComponentLinkRow | NormalizedComponentRequestRow | NormalizedComponentText | NormalizedComponentSeparator)[]; kind: "container"; spoiler: boolean; } export type NormalizedComponent = NormalizedComponentContainer | NormalizedComponentLinkRow | NormalizedComponentRequestRow | NormalizedComponentSeparator | NormalizedComponentText; export type NormalizedComponentLayout = NormalizedComponent[]; export interface DiscordTextDisplayComponent { content: string; type: 10; } export interface DiscordSeparatorComponent { divider: boolean; spacing: 1 | 2; type: 14; } export interface DiscordLinkButtonComponent { label: string; style: 5; type: 2; url: string; } export interface DiscordRequestButtonComponent { custom_id: string; label: string; style: 1 | 2 | 3 | 4; type: 2; } export interface DiscordActionRowComponent { components: DiscordLinkButtonComponent[] | DiscordRequestButtonComponent[]; type: 1; } export interface DiscordContainerComponent { accent_color?: number; components: (DiscordActionRowComponent | DiscordTextDisplayComponent | DiscordSeparatorComponent)[]; spoiler: boolean; type: 17; } export type DiscordStaticComponent = DiscordActionRowComponent | DiscordContainerComponent | DiscordSeparatorComponent | DiscordTextDisplayComponent; export interface ComponentLayoutCounts { actionRows: number; containers: number; linkButtons: number; requestButtons: number; separators: number; textDisplays: number; topLevel: number; total: number; } export interface ComponentLayoutReview { counts: ComponentLayoutCounts; layout: NormalizedComponentLayout; linkOrigins: string[]; linkUrls: string[]; mentionedUserIds: string[]; notificationUserIds: string[]; preview: string; suppressedUserMentionIds: string[]; textCharacters: number; warnings: string[]; } export interface ComponentLayoutRequestButtonBinding { binding: RequestButtonRouteBinding; key: Uint8Array; } export interface ComponentLayoutRequestButtonVerification { key: Uint8Array; operationKeyHash?: string; scope: RequestButtonScope; } export interface ManagedRequestButton { customId: string; index: number; label: string; route: string; style: RequestButtonStyle; } export interface ParsedManagedComponentLayout { layout: NormalizedComponentLayout; requestButtons: ManagedRequestButton[]; route: string | null; } export declare function normalizeComponentLayout(input: unknown): NormalizedComponentLayout; export declare function compileComponentLayout(layout: NormalizedComponentLayout, requestButtons?: ComponentLayoutRequestButtonBinding): DiscordStaticComponent[]; export declare function assertCompiledComponentLayout(input: unknown): asserts input is DiscordStaticComponent[]; export declare function parseDiscordManagedComponentLayout(input: unknown, requestButtonVerification?: ComponentLayoutRequestButtonVerification): ParsedManagedComponentLayout; export declare function parseDiscordComponentLayout(input: unknown, requestButtonVerification?: ComponentLayoutRequestButtonVerification): NormalizedComponentLayout; export declare function componentLayoutsEqual(left: NormalizedComponentLayout, right: NormalizedComponentLayout): boolean; export declare function componentLayoutHasRequestButtons(layout: NormalizedComponentLayout): boolean; export declare function componentLayoutText(layout: NormalizedComponentLayout): string; export declare function componentLayoutTextCharacters(layout: NormalizedComponentLayout): number; export declare function componentLayoutCounts(layout: NormalizedComponentLayout): ComponentLayoutCounts; export declare function reviewComponentLayout(input: unknown, requestedNotificationUserIds: readonly string[] | undefined): ComponentLayoutReview; //# sourceMappingURL=component-layout.d.ts.map