@tef-novum/webview-bridge
Version:
JavaScript library to access to native functionality. Requires a webview with a postMessage bridge.
81 lines (80 loc) • 1.97 kB
TypeScript
import { type SheetResponse } from './post-message';
export declare type SheetRowItem = Readonly<{
id: string;
tag?: {
type?: 'promo' | 'info' | 'active' | 'inactive' | 'success' | 'warning' | 'error';
text: string;
};
title?: string;
description?: string;
icon?: Readonly<{
url: string;
urlDark?: string;
size?: 'large' | 'small';
}>;
}>;
export declare type SheetActionItem = Readonly<{
id: string;
title: string;
style?: 'normal' | 'destructive';
icon?: Readonly<{
url: string;
urlDark?: string;
}>;
}>;
declare type InfoIcon = Readonly<{
url: string;
urlDark?: string;
type: 'regular' | 'small';
}> | Readonly<{
type: 'bullet';
}>;
export declare type SheetInfoItem = Readonly<{
id: string;
title: string;
description?: string;
icon: InfoIcon;
}>;
declare type SheetUIElement = Readonly<{
id: string;
type: 'LIST';
listType: 'SINGLE_SELECTION';
autoSubmit?: boolean;
selectedIds: Array<string>;
items: Array<SheetRowItem>;
}> | Readonly<{
id: string;
type: 'LIST';
listType: 'ACTIONS';
autoSubmit?: boolean;
selectedIds: Array<string>;
items: Array<SheetActionItem>;
}> | Readonly<{
id: string;
type: 'LIST';
listType: 'INFORMATIVE';
autoSubmit?: boolean;
selectedIds: Array<string>;
items: Array<SheetInfoItem>;
}> | Readonly<{
id: string;
type: 'BOTTOM_ACTIONS';
button: {
text: string;
};
secondaryButton?: {
text: string;
};
link?: {
text: string;
withChevron?: boolean;
};
}>;
declare type SheetUI = Readonly<{
title?: string;
subtitle?: string;
description?: string;
content: Array<SheetUIElement>;
}>;
export declare const bottomSheet: (payload: SheetUI) => Promise<SheetResponse>;
export {};