/** * Delivery overrides passed alongside an interaction's message params. `debounceMs` overrides the * interaction's default debounce for this call and enables debouncing for one that has none. * `delayMs` overrides the default delay of the immediate path. `debounceMs` wins when both are set, * and interactions without params are always immediate. * * A debounce runs on a per-call-site timer that is cancelled when the call site unmounts, which * suits a value that keeps changing in place. `delayMs` is scheduled in the announcer provider and * survives the caller unmounting, which suits a one-shot confirmation whose origin disappears. */ export type InteractionDeliveryOptions = { debounceMs?: number; delayMs?: number; }; /** * Params of each interaction announcement. Interactions without params map to `undefined`; the * others also accept {@link InteractionDeliveryOptions}. */ export type InteractionAnnouncementParams = { /** The audio playback rate changed. `rate` is the new multiplier. */ 'audioPlayer.playbackRateChanged': InteractionDeliveryOptions & { rate: number; }; /** A channel was opened from the list. `name` is its display title. */ 'channel.opened': InteractionDeliveryOptions & { name: string; }; /** A slash command was picked from the Instant Commands menu. `command` is its name. */ 'command.selected': InteractionDeliveryOptions & { command: string; }; 'giphy.canceled': undefined; 'giphy.sent': undefined; 'giphy.shuffled': InteractionDeliveryOptions & { title?: string; }; 'poll.dialogOpened': undefined; /** A poll option was dropped at a new position during keyboard reorder. */ 'poll.optionDropped': InteractionDeliveryOptions & { option: string; position: number; }; /** A poll option was picked up to start a keyboard reorder. `option` is its text or fallback. */ 'poll.optionPickedUp': InteractionDeliveryOptions & { option: string; }; 'poll.optionRemoved': InteractionDeliveryOptions & { option: string; }; 'poll.sent': undefined; 'search.cleared': undefined; 'search.resultCount': InteractionDeliveryOptions & { /** Whether every active source is fully loaded; appends an "all results loaded" clause. */ allResultsLoaded?: boolean; count: number; }; 'suggestions.count': InteractionDeliveryOptions & { count: number; suggestionsLabel?: string; }; /** A thread was opened from the list. `name` is its channel's display title. */ 'thread.opened': InteractionDeliveryOptions & { name: string; }; 'user.selected': InteractionDeliveryOptions & { user: string; }; /** A finished voice recording was added to the composer (async multi-send, not sent yet). */ 'voiceRecording.attached': undefined; 'voiceRecording.paused': undefined; 'voiceRecording.resumed': undefined; /** A finished voice recording was sent immediately as a message. */ 'voiceRecording.sent': undefined; 'voiceRecording.started': undefined; }; export type InteractionAnnouncementType = keyof InteractionAnnouncementParams; type AnnounceInteraction = { (interaction: InteractionAnnouncementParams[T] extends undefined ? T : never): void; (interaction: InteractionAnnouncementParams[T] extends undefined ? never : T, params: InteractionAnnouncementParams[T]): void; }; export type UseInteractionAnnouncementsValue = { /** Announces a predefined interaction; it maps to a localized message and a fixed priority. */ announceInteraction: AnnounceInteraction; /** * Cancels pending (debounced or delayed, not yet emitted) announcements: one `interaction`, or * all when omitted. Call it when the source is torn down so a queued message is not spoken out * of context. An announcement already emitted into the live region cannot be recalled. */ cancelInteraction: (interaction?: InteractionAnnouncementType) => void; }; /** * Typed wrapper over {@link useAriaLiveAnnouncer} for transient, user-initiated UI interactions. * Each interaction maps to an i18n key and a fixed priority, and is registered as one entry in * {@link INTERACTION_MESSAGES}. */ export declare const useInteractionAnnouncements: () => UseInteractionAnnouncementsValue; export {}; //# sourceMappingURL=useInteractionAnnouncements.d.ts.map