tg-bot-ts/src/ui/types.ts
2026-06-11 05:17:29 +01:00

28 lines
No EOL
990 B
TypeScript

/**
* UI types — shared interfaces for all UI modules.
*/
import { EmbedBuilder } from "discord.js";
import { PollState, VoteEntry, Nation } from "@types";
// ─── Poll ─────────────────────────────────────────────────────────────────────
export interface PollRowContext {
nationHasRank: boolean;
nationHasDelta: boolean;
showNationEmoji?: boolean;
historyKey?: string
}
export interface PollEmbedOptions {
overrideLockMsg?: string;
showScoreButton?: boolean;
}
export interface PollLayout {
name: string;
description: string;
buildEmbed(state: PollState, options?: PollEmbedOptions): EmbedBuilder;
formatRow(entry: VoteEntry, context: PollRowContext): string;
buildContext(entries: VoteEntry[], nation: Nation, options?: { showNationEmoji?: boolean }): PollRowContext;
}