@tef-novum/webview-bridge
Version:
JavaScript library to access to native functionality. Requires a webview with a postMessage bridge.
32 lines (31 loc) • 1.45 kB
TypeScript
import { type SnackbarResponse } from './post-message';
export declare const nativeConfirm: ({ message, title, acceptText, cancelText, destructive, }: {
message: string;
title?: string | undefined;
acceptText: string;
cancelText: string;
destructive?: boolean | undefined;
}) => Promise<boolean>;
export declare const nativeAlert: ({ message, title, buttonText, }: {
message: string;
title?: string | undefined;
buttonText: string;
}) => Promise<void>;
export declare const nativeMessage: ({ message, duration, buttonText, buttonAccessibilityLabel, type, withDismiss, }: {
message: string;
/**
* By default, the snackbar auto dismisses after 5s or 10s (if it has buttonText)
* PERSISTENT: the snackbar won't dismiss without user interaction
* number: deprecated, this is ignored by native app and default values are used instead
*/
duration?: number | "PERSISTENT" | undefined;
buttonText?: string | undefined;
buttonAccessibilityLabel?: string | undefined;
type?: "INFORMATIVE" | "CRITICAL" | "SUCCESS" | undefined;
/**
* When true, the snackbar will have a dismiss button. By default is false.
* If the snackbar has duration: "PERSISTENT" and doesn't have buttonText, the
* dismiss button is always shown, regardless of this attribute value.
*/
withDismiss?: boolean | undefined;
}) => Promise<SnackbarResponse>;