declare module "fetch" {
    export type fetch = (url: string, options?: {
        headers?: Record<string, string>;
        method?: "GET" | "POST" | "PUT" | "DELETE";
        body?: string | Uint8Array;
        encoding?: string;
        timeout?: number;
    }) => Promise<{
        headers: Record<string, string>;
        statusCode: number;
        statusMessage: string;
        body: string | Uint8Array;
    }>;
}
declare module "fs" {
    type Stat = {
        dev: number;
        ino: number;
        mode: number;
        nlink: number;
        uid: number;
        gid: number;
        rdev: number;
        size: number;
        blksize: number;
        blocks: number;
        atimeMs: number;
        mtimeMs: number;
        ctimeMs: number;
        birthtimeMs: number;
        atime: Date;
        mtime: Date;
        ctime: Date;
        birthtime: Date;
        isDirectory: boolean;
        isFile: boolean;
    };
    export type Dirent = {
        name: string;
        isDirectory: boolean | (() => boolean);
    };
    export type fs = {
        readFile(path: string, options?: {
            encoding?: string;
            absolutePath?: boolean;
        }): Promise<string | Uint8Array>;
        writeFile(file: string, data: string | Uint8Array, options?: {
            encoding?: "utf8";
            absolutePath?: boolean;
            recursive?: boolean;
        }): Promise<void>;
        writeFileMulti(files: {
            path: string;
            data: string | Uint8Array;
        }[], options: {
            encoding?: "utf8";
            absolutePath?: boolean;
            recursive?: boolean;
        }): Promise<void[]>;
        unlink(path: string, options?: {
            absolutePath?: boolean;
        }): Promise<void>;
        readdir(path: string, options?: {
            withFileTypes?: boolean;
            absolutePath?: boolean;
            recursive?: boolean;
        }): Promise<string[] | Dirent[]>;
        mkdir(path: string, options?: {
            absolutePath?: boolean;
        }): Promise<void>;
        rmdir(path: string, options?: {
            absolutePath?: boolean;
        }): Promise<void>;
        stat(path: string, options?: {
            absolutePath?: boolean;
        }): Promise<Stat>;
        lstat(path: string, options?: {
            absolutePath?: boolean;
        }): Promise<Stat>;
        readlink(path: string, options?: {
            absolutePath?: boolean;
        }): Promise<string>;
        symlink(path: string, options?: {
            absolutePath?: boolean;
        }): Promise<void>;
        chmod(path: string, uid: number, gid: number, options?: {
            absolutePath?: boolean;
        }): Promise<void>;
        exists(path: string, options?: {
            absolutePath?: boolean;
        }): Promise<null | {
            isFile: boolean;
        }>;
        rename(oldPath: string, newPath: string, options?: {
            absolutePath?: boolean;
        }): Promise<void>;
    };
}
declare module "fullstacked" {
    import { fetch } from "fetch";
    import { Dirent, fs } from "fs";
    export type Adapter = {
        fs: fs;
        fetch: fetch;
        platform: string;
        broadcast(data: string): void;
    };
    global {
        var rpc: () => {
            broadcast(data: string): void;
            platform: () => Promise<Adapter["platform"]>;
            fs: Omit<Adapter["fs"], "readFile" | "readdir"> & {
                readFile(path: string): Promise<Uint8Array>;
                readFile(path: string, options: {
                    encoding: "utf8";
                }): Promise<string>;
                readdir(path: string, options?: {
                    withFileTypes?: false | undefined;
                    recursive?: boolean;
                }): Promise<string[]>;
                readdir(path: string, options?: {
                    withFileTypes?: true;
                    recursive?: boolean;
                }): Promise<Dirent[]>;
            };
            fetch(url: string, options?: {
                headers?: Record<string, string>;
                method?: "GET" | "POST" | "PUT" | "DELTE";
                body?: string | Uint8Array;
                timeout?: number;
            }): Promise<{
                headers: Record<string, string>;
                statusCode: number;
                statusMessage: string;
                body: Uint8Array;
            }>;
            fetch(url: string, options?: {
                encoding: "utf8";
                headers?: Record<string, string>;
                method?: "GET" | "POST" | "PUT" | "DELTE";
                body?: string | Uint8Array;
                timeout?: number;
            }): Promise<{
                headers: Record<string, string>;
                statusCode: number;
                statusMessage: string;
                body: string;
            }>;
        };
        var onPush: {
            [messageType: string]: (message: string) => void;
        };
    }
}
