import DBIDefinition from './DBIDefinition.ts';
/***  VALIDATION FUNCTIONS ***/
/**
 * validates the basePath & envName exist.  checks basePath is a valid path
 * @param {String} basePath - top level path the environment folder and the .mdb file live under
 * @param {String} envName - name of environment
 */
export declare function pathEnvNameValidation(basePath: string, envName: string): void;
/**
 * checks the environment file exists and returns its path
 * @param {String} basePath - top level path the environment folder and the .mdb file live under
 * @param {String} envName - name of environment
 * @returns {Promise<string>}
 */
export declare function validateEnvironmentPath(basePath: string, envName: string, allowV3?: boolean): Promise<string>;
/**
 * validates the env & dbiName variables exist
 * @param {lmdb.RootDatabase} env - lmdb environment object
 * @param {String} dbiName - name of the dbi (KV store)
 */
export declare function validateEnvDBIName(env: any, dbiName: string): void;
/***  ENVIRONMENT FUNCTIONS ***/
/**
 * creates a new environment
 * @param basePath - base path the environment will reside in
 * @param envName - name of the environment
 * @param {Boolean} isTxn - defines if is a transactions environment
 * @returns {Promise<lmdb.RootDatabase>} - LMDB environment object
 */
export declare function createEnvironment(basePath: string, envName: string, isTxn?: boolean, isV3?: boolean): Promise<any>;
/**
 * opens an environment
 * @returns {lmdb.RootDatabase} - lmdb environment object
 * @param {String} basePath - the base pase under which the envrinment resides
 * @param {String} envName -  the name of the environment
 * @param {Boolean} isTxn - defines if is a transactions environemnt
 */
export declare function openEnvironment(basePath: string, envName: string, isTxn?: boolean): Promise<any>;
/**
 * deletes the environment from the file system & removes the reference from global
 * @param {String} basePath - top level path the environment folder and the .mdb file live under
 * @param {String} envName - name of environment
 * @param {Boolean} isTxn - defines if is a transactions environemnt
 */
export declare function deleteEnvironment(basePath: string, envName: string, isTxn?: boolean): Promise<void>;
/**
 * takes an environment and closes it
 * @param {lmdb.RootDatabase} env
 */
export declare function closeEnvironment(env: any): Promise<void>;
/**
 * creates a composite name for the environment based on the parent folder name & the environment name.
 * This forces uniqueness when same environment names live under different parent folders
 * @param {String} basePath
 * @param {String} envName
 * @param {Boolean} isTxn - defines if is a transactions environemnt
 * @returns {string}
 */
export declare function getCachedEnvironmentName(basePath: string, envName: string, isTxn?: boolean): string;
/***  DBI FUNCTIONS ***/
/**
 * lists dbis in a map with their defintition as the value
 * @param {lmdb.RootDatabase} env - environment object used high level to interact with all data in an environment
 * @returns {{String, DBIDefinition}}
 */
export declare function listDBIDefinitions(env: any): any;
/**
 * lists all dbis in an environment
 * @param {lmdb.RootDatabase} env - environment object used high level to interact with all data in an environment
 * @returns {[String]}
 */
export declare function listDBIs(env: any): any[];
/**
 * fetches an individual dbi definition from the internal dbi
 * @param {lmdb.RootDatabase} env
 * @param dbiName
 * @returns {undefined|DBIDefinition}
 */
export declare function getDBIDefinition(env: any, dbiName: string): DBIDefinition;
/**
 * creates a new named database in an environment
 * @param {lmdb.RootDatabase} env - environment object used high level to interact with all data in an environment
 * @param {String} dbiName - name of the dbi (KV store)
 * @param {Boolean} [dupSort] - optional, determines if the dbi allows duplicate keys or not
 * @param {Boolean} isHashAttribute - defines if the dbi being created is the hash_attribute fro the environment / table
 * @returns {*} - reference to the dbi
 */
export declare function createDBI(env: any, dbiName: string, dupSort?: boolean, isHashAttribute?: boolean): any;
/**
 * opens an existing named database from an environment
 * @param {lmdb.RootDatabase} env - environment object used thigh level to interact with all data in an environment
 * @param {String} dbiName - name of the dbi (KV store)
 * @returns {lmdb.Database} - returns reference to the dbi
 */
export declare function openDBI(env: any, dbiName: string): any;
/**
 * gets the statistics for a named database from the environment
 * @param {lmdb.RootDatabase} env - environment object used thigh level to interact with all data in an environment
 * @param {String} dbiName - name of the dbi (KV store)
 * @returns {void | Promise<Stats> | *} - object holding stats for the dbi
 */
export declare function statDBI(env: any, dbiName: string): any;
/**
 * removes a named database from an environment
 * @param {lmdb.RootDatabase} env - environment object used thigh level to interact with all data in an environment
 * @param {String} dbiName - name of the dbi (KV store)
 */
export declare function dropDBI(env: any, dbiName: string): void;
/**
 * opens/ creates all specified attributes
 * @param {lmdb.RootDatabase} env - lmdb environment object
 * @param {String} hash_attribute - name of the table's hash attribute
 * @param {Array.<String>} writeAttributes - list of all attributes to write to the database
 */
export declare function initializeDBIs(env: any, hash_attribute: string, writeAttributes: string[]): void;
