declare namespace datasources {
  class ProgressIndicator {
    refID: string;
    started: Date;
    lastChecked: number;
    inited: boolean;
    checkDeletedCount: number;
    askedToStop: boolean;
    graceFullStop: boolean;

    getRefID(): string;
    userAbort(): void;
    stopGracefully(): void;

    static InitManager(): void;
    static register(progress: ProgressIndicator): void;
    static unregister(progress: ProgressIndicator): void;
    static getProgress(refID: string): ProgressIndicator;
    static addListener(handler: Function): number;
    static removeListener(id: string): void;
    static tellListeners(command: string, progress: ProgressIndicator): void;
  }

  interface IDataStorePrivate {
    uniqID: string;
    dataclasses: {
      [dataclassName: string]: DataClass;
    };
    dataclassesByCollectionName: {
      [collectionName: string]: DataClass;
    };
    cacheDelay: number;
  }

  class DataStore {
    _private: IDataClassPrivate;
    constructor(ID: string);
    fetch(): Promise<this>;
    getUniqID(): string;
    getBaseID(): string;
    getDataClass(classname: string): DataClass;
    getDataClassByCollectionName(collectionName: string): DataClass;
    getCacheDelay(): number;
    getDataClasses(): {
      [dataclassName: string]: DataClass;
    };
    initProgressManager(): void;
    newProgressIndicator(): ProgressIndicator;
    addProgressListener(handler: Function): void;
    removeProgressListener(id: string): void;
    getProjectName(): string;
    getMethods(): {
      [key: string]: {
        name: string;
        exposed: boolean;
        allowedOnHTTPGET: boolean;
      };
    };
    HTMLEncode(source: string, display: boolean, tabs: number): string;
    logout(): Promise;
  }
}
