/**
 * Copyright (c) 2018-present, heineiuo.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */ type BufferEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex" ; export interface Stats < T = number > { isFile ( ) : boolean ; isDirectory ( ) : boolean ; isBlockDevice ( ) : boolean ; isCharacterDevice ( ) : boolean ; isSymbolicLink ( ) : boolean ; isFIFO ( ) : boolean ; isSocket ( ) : boolean ; dev : T ; ino : T ; mode : T ; nlink : T ; uid : T ; gid : T ; rdev : T ; size : T ; blksize : T ; blocks : T ; atimeMs : T ; mtimeMs : T ; ctimeMs : T ; birthtimeMs : T ; atime : Date ; mtime : Date ; ctime : Date ; birthtime : Date ; } export interface Dirent { isFile ( ) : boolean ; isDirectory ( ) : boolean ; isBlockDevice ( ) : boolean ; isCharacterDevice ( ) : boolean ; isSymbolicLink ( ) : boolean ; isFIFO ( ) : boolean ; isSocket ( ) : boolean ; name : string ; } export interface FileHandle { /**
     * Gets the file descriptor for this file handle.
     */ readonly fd : number ; param data param options appendFile ( data , options ? ) : Promise < void > ; /**
     * Asynchronous fchown(2) - Change ownership of a file.
     */ chown ( uid , gid ) : Promise < void > ; param mode chmod ( mode ) : Promise < void > ; /**
     * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device.
     */ datasync ( ) : Promise < void > ; /**
     * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device.
     */ sync ( ) : Promise < void > ; param buffer param offset param length param position read < TBuffer extends Uint8Array > ( buffer , offset ? , length ? , position ? ) : Promise < { bytesRead : number ; buffer : TBuffer ; } > ; param options readFile ( options ? ) : Promise < Uint8Array > ; param options readFile ( options ) : Promise < string > ; param options readFile ( options ? ) : Promise < string | Uint8Array > ; /**
     * Asynchronous fstat(2) - Get file status.
     */ stat ( ) : Promise < Stats > ; param len truncate ( len ? ) : Promise < void > ; param atime param mtime utimes ( atime , mtime ) : Promise < void > ; param buffer param offset param length param position write < TBuffer extends Uint8Array > ( buffer , offset ? , length ? , position ? ) : Promise < { bytesWritten : number ; buffer : TBuffer ; } > ; param string param position param encoding write ( data , position ? , encoding ? ) : Promise < { bytesWritten : number ; buffer : string ; } > ; param data param options writeFile ( data , options ? ) : Promise < void > ; /**
     * Asynchronous close(2) - close a `FileHandle`.
     */ close ( ) : Promise < void > ; } export interface Env { onExit ( callback ) : void ; platform ( ) : string ; now ( ) : number ; access ( dbpath ) : Promise < void > ; mkdir ( dbpath ) : Promise < void > ; rename ( oldpath , newpath ) : Promise < void > ; readFile ( dbpath ) : Promise < Uint8Array > ; readFile ( dbpath , options ? ) : Promise < string | Uint8Array > ; readFile ( dbpath , bufferEncoding ) : Promise < string > ; writeFile ( dbpath , content ) : Promise < void > ; open ( dbpath , flag ) : Promise < FileHandle > ; unlink ( filename ) : Promise < void > ; unlinkSync ( filename ) : void ; fstat ( fd ) : Promise < Stats > ; readdir ( dbpath ) : Promise < Dirent [ ] > ; getFileSize ( filename ) : Promise < number > ; }