Move Compose(Network|Volume)Config to top level types

This reduces dependencies from 80 to 47

Change-type: patch
This commit is contained in:
Felipe Lalanne 2024-05-15 15:26:00 -04:00
parent 234e0de075
commit bef5e78440
3 changed files with 29 additions and 30 deletions

View File

@ -8,27 +8,9 @@ import type {
export interface NetworkInspectInfo extends DockerNetworkInspectInfo {
ConfigOnly: boolean;
}
import type { ComposeNetworkConfig } from '../../types';
export type { ComposeNetworkConfig } from '../../types';
export interface ComposeNetworkConfig {
driver: string;
driver_opts: Dictionary<string>;
ipam: {
driver: string;
config: Array<
Partial<{
subnet: string;
ip_range: string;
gateway: string;
aux_addresses: Dictionary<string>;
}>
>;
options: Dictionary<string>;
};
enable_ipv6: boolean;
internal: boolean;
labels: Dictionary<string>;
config_only: boolean;
}
export interface NetworkConfig {
driver: string;
ipam: {

View File

@ -1,5 +1,6 @@
import type { LabelObject } from '../../types';
import type { VolumeInspectInfo } from 'dockerode';
export type { ComposeVolumeConfig } from '../../types';
export interface VolumeConfig {
labels: LabelObject;
@ -7,12 +8,6 @@ export interface VolumeConfig {
driverOpts: VolumeInspectInfo['Options'];
}
export interface ComposeVolumeConfig {
driver: string;
driver_opts: Dictionary<string>;
labels: LabelObject;
}
export interface Volume {
name: string;
appId: number;

View File

@ -13,10 +13,32 @@ import {
nonEmptyRecord,
} from './basic';
import type {
ComposeVolumeConfig,
ComposeNetworkConfig,
} from '../compose/types';
export interface ComposeVolumeConfig {
driver: string;
driver_opts: Dictionary<string>;
labels: LabelObject;
}
export interface ComposeNetworkConfig {
driver: string;
driver_opts: Dictionary<string>;
ipam: {
driver: string;
config: Array<
Partial<{
subnet: string;
ip_range: string;
gateway: string;
aux_addresses: Dictionary<string>;
}>
>;
options: Dictionary<string>;
};
enable_ipv6: boolean;
internal: boolean;
labels: Dictionary<string>;
config_only: boolean;
}
export type DeviceLegacyReport = Partial<{
api_port: number;