import type { PluginListenerHandle } from '@capacitor/core'; /** * Colors are CSS color strings resolved on the web side from the chat theme * variables, so the native bar matches light/dark mode and the in-app palette. */ export interface NativeInputTheme { /** Bar / text field background. From `--chat-input-bg`. */ inputBackground?: string; /** Text + caret color. From `--chat-input-text`. */ text?: string; /** Placeholder color. */ placeholder?: string; /** Accent used for the "+" button. From `--accent`. */ accent?: string; /** Send button background. From `--chat-sent-bg`. */ sendBackground?: string; /** Send button glyph color. From `--chat-sent-text`. */ sendText?: string; /** Whether the app is currently in dark mode (drives the glass/blur tint). */ dark?: boolean; } export interface PresentOptions { /** Identifies the active chat so re-presents for a different chat reset text. */ chatId: string; placeholder?: string; /** Pre-fill text (e.g. a half-typed draft when re-mounting). */ text?: string; /** When false, the field is read-only and the send button is disabled. */ canSend?: boolean; theme?: NativeInputTheme; } export interface NativeInputPlugin { /** Create + show the native input bar pinned above the keyboard. */ present(options: PresentOptions): Promise; /** Remove the native input bar. */ dismiss(): Promise; setText(options: { text: string }): Promise; getText(): Promise<{ text: string }>; focus(): Promise; blur(): Promise; setPlaceholder(options: { placeholder: string }): Promise; setEnabled(options: { enabled: boolean }): Promise; setTheme(options: { theme: NativeInputTheme }): Promise; /** Hide/show without tearing down (e.g. when navigating away briefly). */ setVisible(options: { visible: boolean }): Promise; /** Fires on every text edit. */ addListener(eventName: 'inputChange', listenerFunc: (data: { text: string }) => void): Promise; /** Fires when the user taps send / hits the send key. */ addListener(eventName: 'send', listenerFunc: (data: { text: string }) => void): Promise; /** Fires when the "+" attach button is tapped. */ addListener(eventName: 'attach', listenerFunc: () => void): Promise; /** Fires on focus / blur of the native field. */ addListener(eventName: 'focusChange', listenerFunc: (data: { focused: boolean }) => void): Promise; /** * Fires when the space the bar (and keyboard) occupies changes, in CSS px, * so the web layout can pad its scroll area / position the reply strip. */ addListener(eventName: 'heightChange', listenerFunc: (data: { bottomInset: number }) => void): Promise; removeAllListeners(): Promise; }