import { F as FeatureInterface, k as RoleInterface, U as UserInterface, l as UserInput, h as CompanyInterface, C as CompanyInput, N as NotificationInterface } from './notification.interface-CmKmObIU.js';
import { A as ApiDataInterface, J as JsonApiHydratedDataInterface } from './ApiDataInterface-DPP8s46n.js';
import { a as ContentInterface } from './content.interface-DFQ7mkpL.js';
import { A as ApiRequestDataTypeInterface } from './ApiRequestDataTypeInterface-CUKFDBx2.js';

declare enum HttpMethod {
    GET = "GET",
    POST = "POST",
    PUT = "PUT",
    PATCH = "PATCH",
    DELETE = "DELETE"
}
interface NextRef {
    next?: string;
}
interface PreviousRef {
    previous?: string;
}
interface SelfRef {
    self?: string;
}
/**
 * Set a global error handler for API errors (client-side only).
 * This handler will be called instead of throwing errors.
 */
declare function setGlobalErrorHandler(handler: (status: number, message: string) => void): void;
/**
 * Get the current global error handler.
 */
declare function getGlobalErrorHandler(): ((status: number, message: string) => void) | null;
/**
 * Abstract base class for services that interact with the JSON:API.
 * Extend this class to create feature-specific services.
 */
declare abstract class AbstractService {
    /**
     * Extract locale from client-side URL pathname
     * URL structure: /{locale}/route-path (e.g., /it/accounts)
     * Fallback chain: URL locale → navigator.language → "en"
     */
    private static getClientLocale;
    static next<T>(params: {
        type: ApiRequestDataTypeInterface;
        endpoint: string;
        next?: NextRef;
        previous?: PreviousRef;
        self?: SelfRef;
    }): Promise<T>;
    /**
     * Fetch the previous page of results.
     */
    static previous<T>(params: {
        type: ApiRequestDataTypeInterface;
        endpoint: string;
        next?: NextRef;
        previous?: PreviousRef;
        self?: SelfRef;
    }): Promise<T>;
    /**
     * Make an API call with automatic environment detection and error handling.
     */
    protected static callApi<T>(params: {
        type: ApiRequestDataTypeInterface;
        method: HttpMethod;
        endpoint: string;
        companyId?: string;
        input?: any;
        overridesJsonApiCreation?: boolean;
        next?: NextRef;
        previous?: PreviousRef;
        self?: SelfRef;
        responseType?: ApiRequestDataTypeInterface;
        files?: {
            [key: string]: File | Blob;
        } | File | Blob;
    }): Promise<T>;
    /**
     * Make an API call and return both data and meta from the response.
     */
    protected static callApiWithMeta<T>(params: {
        type: ApiRequestDataTypeInterface;
        method: HttpMethod;
        endpoint: string;
        companyId?: string;
        input?: any;
        overridesJsonApiCreation?: boolean;
        responseType?: ApiRequestDataTypeInterface;
        files?: {
            [key: string]: File | Blob;
        } | File | Blob;
    }): Promise<{
        data: T;
        meta?: Record<string, any>;
    }>;
    /**
     * Get raw JSON:API response data without deserialization.
     */
    protected static getRawData(params: {
        type: ApiRequestDataTypeInterface;
        method: HttpMethod;
        endpoint: string;
        companyId?: string;
    }): Promise<any>;
}

declare class FeatureService extends AbstractService {
    static findMany(params: {
        companyId?: string;
        search?: string;
        next?: NextRef;
    }): Promise<FeatureInterface[]>;
}

declare class RoleService extends AbstractService {
    static findById(params: {
        roleId: string;
    }): Promise<RoleInterface>;
    static findAllRoles(params: {
        search?: string;
        next?: NextRef;
    }): Promise<RoleInterface[]>;
    static findAllRolesByUser(params: {
        userId: string;
        search?: string;
        next?: NextRef;
        prev?: PreviousRef;
    }): Promise<RoleInterface[]>;
    static findAllRolesUserNotIn(params: {
        userId: string;
        search?: string;
        next?: NextRef;
        prev?: PreviousRef;
    }): Promise<RoleInterface[]>;
    static addUserToRole(params: {
        userId: string;
        roleId: string;
    }): Promise<void>;
    static removeUserFromRole(params: {
        userId: string;
        roleId: string;
    }): Promise<void>;
    static create(params: {
        roleId: string;
        name: string;
        description?: string;
    }): Promise<RoleInterface>;
    static update(params: {
        roleId: string;
        name: string;
        description?: string;
    }): Promise<RoleInterface>;
    static delete(params: {
        roleId: string;
    }): Promise<RoleInterface>;
}

