[TS] Fix alerts API types

This commit is contained in:
Beef 2023-04-06 00:08:48 +01:00
parent 5461065db8
commit cfdee54d8e
3 changed files with 12 additions and 13 deletions

22
src/def.d.ts vendored
View file

@ -63,22 +63,22 @@ export enum ButtonColors {
} }
interface ConfirmationAlertOptions { interface ConfirmationAlertOptions {
title: string | undefined; title?: string;
content: string | JSX.Element | JSX.Element[]; content: string | JSX.Element | JSX.Element[];
confirmText: string | undefined; confirmText?: string;
confirmColor: ButtonColors | undefined; confirmColor?: ButtonColors;
onConfirm: () => void; onConfirm: () => void;
cancelText: string | undefined; cancelText?: string;
} }
interface InputAlertProps { interface InputAlertProps {
title: string | undefined; title?: string;
confirmText: string | undefined; confirmText?: string;
confirmColor: ButtonColors | undefined; confirmColor?: ButtonColors;
onConfirm: (input: string) => void | Promise<void>; onConfirm: (input: string) => (void | Promise<void>);
cancelText: string | undefined; cancelText?: string;
placeholder: string | undefined; placeholder?: string;
initialValue: string | undefined; initialValue?: string;
} }
interface Author { interface Author {

View file

@ -26,7 +26,6 @@ export default function InstallButton({ alertTitle, installFunction: fetchFuncti
placeholder: "https://example.com/", placeholder: "https://example.com/",
onConfirm: (input: string) => fetchFunction(input), onConfirm: (input: string) => fetchFunction(input),
confirmText: "Install", confirmText: "Install",
confirmColor: undefined,
cancelText: "Cancel" cancelText: "Cancel"
}) })
) )

View file

@ -1,5 +1,5 @@
import { ButtonColors, Theme } from "@types"; import { ButtonColors, Theme } from "@types";
import { ReactNative as RN, clipboard } from "@metro/common"; import { clipboard } from "@metro/common";
import { fetchTheme, removeTheme, selectTheme } from "@lib/themes"; import { fetchTheme, removeTheme, selectTheme } from "@lib/themes";
import { BundleUpdaterManager } from "@lib/native"; import { BundleUpdaterManager } from "@lib/native";
import { getAssetIDByName } from "@ui/assets"; import { getAssetIDByName } from "@ui/assets";