mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
dockerode definition update
This commit is contained in:
parent
1def709eed
commit
1d69ae6694
261
types/dockerode/index.d.ts
vendored
261
types/dockerode/index.d.ts
vendored
@ -6,6 +6,8 @@
|
||||
// Ray Fang <https://github.com/lazarusx>
|
||||
// Marius Meisenzahl <https://github.com/meisenzahl>
|
||||
// Rob Moran <https://github.com/thegecko>
|
||||
// Cameron Diver <https://github.com/CameronDiver>
|
||||
// Pascal Sthamer <https://github.com/p4sca1>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
@ -14,8 +16,16 @@
|
||||
import * as stream from 'stream';
|
||||
import * as events from 'events';
|
||||
|
||||
// The modem parameter is an instance of docker-modem, which is missing type declarations.
|
||||
// https://github.com/apocas/docker-modem
|
||||
|
||||
declare namespace Dockerode {
|
||||
interface Container {
|
||||
class Container {
|
||||
constructor(modem: any, id: string);
|
||||
|
||||
modem: any;
|
||||
id: string;
|
||||
|
||||
inspect(options: {}, callback: Callback<ContainerInspectInfo>): void;
|
||||
inspect(callback: Callback<ContainerInspectInfo>): void;
|
||||
inspect(options?: {}): Promise<ContainerInspectInfo>;
|
||||
@ -103,14 +113,16 @@ declare namespace Dockerode {
|
||||
stats(callback: Callback<any>): void;
|
||||
stats(options?: {}): Promise<any>;
|
||||
|
||||
attach(options: {}, callback: Callback<NodeJS.ReadableStream>): void;
|
||||
attach(options: {}): Promise<NodeJS.ReadableStream>;
|
||||
|
||||
modem: any;
|
||||
id?: string;
|
||||
attach(options: {}, callback: Callback<NodeJS.ReadWriteStream>): void;
|
||||
attach(options: {}): Promise<NodeJS.ReadWriteStream>;
|
||||
}
|
||||
|
||||
interface Image {
|
||||
class Image {
|
||||
constructor(modem: any, name: string);
|
||||
|
||||
modem: any;
|
||||
id: string;
|
||||
|
||||
inspect(callback: Callback<ImageInspectInfo>): void;
|
||||
inspect(): Promise<ImageInspectInfo>;
|
||||
|
||||
@ -131,24 +143,28 @@ declare namespace Dockerode {
|
||||
remove(options: {}, callback: Callback<ImageRemoveInfo>): void;
|
||||
remove(callback: Callback<ImageRemoveInfo>): void;
|
||||
remove(options?: {}): Promise<any>;
|
||||
|
||||
modem: any;
|
||||
id?: string;
|
||||
}
|
||||
|
||||
interface Volume {
|
||||
class Volume {
|
||||
constructor(modem: any, name: string);
|
||||
|
||||
modem: any;
|
||||
name: string;
|
||||
|
||||
inspect(callback: Callback<any>): void;
|
||||
inspect(): Promise<any>;
|
||||
|
||||
remove(options: {}, callback: Callback<any>): void;
|
||||
remove(callback: Callback<any>): void;
|
||||
remove(options?: {}): Promise<any>;
|
||||
|
||||
modem: any;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
interface Service {
|
||||
class Service {
|
||||
constructor(modem: any, id: string);
|
||||
|
||||
modem: any;
|
||||
id: string;
|
||||
|
||||
inspect(callback: Callback<any>): void;
|
||||
inspect(): Promise<any>;
|
||||
|
||||
@ -158,20 +174,24 @@ declare namespace Dockerode {
|
||||
|
||||
update(options: {}, callback: Callback<any>): void;
|
||||
update(options: {}): Promise<any>;
|
||||
|
||||
modem: any;
|
||||
id?: string;
|
||||
}
|
||||
|
||||
interface Task {
|
||||
class Task {
|
||||
constructor(modem: any, id: string);
|
||||
|
||||
modem: any;
|
||||
id: string;
|
||||
|
||||
inspect(callback: Callback<any>): void;
|
||||
inspect(): Promise<any>;
|
||||
|
||||
modem: any;
|
||||
id?: string;
|
||||
}
|
||||
|
||||
interface Node {
|
||||
class Node {
|
||||
constructor(modem: any, id: string);
|
||||
|
||||
modem: any;
|
||||
id: string;
|
||||
|
||||
inspect(callback: Callback<any>): void;
|
||||
inspect(): Promise<any>;
|
||||
|
||||
@ -182,12 +202,11 @@ declare namespace Dockerode {
|
||||
remove(options: {}, callback: Callback<any>): void;
|
||||
remove(callback: Callback<any>): void;
|
||||
remove(options?: {}): Promise<any>;
|
||||
|
||||
modem: any;
|
||||
id?: string;
|
||||
}
|
||||
|
||||
interface Plugin {
|
||||
class Plugin {
|
||||
constructor(modem: any, name: string, remote?: any);
|
||||
|
||||
modem: any;
|
||||
name: string;
|
||||
remote: any;
|
||||
@ -226,7 +245,12 @@ declare namespace Dockerode {
|
||||
upgrade(auth: any, options?: {}): Promise<any>;
|
||||
}
|
||||
|
||||
interface Secret {
|
||||
class Secret {
|
||||
constructor(modem: any, id: string);
|
||||
|
||||
modem: any;
|
||||
id: string;
|
||||
|
||||
inspect(callback: Callback<SecretInfo>): void;
|
||||
inspect(): Promise<SecretInfo>;
|
||||
|
||||
@ -237,12 +261,14 @@ declare namespace Dockerode {
|
||||
remove(options: {}, callback: Callback<any>): void;
|
||||
remove(callback: Callback<any>): void;
|
||||
remove(options?: {}): Promise<any>;
|
||||
|
||||
modem: any;
|
||||
id?: string;
|
||||
}
|
||||
|
||||
interface Network {
|
||||
class Network {
|
||||
constructor(modem: any, id: string);
|
||||
|
||||
modem: any;
|
||||
id: string;
|
||||
|
||||
inspect(callback: Callback<any>): void;
|
||||
inspect(): Promise<any>;
|
||||
|
||||
@ -257,12 +283,14 @@ declare namespace Dockerode {
|
||||
disconnect(options: {}, callback: Callback<any>): void;
|
||||
disconnect(callback: Callback<any>): void;
|
||||
disconnect(options?: {}): Promise<any>;
|
||||
|
||||
modem: any;
|
||||
id?: string;
|
||||
}
|
||||
|
||||
interface Exec {
|
||||
class Exec {
|
||||
constructor(modem: any, id: string);
|
||||
|
||||
modem: any;
|
||||
id: string;
|
||||
|
||||
inspect(callback: Callback<any>): void;
|
||||
inspect(): Promise<any>;
|
||||
|
||||
@ -271,9 +299,6 @@ declare namespace Dockerode {
|
||||
|
||||
resize(options: {}, callback: Callback<any>): void;
|
||||
resize(options: {}): Promise<any>;
|
||||
|
||||
modem: any;
|
||||
id?: string;
|
||||
}
|
||||
|
||||
interface ImageInfo {
|
||||
@ -328,6 +353,20 @@ declare namespace Dockerode {
|
||||
MacAddress: string;
|
||||
}
|
||||
|
||||
// not complete definition of network inspection
|
||||
// info which is returned by list / inspect
|
||||
interface NetworkInspectInfo {
|
||||
Id: string;
|
||||
Name: string;
|
||||
Driver: string;
|
||||
Created: string;
|
||||
Scope: string;
|
||||
EnableIPv6: boolean;
|
||||
Internal: boolean;
|
||||
Attachable: boolean;
|
||||
Ingress: boolean;
|
||||
}
|
||||
|
||||
interface ContainerInspectInfo {
|
||||
Id: string;
|
||||
Created: string;
|
||||
@ -434,13 +473,13 @@ declare namespace Dockerode {
|
||||
}
|
||||
};
|
||||
Node?: {
|
||||
ID: string;
|
||||
IP: string;
|
||||
Addr: string;
|
||||
Name: string;
|
||||
Cpus: number;
|
||||
Memory: number;
|
||||
Labels: any;
|
||||
ID: string;
|
||||
IP: string;
|
||||
Addr: string;
|
||||
Name: string;
|
||||
Cpus: number;
|
||||
Memory: number;
|
||||
Labels: any;
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -573,6 +612,77 @@ declare namespace Dockerode {
|
||||
};
|
||||
}
|
||||
|
||||
interface AuthConfig {
|
||||
username: string;
|
||||
password: string;
|
||||
serveraddress: string;
|
||||
email?: string;
|
||||
}
|
||||
|
||||
interface PortBinding {
|
||||
HostIp?: string;
|
||||
HostPort?: string;
|
||||
}
|
||||
|
||||
interface PortMap {
|
||||
[key: string]: PortBinding[];
|
||||
}
|
||||
|
||||
interface RestartPolicy {
|
||||
Name: string;
|
||||
MaximumRetryCount?: number;
|
||||
}
|
||||
|
||||
type LoggingDriverType =
|
||||
| "json-file"
|
||||
| "syslog"
|
||||
| "journald"
|
||||
| "gelf"
|
||||
| "fluentd"
|
||||
| "awslogs"
|
||||
| "splunk"
|
||||
| "etwlogs"
|
||||
| "none";
|
||||
|
||||
interface LogConfig {
|
||||
Type: LoggingDriverType;
|
||||
Config?: { [key: string]: string };
|
||||
}
|
||||
|
||||
interface DeviceMapping {
|
||||
PathOnHost: string;
|
||||
PathInContainer: string;
|
||||
CgroupPermissions: string;
|
||||
}
|
||||
|
||||
/* tslint:disable:interface-name */
|
||||
interface IPAMConfig {
|
||||
IPv4Address?: string;
|
||||
IPv6Address?: string;
|
||||
LinkLocalIPs?: string[];
|
||||
}
|
||||
/* tslint:enable:interface-name */
|
||||
|
||||
interface EndpointSettings {
|
||||
IPAMConfig?: IPAMConfig;
|
||||
Links?: string[];
|
||||
Aliases?: string[];
|
||||
NetworkID?: string;
|
||||
EndpointID?: string;
|
||||
Gateway?: string;
|
||||
IPAddress?: string;
|
||||
IPPrefixLen?: number;
|
||||
IPv6Gateway?: string;
|
||||
GlobalIPv6Address?: string;
|
||||
GlobalIPV6PrefixLen?: number;
|
||||
MacAddress?: string;
|
||||
DriverOpts?: { [key: string]: string };
|
||||
}
|
||||
|
||||
interface EndpointsConfig {
|
||||
[key: string]: EndpointSettings;
|
||||
}
|
||||
|
||||
interface ContainerCreateOptions {
|
||||
name?: string;
|
||||
Hostname?: string;
|
||||
@ -620,7 +730,7 @@ declare namespace Dockerode {
|
||||
OomScoreAdj?: number;
|
||||
PidMode?: string;
|
||||
PidsLimit?: number;
|
||||
PortBindings?: { [portAndProtocol: string]: Array<{ [index: string]: string }> };
|
||||
PortBindings?: PortMap;
|
||||
PublishAllPorts?: boolean;
|
||||
Privileged?: boolean;
|
||||
ReadonlyRootfs?: boolean;
|
||||
@ -632,31 +742,19 @@ declare namespace Dockerode {
|
||||
CapAdd?: string[];
|
||||
CapDrop?: string[];
|
||||
GroupAdd?: string[];
|
||||
RestartPolicy?: { [index: string]: number | string };
|
||||
RestartPolicy?: RestartPolicy;
|
||||
NetworkMode?: string;
|
||||
Devices?: any[];
|
||||
Devices?: DeviceMapping[];
|
||||
Sysctls?: { [index: string]: string };
|
||||
Ulimits?: Array<{}>;
|
||||
LogConfig?: { [index: string]: string | {} };
|
||||
LogConfig?: LogConfig;
|
||||
SecurityOpt?: { [index: string]: any };
|
||||
CgroupParent?: string;
|
||||
VolumeDriver?: string;
|
||||
ShmSize?: number;
|
||||
};
|
||||
NetworkingConfig?: {
|
||||
EndpointsConfig?: {
|
||||
[index: string]: any;
|
||||
isolated_nw?: {
|
||||
[index: string]: any;
|
||||
IPAMConfig?: {
|
||||
IPv4Address?: string;
|
||||
IPv6Adress?: string;
|
||||
LinkLocalIPs?: string[];
|
||||
}
|
||||
Links?: string[];
|
||||
Aliases?: string[];
|
||||
}
|
||||
}
|
||||
EndpointsConfig?: EndpointsConfig;
|
||||
};
|
||||
}
|
||||
|
||||
@ -820,8 +918,37 @@ declare namespace Dockerode {
|
||||
}
|
||||
|
||||
interface ImageBuildContext {
|
||||
context: string;
|
||||
src: string[];
|
||||
context: string;
|
||||
src: string[];
|
||||
}
|
||||
|
||||
interface DockerVersion {
|
||||
ApiVersion: string;
|
||||
Arch: string;
|
||||
BuildTime: Date;
|
||||
Components: Array<{
|
||||
Details: {
|
||||
ApiVersion: string;
|
||||
Arch: string;
|
||||
BuilTime: Date;
|
||||
Experimental: string;
|
||||
GitCommit: string;
|
||||
GoVersion: string;
|
||||
KernelVersion: string;
|
||||
Os: string;
|
||||
};
|
||||
Name: string;
|
||||
Version: string;
|
||||
}>;
|
||||
GitCommit: string;
|
||||
GoVersion: string;
|
||||
KernelVersion: string;
|
||||
MinAPIVersion: string;
|
||||
Os: string;
|
||||
Platform: {
|
||||
Name: string;
|
||||
};
|
||||
Version: string;
|
||||
}
|
||||
}
|
||||
|
||||
@ -949,8 +1076,8 @@ declare class Dockerode {
|
||||
df(callback: Callback<any>): void;
|
||||
df(): Promise<any>;
|
||||
|
||||
version(callback: Callback<any>): void;
|
||||
version(): Promise<any>;
|
||||
version(callback: Callback<Dockerode.DockerVersion>): void;
|
||||
version(): Promise<Dockerode.DockerVersion>;
|
||||
|
||||
ping(callback: Callback<any>): void;
|
||||
ping(): Promise<any>;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user