import { PorjectSchema, IFileSchema, TemplateDescription } from './types';
import { IFile } from './models';
import { Engine } from './Engine';

export abstract class Service {
  public abstract loadProject(
    engine: Engine,
    project?: PorjectSchema
  ): Promise<PorjectSchema>;
  public abstract getFile(engine: Engine, id: string): Promise<IFileSchema>;
  public abstract createFile(engine: Engine, file: IFile): Promise<boolean>;
  public abstract updateFile(engine: Engine, file: IFile): Promise<boolean>;
  public abstract removeFile(engine: Engine, file: IFile): Promise<boolean>;
  public abstract updateProject(
    engine: Engine,
    project: PorjectSchema
  ): Promise<PorjectSchema>;
  public abstract saveHistory(engine: Engine, file: IFile): Promise<boolean>;
  public abstract removeHistory(
    engine: Engine,
    file: IFile,
    id: string
  ): Promise<boolean>;
  public abstract getFileHistories(
    engine: Engine,
    id: string
  ): Promise<string[]>;
  public abstract getHistory(
    engine: Engine,
    fileId: string,
    id: string
  ): Promise<IFileSchema>;
  public abstract removeTemplate(
    engine: Engine,
    name: string
  ): Promise<boolean>;
  public abstract addTemplate(
    engine: Engine,
    template: TemplateDescription
  ): Promise<boolean>;
  public abstract getTemplates(engine: Engine): Promise<TemplateDescription[]>;
}
