import EventEmitter from "node:events"; //#region src/repo.d.ts type Repo = { mode: 'tar' | 'git'; name: string; ref: string; site: string; transport: 'https' | 'ssh'; ssh: string; subdir?: string; url: string; user: string; }; //#endregion //#region src/git-client.d.ts type Ref = { hash: string; name?: string; type?: string; }; type GitClient = { fetchRefs(repo: Repo): Promise; clone(repo: Repo, dest: string, ref?: string, transport?: Repo['transport']): Promise; }; //#endregion //#region src/index.d.ts type FetchFn = (url: string, dest: string, proxy?: string) => Promise; type ConstructorOptions = { cache?: boolean; fetch?: FetchFn; force?: boolean; git?: GitClient; mode?: 'tar' | 'git'; platform?: NodeJS.Platform; verbose?: boolean; }; type EventInfo = { code?: InfoCode | DegitErrorCode; dest?: string; message: string; repo?: Repo; url?: string; original?: unknown; ref?: string; }; type Directive = { action: 'clone'; cache?: boolean; src: string; verbose?: boolean; } | { action: 'remove'; files: string | string[]; }; type CloneDirective = Extract; type RemoveDirective = Extract; type DirectiveActions = { clone: (dir: string, dest: string, action: CloneDirective) => Promise; remove: (dest: string, action: RemoveDirective) => void; }; type Options = ConstructorOptions; type ValidModes = 'tar' | 'git'; type InfoCode = 'SUCCESS' | 'FILE_DOES_NOT_EXIST' | 'FILE_OUTSIDE_DEST' | 'REMOVED' | 'DEST_NOT_EMPTY' | 'DEST_IS_EMPTY' | 'USING_CACHE' | 'FOUND_MATCH' | 'FILE_EXISTS' | 'PROXY' | 'DOWNLOADING' | 'EXTRACTING'; type DegitErrorCode = 'DEST_NOT_EMPTY' | 'MISSING_REF' | 'COULD_NOT_DOWNLOAD' | 'BAD_SRC' | 'UNSUPPORTED_HOST' | 'BAD_REF' | 'COULD_NOT_FETCH'; type Info = EventInfo; type Action = Directive; type DegitAction = CloneDirective; type RemoveAction = RemoveDirective; declare function degit(src: string, opts?: ConstructorOptions): Degit; declare class Degit extends EventEmitter { cache?: boolean; force?: boolean; mode: 'tar' | 'git'; verbose?: boolean; proxy?: string; repo: Repo; platform: NodeJS.Platform; _fetch: FetchFn; _git?: GitClient; _gitClientPromise?: Promise; _hasStashed: boolean; directiveActions: DirectiveActions; constructor(src: string, opts?: ConstructorOptions); _getGitClient(): Promise; _getDirectives(dest: string): Directive[] | false; clone(dest: string): Promise; remove(dest: string, action: RemoveDirective): void; _checkDirIsEmpty(dir: string): void; _info(info: EventInfo): void; _warn(info: EventInfo): void; _verbose(info: EventInfo): void; _getHash(repo: Repo, cached: Record): Promise; _getHashFromCache(repo: Repo, cached: Record): string | undefined; _selectRef(refs: Array<{ hash: string; name?: string; type?: string; }>, selector: string): string | null | undefined; _selectHead(refs: Array<{ hash: string; name?: string; type?: string; }>): string; _cloneWithTar(dir: string, dest: string): Promise; _cloneWithGit(dest: string, ref?: string): Promise; _shouldFallbackToGit(error: unknown): boolean; _untarWithRetry(file: string, dest: string, subdir: string | null, url: string): Promise; _hasGitLfsPointers(dir: string): boolean; _copyExtractedFiles(sourceDir: string, destDir: string): void; } //#endregion export { Action, DegitAction, DegitErrorCode, Info, InfoCode, Options, RemoveAction, ValidModes, degit as default };