Skip to content

Commit 4163c3a

Browse files
authored
🤖 Merge PR DefinitelyTyped#73520 fix(dockerode): improve types for AuthConfig, Image.push by @jirimoravcik
1 parent f26583d commit 4163c3a

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

types/dockerode/index.d.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,10 @@ declare namespace Dockerode {
130130
get(callback: Callback<NodeJS.ReadableStream>): void;
131131
get(): Promise<NodeJS.ReadableStream>;
132132

133-
push(options: ImagePushOptions, callback: Callback<NodeJS.ReadableStream>): void;
134-
push(callback: Callback<NodeJS.ReadableStream>): void;
133+
push(options: ImagePushOptions, callback: Callback<NodeJS.ReadableStream>, auth?: AuthConfig): void;
134+
push(callback: Callback<NodeJS.ReadableStream>, auth?: AuthConfig): void;
135135
push(options?: ImagePushOptions): Promise<NodeJS.ReadableStream>;
136+
push(options?: ImagePushOptions, callback?: undefined, auth?: AuthConfig): Promise<NodeJS.ReadableStream>;
136137

137138
tag(options: ImageTagOptions, callback: Callback<any>): void;
138139
tag(callback: Callback<any>): void;
@@ -1134,6 +1135,7 @@ declare namespace Dockerode {
11341135
tag?: string | undefined;
11351136
authconfig?: AuthConfig | undefined;
11361137
abortSignal?: AbortSignal;
1138+
stream?: boolean | undefined;
11371139
}
11381140

11391141
interface ImageTagOptions {
@@ -1148,7 +1150,13 @@ declare namespace Dockerode {
11481150
tag?: string;
11491151
}
11501152

1151-
interface AuthConfig {
1153+
interface AuthConfigKey {
1154+
key: string;
1155+
}
1156+
interface AuthConfigBase64 {
1157+
base64: string;
1158+
}
1159+
interface AuthConfigObject {
11521160
username?: string;
11531161
password?: string;
11541162
auth?: string;
@@ -1159,6 +1167,8 @@ declare namespace Dockerode {
11591167
email?: string | undefined;
11601168
}
11611169

1170+
type AuthConfig = AuthConfigKey | AuthConfigBase64 | AuthConfigObject;
1171+
11621172
interface RegistryConfig {
11631173
[registryAddress: string]: {
11641174
username: string;

0 commit comments

Comments
 (0)