import { type ResponseGenerator, type MockHandler, type SetupWorkerOptions, type InterceptOptions, type SerializedRequest } from '@jarrodek/amw';
import { ModelingMock } from '../mocking/ModelingMock.js';
export interface MockResult {
    /**
     * Custom response generator for the mock intercept.
     */
    response?: ResponseGenerator;
    /**
     * If true, the request body will be generated using the body generator.
     * It is useful when only setting up response headers or status code, but
     * the request body should still be generated, even when missing in the `response` option.
     */
    forceBody?: boolean;
}
export interface MockListResult extends MockResult {
    /**
     * Number of items to generate in the list response.
     */
    size?: number;
    /**
     * If true, the response will include a cursor for pagination.
     * If false, the response will not include a cursor.
     * If not set, a random choice will be made.
     */
    cursor?: boolean;
}
/**
 * SDK mocking utility for testing. Uses Service Workers to intercept HTTP requests
 * and provide mock responses for API calls.
 *
 * This class uses the `@jarrodek/amw` library to set up a Service Worker that intercepts
 * fetch requests matching the configured routes. Each method adds an intercept for a specific
 * API endpoint, returning either random generated data or custom responses.
 *
 * @example
 * ```typescript
 * import { SdkMock } from '@api-client/core/sdk/SdkMock.js';
 * import { StoreSdk } from '@api-client/core/sdk/StoreSdkWeb.js';
 *
 * const sdk = new StoreSdk('http://localhost:8080');
 * const mocker = new SdkMock({
 *   swPath: '/mockServiceWorker.js', // Path to the Service Worker script
 *   base: 'http://localhost:8080'    // Base URL matching the SDK
 * });
 *
 * // Initialize the Service Worker
 * await mocker.setup();
 *
 * // Add intercept - returns random organizations
 * await mocker.organizations.list();
 *
 * // Custom response with specific data
 * await mocker.organizations.create({
 *   response: {
 *     status: 201,
 *     headers: { 'Content-Type': 'application/json', 'X-Custom-Header': 'value' },
 *     body: JSON.stringify({ key: 'custom-id', name: 'Custom Org' })
 *   }
 * });
 *
 * // Control pagination in list responses
 * await mocker.groups.list({
 *   size: 10,        // Number of items to generate
 *   cursor: true     // Include pagination cursor
 * });
 *
 * // Error simulation
 * await mocker.users.me({
 *   response: {
 *     status: 404,
 *     headers: { 'Content-Type': 'application/json' },
 *     body: JSON.stringify({ error: 'Not found' })
 *   }
 * });
 *
 * // Remove all intercepts (keep Service Worker active)
 * await mocker.reset();
 *
 * // Stop and remove the Service Worker
 * await mocker.teardown();
 * ```
 *
 * @TODO: Add a in-memory state store so that mocks can maintain state across requests.
 * This way, operations like create, update, delete can affect subsequent list/read calls
 * and we can mimic the API behavior more closely.
 */
