import { LinkCallback, PerspectiveClient, SyncStateChangeCallback } from "./PerspectiveClient";
import { Link, LinkExpression, LinkExpressionInput, LinkExpressionMutations, LinkMutations } from "../links/Links";
import { LinkQuery } from "./LinkQuery";
import { PerspectiveHandle, PerspectiveState } from './PerspectiveHandle';
import { Perspective } from "./Perspective";
import { ExpressionRendered } from "../expression/Expression";
import { NeighbourhoodProxy } from "../neighbourhood/NeighbourhoodProxy";
import { NeighbourhoodExpression } from "../neighbourhood/Neighbourhood";
type PerspectiveListenerTypes = "link-added" | "link-removed" | "link-updated";
export type LinkStatus = "shared" | "local";
interface Parameter {
    name: string;
    value: string;
}
/** Perspective UI proxy object
 *
 * Convenience object for UIs to interact with a perspective.
 * It is created by some of the methods in the PerspectiveClient class and includes
 * a reference to the PerspectiveClient object that created it.
 */
export declare class PerspectiveProxy {
    #private;
    /** Unique ID of the perspective */
    uuid: string;
    /** Given name of the perspective */
    name: string;
    /** If the perspective is shared as a Neighbourhood, this is the Neighbourhood URL */
    sharedUrl: string | null;
    /** If the perspective is shared as a Neighbourhood, this is the Neighbourhood Expression */
    neighbourhood: NeighbourhoodExpression | null;
    /** Returns the state of the perspective **/
    state: PerspectiveState | null;
    constructor(handle: PerspectiveHandle, ad4m: PerspectiveClient);
    executeAction(actions: any, expression: any, parameters: Parameter[]): Promise<boolean>;
    /** Returns all the links of this perspective that matches the LinkQuery */
    get(query: LinkQuery): Promise<LinkExpression[]>;
    /** Runs a Prolog query on the perspective's Prolog engine */
    infer(query: string): Promise<any>;
    /** Adds a link to this perspective */
    add(link: Link, status?: LinkStatus): Promise<LinkExpression>;
    /** Adds multiple links to this perspective **/
    addLinks(links: Link[], status?: LinkStatus): Promise<LinkExpression[]>;
    /** Removes multiple links from this perspective **/
    removeLinks(links: LinkExpressionInput[]): Promise<LinkExpression[]>;
    /** Adds and removes multiple links from this perspective **/
    linkMutations(mutations: LinkMutations, status?: LinkStatus): Promise<LinkExpressionMutations>;
    /** Adds a linkExpression to this perspective */
    addLinkExpression(link: LinkExpression, status?: LinkStatus): Promise<LinkExpression>;
    update(oldLink: LinkExpressionInput, newLink: Link): Promise<LinkExpression>;
    remove(link: LinkExpressionInput): Promise<{
        perspectiveRemoveLink: boolean;
    }>;
    getExpression(expressionURI: string): Promise<ExpressionRendered>;
    createExpression(content: any, languageAddress: string): Promise<string>;
    /** Adds a link listener
     * @param type Can be 'link-added' or 'link-removed'
     * @param cb Callback function that is called when a link is added to the perspective
     */
    addListener(type: PerspectiveListenerTypes, cb: LinkCallback): Promise<void>;
    /** Adds a sync state listener
     * @param cb Callback function that is called when the sync state of the perspective changes
     * @returns A function that can be called to remove the listener
     */
    addSyncStateChangeListener(cb: SyncStateChangeCallback): Promise<void>;
    /** Removes a previously added link listener
     * @param type Can be 'link-added' or 'link-removed'
     * @param cb Callback function that is called when a link is added to the perspective
     */
    removeListener(type: PerspectiveListenerTypes, cb: LinkCallback): Promise<void>;
    /** Create and return a snapshot of this perspective
     * A snapshot is a rendered Perspectie object that contains all the links of the perspective.
     */
    snapshot(): Promise<Perspective>;
    /** Take and load all the links from the given snapshot */
    loadSnapshot(snapshot: Perspective): Promise<void>;
    /** Convenience function to get the target of the first link that matches the given query
     * This makes sense when the query is expected to return only one link
     * and the target of that link is what you are looking for.
     *
     * Works best together with @member setSingelTarget()
     */
    getSingleTarget(query: LinkQuery): Promise<string | void>;
    /** Convenience function to ensure there is only one link with given source and predicate
     * This function will remove all links with the same source and predicate as the given link,
     * and then add the given link.
     * This ensures there is only one target for the given source and predicate.
     *
     * Works best together with @member getSingleTarget()
     */
    setSingleTarget(link: Link, status?: LinkStatus): Promise<void>;
    /** Returns all the Social DNA flows defined in this perspective */
    sdnaFlows(): Promise<string[]>;
    /** Returns all Social DNA flows that can be started from the given expression */
    availableFlows(exprAddr: string): Promise<string[]>;
    /**  Starts the Social DNA flow @param flowName on the expression @param exprAddr */
    startFlow(flowName: string, exprAddr: string): Promise<void>;
    /** Returns all expressions in the given state of given Social DNA flow */
    expressionsInFlowState(flowName: string, flowState: number): Promise<string[]>;
    /** Returns the given expression's flow state with regard to given Social DNA flow */
    flowState(flowName: string, exprAddr: string): Promise<number>;
    /** Returns available action names, with regard to Social DNA flow and expression's flow state */
    flowActions(flowName: string, exprAddr: string): Promise<string[]>;
    /** Runs given Social DNA flow action */
    runFlowAction(flowName: string, exprAddr: string, actionName: string): Promise<void>;
    /** Returns the perspective's Social DNA code
     * This will return all SDNA code elements in an array.
     */
    getSdna(): Promise<string[]>;
    /** Adds the given Social DNA code to the perspective's SDNA code */
    addSdna(name: string, sdnaCode: string, sdnaType: "subject_class" | "flow" | "custom"): Promise<boolean>;
    /** Returns all the Subject classes defined in this perspectives SDNA */
    subjectClasses(): Promise<string[]>;
    stringOrTemplateObjectToSubjectClass<T>(subjectClass: T): Promise<string>;
    /** Creates a new subject instance by running its (SDNA defined) constructor,
     * which means adding links around the given expression address so that it
     * conforms to the given subject class.
     *
     * @param subjectClass Either a string with the name of the subject class, or an object
     * with the properties of the subject class. In the latter case, the first subject class
     * that matches the given properties will be used.
     * @param exprAddr The address of the expression to be turned into a subject instance
     */
    createSubject<T>(subjectClass: T, exprAddr: string): Promise<T>;
    getSubjectData<T>(subjectClass: T, exprAddr: string): Promise<T>;
    /** Removes a subject instance by running its (SDNA defined) destructor,
     * which means removing links around the given expression address
     *
     * @param subjectClass Either a string with the name of the subject class, or an object
     * with the properties of the subject class. In the latter case, the first subject class
     * that matches the given properties will be used.
     * @param exprAddr The address of the expression to be turned into a subject instance
     */
    removeSubject<T>(subjectClass: T, exprAddr: string): Promise<void>;
    /** Checks if the given expression is a subject instance of the given subject class
     * @param expression The expression to be checked
     * @param subjectClass Either a string with the name of the subject class, or an object
     * with the properties of the subject class. In the latter case, the first subject class
     * that matches the given properties will be used.
    */
    isSubjectInstance<T>(expression: string, subjectClass: T): Promise<boolean>;
    /** For an existing subject instance (existing in the perspective's links)
     * this function returns a proxy object that can be used to access the subject's
     * properties and methods.
     *
     * @param base URI of the subject's root expression
     * @param subjectClass Either a string with the name of the subject class, or an object
     * with the properties of the subject class. In the latter case, the first subject class
     * that matches the given properties will be used.
     */
    getSubjectProxy<T>(base: string, subjectClass: T): Promise<T>;
    /** Returns all subject instances of the given subject class as proxy objects.
     *  @param subjectClass Either a string with the name of the subject class, or an object
     * with the properties of the subject class. In the latter case, all subject classes
     * that match the given properties will be used.
     */
    getAllSubjectInstances<T>(subjectClass: T): Promise<T[]>;
    /** Returns all subject proxies of the given subject class.
     *  @param subjectClass Either a string with the name of the subject class, or an object
     * with the properties of the subject class. In the latter case, all subject classes
     * that match the given properties will be used.
     */
    getAllSubjectProxies<T>(subjectClass: T): Promise<T[]>;
    private buildQueryFromTemplate;
    /** Returns all subject classes that match the given template object.
     * This function looks at the properties of the template object and
     * its setters and collections to create a Prolog query that finds
     * all subject classes that would be converted to a proxy object
     * with exactly the same properties and collections.
     *
     * Since there could be multiple subject classes that match the given
     * criteria, this function returns a list of class names.
     *
     * @param obj The template object
     */
    subjectClassesByTemplate(obj: object): Promise<string[]>;
    /** Takes a JS class (its constructor) and assumes that it was decorated by
     * the @subjectClass etc. decorators. It then tests if there is a subject class
     * already present in the perspective's SDNA that matches the given class.
     * If there is no such class, it gets the JS class's SDNA by calling its
     * static generateSDNA() function and adds it to the perspective's SDNA.
     */
    ensureSDNASubjectClass(jsClass: any): Promise<void>;
    getNeighbourhoodProxy(): NeighbourhoodProxy;
}
export {};
