|
1 | | -export declare interface HypervisorOptions { |
2 | | - uri: string; |
3 | | -} |
| 1 | +import type { |
| 2 | + HypervisorOptions, |
| 3 | + DomainInfo, |
| 4 | + NodeInfo, |
| 5 | + DomainBlockInfo, |
| 6 | + DomainInterfaceInfo, |
| 7 | + DomainInterfaceAddress, |
| 8 | + DomainState, |
| 9 | + DomainRebootFlags, |
| 10 | + DomainInterfaceAddressesSource, |
| 11 | + ConnectListAllDomainsFlags, |
| 12 | + DomainGetXMLDescFlags |
| 13 | +} from './types.js'; |
4 | 14 |
|
5 | 15 | export declare class Hypervisor { |
6 | 16 | constructor(options: HypervisorOptions); |
@@ -31,32 +41,6 @@ export declare class Hypervisor { |
31 | 41 | nodeGetInfo(): Promise<NodeInfo>; |
32 | 42 | } |
33 | 43 |
|
34 | | -export declare const enum ConnectListAllDomainsFlags { |
35 | | - ACTIVE = 1, |
36 | | - INACTIVE = 2, |
37 | | - PERSISTENT = 4, |
38 | | - TRANSIENT = 8, |
39 | | - RUNNING = 16, |
40 | | - PAUSED = 32, |
41 | | - SHUTOFF = 64, |
42 | | - OTHER = 128, |
43 | | - MANAGEDSAVE = 256, |
44 | | - NO_MANAGEDSAVE = 512, |
45 | | - AUTOSTART = 1024, |
46 | | - NO_AUTOSTART = 2048, |
47 | | - HAS_SNAPSHOT = 4096, |
48 | | - NO_SNAPSHOT = 8192, |
49 | | - HAS_CHECKPOINT = 16384, |
50 | | - NO_CHECKPOINT = 32768, |
51 | | -} |
52 | | - |
53 | | -export declare const enum DomainGetXMLDescFlags { |
54 | | - SECURE = 1, |
55 | | - INACTIVE = 2, |
56 | | - UPDATE_CPU = 4, |
57 | | - MIGRATABLE = 8, |
58 | | -} |
59 | | - |
60 | 44 | export declare class Domain { |
61 | 45 | isActive(): Promise<boolean>; |
62 | 46 | isPersistent(): Promise<boolean>; |
@@ -89,65 +73,16 @@ export declare class Domain { |
89 | 73 | getInterfaceAddresses(source?: DomainInterfaceAddressesSource): Promise<DomainInterfaceInfo[]>; |
90 | 74 | } |
91 | 75 |
|
92 | | -export declare enum DomainRebootFlags { |
93 | | - NONE = 0, |
94 | | - ACPI = 1, |
95 | | - GUEST_AGENT = 2, |
96 | | - INIT = 4, |
97 | | - SIGNAL = 8, |
98 | | -} |
99 | | - |
100 | | -export declare enum DomainInterfaceAddressesSource { |
101 | | - LEASE = 0, |
102 | | - AGENT = 1, |
103 | | - ARP = 2, |
104 | | -} |
105 | | - |
106 | | -export declare interface DomainBlockInfo { |
107 | | - capacity: number; |
108 | | - allocation: number; |
109 | | - physical: number; |
110 | | -} |
111 | | - |
112 | | -export declare interface DomainInterfaceInfo { |
113 | | - name: string; |
114 | | - hwaddr: string; |
115 | | - addrs: DomainInterfaceAddress[]; |
116 | | -} |
117 | | - |
118 | | -export declare interface DomainInterfaceAddress { |
119 | | - type: number; |
120 | | - addr: string; |
121 | | - prefix: number; |
122 | | -} |
123 | | - |
124 | | -// https://libvirt.org/manpages/virsh.html#list |
125 | | -export declare const enum DomainState { |
126 | | - NOSTATE = 0, |
127 | | - RUNNING = 1, |
128 | | - BLOCKED = 2, |
129 | | - PAUSED = 3, |
130 | | - SHUTDOWN = 4, |
131 | | - SHUTOFF = 5, |
132 | | - CRASHED = 6, |
133 | | - PMSUSPENDED = 7, |
134 | | -} |
135 | | - |
136 | | -export declare interface DomainInfo { |
137 | | - state: DomainState; |
138 | | - maxMem: number; |
139 | | - memory: number; |
140 | | - nrVirtCpu: number; |
141 | | - cpuTime: number; |
142 | | -} |
143 | | - |
144 | | -export declare interface NodeInfo { |
145 | | - model: string; |
146 | | - memory: number; |
147 | | - cpus: number; |
148 | | - mhz: number; |
149 | | - nodes: number; |
150 | | - sockets: number; |
151 | | - cores: number; |
152 | | - threads: number; |
153 | | -} |
| 76 | +export type { |
| 77 | + HypervisorOptions, |
| 78 | + DomainInfo, |
| 79 | + NodeInfo, |
| 80 | + DomainBlockInfo, |
| 81 | + DomainInterfaceInfo, |
| 82 | + DomainInterfaceAddress, |
| 83 | + DomainState, |
| 84 | + DomainRebootFlags, |
| 85 | + DomainInterfaceAddressesSource, |
| 86 | + ConnectListAllDomainsFlags, |
| 87 | + DomainGetXMLDescFlags |
| 88 | +}; |
0 commit comments