import { Result } from "@webiny/feature/api"; import type { AdminUser } from "../../../features/users/shared/types.js"; import { AdminUsersRepository } from "../../../features/users/shared/abstractions.js"; import { NotAuthorizedError } from "../../../features/users/shared/errors.js"; import { CannotDeleteOwnAccountError } from "./errors.js"; export interface IDeleteUserErrors { notAuthorized: NotAuthorizedError; cannotDeleteOwnAccount: CannotDeleteOwnAccountError; } export type DeleteUserError = IDeleteUserErrors[keyof IDeleteUserErrors] | AdminUsersRepository.Error; export interface IDeleteUser { execute(id: string): Promise>; } /** Delete an admin user. */ export declare const DeleteUserUseCase: import("@webiny/di").Abstraction; export declare namespace DeleteUserUseCase { type Interface = IDeleteUser; type Error = DeleteUserError; } export interface UserBeforeDeletePayload { user: AdminUser; } export interface UserAfterDeletePayload { user: AdminUser; }