import type { IncomingHttpHeaders } from 'node:http'; import type { Readable } from 'node:stream'; import type { estypes } from '@elastic/elasticsearch'; import type { Context } from 'egg'; export interface UploadResult { key: string; } export interface AppendResult { key: string; nextAppendPosition?: number; } export interface UploadOptions { key: string; } export interface AppendOptions { key: string; position?: string; headers?: IncomingHttpHeaders; } export interface DownloadOptions { timeout: number; } export interface NFSClient { uploadBytes(bytes: Uint8Array, options: UploadOptions): Promise; appendBytes(bytes: Uint8Array, options: AppendOptions): Promise; upload(filePath: string, options: UploadOptions): Promise; remove(key: string): Promise; readBytes(key: string): Promise; createDownloadStream(key: string): Promise; download(key: string, filepath: string, options: DownloadOptions): Promise; url?(key: string): string; } export interface QueueAdapter { push(key: string, item: T): Promise; pop(key: string): Promise; length(key: string): Promise; } export interface SearchAdapter { search(query: any): Promise>; upsert(id: string, document: T): Promise; delete(id: string): Promise; } export interface AuthUrlResult { loginUrl: string; doneUrl: string; } export interface userResult { name: string; email: string; } export interface AuthClient { getAuthUrl(ctx: Context): Promise; ensureCurrentUser(): Promise; }