declare module '@tako/datatable' { export function get(key: string): Promise<{ descriptor: object, value: any }> export function set(key: string, value: any, descriptor?: object): Promise export function listKeys(): Promise; } declare module '@tako/large-content-proxy' { /** * 将文本内容储存在 OSS 上,并返回一个唯一 ID * 一般用于储存大文件,长文本 * @param content 文本内容 * @return uuid 唯一 ID */ export function store(content: string | Buffer): Promise /** * 若规定 isData 参数,则可以储存数据 * @param data 数据,一般为 JS 对象(暂不支持 Function 的存储) * @param isData 是否为数据,默认为 false * @return uuid 唯一 ID */ export function store(data: any, isData: true): Promise /** * 从 oss 上获取获取文件内容 * @param id 唯一 ID * @return content 文件内容,该内容是一个 Buffer,可以直接转换为字符串 */ export function retrieve(id: string): Promise /** * 若规定 isData 参数,从 oss 上获取获取数据 * @param id 唯一 ID * @param isData 是否为数据,默认为 false */ export function retrieve(id: string, isData: true): Promise /** * 判断内容是否为大文件 Id * @param id */ export function isLargeContent(id: string): boolean } module '@tako/fs' { /// import * as fs from 'fs'; import { WriteFileOptions } from 'fs'; /** * Asynchronously reads the entire contents of a file. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * If a file descriptor is provided, the underlying file will _not_ be closed automatically. * @param options An object that may contain an optional flag. * If a flag is not provided, it defaults to `'r'`. */ export declare function readFile(path: string, options: { encoding?: null; flag?: string; } | undefined | null): Promise; /** * Asynchronously writes data to a file, replacing the file if it already exists. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * URL support is _experimental_. * If a file descriptor is provided, the underlying file will _not_ be closed automatically. * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. * If `encoding` is not supplied, the default of `'utf8'` is used. * If `mode` is not supplied, the default of `0o666` is used. * If `mode` is a string, it is parsed as an octal integer. * If `flag` is not supplied, the default of `'w'` is used. */ export declare function writeFile(path: string, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): Promise; /** * Asynchronous stat(2) - Get file status. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. */ export declare function stat(path: string): Promise; /** * Asynchronously tests a user's permissions for the file specified by path. * URL support is _experimental_. */ export declare function access(path: string, mode: number | undefined): Promise; /** * Returns a new `ReadStream` object. * URL support is _experimental_. */ export declare function createReadStream(path: string, options?: string | { flags?: string; encoding?: BufferEncoding; fd?: number; mode?: number; autoClose?: boolean; /** * @default false */ emitClose?: boolean; start?: number; end?: number; highWaterMark?: number; }): Promise; /** * Returns a new `WriteStream` object. * URL support is _experimental_. */ export declare function createWriteStream(path: string, options?: string | { flags?: string; encoding?: BufferEncoding; fd?: number; mode?: number; autoClose?: boolean; emitClose?: boolean; start?: number; highWaterMark?: number; }): Promise; }