import { TwinfinityInfo, BimContainer, BimContainerInfo, BimChangeIfc, BimChange } from '../bim-api-client';
import { TypedResponse } from '../../http';
import { TwinfinityApiClient } from './TwinfinityApiClient';
import { LayerApiClient } from './LayerApiClient';
import { MessageApiClient } from './MessageApiClient';
import { UploadApiClient } from './UploadApiClient';
import { Writeable } from '../../Types';
import { SettingsApiClient } from './SettingsApiClient';
import { MapBoxApiClient } from './MapBoxApiClient';
import type { TwinfinityApiOptions } from './TwinfinityApiOptions';
import { TwinClient } from '@twinfinity/twin';
/**
 * Enhances a {@link BimChange} dto with calculated properties.
 * When a {@link BimChange} dto is received from the backend, it may not contain all the properties that we need
 * so we calculate them here.
 *
 * @param dto - The {@link BimChange} object to enhance.
 * @hidden
 * @internal
 * @returns The enhanced {@link BimChange} object.
 */
export declare function enhanceChangeDtoWithCalculatedProperties<T extends BimChange>(dto: T): T;
/**
 * Enhances a {@link BimContainer} object with calculated properties.
 * When a {@link BimContainer} dto is received from the backend, it may not contain all the properties that we need
 * so we calculate them here.
 * @param dto - The {@link BimContainer} object to enhance.
 * @hidden
 * @internal
 * @returns The enhanced {@link BimContainer} object.
 */
export declare function enhancedContainerDtoWithCalculatedProperties(dto: Writeable<BimContainer>): BimContainer;
/**
 * Loads container and IFC data from the Twinfinity backend.
 */
export declare class BimTwinfinityApiClient implements TwinfinityApiClient {
    private static readonly _predefinedRootUrls;
    readonly baseUrl: URL;
    private readonly _rootWebUrls;
    /**
     * Access to layer operations.
     */
    readonly layers: LayerApiClient;
    /**
     * Access to message operations.
     */
    readonly messages: MessageApiClient;
    /**
     * Access to upload operations.
     */
    readonly upload: UploadApiClient;
    /**
     * Access to settings operations.
     */
    readonly settings: SettingsApiClient;
    /**
     * Access to MapBox operations.
     */
    readonly mapBox: MapBoxApiClient;
    /**
     * Access to twin operations.
     */
    readonly twins: TwinClient;
    /**
     * Constructor
     * @param baseUrl Url to twinfinity. Example: https://bim.demo.projektstruktur.se or https://bim.demo.projektstruktur.se/sites/portal/projects/projectA
     */
    constructor(baseUrl: URL | URL[], options?: TwinfinityApiOptions);
    private getHttpClient;
    /**
     * Creates a new instance of `BimTwinfinityApiClient` by detecting available root URLs for the current user.
     * @example
     * ```typescript
     * const client = await BimTwinfinityApiClient.create('demo.projektstruktur.se');
     * if (client == null) {
     *   console.log('User does not have access to any root URLs.');
     *   return;
     * }
     * const containers = await client.getContainers(); // Fetch containers from all available root URLs.
     * console.log(containers);
     * ```
     * @param hostnameOrUrl Hostname of the Twinfinity installation. If the hostname does not start with `bim.` it will be added automatically.
     * Its ok to pass a full URL too, but only the hostname is used. Scheme is always set to `https`.
     * @param options Optional session used to get authorization header for requests.
     * @returns A promise that resolves to a new instance of `BimTwinfinityApiClient`. If no root URLs are detected, the promise resolves to `undefined`.
     * `undefined` indicates that the user is not authorized or does not have access to any Twinfinity resources.
     */
    static create(hostnameOrUrl: string | URL, options?: TwinfinityApiOptions): Promise<BimTwinfinityApiClient | undefined>;
    /**
     * Detects the root URLs available for the current user given a base URL. The result depends on type of Twinfinity installation, how its configured and
     * which resources the user has access to. The method will test the following root URLs:
     * - {protocol}://{host}/sites/portal/
     * - {protocol}://{host}/sites/archive/
     * - {protocol}://{host}/workspaces/
     * Where {protocol} and {host} is taken from the provided `baseUrl`.
     * @param baseUrl The base URL to detect root URLs for.
     * @param options Optional session used to get authorization header for requests.
     * @returns A promise that resolves to an array of detected root URLs.
     * @example
     * ```typescript
     * const baseUrl = new URL('https://bim.demo.projektstruktur.se');
     * const rootUrls = await BimTwinfinityApiClient.detectRootUrls(baseUrl);
     * console.log(rootUrls); // [ 'https://bim.demo.projektstruktur.se/sites/portal/', 'https://bim.demo.projektstruktur.se/sites/archive/' ]
     * ```
     */
    static detectRootUrls(baseUrl: URL, options?: TwinfinityApiOptions): Promise<URL[]>;
    /** Hostname of {@link baseUrl}. */
    get id(): string;
    /** @inheritDoc */
    canDelete({ permissions, ownerSystem, type }: BimChange): boolean;
    /** @inheritDoc */
    deleteChanges(changesToDelete: BimChange[]): Promise<TypedResponse<number>[]>;
    private toLookup;
    private getLongestCommonUrlPath;
    /** @inheritDoc */
    getInfo(): Promise<TwinfinityInfo>;
    /** @inheritDoc */
    getContainerInfo(containerOrUrl?: BimContainer | URL): Promise<TypedResponse<BimContainerInfo>>;
    /** @inheritDoc */
    getContainers(id?: string): Promise<BimContainer[]>;
    /** @inheritDoc */
    getChanges<T extends BimChange = BimChange>(parentOrUrl: BimContainer | URL | BimChange, options: {
        id: string;
    } | {
        query: string;
    } | {
        query: 'all';
    }): Promise<TypedResponse<T[]>>;
    /** @inheritDoc */
    getIfcChanges(parentOrUrl: BimContainer | URL | BimChange): Promise<BimChangeIfc[]>;
    /** @inheritDoc */
    get<T>(absoluteUrl: string | URL, converter: (r: Response) => TypedResponse<T>, init?: RequestInit): Promise<TypedResponse<T>>;
    private getOrUndefined;
    private static containerInfo;
}
//# sourceMappingURL=BimTwinfinityApiClient.d.ts.map