betterdisplaycli 0.1.18 → 0.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "betterdisplaycli",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
4
4
  "description": "TypeScript bindings for `betterdisplaycli`.",
5
5
  "author": "Lucas Garron <code@garron.net>",
6
6
  "license": "MIT",
package/src/Device.ts CHANGED
@@ -200,17 +200,20 @@ export class Display extends SingleDisplay {
200
200
  super(info);
201
201
  }
202
202
 
203
- static main(): Promise<Display> {
204
- return getDisplayWithSelectorArg("--displayWithMainStatus");
203
+ static main(options?: QuietOption): Promise<Display> {
204
+ return getDisplayWithSelectorArg("--displayWithMainStatus", options);
205
205
  }
206
206
 
207
- static fromName(name: string): Promise<Display> {
208
- return getDisplayWithSelectorArg(`--name=${name}`);
207
+ static fromName(name: string, options?: QuietOption): Promise<Display> {
208
+ return getDisplayWithSelectorArg(`--name=${name}`, options);
209
209
  }
210
210
 
211
- static async tryFromName(name: string): Promise<Display | null> {
211
+ static async tryFromName(
212
+ name: string,
213
+ options?: QuietOption,
214
+ ): Promise<Display | null> {
212
215
  try {
213
- return await getDisplayWithSelectorArg(`--name=${name}`);
216
+ return await getDisplayWithSelectorArg(`--name=${name}`, options);
214
217
  } catch {
215
218
  // TODO: what is the simplest way to verify this was because there was no such display (as opposed to a general invocation error)?
216
219
  return null;
package/src/get.ts CHANGED
@@ -78,6 +78,7 @@ export async function getAllDevices(
78
78
 
79
79
  export async function getDisplayWithSelectorArg(
80
80
  arg: "--displayWithMainStatus" | `--name=${string}`,
81
+ options?: QuietOption,
81
82
  ): Promise<Display> {
82
83
  return (
83
84
  await getDeviceInfos<Display>(
@@ -87,6 +88,7 @@ export async function getDisplayWithSelectorArg(
87
88
  "--type=Display",
88
89
  "--identifiers",
89
90
  ]),
91
+ options,
90
92
  )
91
93
  )[0];
92
94
  }