export declare class SdkMock {
    options?: SetupWorkerOptions | undefined;
    handler?: MockHandler;
    gen: ModelingMock;
    constructor(options?: SetupWorkerOptions | undefined);
    /**
     * Initializes the mock handler. It uses options provided in the constructor.
     * It has to be called before using any of the mock methods.
     */
    setup(): Promise<void>;
    /**
     * Removes the mock worker and all intercepts.
     */
    teardown(): Promise<void>;
    /**
     * Removes all added intercepts.
     */
    reset(): Promise<void>;
    get mock(): MockHandler;
    protected createCursorOption(init?: MockListResult): string | undefined;
    protected createDefaultResponse(status: number, headers?: Record<string, string>, body?: (req: SerializedRequest) => string, userConfig?: MockResult): ResponseGenerator;
    /**
     * Organization API mocks.
     */
    organizations: {
        /**
         * Adds an intercept to mock the `organizations.list()` method.
         * @param options Optional response configuration
         */
        list: (init?: MockListResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Adds an intercept to mock the `organizations.create()` method.
         * @param options Optional response configuration
         */
        create: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        invitations: {
            list: (init?: MockListResult, options?: InterceptOptions) => Promise<void>;
            create: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
            findByToken: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
            decline: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
            delete: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
            patch: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
            resend: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        };
        users: {
            list: (init?: MockListResult, options?: InterceptOptions) => Promise<void>;
            read: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
            readBatch: (init?: MockListResult, options?: InterceptOptions) => Promise<void>;
            activate: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
            deactivate: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
            delete: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        };
    };
    /**
     * Group API mocks.
     */
    groups: {
        /**
         * Mocks the `groups.list()` method.
         * @param options Optional response customization.
         */
        list: (init?: MockListResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `groups.create()` method.
         * @param options Optional response customization.
         */
        create: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `groups.update()` method.
         * @param options Optional response customization.
         */
        update: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `groups.delete()` method.
         * @param options Optional response customization.
         */
        delete: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `groups.addUsers()` method.
         */
        addUsers: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `groups.removeUsers()` method.
         */
        removeUsers: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
    };
    /**
     * User API mocks.
     */
    users: {
        /**
         * Mocks the `user.me()` method.
         * @param options Optional response customization.
         */
        me: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
    };
    /**
     * Files API mocks.
     */
    files: {
        /**
         * Mocks the `file.list()` method.
         */
        list: (init?: MockListResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.createMeta()` method.
         */
        createMeta: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.createMedia()` method.
         */
        createMedia: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.create()` method.
         */
        create: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.createFolder()` method.
         */
        createFolder: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.read()` method.
         */
        read: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.readMedia()` method.
         */
        readMedia: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.readBulk()` method.
         */
        readBulk: (init?: MockListResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.patch()` method.
         */
        patch: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.patchMedia()` method.
         */
        patchMedia: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.delete()` method.
         */
        delete: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.deleteBulk()` method.
         */
        deleteBulk: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.patchUsers()` method.
         */
        patchUsers: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.addUser()` method.
         */
        addUser: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.removeUser()` method.
         */
        removeUser: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.listUsers()` method.
         */
        listUsers: (init?: MockListResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.breadcrumbs()` method.
         */
        breadcrumbs: (init?: MockListResult, options?: InterceptOptions) => Promise<void>;
    };
    /**
     * @deprecated Use `files` instead.
     */
    file: {
        /**
         * Mocks the `file.list()` method.
         */
        list: (init?: MockListResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.createMeta()` method.
         */
        createMeta: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.createMedia()` method.
         */
        createMedia: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.create()` method.
         */
        create: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.createFolder()` method.
         */
        createFolder: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.read()` method.
         */
        read: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.readMedia()` method.
         */
        readMedia: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.readBulk()` method.
         */
        readBulk: (init?: MockListResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.patch()` method.
         */
        patch: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.patchMedia()` method.
         */
        patchMedia: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.delete()` method.
         */
        delete: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.deleteBulk()` method.
         */
        deleteBulk: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.patchUsers()` method.
         */
        patchUsers: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.addUser()` method.
         */
        addUser: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.removeUser()` method.
         */
        removeUser: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.listUsers()` method.
         */
        listUsers: (init?: MockListResult, options?: InterceptOptions) => Promise<void>;
        /**
         * Mocks the `file.breadcrumbs()` method.
         */
        breadcrumbs: (init?: MockListResult, options?: InterceptOptions) => Promise<void>;
    };
    /**
     * Shared API mocks.
     */
    shared: {
        list: (init?: MockListResult, options?: InterceptOptions) => Promise<void>;
    };
    /**
     * Trash API mocks.
     */
    trash: {
        list: (init?: MockListResult, options?: InterceptOptions) => Promise<void>;
        delete: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        restore: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        empty: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
    };
    /**
     * Trash Data Catalog mocks.
     */
    dataCatalog: {
        list: (init?: MockListResult, options?: InterceptOptions) => Promise<void>;
        listVersions: (init?: MockListResult, options?: InterceptOptions) => Promise<void>;
        publish: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        read: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        deprecate: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        unpublish: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        publishVersion: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        readVersion: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        listDependencies: (init?: MockListResult, options?: InterceptOptions) => Promise<void>;
        deprecateVersion: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        unpublishVersion: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
        checkPublicationStatus: (init?: MockResult, options?: InterceptOptions) => Promise<void>;
    };
}
//# sourceMappingURL=SdkMock.d.ts.map