declare class UserService extends AbstractService {
    static findFullUser(): Promise<UserInterface>;
    static findById(params: {
        userId: string;
    }): Promise<UserInterface>;
    static findByEmail(params: {
        email: string;
    }): Promise<UserInterface>;
    static findMany(params: {
        roleId?: string;
        search?: string;
        fetchAll?: boolean;
        includeDeleted?: boolean;
        next?: NextRef;
        prev?: PreviousRef;
    }): Promise<UserInterface[]>;
    static findManyByContentIds(params: {
        contentIds: string[];
        search?: string;
        next?: NextRef;
        prev?: PreviousRef;
    }): Promise<UserInterface[]>;
    static findRelevant(params: {
        id: string;
        next?: NextRef;
        prev?: PreviousRef;
    }): Promise<UserInterface[]>;
    static findManyForAmin(params: {
        companyId?: string;
        search?: string;
        next?: NextRef;
        prev?: PreviousRef;
    }): Promise<UserInterface[]>;
    static findAllUsers(params: {
        companyId: string;
        search?: string;
        limitToRoles?: string[];
        isDeleted?: boolean;
        next?: NextRef;
        prev?: PreviousRef;
    }): Promise<UserInterface[]>;
    static findAllUsersByRole(params: {
        roleId: string;
        search?: string;
        next?: NextRef;
        prev?: PreviousRef;
    }): Promise<UserInterface[]>;
    static findAllUsersNotInRole(params: {
        roleId: string;
        search?: string;
        next?: NextRef;
        prev?: PreviousRef;
    }): Promise<UserInterface[]>;
    static create(params: UserInput): Promise<UserInterface>;
    static reactivate(params: {
        userId: string;
    }): Promise<UserInterface>;
    static sendInvitation(params: {
        userId: string;
        companyId?: string;
    }): Promise<void>;
    static update(params: UserInput): Promise<UserInterface>;
    static patchRate(params: UserInput): Promise<UserInterface>;
    static delete(params: {
        userId: string;
        companyId: string;
    }): Promise<void>;
}

type AuthInput = {
    id?: string;
    email?: string | undefined | null;
    password?: string | undefined;
    name?: string;
    companyName?: string;
    partitaIva?: string;
    codiceFiscale?: string;
};
type AuthQuery = {
    userId?: string;
    tokenCode?: string;
    refreshToken?: string;
    login?: boolean;
    forgot?: boolean;
    code?: string;
    activationCode?: string;
    checkUsername?: string;
};
interface AuthInterface extends ApiDataInterface {
    get token(): string;
    get refreshToken(): string;
    get user(): UserInterface;
}

declare class AuthService extends AbstractService {
    static login(params: {
        email: string;
        password: string;
        language?: string;
    }): Promise<UserInterface>;
    static logout(params?: {
        language?: string;
    }): Promise<void>;
    static initialiseForgotPassword(params: {
        email: string;
        language?: string;
    }): Promise<void>;
    static register(params: AuthInput): Promise<void>;
    static activate(params: {
        activationCode: string;
    }): Promise<void>;
    static validateCode(params: {
        code: string;
        language?: string;
    }): Promise<void>;
    static resetPassword(params: {
        code: string;
        password: string;
    }): Promise<void>;
    static acceptInvitation(params: {
        code: string;
        password: string;
    }): Promise<void>;
    static findToken(params: {
        tokenCode: string;
    }): Promise<AuthInterface>;
    static saveToken(params: {
        dehydratedAuth: JsonApiHydratedDataInterface;
    }): Promise<void>;
}

declare class CompanyService extends AbstractService {
    static findOne(params: {
        companyId: string;
    }): Promise<CompanyInterface>;
    static findMany(params: {
        search?: string;
        next?: NextRef;
    }): Promise<CompanyInterface[]>;
    static delete(params: {
        companyId: string;
    }): Promise<void>;
    static create(params: CompanyInput): Promise<CompanyInterface>;
    static update(params: CompanyInput): Promise<CompanyInterface>;
    static updateConfigurations(params: CompanyInput): Promise<CompanyInterface>;
    static activateLicense(params: CompanyInput): Promise<CompanyInterface>;
}

declare class ContentService extends AbstractService {
    static findMany(params: {
        contentIds?: string[];
        search?: string;
        fetchAll?: boolean;
        next?: NextRef;
        prev?: PreviousRef;
    }): Promise<ContentInterface[]>;
    static findRelevant(params: {
        id: string;
        next?: NextRef;
        prev?: PreviousRef;
    }): Promise<ContentInterface[]>;
    static findManyByAuthor(params: {
        userId: string;
        search?: string;
        fetchAll?: boolean;
        next?: NextRef;
        prev?: PreviousRef;
    }): Promise<ContentInterface[]>;
}

declare class NotificationService extends AbstractService {
    static findMany(params: {
        isArchived?: boolean;
        next?: NextRef;
    }): Promise<NotificationInterface[]>;
    static markAsRead(params: {
        data: any;
    }): Promise<void>;
    static archive(params: {
        id: string;
    }): Promise<void>;
}

declare class PushService extends AbstractService {
    static register(params: {
        data: any;
    }): Promise<void>;
}

type S3Input = {
    key: string;
    contentType?: string;
};
interface S3Interface extends ApiDataInterface {
    get url(): string;
    get headers(): Record<string, string>;
}

declare class S3Service extends AbstractService {
    static getPreSignedUrl(params: {
        key: string;
        contentType: string;
        isPublic?: boolean;
    }): Promise<S3Interface>;
    static getSignedUrl(params: {
        key: string;
        isPublic?: boolean;
    }): Promise<S3Interface>;
    static deleteFile(params: {
        key: string;
    }): Promise<void>;
}

export { AbstractService as A, CompanyService as C, FeatureService as F, HttpMethod as H, type NextRef as N, type PreviousRef as P, RoleService as R, type SelfRef as S, UserService as U, type AuthInput as a, type AuthQuery as b, type AuthInterface as c, AuthService as d, ContentService as e, NotificationService as f, getGlobalErrorHandler as g, PushService as h, type S3Input as i, type S3Interface as j, S3Service as k, setGlobalErrorHandler as s };
