import { Result } from "@webiny/feature/api"; import type { AdminUser } from "../../../features/users/shared/types.js"; import type { CreateUserInput } from "../../../features/users/shared/types.js"; import { AdminUsersRepository } from "../../../features/users/shared/abstractions.js"; import { NotAuthorizedError, EmailTakenError, UserValidationError } from "../../../features/users/shared/errors.js"; export interface ICreateUserErrors { notAuthorized: NotAuthorizedError; userExists: EmailTakenError; validation: UserValidationError; } type CreateUserError = ICreateUserErrors[keyof ICreateUserErrors] | AdminUsersRepository.Error; export interface ICreateUser { execute(input: CreateUserInput): Promise>; } /** Create a new admin user. */ export declare const CreateUserUseCase: import("@webiny/di").Abstraction; export declare namespace CreateUserUseCase { type Interface = ICreateUser; type Input = CreateUserInput; type Error = CreateUserError; } export interface UserBeforeCreatePayload { user: AdminUser; input: CreateUserInput; } export interface UserAfterCreatePayload { user: AdminUser; input: CreateUserInput; } export {};