Refactor: Add docker-utils typings

Change-type: patch
Signed-off-by: Cameron Diver <cameron@resin.io>
This commit is contained in:
Cameron Diver 2018-07-23 22:48:27 +01:00
parent b504306f28
commit 3a4f1594e0
No known key found for this signature in database
GPG Key ID: 69264F9C923F55C1

35
src/lib/docker-utils.d.ts vendored Normal file
View File

@ -0,0 +1,35 @@
import * as Bluebird from 'bluebird';
import DockerToolbelt = require('docker-toolbelt');
// This is the EnvVarObject from src/lib/types, but it seems we cannot
// reference it relatively. Just redefine it as it's simple and won't change
// often
interface EnvVarObject {
[name: string]: string;
}
interface TaggedRepoImage {
repo: string;
tag: string;
}
declare class DockerUtils extends DockerToolbelt {
constructor(opts: any);
getRepoAndTag(image: string): Bluebird<TaggedRepoImage>;
fetchDeltaWithProgress(imgDest: string, fullDeltaOpts: any, onProgress: (args: any) => void): Bluebird<void>;
fetchImageWithProgress(
image: string,
config: { uuid: string, currentApiKey: string },
onProgress: (args: any) => void,
): Bluebird<void>;
getImageEnv(id: string): Bluebird<EnvVarObject>;
getNetworkGateway(netName: string): Bluebird<string>;
}
export = DockerUtils;