/// <reference types="node" />
import { IRestEntity } from '@jacquesparis/objects-model';
import { DataObject } from '@loopback/repository';
import { Principal } from '@loopback/security';
import { IncomingHttpHeaders } from 'http';
import { ObjectTreesApplicationInterface } from '../application.interface';
import { ObjectNode } from '../models/object-node.model';
import { ObjectSubType } from '../models/object-sub-type.model';
import { ObjectType } from '../models/object-type.model';
import { TreatmentDescription } from './../integration/extension-description';
import { EntityName } from './../models/entity-name';
import { ObjectTree } from './../models/object-tree.model';
import { ObjectTypeRelations } from './../models/object-type.model';
import { AccessRightsPermissions, AccessRightsSet } from './access-rights/access-rights.const';
export declare enum EntityActionType {
    create = "create",
    read = "read",
    update = "update",
    delete = "delete"
}
export declare class EntityActions {
    [controllerName: string]: {
        entityName: EntityName;
        entityActionType: EntityActionType;
    };
}
export declare class MethodContext {
    entity: ExpectedValue<IRestEntity>;
}
export declare class NodeContext {
    node: ExpectedValue<ObjectNode>;
    tree: ExpectedValue<ObjectNode>;
    owner: ExpectedValue<ObjectNode>;
    namespace: ExpectedValue<ObjectNode>;
    parent: ExpectedValue<ObjectNode>;
    parentType: ExpectedValue<ObjectType>;
    objectSubType: ExpectedValue<ObjectSubType>;
    objectType: ExpectedValue<ObjectType>;
    brothers: ExpectedValue<ObjectNode[]>;
    references: {
        [treeId: string]: ExpectedValue<ObjectNode>;
    };
}
export declare class TreeContext {
    treeNode: ExpectedValue<ObjectNode>;
    treeType: ExpectedValue<ObjectType>;
    treeChildren: ExpectedValue<ObjectNode[]>;
}
export declare class AccessRightsContext {
    copyToChildContext: boolean;
    rights: ExpectedValue<AccessRightsPermissions>;
    user: ExpectedValue<Principal>;
    treeRootNodeId: ExpectedValue<string>;
    aclTrees: ExpectedValue<{
        [aclId: string]: ObjectTree;
    }>;
    rootRights: ExpectedValue<AccessRightsSet>;
    authorization: ExpectedValue<string>;
}
export declare class TypeContext {
    copyToChildContext: boolean;
    types: ExpectedValue<{
        [id: string]: ObjectType;
    }>;
}
export declare class UriContext {
    copyToChildContext: boolean;
    mainContext: boolean;
    uri: ExpectedValue<{
        baseUri: string;
        path: string;
        objectUri: string;
        method: string;
        headers: IncomingHttpHeaders;
        host: string;
        protocol: string;
        url: string;
        acceptLanguages: string[];
        acceptLanguage: string;
    }>;
    returnedEntity: ExpectedValue<IRestEntity | IRestEntity[]>;
}
export declare class WebSiteContext {
    copyToChildContext: boolean;
    urlNode: ExpectedValue<ObjectNode>;
    webSiteTree: ExpectedValue<ObjectTree>;
    webSitePageNode: ExpectedValue<ObjectNode>;
    pageBaseUri: ExpectedValue<string>;
    siteBaseUriTree: ExpectedValue<ObjectTree>;
    cachedContent: ExpectedValue<{
        body: string;
    }>;
}
export declare class CurrentContext {
    nodeContext: NodeContext;
    treeContext: TreeContext;
    accessRightsContext: AccessRightsContext;
    typeContext: TypeContext;
    uriContext: UriContext;
    methodContext: MethodContext;
    webSiteContext: WebSiteContext;
    static get(parentCtx: CurrentContext, value?: DataObject<CurrentContext>): CurrentContext;
    [key: string]: any;
}
export declare const CURRENT_CONTEXT = "CURRENT_CONTEXT";
export declare class ExpectedValue<T> {
    private _value;
    private resolveValue;
    constructor(value?: T);
    waitForValue: Promise<T>;
    get value(): T;
    set value(value: T);
    getOrSetValue(searchValue: () => Promise<T>): Promise<T>;
}
export declare enum ObjectTypeName {
    REPOSITORY = "Repository",
    USER = "User",
    ANONYMOUS_USER = "AnonymousUser",
    ACCESS_RIGHT_DEFINITION = "AccessRightsDefinition",
    ACCESS_RIGHT_GROUP = "AccessRightsGroup",
    ACCESS_RIGHT_OWNERS = "AccessRightsOwners",
    ACCESS_RIGHT_ACCESS_MANAGERS = "AccessRightsAccessManagers",
    TENANT = "Tenant",
    REPOSITORY_CATEGORY = "RepositoryCategory"
}
export declare class ApplicationExtensionContext {
    resolve: () => void;
    reject: () => void;
    ready: Promise<void>;
    types: {
        [key: string]: ExpectedValue<ObjectType>;
    };
    nodes: {
        [key: string]: ExpectedValue<ObjectNode>;
    };
}
export declare class AccessRightsProviderContext extends ApplicationExtensionContext {
    types: {
        user: ExpectedValue<ObjectType>;
        anonymousUser: ExpectedValue<ObjectType>;
        accessRightsDefinition: ExpectedValue<ObjectType>;
        accessRightsGroup: ExpectedValue<ObjectType>;
        accessRightsOwners: ExpectedValue<ObjectType>;
        accessRightsAccessManagers: ExpectedValue<ObjectType>;
        [key: string]: ExpectedValue<ObjectType>;
    };
    nodes: {
        rootACL: ExpectedValue<ObjectNode>;
        [key: string]: ExpectedValue<ObjectNode>;
    };
}
export declare class ObjectTreeProviderContext extends ApplicationExtensionContext {
    types: {
        repository: ExpectedValue<ObjectType>;
        category: ExpectedValue<ObjectType>;
        tenant: ExpectedValue<ObjectType>;
        folder: ExpectedValue<ObjectType>;
        [key: string]: ExpectedValue<ObjectType>;
    };
    nodes: {
        root: ExpectedValue<ObjectNode>;
        public: ExpectedValue<ObjectNode>;
        publicTemplates: ExpectedValue<ObjectNode>;
        demonstrationAccount: ExpectedValue<ObjectNode>;
        demonstrationExamples: ExpectedValue<ObjectNode>;
        demonstrationSandbox: ExpectedValue<ObjectNode>;
        [key: string]: ExpectedValue<ObjectNode>;
    };
}
export declare class ApplicationService {
    static OBJECT_TYPE_NAMES: typeof ObjectTypeName;
    static OBJECT_NODE_NAMES: {
        [objectType in ObjectTypeName]: string;
    };
    static CONTENT_TYPE: {
        USER: string;
        JSON: string;
    };
    configSummary: TreatmentDescription;
    app: ObjectTreesApplicationInterface;
    get repositoryType(): ExpectedValue<ObjectType>;
    get categoryType(): ExpectedValue<ObjectType>;
    get tenantType(): ExpectedValue<ObjectType>;
    get folderType(): ExpectedValue<ObjectType>;
    get rootNode(): ExpectedValue<ObjectNode>;
    get publicNode(): ExpectedValue<ObjectNode>;
    get demonstrationAccountNode(): ExpectedValue<ObjectNode>;
    get demonstrationExamplesNode(): ExpectedValue<ObjectNode>;
    get demonstrationSandboxNode(): ExpectedValue<ObjectNode>;
    get publicTemplatesNode(): ExpectedValue<ObjectNode>;
    get userType(): ExpectedValue<ObjectType>;
    get anonymousUserType(): ExpectedValue<ObjectType>;
    get accessRightsDefinitionType(): ExpectedValue<ObjectType>;
    get accessRightsGroupType(): ExpectedValue<ObjectType>;
    get accessRightsOwnersType(): ExpectedValue<ObjectType>;
    get accessRightsAccessManagersType(): ExpectedValue<ObjectType>;
    entityActions: EntityActions;
    private extensions;
    ready: Promise<unknown>;
    allTypes: ExpectedValue<{
        [nameId: string]: ObjectType & ObjectTypeRelations;
    }>;
    implementedTypes: ExpectedValue<{
        [type: string]: string[];
    }>;
    implementingTypes: ExpectedValue<{
        [type: string]: string[];
    }>;
    parentTypes: ExpectedValue<{
        [type: string]: string[];
    }>;
    parentImplementingTypes: ExpectedValue<{
        [type: string]: string[];
    }>;
    implementingCommonTypes: ExpectedValue<{
        [type: string]: string[];
    }>;
    getExtensionContext<T extends ApplicationExtensionContext>(extensionNameOrClass: string | {
        name: string;
    }): T;
}
