// Part of the Chili3d Project, under the AGPL-3.0 License.
// See LICENSE file in the project root for full license information.

import {
    type Act,
    History,
    type IApplication,
    type IDocument,
    InternalClassName,
    type ISelection,
    type IView,
    ModelManager,
    ObservableCollection,
    type PropertyChangedHandler,
    type Serialized,
} from "@chili3d/core";
import { ThreeVisual } from "../src/threeVisual";

export class TestDocument implements IDocument {
    application: IApplication;
    name: string;
    id: string;
    history: History;
    selection: ISelection;
    visual: ThreeVisual;
    activeView: IView | undefined;
    modelManager: ModelManager = new ModelManager(this);
    acts: ObservableCollection<Act> = new ObservableCollection<Act>();
    userData?: Record<string, unknown> | undefined;
    onPropertyChanged<K extends keyof this>(handler: PropertyChangedHandler<this, K>): void {
        throw new Error("Method not implemented.");
    }
    removePropertyChanged<K extends keyof this>(handler: PropertyChangedHandler<this, K>): void {
        throw new Error("Method not implemented.");
    }
    dispose() {
        throw new Error("Method not implemented.");
    }

    importFiles(files: File[] | FileList): Promise<void> {
        return Promise.resolve();
    }

    close(): Promise<void> {
        return Promise.resolve();
    }

    serialize(): Serialized {
        return {
            [InternalClassName]: "TestDocument",
            properties: {},
        };
    }

    constructor() {
        this.name = "test";
        this.id = "test";
        this.visual = new ThreeVisual(this);
        this.history = new History();
        this.selection = {} as any;
        this.application = { views: [] } as any;
    }
    clearPropertyChanged(): void {
        throw new Error("Method not implemented.");
    }
    save(): Promise<void> {
        return Promise.resolve();
    }
}
