/// import type { ChecksumValue, DataSource, DbDataSource, IncrementalMatch, LogStatus, TaskAction, ViewEngine } from './squared'; import type { ExternalAsset, FileCommand, FileData, IFileThread, OutputFinalize } from './asset'; import type { BucketWebsiteOptions, CloudDatabase, CloudFeatures, CloudFunctions, CloudLogMessageType, CloudService, CloudStorage, CloudStorageDownload, CloudStorageUpload, CopyObjectOptions, DeleteObjectsOptions, UploadAssetOptions } from './cloud'; import type { BrotliCompressLevel, BufferResult, CompressFormat, CompressLevel, ReadableOptions, TryFileCompressor } from './compress'; import type { ClientConstructor, ClientDbConstructor, HostInitConfig, IAbortComponent, IClient, IClientDb, IPermission, JoinQueueOptions, PermissionReadWrite, ResumeThreadOptions, ThreadCountStat } from './core'; import type { BatchQueryResult, DB_TYPE, ErrorQueryCallback, ExecuteBatchQueryOptions, ExecuteQueryOptions, HandleFailOptions, ProcessRowsOptions, QueryResult, SQL_COMMAND } from './db'; import type { AsSourceFileOptions, ConfigOrTransformer, CustomizeOptions as CustomizeDocument, GenerateLintTableOptions, LintMessage, PluginConfig, SourceCode, SourceInput, SourceMap, SourceMapOptions, TransformAction, TransformCallback, TransformOutput, TransformResult, UpdateGradleOptions } from './document'; import type { AssetContentOptions, CheckHashOptions, ChecksumOptions, DeleteFileAddendum, FileOutput, FinalizeResult, FindAssetOptions, IHttpDiskCache, IHttpMemoryCache, ImageMimeMap, InstallData, PostFinalizeCallback, ReplaceOptions } from './filemanager'; import type { HttpAgentSettings, HttpProtocolVersion, HttpRequestClient, InternetProtocolVersion } from './http'; import type { CommandData, CropData, QualityData, ResizeData, RotateData, TransformOptions } from './image'; import type { ExecCommand, LOG_TYPE, LogArguments, LogComponent, LogDate, LogFailOptions, LogMessageOptions, LogOptions, LogProcessOptions, LogState, LogTime, LogType, LogValue, STATUS_TYPE, StatusType } from './logger'; import type { AsHashOptions, CheckSemVerOptions, CopyDirOptions, CopyDirResult, CopyFileOptions, CreateDirOptions, DeleteFileOptions, DirectoryActionType, FileActionType, FileTypeFormat, GlobDirOptions, MoveFileOptions, PackageVersionOptions, ParseFunctionOptions, PermissionOptions, PermissionType, ProtocolType, ReadBufferOptions, ReadFileCallback, ReadFileOptions, ReadHashOptions, ReadTextOptions, RemoveDirOptions, TempDirOptions, WriteFileOptions } from './module'; import type { ErrorCode, HighResolutionTime, RequestData, Settings } from './node'; import type { ApplyOptions, Aria2Options, BufferFormat, DataEncodedResult, DataObjectResult, HeadersOnCallback, HostConfig, IHttpAdapter, OpenOptions, PatchOptions, PostFileParts as PostFileParts, PostOptions, ProxySettings, PutOptions, RcloneOptions, ReadExpectType, RequestInit, StatusOnCallback } from './request'; import type { ClientModule, CloudAuthSettings, CloudModule, CloudServiceOptions, CompressModule, CompressSettings, DbCacheSettings, DbCoerceSettings, DbModule, DbSettings, DbSourceOptions, DnsLookupSettings, DocumentComponent, DocumentComponentOption, DocumentModule, HandlerSettings, HttpConnectSettings, HttpMemorySettings, ImageModule, ImportModule, LoggerFormat, LoggerFormatSettings, PoolConfig, RequestModule, RequestSettings, TaskModule, WatchModule } from './settings'; import type { Command, SpawnResult } from './task'; import type { IFileGroup, ModifiedPostFinalizeListener, SecureOptions, WatchInitResult } from './watch'; import type { SpawnOptions } from 'node:child_process'; import type { BinaryLike, HashOptions } from 'node:crypto'; import type { NoParamCallback, WriteStream } from 'node:fs'; import type { ClientRequest, OutgoingHttpHeaders } from 'node:http'; import type { LookupFunction } from 'node:net'; import type { Readable, Writable } from 'node:stream'; import type { SecureContextOptions } from 'node:tls'; import type { BrotliCompress, BrotliOptions, Gzip, ZlibOptions } from 'node:zlib'; // @ts-ignore import type { Unit } from 'bytes'; // @ts-ignore import type { FileTypeResult } from 'file-type'; import type * as EventEmitter from 'node:events'; // @ts-ignore import type * as ws from 'ws'; type BufferView = Bufferable | NodeJS.ArrayBufferView; type CpuUsage = NodeJS.CpuUsage; declare namespace functions { type FormatMessageArgs = [type: LogType, title: string, value: LogValue, message: unknown, options: LogMessageOptions]; interface IScopeOrigin { host?: T; instance?: U; } interface IExternalConfig { module: T; init(...args: unknown[]): this; get settings(): U; } interface IExternalFunction> { set extensions(values: unknown[]); get extensions(): T[]; } interface IWorkerConstructor { asBuffer(data: Buffer | Uint8Array): Buffer; } interface ICompress extends IModule, IExternalConfig { level: ObjectMap; compressors: ObjectMap; register(format: string, callback: TryFileCompressor): void; getLevel(value: string, fallback?: number): number | undefined; getReadable(file: string | URL | Buffer, options?: ReadableOptions): Readable; createGzip(file: Bufferable, options?: CompressLevel): Gzip; createBrotliCompress(file: Bufferable, options?: BrotliCompressLevel): BrotliCompress; createWriteStreamAsGzip(file: Bufferable, output: string, options?: CompressLevel): WriteStream; createWriteStreamAsBrotli(file: Bufferable, output: string, options?: BrotliCompressLevel): WriteStream; intoGzipStream(output: string, options?: ZlibOptions): WriteStream; intoBrotliStream(output: string, options?: BrotliOptions): WriteStream; writeGzip(file: Bufferable, output: string, options?: CompressLevel): Promise; writeBrotli(file: Bufferable, output: string, options?: CompressLevel): Promise; tryFile(file: Bufferable, options: CompressFormat): Promise; tryFile(file: Bufferable, output: string, options?: CompressFormat): Promise; tryImage(file: string, options: CompressFormat): Promise; tryImage(file: Bufferable, output: string, options?: CompressFormat): Promise; hasPermission(type: string, options?: unknown): boolean; set chunkSize(value: number | string | undefined); get chunkSize(): number | undefined; } interface CompressConstructor extends ModuleConstructor, IWorkerConstructor { singleton(): ICompress; readonly prototype: ICompress; new(module?: U): ICompress; } interface IImage extends IClient { resizeData?: ResizeData | null; cropData?: CropData | null; rotateData?: RotateData | null; qualityData?: QualityData | null; methodData?: [string, unknown[]?][] | null; opacityValue?: number; outputType?: string; setCommand(value: string | CommandData, outputAs?: string): void; getCommand(): string; parseCommand(value: string): CommandData; parseMethod(value: string): [string, unknown[]?][] | null; parseResize(value: string): ResizeData | null; parseCrop(value: string): CropData | null; parseRotate(value: string): RotateData | null; parseQuality(value: string): QualityData | null; parseOpacity(value: string): number; parseWorker(command: string | CommandData, outputType?: string): CommandData | null; using?(data: IFileThread, command: string): Promise; get outputAs(): string; set host(value); get host(): T | null; } interface ImageConstructor extends ClientConstructor, IWorkerConstructor { readonly MIME_JPEG: string; readonly MIME_PNG: string; readonly MIME_WEBP: string; readonly MIME_SVG: string; readonly MIME_GIF: string; readonly MIME_BMP: string; readonly MIME_TIFF: string; transform(file: string, command: string, options?: W): Promise; clamp(value: unknown, min?: number, max?: number): number; isBinary(mime: unknown): mime is string; toABGR(buffer: Uint8Array | Buffer): Buffer; readonly prototype: IImage; new(module?: U, ...args: unknown[]): IImage; } interface ITask extends IClient { using?(data: IFileThread): Promise; collect?(items: unknown[], preceding?: boolean): Promise[]; map?(tasks: Command[]): Promise[]; series?(tasks: Command[]): Promise; parallel?(tasks: Command[]): Promise; spawn?(task: PlainObject, callback: (result?: SpawnResult) => void): void; execute?, X extends ExternalAsset>(manager: W, task: PlainObject, callback: (value?: unknown) => void): void; set host(value); get host(): T | null; } interface TaskConstructor extends ClientConstructor { finalize(this: T, instance: ITask, assets: V[]): Promise; readonly prototype: ITask; new(module?: U, ...args: unknown[]): ITask; } interface IDb extends IClientDb { setCredential(item: V): Promise; getCredential(item: V): Y | undefined; hasSource(source: string, ...type: number[]): boolean; applyCommand(...items: V[]): void; executeQuery(item: V, callback: ErrorQueryCallback): Promise; executeQuery(item: V, sessionKey: string): Promise; executeQuery(item: V, options?: ExecuteQueryOptions | string): Promise; executeBatchQuery(batch: V[], callback: ErrorQueryCallback, outResult?: BatchQueryResult): Promise; executeBatchQuery(batch: V[], sessionKey: string | undefined, outResult?: BatchQueryResult): Promise; executeBatchQuery(batch: V[], options?: ExecuteBatchQueryOptions, outResult?: BatchQueryResult): Promise; processRows(batch: V[], tasks: Promise[], parallel: boolean): Promise; processRows(batch: V[], tasks: Promise[], options?: ProcessRowsOptions | boolean, outResult?: BatchQueryResult): Promise; handleFail(err: unknown, item: V, options?: HandleFailOptions): boolean; readTLSCert(value: unknown, cache?: boolean): string; readTLSConfig(options: SecureContextOptions, cache?: boolean): void; settingsOf(source: string, name: keyof Omit): unknown; settingsOf(source: string, name: "cache", component: keyof DbCacheSettings): unknown; settingsOf(source: string, name: "coerce", component: keyof DbCoerceSettings): unknown; settingsKey(source: string, name: keyof Omit): unknown; settingsKey(source: string, name: "cache", component: keyof DbCacheSettings): unknown; settingsKey(source: string, name: "coerce", component: keyof DbCoerceSettings): unknown; getPoolConfig(source: string, uuidKey?: string): Required | undefined; get sourceType(): DB_TYPE; get commandType(): SQL_COMMAND; set host(value); get host(): T | null; /* EventEmitter */ on(event: "exec", listener: (command: ExecCommand, options?: SpawnOptions) => void): this; on(event: "error", listener: (err: Error) => void): this; on(event: "file:read", listener: (src: string, data: Bufferable, options?: ReadFileOptions) => void): this; on(event: "file:write", listener: (src: string, options?: WriteFileOptions) => void): this; on(event: "file:delete", listener: (src: string, options?: DeleteFileOptions) => void): this; on(event: "file:copy", listener: (dest: string, options?: CopyFileOptions) => void): this; on(event: "file:move", listener: (dest: string, options?: MoveFileOptions) => void): this; on(event: "file:permission", listener: (src: string, type?: FileActionType) => void): this; on(event: "dir:create", listener: (src: string, options?: CreateDirOptions) => void): this; on(event: "dir:remove", listener: (src: string, options?: RemoveDirOptions) => void): this; on(event: "dir:permission", listener: (src: string, type?: DirectoryActionType) => void): this; once(event: "exec", listener: (command: ExecCommand, options?: SpawnOptions) => void): this; once(event: "error", listener: (err: Error) => void): this; once(event: "file:read", listener: (src: string, data: Bufferable, options?: ReadFileOptions) => void): this; once(event: "file:write", listener: (src: string, options?: WriteFileOptions) => void): this; once(event: "file:delete", listener: (src: string, options?: DeleteFileOptions) => void): this; once(event: "file:copy", listener: (dest: string, options?: CopyFileOptions) => void): this; once(event: "file:move", listener: (dest: string, options?: MoveFileOptions) => void): this; once(event: "file:permission", listener: (src: string, type?: FileActionType) => void): this; once(event: "dir:create", listener: (src: string, options?: CreateDirOptions) => void): this; once(event: "dir:remove", listener: (src: string, options?: RemoveDirOptions) => void): this; once(event: "dir:permission", listener: (src: string, type?: DirectoryActionType) => void): this; emit(event: "exec", command: ExecCommand, options?: SpawnOptions): boolean; emit(event: "error", err: Error): boolean; emit(event: "file:read", src: string, data: Bufferable, options?: ReadFileOptions): boolean; emit(event: "file:write", src: string, options?: WriteFileOptions): boolean; emit(event: "file:delete", src: string, options?: DeleteFileOptions): boolean; emit(event: "file:copy", dest: string, options?: CopyFileOptions): boolean; emit(event: "file:move", dest: string, options?: MoveFileOptions): boolean; emit(event: "file:permission", src: string, type?: FileActionType): boolean; emit(event: "dir:create", src: string, options?: CreateDirOptions): boolean; emit(event: "dir:remove", src: string, options?: RemoveDirOptions): boolean; emit(event: "dir:permission", src: string, type?: DirectoryActionType): boolean; /* EventEmitter */ on(event: "db:result", listener: (batch: V[], result: BatchQueryResult) => void): this; on(event: "db:fail", listener: (err: unknown, item: V) => void): this; once(event: "db:result", listener: (batch: V[], result: BatchQueryResult) => void): this; once(event: "db:fail", listener: (err: unknown, item: V) => void): this; emit(event: "db:result", batch: V[], result: BatchQueryResult): boolean; emit(event: "db:fail", err: unknown, item: V): boolean; } interface DbConstructor extends ClientDbConstructor { readonly HASH_ALGORITHM: string; loadSettings(settings: Settings & { db?: DbSettings }, password?: string): boolean; setPoolConfig(value: ObjectMap): void; getPoolConfig(source: string): Required | undefined; readonly prototype: IDb; new(module?: U, database?: V[], ...args: unknown[]): IDb; } interface ICloud extends IClientDb { readonly uploaded: string[]; readonly downloaded: string[]; createBucket(service: string, credential: unknown, bucket: string, acl?: unknown, options?: unknown): Promise; createBucket(service: string, credential: unknown, bucket: string, publicRead?: boolean): Promise; setBucketPolicy(service: string, credential: unknown, bucket: string, options: unknown): Promise; setBucketTagging(service: string, credential: unknown, bucket: string, options: unknown): Promise; setBucketWebsite(service: string, credential: unknown, bucket: string, options: BucketWebsiteOptions): Promise; deleteObjects(service: string, credential: unknown, bucket: string, options: DeleteObjectsOptions): Promise; deleteObjects(service: string, credential: unknown, bucket: string, recursive?: boolean | DeleteObjectsOptions): Promise; copyObject(service: string, credential: unknown, bucketSource: string, keySource: string, bucket: string, key: string, options?: CopyObjectOptions): Promise; uploadObject(service: string, credential: unknown, bucket: string, upload: CloudStorageUpload, localUri: string, beforeResolve?: (value: string) => Promise | void): Promise; downloadObject(service: string, credential: unknown, bucket: string, download: CloudStorageDownload, beforeResolve?: (value: Bufferable | null) => Promise | void): Promise; getStorage(action: CloudFunctions, data: CloudStorage[] | undefined): CloudStorage | undefined; hasStorage(action: CloudFunctions, storage: CloudStorage): CloudStorageUpload | false; getDatabaseRows(item: V, ignoreErrors: boolean, sessionKey?: string): Promise; getDatabaseRows(item: V, sessionKey?: string): Promise; getDatabaseBatchRows(batch: V[], ignoreErrors: boolean, sessionKey?: string): Promise; getDatabaseBatchRows(batch: V[], sessionKey?: string): Promise; hasCredential(feature: CloudFeatures, data: CloudService, credential?: unknown): boolean; getCredential(item: CloudService, unused?: boolean): PlainObject; getSettings(service: string): AnyObject | undefined; settingsOf(service: string, name: "cache"): unknown; settingsOf(service: string, name: "coerce", component: keyof DbCoerceSettings): unknown; settingsOf(service: string, name: "auth", component: keyof CloudAuthSettings): unknown; getUploadHandler(service: string, credential: unknown): FunctionReturn; getDownloadHandler(service: string, credential: unknown): FunctionReturn; resolveService(service: string, folder?: string): string; set host(value); get host(): T | null; } interface CloudConstructor extends ClientDbConstructor { LOG_CLOUD_SUCCESS: LogMessageOptions; LOG_CLOUD_FAIL: LogMessageOptions; LOG_CLOUD_COMMAND: LogMessageOptions; LOG_CLOUD_WARN: LogMessageOptions; LOG_CLOUD_UPLOAD: LogMessageOptions; LOG_CLOUD_DOWNLOAD: LogMessageOptions; LOG_CLOUD_DELETE: LogMessageOptions; LOG_CLOUD_DELAYED: LogMessageOptions; finalize(this: T, instance: ICloud): Promise; uploadAsset, X extends ExternalAsset>(state: IScopeOrigin>, file: X, options: UploadAssetOptions): Promise[]; uploadAsset, X extends ExternalAsset>(state: IScopeOrigin>, file: X, ignoreProcess: boolean): Promise[]; uploadAsset, X extends ExternalAsset>(state: IScopeOrigin>, file: X, contentType?: string | boolean | UploadAssetOptions, ignoreProcess?: boolean): Promise[]; uploadAssetSuccess, X extends ExternalAsset>(state: IScopeOrigin>, file: X, active?: boolean): (value: string) => Promise | void; sanitizeAssets(assets: W[]): W[]; optionsLogMessage(type: CloudLogMessageType, options?: W): W; readonly prototype: ICloud; new(module?: U, database?: CloudDatabase[], ...args: unknown[]): ICloud; } interface IDocument, U extends ExternalAsset = ExternalAsset, V extends ClientModule = DocumentModule, W extends DocumentComponent = DocumentComponent, X extends DocumentComponentOption = DocumentComponentOption, Y extends ICloud = ICloud, Z extends FunctionReturn = TransformCallback> extends IClient { Db: IDb | null; assets: U[]; config: StandardMap; init(assets: U[], config?: HostInitConfig): this; customize(options?: CustomizeDocument): void; findConfig(data: object, name: string, type?: string): PluginConfig; loadConfig(data: object, name: string): ConfigOrTransformer | undefined; asSourceFile(value: string, cache: boolean): unknown; asSourceFile(value: string, options?: AsSourceFileOptions): unknown; findVersion(name: string | string[], fallback?: string): string; findSourceScope(uri: string, imports: ImportModule): StringMap[]; findSourceRoot(uri: string, imports?: ImportModule): string | undefined; resolveDir(name: string, ...paths: string[]): string | undefined; locateSourceFiles(file: U, code?: string, bundleContent?: string[]): (imports?: ImportModule) => SourceInput | undefined; resolveSourceFile(file: U): (code?: string, imports?: ImportModule) => SourceInput | undefined; resolvePackageJSONExports(uri: string, base?: string | URL): string | undefined; tryParse(source: string, format: string, options?: PlainObject): unknown; forDb(item: DataSource): boolean; hasEval(name: string): boolean; settingsOf(name: keyof W, option: keyof X): unknown; parseTemplate(viewEngine: ViewEngine | string, template: string, data: unknown[]): Promise; transform(type: string, code: string, format: string | string[], options?: TransformOutput & TransformAction): Promise; abort(err: Error): void; abort(name?: keyof W, reason?: unknown): void; restart(): void; using?(data: IFileThread): Promise; setLocalUri?(file: U, replace?: boolean): void; resolveUri?(file: U, source: string): string; resolveUri?(file: U, source: string, trailing: string): [string, string]; resolveImports?(file: U, code: string, baseFile?: string | U): string | undefined; replaceContent?(source: string, statement: RegExpExecArray | string, mimeType?: string): string | undefined; addCopy?(data: FileCommand, saveAs: string, replace?: boolean): string | undefined; writeImage?(output: OutputFinalize): boolean; cloudInit?(state: IScopeOrigin): void; cloudObject?(state: IScopeOrigin, file: U): boolean; cloudUpload?(state: IScopeOrigin, file: U, url: string, active?: boolean): Promise; cloudFinalize?(state: IScopeOrigin): Promise; watchInit?(watch: IFileGroup, assets: U[], sanitize?: boolean): WatchInitResult | undefined; watchModified?(watch: IFileGroup, assets?: U[], recursive?: [string, string[]][]): PostFinalizeCallback; set dataSource(value: DataSource[]); get dataSource(): DataSource[]; set imports(value); get imports(): ImportModule; get watching(): boolean; set host(value); get host(): T | null; } interface DocumentConstructor, U extends ExternalAsset = ExternalAsset, V extends ClientModule = DocumentModule, W extends DocumentComponent = DocumentComponent, X extends DocumentComponentOption = DocumentComponentOption, Y extends ICloud = ICloud> extends ClientConstructor { finalize(this: T, instance: IDocument): Promise; createSourceMap(code: string, remove: boolean): SourceMap; createSourceMap(code: string, uri?: string, remove?: boolean): SourceMap; writeSourceMap(uri: string, data: SourceCode, options?: SourceMapOptions): string | undefined; /** @deprecated */ updateGradle(source: string, namespaces: (string | RegExp)[], value: string | string[], upgrade: boolean): string; /** @deprecated */ updateGradle(source: string, namespaces: (string | RegExp)[], value: string | string[], options?: UpdateGradleOptions): string; generateLintTable(messages: LintMessage[], options: GenerateLintTableOptions): LogComponent[]; cleanup?(this: T, instance: IDocument): Promise; sanitizeAssets?(assets: U[], exclusions?: unknown[]): U[]; readonly prototype: IDocument; new(module?: V, ...args: unknown[]): IDocument; } interface IWatch, U extends ExternalAsset = ExternalAsset, V extends WatchModule = WatchModule, W extends FunctionReturn = ModifiedPostFinalizeListener> extends IClient { connectTimeout: number; init(config?: HostInitConfig): this; start(assets: U[], permission?: IPermission | null): void; modified(watch: IFileGroup): Promise; configureServer(options: SecureOptions): boolean; setCA(value: string): boolean; setSSLKey(value: string): boolean; setSSLCert(value: string): boolean; hasSecureProtocol(): boolean; getRecursiveFiles(watch: IFileGroup): [string, string[]][]; whenModified?(assets: U[], postFinalize: PostFinalizeCallback): T; whenModified?(assets: U[], sanitize?: boolean, postFinalize?: PostFinalizeCallback): T; set assets(value: U[]); get assets(): U[]; set interval(value); get interval(): number; set port(value); get port(): number; set securePort(value); get securePort(): number; set host(value); get host(): T | null; } interface WatchConstructor, U extends ExternalAsset = ExternalAsset, V extends WatchModule = WatchModule, W extends FunctionReturn = ModifiedPostFinalizeListener> extends ClientConstructor { createServer(port: number, active: boolean): ws.Server | null; createServer(port: number, secure?: SecureOptions | null, active?: boolean): ws.Server | null; shutdown(): void; setTimeout(value: number | string): void; checkTimeout(client: ws.WebSocket): boolean; isConnectionError(err: unknown): boolean; readonly prototype: IWatch; new(module?: V): IWatch; new(interval?: number, port?: number, securePort?: number, extensions?: unknown[]): IWatch; } interface IRequest extends IModule, IExternalConfig { startTime: number; acceptEncoding: boolean; keepAlive: boolean | null; readTimeout: number; readExpect: ReadExpectType; proxy: ProxySettings | null; init(config?: RequestInit): this; apply(options: ApplyOptions): this; addDns(hostname: string, address: string, timeout: number): void; addDns(hostname: string, address: string, family?: number | string, timeout?: number): void; lookupDns(hostname: string): LookupFunction; proxyOf(uri: string, localhost?: boolean): ProxySettings | undefined; statusOn(name: number | number[], callback: StatusOnCallback): void; statusOn(name: number | number[], globUrl: string, callback: StatusOnCallback): void; headersOn(name: string | string[], callback: HeadersOnCallback): void; headersOn(name: string | string[], globUrl: string, callback: HeadersOnCallback): void; headersOf(uri: string): OutgoingHttpHeaders | undefined; aria2c(uri: string | URL, pathname: string | URL): Promise; aria2c(uri: string | URL, options?: Aria2Options): Promise; rclone(uri: string | URL, pathname: string | URL): Promise; rclone(uri: string | URL, options?: RcloneOptions): Promise; json(uri: string | URL, options?: OpenOptions): Promise; blob(uri: string | URL, options?: OpenOptions): Promise; pipe(uri: string | URL, to: Writable, options?: OpenOptions): Promise; opts(url: string | URL, options?: V): HostConfig & V; open(uri: string | URL, options: OpenOptions): HttpRequestClient; head(uri: string | URL, options?: OpenOptions): ClientRequest; put(uri: string | URL, data: unknown, contentType: string): Promise>; put(uri: string | URL, data: unknown, options: V): Promise>; put(uri: string | URL, data: unknown, contentType?: string | V, options?: V): Promise>; patch(uri: string | URL, data: unknown, contentType: string): Promise>; patch(uri: string | URL, data: unknown, options: V): Promise>; patch(uri: string | URL, data: unknown, contentType?: string | V, options?: V): Promise>; post(uri: string | URL, data: unknown, contentType: string): Promise>; post(uri: string | URL, parts: PostFileParts): Promise>; post(uri: string | URL, form: AnyObject, parts: PostFileParts): Promise>; post(uri: string | URL, data: unknown, options: V): Promise>; post(uri: string | URL, data: unknown, contentType?: string | PostFileParts | V, options?: V): Promise>; get(uri: string | URL, options: V): Promise; get(uri: string | URL, format: V): Promise; get(uri: string | URL, options?: W): Promise>; detach(singleton?: boolean): void; reset(adapter?: IHttpAdapter): void; close(): void; set adapter(value: unknown); set agentTimeout(value); get agentTimeout(): number; set httpVersion(value); get httpVersion(): HttpProtocolVersion | null; set ipVersion(value); get ipVersion(): InternetProtocolVersion; } interface RequestConstructor extends ModuleConstructor { readCACert(value: string, cache?: boolean): string; readTLSKey(value: string, cache?: boolean): string; readTLSCert(value: string, cache?: boolean): string; isCert(value: string): boolean; defineHttpAgent(options: HttpAgentSettings): void; defineDnsLookup(options: DnsLookupSettings, clear?: boolean): void; isRclone(value: string | URL): boolean; getAria2Path(): string; getRclonePath(): string; readonly prototype: IRequest; new(module?: T): IRequest; } interface IFileManager extends IHost, Set { processTimeout: number; Request: IRequest; Document: InstallData, T>, DocumentConstructor, T>>[]; Task: InstallData[]; Image: ImageMimeMap | null; Cloud: ICloud | null; Watch: IWatch | null; Compress: ICompress | null; readonly documentAssets: T[]; readonly taskAssets: Array>; readonly dataSourceItems: DataSource[]; readonly files: Set; readonly filesQueued: Set; readonly filesToRemove: Set; readonly filesToCompare: Map; readonly contentToAppend: Map; readonly contentToReplace: Map; readonly processing: IFileThread[]; readonly fetchedAssets: T[]; readonly copiedAssets: T[]; readonly emptyDir: Set; readonly cacheToDisk: IHttpDiskCache; readonly cacheToMemory: IHttpMemoryCache; [Symbol.asyncIterator](): IteratorObject<[string, Buffer, BufferEncoding?], BuiltinIteratorReturn>; install(name: "document", handler: string, module?: DocumentModule, ...args: unknown[]): IDocument | undefined; install(name: "document", target: DocumentConstructor, module?: DocumentModule, ...args: unknown[]): IDocument | undefined; install(name: "task", handler: string, module?: TaskModule, ...args: unknown[]): ITask | undefined; install(name: "task", target: TaskConstructor, module?: TaskModule, ...args: unknown[]): ITask | undefined; install(name: "cloud", handler: string, module?: CloudModule, ...args: unknown[]): ICloud | undefined; install(name: "cloud", module?: CloudModule): ICloud | undefined; install(name: "image", handler: string, module?: ImageModule, ...args: unknown[]): IImage | undefined; install(name: "image", target: ImageConstructor, module?: ImageModule, ...args: unknown[]): IImage | undefined; install(name: "image", targets: Map, module?: ImageModule): void; install(name: "watch", handler: string, module?: WatchModule, ...args: unknown[]): IWatch | undefined; install(name: "watch", target: WatchConstructor, module?: WatchModule, ...args: unknown[]): IWatch | undefined; install(name: "watch", module: WatchModule): IWatch | undefined; install(name: "compress", module?: CompressModule): ICompress | undefined; install(name: string, ...args: unknown[]): U | undefined; using(...items: FirstOf): this; contains(item: T, condition?: FunctionArgs<[T], boolean>): boolean; removeCwd(value: unknown): string; findAsset(value: string | URL, instance?: IModule | FindAssetOptions): T | undefined; removeAsset(file: T): boolean; replace(file: T, replaceWith: string, mimeType: string | undefined): boolean; replace(file: T, replaceWith: string, options?: ReplaceOptions): boolean; rename(file: T, value: string): boolean; performAsyncTask(): void; removeAsyncTask(): void; completeAsyncTask(err?: unknown, uri?: string, parent?: T, type?: number): void; performFinalize(override?: boolean): void; hasDocument(instance: IModule, document: string | string[] | undefined): boolean; getDocumentAssets(instance: IModule, condition?: FunctionArgs<[T], boolean>): T[]; getDataSourceItems(instance: IModule, condition?: FunctionArgs<[DataSource], boolean>): DataSource[]; checkFilename(file: T, pathname?: string): string; setLocalUri(file: T, replace?: boolean): FileOutput; getLocalUri(data: FileData): string; getMimeType(data: FileData): string; openThread(instance: IModule, data: IFileThread, timeout?: number): boolean; closeThread(instance: IModule | null, data: IFileThread, callback?: FunctionType): boolean; addProcessTimeout(instance: IModule, file: T, timeout: number): void; removeProcessTimeout(instance: IModule, file: T): void; getProcessTimeout(handler: InstallData): number; clearProcessTimeout(): void; scheduleTask(uri: string | URL, data: unknown, priority: number): Promise; scheduleTask(uri: string | URL, data: unknown, thenCallback?: FunctionReturn, catchCallback?: FunctionReturn, priority?: number): Promise; setTaskLimit(value: number): void; addDownload(value: number | Bufferable, encoding: BufferEncoding): number; addDownload(value: number | Bufferable, type?: number | BufferEncoding, encoding?: BufferEncoding): number; getDownload(type?: number): [number, number]; checkHash(checksum: ChecksumValue, options: CheckHashOptions): boolean; checkHash(checksum: ChecksumValue, data: Optional, uri: string | URL | undefined): boolean; checkHash(checksum: ChecksumValue, data: Bufferable, options?: CheckHashOptions): boolean; transformAsset(data: IFileThread, parent?: T, override?: boolean): Promise; addCopy(data: FileCommand, saveAs?: string, replace?: boolean): string | undefined; handleFilePermission(file: T): void; findMime(file: T, rename?: boolean): Promise; getUTF8String(file: T, uri?: string): string; getBuffer(file: T, minStreamSize?: U): U extends number ? Promise : Buffer | null; getCacheDir(url: string | URL, createDir?: boolean): string; setAssetContent(file: T, content: string, options?: AssetContentOptions): string; getAssetContent(file: T, content?: string): string | undefined; writeBuffer(file: T, options?: WriteFileOptions): Buffer | null; writeImage(document: string | string[], output: OutputFinalize): boolean; compressFile(file: T, overwrite?: boolean): Promise; fetchObject(uri: string | URL, format: BufferFormat): Promise; fetchObject(uri: string | URL, options?: OpenOptions | BufferFormat): Promise; fetchBuffer(uri: string | URL, options?: U): Promise>; fetchFiles(uri: string | URL, pathname: string): Promise; fetchFiles(uri: string | URL, options?: Aria2Options | RcloneOptions): Promise; updateProgress(name: "request", id: number | string, receivedBytes: number, totalBytes: number, dataTime?: HighResolutionTime): void; start(emptyDir?: boolean): Promise; processAssets(emptyDir?: boolean, using?: T[]): void; deleteFile>(src: string, promises: boolean): U; deleteFile>(src: string, options: DeleteFileOptions & DeleteFileAddendum, promises: boolean): U; deleteFile(src: string, callback?: U): unknown; deleteFile(src: string, options: DeleteFileOptions & DeleteFileAddendum, callback?: U): unknown; restart(recursive?: boolean | "abort", emptyDir?: boolean): void; restart(recursive?: boolean | "abort", exclusions?: string[], emptyDir?: boolean): void; finalizeCompress(assets: T[]): Promise; finalizeDocument(): Promise; finalizeTask(assets: Array>): Promise; finalizeCloud(): Promise; finalizeChecksum(): Promise; finalizeCleanup(): Promise; finalize(): Promise; removeFiles(): void; close(): void; reset(): boolean; get baseDirectory(): string; get config(): RequestData; get assets(): T[]; get incremental(): IncrementalMatch; set restarting(value); get restarting(): boolean; get delayed(): number; set cleared(value); get cleared(): boolean; set finalizeState(value); get finalizeState(): number; get retryLimit(): number; /* Set */ add(value: string, parent?: T, type?: number): this; delete(value: string, emptyDir?: boolean): boolean; has(value: unknown): value is string; /* EventEmitter */ on(event: "exec", listener: (command: ExecCommand, options?: SpawnOptions) => void): this; on(event: "error", listener: (err: Error) => void): this; on(event: "file:read", listener: (src: string, data: Bufferable, options?: ReadFileOptions) => void): this; on(event: "file:write", listener: (src: string, options?: WriteFileOptions) => void): this; on(event: "file:delete", listener: (src: string, options?: DeleteFileOptions) => void): this; on(event: "file:copy", listener: (dest: string, options?: CopyFileOptions) => void): this; on(event: "file:move", listener: (dest: string, options?: MoveFileOptions) => void): this; on(event: "file:permission", listener: (src: string, type?: FileActionType) => void): this; on(event: "dir:create", listener: (src: string, options?: CreateDirOptions) => void): this; on(event: "dir:remove", listener: (src: string, options?: RemoveDirOptions) => void): this; on(event: "dir:permission", listener: (src: string, type?: DirectoryActionType) => void): this; once(event: "exec", listener: (command: ExecCommand, options?: SpawnOptions) => void): this; once(event: "error", listener: (err: Error) => void): this; once(event: "file:read", listener: (src: string, data: Bufferable, options?: ReadFileOptions) => void): this; once(event: "file:write", listener: (src: string, options?: WriteFileOptions) => void): this; once(event: "file:delete", listener: (src: string, options?: DeleteFileOptions) => void): this; once(event: "file:copy", listener: (dest: string, options?: CopyFileOptions) => void): this; once(event: "file:move", listener: (dest: string, options?: MoveFileOptions) => void): this; once(event: "file:permission", listener: (src: string, type?: FileActionType) => void): this; once(event: "dir:create", listener: (src: string, options?: CreateDirOptions) => void): this; once(event: "dir:remove", listener: (src: string, options?: RemoveDirOptions) => void): this; once(event: "dir:permission", listener: (src: string, type?: DirectoryActionType) => void): this; emit(event: "exec", command: ExecCommand, options?: SpawnOptions): boolean; emit(event: "error", err: Error): boolean; emit(event: "file:read", src: string, data: Bufferable, options?: ReadFileOptions): boolean; emit(event: "file:write", src: string, options?: WriteFileOptions): boolean; emit(event: "file:delete", src: string, options?: DeleteFileOptions): boolean; emit(event: "file:copy", dest: string, options?: CopyFileOptions): boolean; emit(event: "file:move", dest: string, options?: MoveFileOptions): boolean; emit(event: "file:permission", src: string, type?: FileActionType): boolean; emit(event: "dir:create", src: string, options?: CreateDirOptions): boolean; emit(event: "dir:remove", src: string, options?: RemoveDirOptions): boolean; emit(event: "dir:permission", src: string, type?: DirectoryActionType): boolean; on(event: "end", listener: PostFinalizeCallback): this; on(event: "asset:permission", listener: (file: T) => void): this; once(event: "end", listener: PostFinalizeCallback): this; once(event: "asset:permission", listener: (file: T) => void): this; emit(event: "end", result: FinalizeResult): boolean; emit(event: "asset:permission", file: T): boolean; } interface FileManagerConstructor, U extends ExternalAsset> extends HostConstructor { purgeMemory(percent?: number, limit?: number | boolean, parent?: number | boolean): Promise; loadSettings(settings: Settings, password?: string): boolean; loadSettings(settings: Settings, permission?: PermissionReadWrite, password?: string): boolean; sanitizeAssets(assets: U[], exclusions?: string[]): U[]; writeChecksum(root: string, options: ChecksumOptions): Promise; writeChecksum(root: string, to?: string | ChecksumOptions, options?: ChecksumOptions): Promise; verifyChecksum(root: string, options: ChecksumOptions): Promise<[string[], string[], number] | null>; verifyChecksum(root: string, from?: string | ChecksumOptions, options?: ChecksumOptions): Promise<[string[], string[], number] | null>; createFileThread(host: T, file: U): IFileThread; setTimeout(options: ObjectMap): void; defineHttpCache(options: HttpMemorySettings, disk?: boolean): void; defineHttpConnect(options: HttpConnectSettings): void; defineHttpAdapter(module: unknown): void; generateSessionId(): string; readonly prototype: T; new(baseDirectory: string, config: RequestData, postFinalize?: PostFinalizeCallback): T; new(baseDirectory: string, config: RequestData, permission?: IPermission | null, postFinalize?: PostFinalizeCallback): T; } interface IHost extends IModule { restartable: boolean; readonly modules: Set; readonly subProcesses: Set; readonly startTime: number; using(...items: FirstOf): this; contains(item: unknown, condition?: FunctionReturn): boolean; find(name: string): IModule | undefined; findAll(name: string): IModule[]; willLog(name: string): boolean; ignoreLog(values: boolean | string | string[]): void; collectLog(level?: boolean): LogStatus[]; pauseLog(type?: string): void; resumeLog(type?: string): void; hasLog(type: string): boolean; delayMessage(...args: unknown[]): void; willAbort(value: string | IModule): boolean; loadModule(name: string, ...args: any[]): IModule | null; retain(process: IModule): void; release(process: IModule, log?: boolean): boolean; restart(...args: unknown[]): void; joinQueue(options?: JoinQueueOptions): boolean; updateProgress(name: string, ...args: unknown[]): void; resumeThread?(options: ResumeThreadOptions): void; set host(value); get host(): null; get config(): Readonly; get username(): string; get ipV4(): string; get ipV6(): string; set done(value); get done(): boolean; get queued(): boolean; get logState(): LogState; get errorCount(): number; } interface HostConstructor extends ModuleConstructor { loadSettings(settings: Settings, password?: string): boolean; loadSettings(settings: Settings, permission?: PermissionReadWrite, password?: string): boolean; isPermission(value: unknown): value is IPermission; createPermission(all?: boolean, freeze?: boolean): IPermission; kill(username: string, all: true): number; kill(username: string, pid: number | number[]): number; kill(username: string, iv: BinaryLike, all: true): number; kill(username: string, iv: BinaryLike, pid: number | number[]): number; getThreadCount(full: true): ThreadCountStat; getThreadCount(username: string, iv?: BinaryLike): ThreadCountStat; getThreadCount(username?: string | boolean, iv?: BinaryLike): number; parseIp(value: unknown, kind?: "ipv4" | "ipv6"): string; getLogDelayed(): FormatMessageArgs[]; getPermissionFromSettings(freeze?: boolean): IPermission; readonly prototype: IHost; new(config?: HostInitConfig): IHost; } interface IModule extends EventEmitter, IAbortComponent { readonly status: LogStatus[]; readonly errors: unknown[]; supported(major: number, minor?: number, patch?: number, lts?: boolean): boolean; supports(name: string, value?: boolean, locked?: boolean): boolean; getTempDir(options: TempDirOptions): string; getTempDir(uuidDir: boolean, createDir: boolean): string; getTempDir(pathname: string, createDir: boolean): string; getTempDir(uuidDir: boolean, filename?: string, createDir?: boolean): string; getTempDir(pathname?: string, filename?: string, createDir?: boolean): string; canRead(uri: string | URL, options?: PermissionOptions): boolean; canWrite(uri: string | URL, options?: PermissionOptions): boolean; readFile(src: string | URL): Buffer | undefined; readFile(src: string | URL, options?: U): (U extends { encoding: string } ? U extends { minStreamSize: number | string } ? Promise : string : U extends { minStreamSize: number | string } ? Promise : Buffer) | undefined; readFile(src: string | URL, promises: true): Promise | undefined; readFile(src: string | URL, options: V, promises: true): Promise<(V extends { encoding: string } ? string : U) | undefined>; readFile(src: string | URL, callback: U): (U extends ReadFileCallback ? W : Bufferable) | undefined; readFile(src: string | URL, options: V, callback: U): (V extends { encoding: string } ? string : U extends ReadFileCallback ? W : Bufferable) | undefined; writeFile(src: string | URL, data: BufferView, options?: WriteFileOptions): U; writeFile>(src: string | URL, data: BufferView, promises: true): U; writeFile>(src: string | URL, data: BufferView, options: WriteFileOptions, promises: true): U; writeFile(src: string | URL, data: BufferView, callback: U): void; writeFile(src: string | URL, data: BufferView, options: WriteFileOptions, callback: U): void; deleteFile(src: string | URL, options?: DeleteFileOptions): U; deleteFile>(src: string | URL, promises: true): U; deleteFile>(src: string | URL, options: DeleteFileOptions, promises: true): U; deleteFile(src: string | URL, callback: U): void; deleteFile(src: string | URL, options: DeleteFileOptions, callback: U): void; copyFile(src: string | URL, dest: string | URL, options?: CopyFileOptions): U; copyFile>(src: string | URL, dest: string | URL, promises: true): U; copyFile>(src: string | URL, dest: string | URL, options: CopyFileOptions, promises: true): U; copyFile(src: string | URL, dest: string | URL, callback: U): void; copyFile(src: string | URL, dest: string | URL, options: CopyFileOptions, callback: U): void; moveFile(src: string | URL, dest: string | URL, options?: MoveFileOptions): U; moveFile>(src: string | URL, dest: string | URL, promises: true): U; moveFile>(src: string | URL, dest: string | URL, options: MoveFileOptions, promises: true): U; moveFile(src: string | URL, dest: string | URL, callback: U): void; moveFile(src: string | URL, dest: string | URL, options: MoveFileOptions, callback: U): void; createDir(src: string | URL, options?: CreateDirOptions): U; createDir>(src: string | URL, promises: true): U; createDir>(src: string | URL, options: CreateDirOptions, promises: true): U; createDir(src: string | URL, callback: U): void; createDir(src: string | URL, options: CreateDirOptions, callback: U): void; removeDir(src: string | URL, options?: RemoveDirOptions): U; removeDir>(src: string | URL, promises: true): U; removeDir>(src: string | URL, options: RemoveDirOptions, promises: true): U; removeDir(src: string | URL, callback: U): void; removeDir(src: string | URL, options: RemoveDirOptions, callback: U): void; allSettled(values: readonly (U | PromiseLike)[], rejected?: LogValue, type?: LogType): Promise[]>; allSettled(values: readonly (U | PromiseLike)[], rejected?: LogValue, options?: LogFailOptions): Promise[]>; formatMessage(type: LogType, title: string, value: LogValue, message?: unknown, options?: LogMessageOptions): void; formatFail(type: LogType, title: string, value: LogValue, message?: unknown, options?: LogFailOptions): void; writeFail(value: LogValue, message: unknown, options: LogFailOptions): void; writeFail(value: LogValue, message?: unknown, type?: LogType | LogFailOptions): void; writeTimeProcess(title: string, value: string, startTime: LogTime, options?: LogProcessOptions): void; writeTimeElapsed(title: string, value: LogValue, startTime: LogTime, options?: LogMessageOptions): void; checkPackage(err: unknown, name: string | undefined, type: LogType): boolean; checkPackage(err: unknown, name: string | undefined, options: LogFailOptions): boolean; checkPackage(err: unknown, name: string | undefined, value?: LogValue, options?: LogFailOptions | LogType): boolean; checkFail(message: unknown, options: LogFailOptions): LogArguments | false | undefined; writeLog(component: LogComponent, queue?: boolean): void; writeLog(type: StatusType, value: unknown, options: LogOptions): void; writeLog(type: StatusType, value: unknown, timeStamp?: LogDate, duration?: number): void; addLog(component: LogComponent, queue?: boolean): void; addLog(type: StatusType, value: unknown, options: LogOptions): void; addLog(type: StatusType, value: unknown, from: string, source?: string): void; addLog(type: StatusType, value: unknown, timeStamp?: LogDate, from?: string, source?: string): void; addLog(type: StatusType, value: unknown, timeStamp?: LogDate, duration?: number, from?: string, source?: string): void; getLog(...type: StatusType[]): LogStatus[]; flushLog(): void; willAbort(value: unknown): boolean; /** @deprecated hasPermission("fs") */ hasOwnPermission(): boolean; hasPermission(type: PermissionType | string, ...values: unknown[]): boolean; isFatal(err?: unknown): boolean; detach(): void; reset(): void; get moduleName(): string; set host(value); get host(): T | null; set permission(value); get permission(): IPermission | null; get aborted(): boolean; set abortable(value); get abortable(): boolean; get threadable(): boolean; set sessionId(value); get sessionId(): string; set broadcastId(value); get broadcastId(): string | string[]; set silent(value); get silent(): boolean; get logType(): LOG_TYPE; set logLevel(value: number | string); get logLevel(): number; get statusType(): STATUS_TYPE; set tempDir(value); get tempDir(): string; /* EventEmitter */ on(event: "exec", listener: (command: ExecCommand, options?: SpawnOptions) => void): this; on(event: "error", listener: (err: Error) => void): this; on(event: "file:read", listener: (src: string, data: Bufferable, options?: ReadFileOptions) => void): this; on(event: "file:write", listener: (src: string, options?: WriteFileOptions) => void): this; on(event: "file:delete", listener: (src: string, options?: DeleteFileOptions) => void): this; on(event: "file:copy", listener: (dest: string, options?: CopyFileOptions) => void): this; on(event: "file:move", listener: (dest: string, options?: MoveFileOptions) => void): this; on(event: "file:permission", listener: (src: string, type?: FileActionType) => void): this; on(event: "dir:create", listener: (src: string, options?: CreateDirOptions) => void): this; on(event: "dir:remove", listener: (src: string, options?: RemoveDirOptions) => void): this; on(event: "dir:permission", listener: (src: string, type?: DirectoryActionType) => void): this; once(event: "exec", listener: (command: ExecCommand, options?: SpawnOptions) => void): this; once(event: "error", listener: (err: Error) => void): this; once(event: "file:read", listener: (src: string, data: Bufferable, options?: ReadFileOptions) => void): this; once(event: "file:write", listener: (src: string, options?: WriteFileOptions) => void): this; once(event: "file:delete", listener: (src: string, options?: DeleteFileOptions) => void): this; once(event: "file:copy", listener: (dest: string, options?: CopyFileOptions) => void): this; once(event: "file:move", listener: (dest: string, options?: MoveFileOptions) => void): this; once(event: "file:permission", listener: (src: string, type?: FileActionType) => void): this; once(event: "dir:create", listener: (src: string, options?: CreateDirOptions) => void): this; once(event: "dir:remove", listener: (src: string, options?: RemoveDirOptions) => void): this; once(event: "dir:permission", listener: (src: string, type?: DirectoryActionType) => void): this; emit(event: "exec", command: ExecCommand, options?: SpawnOptions): boolean; emit(event: "error", err: Error): boolean; emit(event: "file:read", src: string, data: Bufferable, options?: ReadFileOptions): boolean; emit(event: "file:write", src: string, options?: WriteFileOptions): boolean; emit(event: "file:delete", src: string, options?: DeleteFileOptions): boolean; emit(event: "file:copy", dest: string, options?: CopyFileOptions): boolean; emit(event: "file:move", dest: string, options?: MoveFileOptions): boolean; emit(event: "file:permission", src: string, type?: FileActionType): boolean; emit(event: "dir:create", src: string, options?: CreateDirOptions): boolean; emit(event: "dir:remove", src: string, options?: RemoveDirOptions): boolean; emit(event: "dir:permission", src: string, type?: DirectoryActionType): boolean; } interface ModuleConstructor { PROCESS_TIMEOUT: number; LOG_STYLE_FAIL: LogMessageOptions; LOG_STYLE_SUCCESS: LogMessageOptions; LOG_STYLE_INFO: LogMessageOptions; LOG_STYLE_WARN: LogMessageOptions; LOG_STYLE_NOTICE: LogMessageOptions; LOG_STYLE_REVERSE: LogMessageOptions; readonly VERSION: string; readonly LOG_TYPE: LOG_TYPE; readonly LOG_FORMAT: LoggerFormatSettings>; readonly STATUS_TYPE: STATUS_TYPE; readonly PLATFORM_WIN32: boolean; readonly MAX_TIMEOUT: number; readonly TEMP_DIR: string; constructorOf(value: unknown, moduleName?: string): value is U; /** @deprecated @e-mc/types */ supported(major: number, minor?: number, patch?: number, lts?: boolean): boolean; formatMessage(type: LogType, title: string, value: LogValue, message?: unknown, options?: LogMessageOptions): void; writeFail(value: LogValue, message?: unknown, options?: LogFailOptions | LogType): void; enabled(key: string, username?: string): boolean; parseFunction(value: unknown, options?: ParseFunctionOptions): FunctionType | U, V> | null; parseFunction(value: unknown, absolute: boolean, sync?: boolean): FunctionType | U, V> | null; asString(value: unknown, cacheKey?: boolean | "throws"): string; asHash(data: BinaryLike, options?: AsHashOptions): string; asHash(data: BinaryLike, algorithm?: string, options?: HashOptions): string; asHash(data: BinaryLike, algorithm?: string, encoding?: BufferEncoding): string; readHash(value: string | URL, options?: ReadHashOptions): Promise; toPosix(value: unknown, normalize: boolean): string; toPosix(value: unknown, filename?: string, normalize?: boolean): string; hasLogType(value: LogType): boolean; isURL(value: string, ...exclude: string[]): boolean; isFile(value: string | URL, type?: ProtocolType): boolean; isDir(value: string | URL, absolute?: boolean): boolean; isPath(value: string | URL, type?: "unc" | "unc-exists"): boolean; isPath(value: string | URL, isFile?: boolean): boolean; /** @deprecated @e-mc/types */ isErrorCode(err: unknown, ...code: U): err is Required>; fromLocalPath(value: string): string; resolveFile(value: string): string; resolvePath(value: string, base: string | URL): string; joinPath(...values: [...paths: unknown[], normalize: boolean][]): string; joinPath(...values: unknown[]): string; normalizePath(value: unknown, flags?: boolean | number): string; createDir(value: string | URL, overwrite?: boolean): boolean; removeDir(value: string | URL, sinceCreated: number, recursive?: boolean): boolean; removeDir(value: string | URL, empty?: boolean, recursive?: boolean): boolean; copyDir(src: string | URL, dest: string | URL, move?: boolean, recursive?: boolean): Promise; copyDir(src: string | URL, dest: string | URL, options?: CopyDirOptions): Promise; globDir(src: string | URL, pattern: string | string[], recursive: boolean | number): Promise; globDir(src: string | URL, pattern: string | string[], options?: GlobDirOptions): Promise; renameFile(src: string | URL, dest: string | URL, throws?: boolean): boolean; streamFile(value: string | URL, cache: boolean): Promise; streamFile(value: string | URL, options: U): Promise; streamFile(value: string | URL, cache?: boolean | U, options?: U): Promise; readText(value: string | URL, cache: boolean): string; readText(value: string | URL, options: U): U extends { minStreamSize: number | string } ? Promise : string; readText(value: string | URL, encoding?: BufferEncoding | ReadTextOptions, cache?: boolean): string; readBuffer(value: string | URL, options: U): U extends { minStreamSize: number | string } ? Promise : Buffer | null; readBuffer(value: string | URL, cache?: boolean | ReadBufferOptions): Buffer | null; resolveMime(data: FileTypeFormat): Promise; lookupMime(value: string, extension?: boolean): string; /** @deprecated class */ initCpuUsage(instance?: IModule, thread?: boolean): CpuUsage; /** @deprecated private */ getCpuUsage(start: CpuUsage, format: true, thread?: boolean): string; /** @deprecated private */ getCpuUsage(start: CpuUsage, format?: boolean, thread?: boolean): number; /** @deprecated private */ getMemUsage(format: true | "%" | Unit, free?: boolean): string; /** @deprecated private */ getMemUsage(format?: boolean, free?: boolean): number; /** @deprecated private */ formatCpuMem(start: CpuUsage, all?: boolean): string; getPackageVersion(name: string | [string, string], options?: PackageVersionOptions): string; checkSemVer(name: string | [string, string], options: CheckSemVerOptions): boolean; checkSemVer(name: string | [string, string], min: number | string, max?: number | string): boolean; checkSemVer(name: string | [string, string], min: number | string, max: number | string, options?: Omit): boolean; /** @deprecated @e-mc/types */ sanitizeCmd(value: string, ...args: unknown[]): string; /** @deprecated @e-mc/types */ sanitizeArgs(value: string, doubleQuote?: boolean): string; /** @deprecated @e-mc/types */ sanitizeArgs(values: string[], doubleQuote?: boolean): string[]; purgeMemory(percent: number, limit: number, parent?: boolean): Promise; purgeMemory(percent?: number, limit?: number | boolean, parent?: unknown): Promise; availableParallelism(factor?: number): number; canWrite(name: "temp" | "home"): boolean; loadSettings(settings: Settings, password?: string): boolean; readonly prototype: IModule; new(): IModule; } } export = functions;