| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- // @ts-check
- // Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
- // This file is automatically generated. DO NOT EDIT
- /**
- * BrightnessService 显示器亮度控制:Windows 下优先 DDC/CI 硬件调光,
- * 显示器不支持时回退 Gamma 软件调光;其他平台不提供(Available 返回 false)。
- * @module
- */
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-ignore: Unused imports
- import { Call as $Call, CancellablePromise as $CancellablePromise, Create as $Create } from "@wailsio/runtime";
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-ignore: Unused imports
- import * as $models from "./models.js";
- /**
- * Available 当前平台是否支持亮度调节
- * @returns {$CancellablePromise<boolean>}
- */
- export function Available() {
- return $Call.ByID(2414845153);
- }
- /**
- * GetMonitors 列出所有显示器及当前亮度;软件调光的显示器取设置里保存的亮度(默认 100)
- * @returns {$CancellablePromise<$models.MonitorBrightnessInfo[]>}
- */
- export function GetMonitors() {
- return $Call.ByID(6803433).then(/** @type {($result: any) => any} */(($result) => {
- return $$createType1($result);
- }));
- }
- /**
- * SaveLevel 记住某个显示器当前亮度(按名称保存,供启动时恢复)
- * @param {string} name
- * @param {number} percent
- * @returns {$CancellablePromise<void>}
- */
- export function SaveLevel(name, percent) {
- return $Call.ByID(2779694815, name, percent);
- }
- /**
- * SetBrightness 设置指定显示器亮度(0-100),硬件不可用时自动回退 Gamma
- * @param {number} index
- * @param {number} percent
- * @returns {$CancellablePromise<void>}
- */
- export function SetBrightness(index, percent) {
- return $Call.ByID(1421607753, index, percent);
- }
- /**
- * TurnOff 立即关闭所有显示器(息屏),移动鼠标或按键即恢复
- * @returns {$CancellablePromise<void>}
- */
- export function TurnOff() {
- return $Call.ByID(680732518);
- }
- // Private type creation functions
- const $$createType0 = $models.MonitorBrightnessInfo.createFrom;
- const $$createType1 = $Create.Array($$createType0);
|