From 3a4f1594e04a214725b0e2b661de6666d154c63c Mon Sep 17 00:00:00 2001 From: Cameron Diver Date: Mon, 23 Jul 2018 22:48:27 +0100 Subject: [PATCH] Refactor: Add docker-utils typings Change-type: patch Signed-off-by: Cameron Diver --- src/lib/docker-utils.d.ts | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/lib/docker-utils.d.ts diff --git a/src/lib/docker-utils.d.ts b/src/lib/docker-utils.d.ts new file mode 100644 index 00000000..6c057fae --- /dev/null +++ b/src/lib/docker-utils.d.ts @@ -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; + + fetchDeltaWithProgress(imgDest: string, fullDeltaOpts: any, onProgress: (args: any) => void): Bluebird; + + fetchImageWithProgress( + image: string, + config: { uuid: string, currentApiKey: string }, + onProgress: (args: any) => void, + ): Bluebird; + + getImageEnv(id: string): Bluebird; + getNetworkGateway(netName: string): Bluebird; + +} + +export = DockerUtils;