/** * #block.ts * * Code generated by ts-proto. DO NOT EDIT. * @packageDocumentation */ import type { BlockAction, BlockAlignment, BlockBorder, BlockColor, BlockSize, BlockSizes } from "./attributes.js"; import type { BlockAnimationDirection, BlockAnimationLoopMode, BlockAnimationType, BlockAvatarBackground, BlockAvatarFacing, BlockAvatarSize, BlockButtonAppearance, BlockButtonSize, BlockFullSnooSize, BlockGap, BlockIconSize, BlockImageResizeMode, BlockPadding, BlockRadius, BlockSpacerShape, BlockSpacerSize, BlockStackDirection, BlockTextOutline, BlockTextOverflow, BlockTextSize, BlockTextStyle, BlockTextWeight, BlockType } from "./enums.js"; export type Block = { type: BlockType; /** * @deprecated Use sizes instead * Common attributes * * @deprecated */ size?: BlockSize | undefined; /** Size constraints */ sizes?: BlockSizes | undefined; /** Block-specific config */ config?: BlockConfig | undefined; /** List of possible actions */ actions: BlockAction[]; /** * Unique identifier for the block, if we have one. This is designed to * facilitate component re-use. * * If this is not set, the block is considered to be a new instance of a * component, or the client may use heuristics to determine if the component * appears similar enough to reuse. */ id?: string | undefined; /** * Key for the block, if we have one. This is designed to handle * component re-ordering within a list or parent. * * Keys are not required to be unique, but they should be stable across * re-orderings of the same list or parent. */ key?: string | undefined; }; export type BlockConfig = { rootConfig?: BlockConfig_Root | undefined; stackConfig?: BlockConfig_Stack | undefined; textConfig?: BlockConfig_Text | undefined; buttonConfig?: BlockConfig_Button | undefined; imageConfig?: BlockConfig_Image | undefined; spacerConfig?: BlockConfig_Spacer | undefined; iconConfig?: BlockConfig_Icon | undefined; avatarConfig?: BlockConfig_Avatar | undefined; fullsnooConfig?: BlockConfig_FullSnoo | undefined; animationConfig?: BlockConfig_Animation | undefined; webviewConfig?: BlockConfig_WebView | undefined; }; export type BlockConfig_Root = { children: Block[]; /** Height of the UI */ height: number; }; export type BlockConfig_Stack = { /** How blocks should be laid out in this stack */ direction: BlockStackDirection; /** Blocks to layout in the stack */ children: Block[]; /** Stack the child blocks in reverse order */ reverse?: boolean | undefined; /** Horizontal and vertical alignment of elements within the stack */ alignment?: BlockAlignment | undefined; /** Distance between child elements and the container border */ padding?: BlockPadding | undefined; /** Distance between child elements */ gap?: BlockGap | undefined; /** Display a border around the stack */ border?: BlockBorder | undefined; /** Round the corners of the stack */ cornerRadius?: BlockRadius | undefined; /** * Set a custom background color for the stack * @deprecated Use background_colors instead * * @deprecated */ backgroundColor?: string | undefined; /** Set a custom background color for the stack */ backgroundColors?: BlockColor | undefined; }; export type BlockConfig_Text = { text: string; size?: BlockTextSize | undefined; weight?: BlockTextWeight | undefined; /** * @deprecated use colors instead * * @deprecated */ color?: string | undefined; alignment?: BlockAlignment | undefined; outline?: BlockTextOutline | undefined; style?: BlockTextStyle | undefined; selectable?: boolean | undefined; colors?: BlockColor | undefined; wrap?: boolean | undefined; overflow?: BlockTextOverflow | undefined; }; export type BlockConfig_Button = { text?: string | undefined; icon?: string | undefined; buttonSize?: BlockButtonSize | undefined; buttonAppearance?: BlockButtonAppearance | undefined; /** * @deprecated use text_colors instead * * @deprecated */ textColor?: string | undefined; /** * @deprecated use background_colors instead * * @deprecated */ backgroundColor?: string | undefined; disabled?: boolean | undefined; textColors?: BlockColor | undefined; backgroundColors?: BlockColor | undefined; }; export type BlockConfig_Image = { /** URL to the image */ url: string; /** Target width, in pixels */ width: number; /** Target height, in pixels */ height: number; /** Description for accessibility */ description?: string | undefined; /** How to resize the image if the target resolution can't be achieved */ resizeMode?: BlockImageResizeMode | undefined; }; export type BlockConfig_Spacer = { size?: BlockSpacerSize | undefined; shape?: BlockSpacerShape | undefined; }; export type BlockConfig_Icon = { icon: string; /** * @deprecated use colors instead * * @deprecated */ color?: string | undefined; size?: BlockIconSize | undefined; colors?: BlockColor | undefined; }; export type BlockConfig_Avatar = { thingId: string; facing?: BlockAvatarFacing | undefined; size?: BlockAvatarSize | undefined; background?: BlockAvatarBackground | undefined; }; /** @deprecated */ export type BlockConfig_FullSnoo = { userId: string; facing?: BlockAvatarFacing | undefined; size?: BlockFullSnooSize | undefined; }; export type BlockConfig_Animation = { /** URL to the animation */ url: string; /** Target width, in pixels */ width: number; /** Target height, in pixels */ height: number; /** Type of player needed */ type: BlockAnimationType; /** Set loop mode. Defaults to true. */ loop?: boolean | undefined; /** How looping should occur */ loopMode?: BlockAnimationLoopMode | undefined; /** Autoplay the animation as soon as it's loaded */ autoplay?: boolean | undefined; /** Playback speed multiplier, when supported by type */ speed?: number | undefined; /** Play the animation forward or backward, when supported by type */ direction?: BlockAnimationDirection | undefined; }; export type BlockConfig_WebView = { /** URL to load in the webview */ url: string; /** State to pass in to the webview */ state?: { [key: string]: any; } | undefined; }; //# sourceMappingURL=block.d.ts.map