-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathindex.d.ts
More file actions
198 lines (166 loc) · 3.93 KB
/
index.d.ts
File metadata and controls
198 lines (166 loc) · 3.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
/*
* index.d.ts: part of the "win32-displayconfig" Node package.
* See the COPYRIGHT file at the top-level directory of this distribution.
*/
export class Win32Error extends Error {
code: number;
}
interface AdapterId {
LowPart: number;
HighPart: number;
}
interface DisplayConfigFractional {
Numerator: number;
Denominator: number;
}
interface SourcePathInfo {
adapterId: AdapterId;
id: number;
statusFlags: number;
modeInfoIdx: number;
}
interface TargetPathInfo {
adapterId: AdapterId;
id: number;
statusFlags: number;
outputTechnology: string;
rotation: number;
scaling: string;
refreshRate: DisplayConfigFractional;
scanlineOrdering: string;
targetAvailable: number;
modeInfoIdx: number;
}
interface PathInfoValue {
flags: number;
sourceInfo: SourcePathInfo;
targetInfo: TargetPathInfo;
}
interface PathInfo {
value: PathInfoValue;
buffer: Buffer;
}
interface DisplayConfigPosition {
x: number;
y: number;
}
interface SourceMode {
width: number;
height: number;
pixelFormat: number;
position: DisplayConfigPosition;
}
interface SourceModeInfo {
adapterId: AdapterId;
id: number;
infoType: "source";
sourceMode: SourceMode;
}
interface PixelRate {
lowPart: number;
highPart: number;
}
interface DisplayConfigSize {
cx: number;
cy: number;
}
interface TargetVideoSignalInfo {
pixelRate: PixelRate;
hSyncFreq: DisplayConfigFractional;
vSyncFreq: DisplayConfigFractional;
activeSize: DisplayConfigSize;
totalSize: DisplayConfigSize;
videoStandard: number;
scanlineOrdering: string;
}
interface TargetMode {
targetVideoSignalInfo: TargetVideoSignalInfo;
}
interface TargetModeInfo {
adapterId: AdapterId;
id: number;
infoType: "target";
targetMode: TargetMode;
}
type ModeInfoValue = SourceModeInfo | TargetModeInfo;
interface ModeInfo {
value: ModeInfoValue;
buffer: Buffer;
}
interface NameInfo {
adapterId: AdapterId;
id: number;
outputTechnology: string;
edidManufactureId: number;
edidProductCodeId: number;
connectorInstance: number;
monitorFriendlyDeviceName: string;
monitorDevicePath: string;
}
export interface QueryDisplayConfigResults {
pathArray: PathInfo[];
modeInfoArray: ModeInfo[];
nameArray: NameInfo[];
}
export function queryDisplayConfig(): Promise<QueryDisplayConfigResults>;
interface ConfigId {
adapterId: AdapterId;
id: number;
}
export interface ExtractedDisplayConfig {
displayName: string;
devicePath: string;
sourceConfigId: ConfigId;
targetConfigId: ConfigId;
inUse: boolean;
outputTechnology: string;
rotation: number;
scaling: string;
sourceMode: SourceMode;
targetVideoSignalInfo?: TargetVideoSignalInfo;
pathBuffer: Buffer;
sourceModeBuffer: Buffer;
targetModeBuffer?: Buffer;
}
export function extractDisplayConfig(): Promise<ExtractedDisplayConfig>;
export interface ToggleEnabledDisplayArgs {
enablePaths: string[];
disablePaths: string[];
persistent: boolean;
}
export function toggleEnabledDisplays(
args: ToggleEnabledDisplayArgs
): Promise<void>;
export interface DisplayResotrationConfigurationEntry {
devicePath: string;
pathBuffer: string;
sourceModeBuffer: string;
targetModeBuffer: string;
}
export function displayConfigForRestoration(): Promise<
DisplayResotrationConfigurationEntry[]
>;
export interface RestoreDisplayConfigArgs {
config: DisplayResotrationConfigurationEntry[];
persistent: boolean;
}
export function restoreDisplayConfig(
args: RestoreDisplayConfigArgs
): Promise<void>;
export type DisplayChangeListener = {
(err: Error): void;
(err: null, conf: ExtractedDisplayConfig): void;
};
export function addDisplayChangeListener(
listener: DisplayChangeListener
): DisplayChangeListener;
export function removeDisplayChangeListener(
listener: DisplayChangeListener
): void;
export class VerticalRefreshRateContext {
findVerticalRefreshRateForDisplayPoint(
x: number,
y: number
): Promise<number | undefined>;
close(): void;
}