/** * 资源墙(Venue Wall)共用工具:六态键、默认色板、倒计时文案、卡片状态推导、配色合并与 diff。 */ import type { RecordBoardResourceWallCardModel } from '../../types'; export declare type VenueWallStatusKey = 'inUse' | 'endingSoon' | 'expired' | 'available' | 'boardingSoon' | 'late'; /** 单态展示配置(与 {@link VENUE_WALL_STATUS_COLOR_MAP} 值同形) */ export declare type VenueWallStatusTone = { key: VenueWallStatusKey; label: string; note: string; color: string; noteBg: string; }; /** 仅覆盖部分字段;用于 Control Panel / localStorage */ export declare type VenueWallStatusToneOverrides = Partial>>; /** 单外观(浅 / 深)下的占用/空闲色与六态覆盖;持久化时 light、dark 各存一份 */ export declare type VenueWallAppearanceSlot = { occupiedCardColor?: string; availableCardColor?: string; statusToneOverrides?: VenueWallStatusToneOverrides; }; export declare type VenueWallAppearanceTheme = { light?: VenueWallAppearanceSlot; dark?: VenueWallAppearanceSlot; }; export declare const VENUE_WALL_STATUS_KEYS: VenueWallStatusKey[]; /** * 六态默认色与占位英文;`getVenueWallStatusToneMap` 会将 label/note 换为 i18n,此处仅作 merge 基底。 */ export declare const VENUE_WALL_STATUS_COLOR_MAP: Record; /** 将 `#RGB` / `#RRGGBB` 转为 `rgba(...)`,供渐变与半透明底 */ export declare function alphaColor(hex: string, alpha: number): string; /** 将数值限制在 [min, max](布局行列、主文案比例等) */ export declare const clamp: (value: number, min: number, max: number) => number; /** 由卡片字段推导状态键(与演示页 test.tsx 规则一致) */ export declare function deriveVenueWallStatus(card: RecordBoardResourceWallCardModel): VenueWallStatusKey; /** * ToolBar Sort 写入的 `searchParams.sort`(如 `status:asc:string`)拆出字段名与升降序。 */ export declare function parseRecordBoardToolbarSortParam(sort: unknown): { field: string; dir: 'asc' | 'desc'; } | null; /** 当 Sort 字段名匹配这些 key(忽略大小写)时,资源墙按占用态重排卡片 */ export declare const DEFAULT_RESOURCE_WALL_STATUS_SORT_FIELD_KEYS: string[]; export declare function matchesResourceWallStatusSortField(sortField: string, keys: readonly string[]): boolean; /** * 用于资源墙排序:占用/将结/已结束为 1,其余为 0(与 {@link deriveVenueWallStatus} 一致)。 * asc → 空闲侧在前;desc → 占用侧在前。 */ export declare function venueWallOccupiedSortRank(card: RecordBoardResourceWallCardModel): 0 | 1; export declare function formatDurationHM(minAbs: number): string; /** * 将「剩余/超支分钟数」格式化为跑码条/主副标题用短文案(走 i18n 模板,负值表示 overtime)。 */ export declare function formatVenueWallCountdown(min: number): string; /** * 合并默认六态配色与业务覆盖,供 {@link VenueWallCard} 与 Control Panel 表单初值共用。 */ export declare function getVenueWallStatusToneMap(overrides?: VenueWallStatusToneOverrides | null): Record; /** * 将编辑后的完整六态表压成「相对默认」的 overrides,便于持久化与 props 传递。 */ export declare function diffVenueWallStatusToneOverrides(draft: Record): VenueWallStatusToneOverrides;