declare namespace datasources {
  interface IDataClassPrivate<T extends IEntity = IEntity> {
    datastore: ICatalog;
    className: string;
    exposed?: boolean;
    attributes: {
      [attributeName: string]: IDataClassAttribute;
    };
    collectionName: string;
    cache: EntityCache<T>;
    keys: string[];
  }

  type IGetEntitySettings = Partial<{
    expand: string;
    filterAttributes: string;
  }>;

  class DataClass<T extends IEntity = IEntity> {
    _private: IDataClassPrivate<T>;
    constructor(rawDef: IDetailedDataClass, owner: ICatalog);
    getName(): string;
    getCollectionName(): string;
    getDataStore(): ICatalog;
    getAttribute(attname: string): IDataClassAttribute | null;
    getAllAttributes(): {
      [attributeName: string]: IDataClassAttribute;
    };
    getEntity(primKey: string, settings?: IGetEntitySettings): Promise<T>;
    query(
      queryStr: string,
      settings?: IEntitySelectionSettings,
    ): EntitySelection<T>;
    getDistinctValues(
      attName: string,
      maxElems?: number,
      queryFilter?: string,
    ): Promise<string[]>;
    allEntities(settings: IEntitySelectionSettings): EntitySelection<T>;
    newEmptySelection(): EntitySelection<T>;
    getCacheDelay(): number;
    getCache(): EntityCache<T>;
    getKeys(): string[];
    isExposed(): boolean;
    supportJSONEntityKey(): boolean;
  }
}
