import type { BundleAction, FileAsset, LocationUri, MimeTypeAction } from './squared'; import type { IFileManager, IModule } from './index'; import type { IAbortComponent } from './core'; import type { FetchType } from './filemanager'; interface ProcessInit { threadCount: number; startTime: number; timeout: number; } export interface BinaryAction { binOpts?: string[]; } export interface StreamAction { minStreamSize?: number | string; } export interface FileData extends MimeTypeAction { file: T; } export interface FileCommand extends FileData { command?: string; outputType?: string; } export interface IFileThread extends IAbortComponent, Required> { threadCount: number; readonly startTime: number; openThread(instance: IModule, timeout?: number): boolean; closeThread(instance: IModule, callback?: FunctionType): boolean; getObject>(data?: PlainObject): U; get host(): IFileManager; get queuedTasks(): FunctionType[]; } export interface FileThreadConstructor { readonly prototype: IFileThread; new(host: IFileManager, file: ExternalAsset, threadCount: number): IFileThread; } export interface OutputFinalize extends FileCommand { output: string; baseDirectory?: string; } export interface InitialValue extends Partial, MimeTypeAction { localUri?: string; buffer?: Buffer; etag?: string; cacheable?: boolean; } export interface ExternalAsset extends FileAsset, BundleAction, BinaryAction, StreamAction { id?: number; url?: URL; socketPath?: string; buffer?: Null; localUri?: string; fetchType?: FetchType; sourceUTF8?: string; transforms?: string[]; descendants?: string[]; torrentFiles?: string[]; sourceFiles?: string[]; initialValue?: InitialValue; processModule?: ObjectMap; etag?: string; lastModified?: string; contentLength?: number; invalid?: boolean; } export type HashAlgorithm = "md5" | "sha1" | "sha256" | "sha224" | "sha384" | "sha512" | "ripemd" | "ripemd-160";