/*!
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License.
 */
/// <reference types="node" />
import { EventEmitter } from 'events';
import { AnimationLike, Guid, UserLike } from '../../..';
import { Client, Connection, InitializeActorMessage, Message, Payloads, Protocols, SyncActor, SyncAnimation, SyncAsset } from '../../../internal';
declare type AssetCreationMessage = Message<Payloads.LoadAssets | Payloads.CreateAsset>;
declare type AnimationCreationMessage = Message<Payloads.CreateAnimation2 | Payloads.CreateActorCommon>;
/**
 * @hidden
 * Class for associating multiple client connections with a single app session.
 */
export declare class Session extends EventEmitter {
    private _conn;
    private _sessionId;
    private _peerAuthoritative;
    private _clientSet;
    private _actorSet;
    private _assetSet;
    private _assetCreatorSet;
    /** Maps animation IDs to animation sync structs */
    private _animationSet;
    /** Maps IDs of messages that can create animations to the messages themselves */
    private _animationCreatorSet;
    private _userSet;
    private _protocol;
    private _disconnect;
    private actorLastUpdate;
    get conn(): Connection;
    get sessionId(): string;
    get protocol(): Protocols.Protocol;
    get clients(): Client[];
    get actors(): Partial<SyncActor>[];
    get assets(): Partial<SyncAsset>[];
    get assetCreators(): Message<Payloads.LoadAssets | Payloads.CreateAsset>[];
    get animationSet(): Map<Guid, Partial<SyncAnimation>>;
    get animations(): IterableIterator<Partial<SyncAnimation>>;
    get animationCreators(): Message<Payloads.CreateActorCommon | Payloads.CreateAnimation2>[];
    get animationCreatorSet(): Map<Guid, Message<Payloads.CreateActorCommon | Payloads.CreateAnimation2>>;
    get actorSet(): Map<Guid, Partial<SyncActor>>;
    get assetSet(): Map<Guid, Partial<SyncAsset>>;
    get assetCreatorSet(): Map<Guid, Message<Payloads.LoadAssets | Payloads.CreateAsset>>;
    get userSet(): Map<Guid, Partial<UserLike>>;
    get rootActors(): Partial<SyncActor>[];
    get authoritativeClient(): Client;
    get peerAuthoritative(): boolean;
    client: (clientId: Guid) => Client;
    actor: (actorId: Guid) => Partial<SyncActor>;
    user: (userId: Guid) => Partial<UserLike>;
    childrenOf: (parentId: Guid) => Partial<SyncActor>[];
    creatableChildrenOf: (parentId: Guid) => Partial<SyncActor>[];
    /**
     * Creates a new Session instance
     */
    constructor(_conn: Connection, _sessionId: string, _peerAuthoritative: boolean);
    /**
     * Performs handshake and sync with the app
     */
    connect(): Promise<void>;
    disconnect(): void;
    /**
     * Adds the client to the session
     */
    join(client: Client): Promise<void>;
    /**
     * Removes the client from the session
     */
    leave(clientId: Guid): void;
    private setAuthoritativeClient;
    private recvFromClient;
    private recvFromApp;
    preprocessFromApp(message: Message): Message;
    preprocessFromClient(client: Client, message: Message): Message;
    sendToApp(message: Message): void;
    sendToClients(message: Message, filterFn?: (value: Client, index: number) => any): void;
    sendPayloadToClients(payload: Partial<Payloads.Payload>, filterFn?: (value: Client, index: number) => any): void;
    isAnimating(syncActor: Partial<SyncActor>): boolean;
    cacheInitializeActorMessage(message: InitializeActorMessage): void;
    cacheActorUpdateMessage(message: Message<Payloads.ActorUpdate>): void;
    cacheAssetCreationRequest(message: AssetCreationMessage): void;
    cacheAssetCreation(assetId: Guid, creatorId: Guid, duration?: number): void;
    cacheAssetUpdate(update: Message<Payloads.AssetUpdate>): void;
    cacheAssetUnload(containerId: Guid): void;
    cacheAnimationCreationRequest(message: AnimationCreationMessage): void;
    cacheAnimationCreation(creatorId: Guid, def: Partial<AnimationLike>): void;
    cacheAnimationUpdate(update: Message<Payloads.AnimationUpdate>): void;
    cacheAnimationUnload(message: Message<Payloads.DestroyAnimations>): void;
}
export {};
//# sourceMappingURL=session.d.ts.map