mirror of
https://github.com/bitbaum/chatkit.git
synced 2026-12-04 06:07:44 +01:00
The empty box's send slot records a voice message in the box's place; one tap sends it. A voice note plays in the thread in the bubble's own colours. AAC in MP4 first, so every phone plays it. Its length travels with it. Fix: the timer rounded to 0:01 at half a second and a short take was dropped without a word. Claude-Session: https://claude.ai/code/session_019MDtmsmMXvM981mcszxEA6 Co-authored-by: Claude <noreply@anthropic.com>
58 lines
2.4 KiB
TypeScript
58 lines
2.4 KiB
TypeScript
import { type ReactNode } from "react";
|
|
import { type MessengerAttachment } from "../messenger.js";
|
|
import type { MessengerLabels } from "./messenger-labels.js";
|
|
/**
|
|
* A face in the Messenger. A person is a circle, an agent a rounded square:
|
|
* the shape says which before any word is read. Without a picture, a person
|
|
* is their initials and an agent is `fallback` (the product's own mark, or
|
|
* the package's).
|
|
*/
|
|
export declare function MessengerAvatar({ name, src, agent, size, online, fallback, }: {
|
|
name: string;
|
|
src?: string | null;
|
|
agent?: boolean;
|
|
size?: "sm" | "md" | "lg";
|
|
online?: boolean;
|
|
fallback?: ReactNode;
|
|
}): import("react").JSX.Element;
|
|
/** The playback speeds a voice note offers, in turn. */
|
|
export declare const VOICE_SPEEDS: readonly [1, 1.5, 2];
|
|
/**
|
|
* A recording on a message: play, where it is, how long, how fast. The
|
|
* browser's own audio control is a different size and colour in every
|
|
* browser, needs no less than 300px to be usable, and on a phone hides the
|
|
* length until it is played; this is one row, the same everywhere.
|
|
*
|
|
* Nothing is loaded until Play: a thread of fifty voice notes costs nothing
|
|
* to open.
|
|
*/
|
|
export declare function VoiceNote({ attachment, labels, }: {
|
|
attachment: MessengerAttachment;
|
|
labels: MessengerLabels;
|
|
}): import("react").JSX.Element;
|
|
/**
|
|
* What was sent with a message: pictures and films as tiles (one large, more
|
|
* as a grid) that open in the viewer, a recording as a player, anything else
|
|
* as a row that downloads. A film is drawn as its still and loads nothing
|
|
* until it is opened.
|
|
*/
|
|
export declare function MessageAttachments({ attachments, labels, caption, }: {
|
|
attachments: readonly MessengerAttachment[];
|
|
labels: MessengerLabels;
|
|
/** Shown in the viewer under the picture: who sent it, and when. */
|
|
caption?: string;
|
|
}): import("react").JSX.Element;
|
|
/**
|
|
* A picture or a film, the whole screen. A native `<dialog>`: Escape, the
|
|
* focus trap and focus coming back to the tile are the browser's. Left and
|
|
* right move through what the message carried.
|
|
*/
|
|
export declare function MediaViewer({ media, index, onIndex, onClose, labels, caption, }: {
|
|
media: readonly MessengerAttachment[];
|
|
index: number;
|
|
onIndex: (index: number) => void;
|
|
onClose: () => void;
|
|
labels: MessengerLabels;
|
|
caption?: string;
|
|
}): import("react").JSX.Element;
|
|
//# sourceMappingURL=MessageAttachments.d.ts.map
|