Files
dbx/apps/desktop/src/lib/sidebar/sidebarDangerDialog.ts
T

38 lines
932 B
TypeScript

import type { SidebarActionTarget } from "@/lib/sidebar/sidebarActionTarget";
export interface SidebarDangerDialogOption {
checked: boolean;
label: string;
hint: string;
onChange?: (checked: boolean) => void | Promise<void>;
}
export interface SidebarDangerDialogProgress {
completed: number;
total: number;
}
export interface SidebarDangerDialogTextInput {
value: string;
label: string;
placeholder?: string;
inputMode?: "text" | "numeric";
onInput?: (value: string) => void | Promise<void>;
}
export interface SidebarDangerDialogRequest {
target: SidebarActionTarget;
title: string;
message: string;
confirmLabel: string;
sql?: string;
details?: string;
detailsText?: string;
loading?: boolean;
closeOnConfirm?: boolean;
progress?: SidebarDangerDialogProgress;
option?: SidebarDangerDialogOption;
textInput?: SidebarDangerDialogTextInput;
confirm: () => void | Promise<void>;
}