1 | import { Arch } from "builder-util";
|
2 | import { CancellationToken, PublishProvider } from "builder-util-runtime";
|
3 | import { Stats } from "fs-extra";
|
4 | import { ClientRequest } from "http";
|
5 | import { MultiProgress } from "./multiProgress";
|
6 | import { ProgressBar } from "./progress";
|
7 | export type PublishPolicy = "onTag" | "onTagOrDraft" | "always" | "never";
|
8 | export { ProgressCallback } from "./progress";
|
9 | export interface PublishOptions {
|
10 | publish?: PublishPolicy | null;
|
11 | }
|
12 | export interface PublishContext {
|
13 | readonly cancellationToken: CancellationToken;
|
14 | readonly progress: MultiProgress | null;
|
15 | }
|
16 | export interface UploadTask {
|
17 | file: string;
|
18 | fileContent?: Buffer | null;
|
19 | arch: Arch | null;
|
20 | safeArtifactName?: string | null;
|
21 | timeout?: number | null;
|
22 | }
|
23 | export declare abstract class Publisher {
|
24 | protected readonly context: PublishContext;
|
25 | protected constructor(context: PublishContext);
|
26 | abstract get providerName(): PublishProvider;
|
27 | abstract upload(task: UploadTask): Promise<any>;
|
28 | protected createProgressBar(fileName: string, size: number): ProgressBar | null;
|
29 | protected createReadStreamAndProgressBar(file: string, fileStat: Stats, progressBar: ProgressBar | null, reject: (error: Error) => void): NodeJS.ReadableStream;
|
30 | abstract toString(): string;
|
31 | }
|
32 | export declare abstract class HttpPublisher extends Publisher {
|
33 | protected readonly context: PublishContext;
|
34 | private readonly useSafeArtifactName;
|
35 | protected constructor(context: PublishContext, useSafeArtifactName?: boolean);
|
36 | upload(task: UploadTask): Promise<any>;
|
37 | protected abstract doUpload(fileName: string, arch: Arch, dataLength: number, requestProcessor: (request: ClientRequest, reject: (error: Error) => void) => void, file: string): Promise<any>;
|
38 | }
|
39 | export declare function getCiTag(): string | null;
|