import type { AccountFormInputs, AssetFormInputs, FixedIncomeTypeFormInputs, GroupTransactionFormInputs, ServiceProviderFeeTypeFormInputs, SPVFormInputs } from "./form.js";
import type { Account, FixedIncome, FixedIncomeType, GroupTransaction, ServiceProviderFeeType, SPV } from "./state.js";
import type { TableDataByTableName, TableName } from "./table.js";
export type FormInputsByTableName = {
    ASSET: AssetFormInputs;
    TRANSACTION: GroupTransactionFormInputs;
    ACCOUNT: AccountFormInputs;
    FIXED_INCOME_TYPE: FixedIncomeTypeFormInputs;
    SERVICE_PROVIDER_FEE_TYPE: ServiceProviderFeeTypeFormInputs;
    SPV: SPVFormInputs;
};
export type ActionOutputByTableName = {
    ASSET: FixedIncome;
    TRANSACTION: GroupTransaction;
    ACCOUNT: Account;
    FIXED_INCOME_TYPE: FixedIncomeType;
    SERVICE_PROVIDER_FEE_TYPE: ServiceProviderFeeType;
    SPV: SPV;
};
interface CreateOrEditAction<TOperation extends "CREATE" | "EDIT", TTableName extends TableName> {
    type: `${TOperation}_${TTableName}`;
    payload: FormInputsByTableName[TTableName];
}
interface DeleteAction<TTableName extends TableName> {
    type: `DELETE_${TTableName}`;
    payload: {
        id: string;
    };
}
export type EditorAction = CreateOrEditAction<"CREATE", TableName> | CreateOrEditAction<"EDIT", TableName> | DeleteAction<TableName>;
export type ActionOutputFor<A extends EditorAction> = A["type"] extends `${infer Action}_${infer Entity}` ? Action extends "DELETE" ? undefined : ActionOutputByTableName[Entity & keyof ActionOutputByTableName] : never;
export type TableNameFor<A extends EditorAction> = A["type"] extends `${infer _Action}_${infer Entity}` ? Entity & keyof TableDataByTableName : never;
export type EditorDispatcher = <TEditorAction extends EditorAction>(action: TEditorAction) => ActionOutputFor<TEditorAction>;
export {};
//# sourceMappingURL=actions.d.ts.map