Typescript

This commit is contained in:
Mitchell McCaffrey
2021-07-13 08:59:28 +10:00
parent 49b8caa2d7
commit 569ed696fc
26 changed files with 298 additions and 138 deletions

View File

@@ -12,21 +12,7 @@ import { Map } from "../types/Map";
import { Group, GroupContainer } from "../types/Group";
import { MapState } from "../types/MapState";
import { Token } from "../types/Token";
type SelectDataProps = {
isOpen: boolean;
onRequestClose: () => void;
onConfirm: (
checkedMaps: SelectData[],
checkedTokens: SelectData[],
checkedMapGroups: Group[],
checkedTokenGroups: Group[]
) => void;
confirmText: string;
label: string;
databaseName: string;
filter: (table: string, data: Map | MapState | Token, id: string) => boolean;
};
import { RequestCloseEventHandler } from "../types/Events";
export type SelectData = {
name: string;
@@ -35,6 +21,23 @@ export type SelectData = {
checked: boolean;
};
export type ConfirmDataEventHandler = (
checkedMaps: SelectData[],
checkedTokens: SelectData[],
checkedMapGroups: Group[],
checkedTokenGroups: Group[]
) => void;
type SelectDataProps = {
isOpen: boolean;
onRequestClose: RequestCloseEventHandler;
onConfirm: ConfirmDataEventHandler;
confirmText: string;
label: string;
databaseName: string;
filter: (table: string, data: Map | MapState | Token, id: string) => boolean;
};
type DataRecord = Record<string, SelectData>;
function SelectDataModal({