/** * 频道状态呈现原子:时间戳格式化、状态摘要/状态点、per-channel 测试按钮、失败徽标。 * * statusMap / sendTest / t 由调用方显式传入:原子层不读卡片状态,否则「搬走的函数捕获的仍是 * 旧 state」这类闭包语义变化不会有任何编译期信号。 */ import * as React from "react"; import type { Translate } from "../../locale.js"; import type { HistoryRecordView } from "../types.js"; import type { Tone } from "../../../../shared/client/ui/index.js"; /** 频道状态表(键 = 频道 id;/status 载荷逐项透传,读侧只取自己认识的字段)。 */ interface ChannelStatus { lastTs?: number; lastStatus?: string; lastError?: unknown; lastSoundWarning?: unknown; } export type ChannelStatusMap = Record; export declare function padTime(ts: number): string; /** 频道状态摘要(上提卡头 statusDot + statusTxt;完整错误经 title 提示)。 */ export declare function statusText(channelKey: string, statusMap: ChannelStatusMap, t: Translate, history?: HistoryRecordView[] | null): string; /** * 频道状态点(R2:状态点本体上提到跨包原语层 shared/client/ui 的 Status)。 * * 为什么改口径:原来这里返回的是**本包领域类名**(""/ "ok" / "fail"),色值与尺寸全在 * notifier 自己的 style.css 里。档 C 原语层把这层「圆点 + 三档色调」收成一处,跨包可复用, * 故本函数改为返回原语的语义档 Tone,呈现交给 。 * * 映射逐条对应旧类名,行为不变:无终态条目 = off(原 "",即中性灰);ok = ok; * 其余(含 skipped 等非 ok 值)= err(原 "fail")。 * 部分声音失败(ok + 合法 lastSoundWarning)= warn:lastStatus / failStreak 不动, * 只是状态点如实呈现「成功但提示音未出」(不属于策略扩展,无新状态值)。 * 视觉差异(有意接受,收敛的代价):点径 7px→8px、off 档底色由 border-l2 换成 * label-tertiary、右侧多 6px 外边距(原样式表里没有)。三处都是原语层的统一口径, * 换来的是这一个圆点不再有第二份实现。 */ export declare function statusTone(channelKey: string, statusMap: ChannelStatusMap): Tone; /** 状态点渲染原子(三张频道卡共用)。装饰点语义:可访问名由旁边的状态文字承担。 */ export declare function statusDot(channelKey: string, statusMap: ChannelStatusMap): React.JSX.Element; /** * per-channel 测试按钮:dirty 时切文案 + 脏徽标 + title(#912 症状1 B-S1-3)。 * dirty 缺省 false——无脏时渲染与此前逐字一致(client-dom 旧断言不动)。 */ export declare function testBtn(channelId: string | undefined, sendTest: (id?: string) => void, t: Translate, dirty?: boolean): React.JSX.Element; /** * 删除二次确认按钮:bark / webhook / 内置三张卡的这段逐字相同(一次点击上膛,3 秒后自动 * 解除),故收成一个原子——三处各留一份时,改确认时长只会改到其中一张卡。 * * 定时器仍在 onClick 闭包里就地创建(不持 ref、不走 effect):这三张卡都不持有 state/ref, * 上膛状态由 SettingsCard 顶层的 delArmedId 反传,闭包捕获的只有 setter 与 id。 */ export declare function delArmedBtn(armed: boolean, channelId: string, remove: () => void, setArmedId: (v: string | null) => void, t: Translate): React.JSX.Element; /** 投递失败徽标:最近投递失败时上提至卡头 summary 行,收起态仍可见。 */ export declare function failBadge(channelKey: string, statusMap: ChannelStatusMap, t: Translate): React.JSX.Element | null; export {};