import { PositionAndRotation } from "@mml-io/mml-web";
import { Group } from "three";
import { CameraManager } from "../camera/CameraManager";
import { CollisionsManager } from "../collisions/CollisionsManager";
import { KeyInputManager } from "../input/KeyInputManager";
import { VirtualJoystick } from "../input/VirtualJoystick";
import { EulXYZ } from "../math/EulXYZ";
import { Vect3 } from "../math/Vect3";
import { Composer } from "../rendering/composer";
import { TimeManager } from "../time/TimeManager";
import { TweakPane } from "../tweakpane/TweakPane";
import { Character, CharacterDescription, LoadedAnimations } from "./Character";
import { CharacterState } from "./CharacterState";
import { CharacterInstances } from "./instancing/CharacterInstances";
import { CharacterModelLoader } from "./loading/CharacterModelLoader";
import { LocalController } from "./LocalController";
import { RemoteController } from "./RemoteController";
type SpawnPosition = {
    x: number;
    y: number;
    z: number;
};
type SpawnPositionVariance = {
    x: number;
    y: number;
    z: number;
};
type RespawnTrigger = {
    minX: number;
    maxX: number;
    minY: number;
    maxY: number;
    minZ: number;
    maxZ: number;
};
export type SpawnConfiguration = {
    spawnPosition?: Partial<SpawnPosition>;
    spawnPositionVariance?: Partial<SpawnPositionVariance>;
    spawnYRotation?: number;
    respawnTrigger?: Partial<RespawnTrigger>;
    enableRespawnButton?: boolean;
};
export type SpawnConfigurationState = {
    spawnPosition: SpawnPosition;
    spawnPositionVariance: SpawnPositionVariance;
    spawnYRotation: number;
    respawnTrigger: RespawnTrigger;
    enableRespawnButton: boolean;
};
export type CharacterManagerConfig = {
    composer: Composer;
    characterModelLoader: CharacterModelLoader;
    collisionsManager: CollisionsManager;
    cameraManager: CameraManager;
    timeManager: TimeManager;
    keyInputManager: KeyInputManager;
    virtualJoystick?: VirtualJoystick;
    remoteUserStates: Map<number, CharacterState>;
    sendUpdate: (update: CharacterState) => void;
    sendLocalCharacterColors: (colors: Array<[number, number, number]>) => void;
    animationsPromise: Promise<LoadedAnimations>;
    spawnConfiguration: SpawnConfigurationState;
    characterResolve: (clientId: number) => {
        username: string | null;
        characterDescription: CharacterDescription | null;
        colors: Array<[number, number, number]> | null;
    };
    updateURLLocation?: boolean;
};
type LoadedCharacterState = {
    character: Character;
    remoteController: RemoteController;
    characterLoaded: boolean;
};
type RemoteCharacterState = {
    id: number;
    loadedCharacterState: LoadedCharacterState | null;
    lastPosition: {
        x: number;
        y: number;
        z: number;
    };
    distanceSquared: number;
    lastLODChange: number;
    abortController?: AbortController;
};
export declare class CharacterManager {
    private config;
    static readonly headTargetOffset: Vect3;
    private localClientId;
    remoteCharacters: Map<number, RemoteCharacterState>;
    localController: LocalController;
    localCharacter: Character | null;
    characterInstances: CharacterInstances | null;
    readonly group: Group;
    private lastUpdateSentTime;
    private readonly MAX_REAL_REMOTE_CHARACTERS;
    private readonly LOD_CHANGE_COOLDOWN_MS;
    private readonly MAX_SCENE_ADDITIONS_PER_FRAME;
    private tempCameraTarget;
    private pendingSpawns;
    private loadingCharacters;
    private charactersReadyForScene;
    constructor(config: CharacterManagerConfig);
    spawnLocalCharacter(id: number, username: string, characterDescription: CharacterDescription | null, spawnPosition?: Vect3, spawnRotation?: EulXYZ): void;
    private calculateDistanceSquared;
    private evaluateLOD;
    private promoteToReal;
    private demoteToInstance;
    setupTweakPane(tweakPane: TweakPane): void;
    private initializeCharacterInstances;
    getLocalCharacterPositionAndRotation(): PositionAndRotation;
    clear(): void;
    dispose(): void;
    addSelfChatBubble(message: string): void;
    addChatBubble(id: number, message: string): void;
    networkCharacterInfoUpdated(id: number): void;
    update(): void;
}
export {};
//# sourceMappingURL=CharacterManager.d.ts.map