Verwendung

Choose the input style for a prompt.

Dieser Typ wird verwendet von prompt

tsx
// Choose the input style for a prompt.
import { prompt, type PromptType } from 'kuito';

async function ask(title: string, type: PromptType) {
  const answer = await prompt({ title, type });

  return answer?.value ?? null;
}

const pin = await ask('Enter your PIN', 'password');
const login = await ask('Sign in to Wi-Fi', 'login'); // { username, password }

Typdeklaration

ts
export type PromptOptions = AlertOptions & {
  type?: PromptType;
  /** The field's starting text, as TextField's `value`; a login's username. */
  value?: string;
  /** The keyboard, as TextField's `inputMode`; a password's too, for a PIN. */
  inputMode?: Exclude<InputMode, 'none'>;
};

Mitglieder 8

NameTypErforderlichBeschreibung
titlestringJa—
messagestringNein—
buttonsreadonly AlertButton[]Nein—
cancelablebooleanNeinAndroid: tapping outside or Back dismisses the alert. False by default.
colorScheme"light" | "dark"NeiniOS: light or dark regardless of the app's appearance, as CSS's color-scheme.
typePromptTypeNein—
valuestringNeinThe field's starting text, as TextField's value; a login's username.
inputMode"search" | "text" | "email" | "tel" | "url" | "decimal" | "numeric"NeinThe keyboard, as TextField's inputMode; a password's too, for a PIN.
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.