1 Star 0 Fork 4K

Feng Lin/interface_sdk-js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
@ohos.screen.d.ts 34.67 KB
一键复制 编辑 原始数据 按行查看 历史
刘波 提交于 2024-08-22 10:42 +08:00 . Description:PC扩展屏需求-新增两个接口
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880
/*
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* @kit ArkUI
*/
import { AsyncCallback, Callback } from './@ohos.base';
/**
* Interface of screen manager
*
* @namespace screen
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
declare namespace screen {
/**
* Get all screen instances, then can get or set detail information.
*
* @param { AsyncCallback<Array<Screen>> } callback the callback of all screens info
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 1400001 - Invalid display or screen.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
function getAllScreens(callback: AsyncCallback<Array<Screen>>): void;
/**
* Get all screen instances, then can get or set detail information.
*
* @returns { Promise<Array<Screen>> } the result of all screens info
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 1400001 - Invalid display or screen.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
function getAllScreens(): Promise<Array<Screen>>;
/**
* Register the callback for screen changes.
*
* @param { 'connect' | 'disconnect' | 'change' } eventType the event of screen changes. This parameter is of string
* type and cannot be empty.
* @param { Callback<number> } callback Callback used to return the screen ID. This parameter is callable.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
function on(eventType: 'connect' | 'disconnect' | 'change', callback: Callback<number>): void;
/**
* Unregister the callback for screen changes.
*
* @param { 'connect' | 'disconnect' | 'change' } eventType the event of screen changes. This parameter is of string
* type and cannot be empty.
* @param { Callback<number> } callback Callback used to return the screen ID. If this parameter is specified, it must
* be a callback.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
function off(eventType: 'connect' | 'disconnect' | 'change', callback?: Callback<number>): void;
/**
* Make screens as expand-screen
*
* @param { Array<ExpandOption> } options Parameters for expanding the screen. The options must be valid, and make
* sure it's type of Array<ExpandOption>.
* @param { AsyncCallback<number> } callback callback used to return the group ID of the expanded screens. It must
* be a callback.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types.
* @throws { BusinessError } 1400001 - Invalid display or screen.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
function makeExpand(options: Array<ExpandOption>, callback: AsyncCallback<number>): void;
/**
* Make screens as expand-screen
*
* @param { Array<ExpandOption> } options Parameters for expanding the screen. The options must be valid, and make
* sure it's type of Array<ExpandOption>.
* @returns { Promise<number> } used to return the group ID of the expanded screens
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types.
* @throws { BusinessError } 1400001 - Invalid display or screen.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
function makeExpand(options: Array<ExpandOption>): Promise<number>;
/**
* Stop expand screens
*
* @param { Array<number> } expandScreen IDs of expand screens to stop. The size of the expandScreen Array should not
* exceed 1000.
* @param { AsyncCallback<void> } callback used to return the result
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 1400001 - Invalid display or screen.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 10
*/
function stopExpand(expandScreen: Array<number>, callback: AsyncCallback<void>): void;
/**
* Stop expand screens
*
* @param { Array<number> } expandScreen IDs of expand screens to stop. The size of the expandScreen Array should not
* exceed 1000.
* @returns { Promise<void> } promise used to return the result
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 1400001 - Invalid display or screen.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 10
*/
function stopExpand(expandScreen: Array<number>): Promise<void>;
/**
* Make screens as mirror-screen
*
* @param { number } mainScreen ID of the primary screen. It's type should be int.
* @param { Array<number> } mirrorScreen IDs of secondary screens
* @param { AsyncCallback<number> } callback Callback used to return the group ID of the secondary screens
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types.
* @throws { BusinessError } 1400001 - Invalid display or screen.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
function makeMirror(mainScreen: number, mirrorScreen: Array<number>, callback: AsyncCallback<number>): void;
/**
* Make screens as mirror-screen
*
* @param { number } mainScreen ID of the primary screen. It's type should be int.
* @param { Array<number> } mirrorScreen IDs of secondary screens
* @returns { Promise<number> } Promise used to return the group ID of the secondary screens
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types.
* @throws { BusinessError } 1400001 - Invalid display or screen.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
function makeMirror(mainScreen: number, mirrorScreen: Array<number>): Promise<number>;
/**
* Stop mirror screens
*
* @param { Array<number> } mirrorScreen IDs of mirror screens to stop. The size of the mirrorScreen Array should not
* exceed 1000.
* @param { AsyncCallback<void> } callback used to return the result
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 1400001 - Invalid display or screen.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 10
*/
function stopMirror(mirrorScreen: Array<number>, callback: AsyncCallback<void>): void;
/**
* Stop mirror screens
*
* @param { Array<number> } mirrorScreen IDs of mirror screens to stop. The size of the mirrorScreen Array should not
* exceed 1000.
* @returns { Promise<void> } promise used to return the result
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 1400001 - Invalid display or screen.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 10
*/
function stopMirror(mirrorScreen: Array<number>): Promise<void>;
/**
* Create virtual screen. if surfaceId is valid, this permission is necessary.
*
* @permission ohos.permission.CAPTURE_SCREEN
* @param { VirtualScreenOption } options Indicates the options of the virtual screen.
* @param { AsyncCallback<Screen> } callback Callback used to return the created virtual screen
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types.
* @throws { BusinessError } 1400001 - Invalid display or screen.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
function createVirtualScreen(options: VirtualScreenOption, callback: AsyncCallback<Screen>): void;
/**
* Create virtual screen. if surfaceId is valid, this permission is necessary.
*
* @permission ohos.permission.CAPTURE_SCREEN
* @param { VirtualScreenOption } options Indicates the options of the virtual screen.
* @returns { Promise<Screen> } Promise used to return the created virtual screen
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types.
* @throws { BusinessError } 1400001 - Invalid display or screen.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
function createVirtualScreen(options: VirtualScreenOption): Promise<Screen>;
/**
* Destroy virtual screen.
*
* @param { number } screenId Indicates the screen id of the virtual screen.
* @param { AsyncCallback<void> } callback Callback used to return the result.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types.
* @throws { BusinessError } 1400002 - Unauthorized operation.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
function destroyVirtualScreen(screenId: number, callback: AsyncCallback<void>): void;
/**
* Destroy virtual screen.
*
* @param { number } screenId Indicates the screen id of the virtual screen.
* @returns { Promise<void> } Promise that returns no value.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types.
* @throws { BusinessError } 1400002 - Unauthorized operation.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
function destroyVirtualScreen(screenId: number): Promise<void>;
/**
* Set surface for the virtual screen.
*
* @permission ohos.permission.CAPTURE_SCREEN
* @param { number } screenId Indicates the screen id of the virtual screen.
* @param { string } surfaceId Indicates the surface id.
* @param { AsyncCallback<void> } callback Callback used to return the result
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types.
* @throws { BusinessError } 1400001 - Invalid display or screen.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
function setVirtualScreenSurface(screenId: number, surfaceId: string, callback: AsyncCallback<void>): void;
/**
* Set surface for the virtual screen.
*
* @permission ohos.permission.CAPTURE_SCREEN
* @param { number } screenId Indicates the screen id of the virtual screen.
* @param { string } surfaceId Indicates the surface id.
* @returns { Promise<void> } Promise that returns no value
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types.
* @throws { BusinessError } 1400001 - Invalid display or screen.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
function setVirtualScreenSurface(screenId: number, surfaceId: string): Promise<void>;
/**
* Get screen rotation lock status.
*
* @param { AsyncCallback<boolean> } callback If true, auto rotate is locked. If false, auto rotate is unlocked
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
function isScreenRotationLocked(callback: AsyncCallback<boolean>): void;
/**
* Get screen rotation lock status.
*
* @returns { Promise<boolean> } If true, auto rotate is locked. If false, auto rotate is unlocked
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
function isScreenRotationLocked(): Promise<boolean>;
/**
* Set screen rotation lock status.
*
* @param { boolean } isLocked Indicates whether the screen rotation switch is locked.
* @param { AsyncCallback<void> } callback Callback used to return the result.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
function setScreenRotationLocked(isLocked: boolean, callback: AsyncCallback<void>): void;
/**
* Set screen rotation lock status.
*
* @param { boolean } isLocked Indicates whether the screen rotation switch is locked.
* @returns { Promise<void> } Promise that returns no value.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
function setScreenRotationLocked(isLocked: boolean): Promise<void>;
/**
* Set multi screen mode(mirror/extend).
*
* @param { number } primaryScreenId - primary screen id.
* @param { number } secondaryScreenId - secondary screen id.
* @param { MultiScreenMode } secondaryScreenMode - secondary screen mode.
* @throws { BusinessError } 202 - Permission verification failed, non-system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types.
* @throws { BusinessError } 1400003 - This display manager service works abnormally.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 13
*/
function setMultiScreenMode(primaryScreenId: number, secondaryScreenId: number,
secondaryScreenMode: MultiScreenMode): Promise<void>;
/**
* Set multi screen relative position.
*
* @param { MultiScreenPositionOptions } mainScreenOptions - main screen position.
* @param { MultiScreenPositionOptions } secondaryScreenOptions - secondary screen position.
* @throws { BusinessError } 202 - Permission verification failed, non-system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types.
* @throws { BusinessError } 1400003 - This display manager service works abnormally.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 13
*/
function setMultiScreenRelativePosition(mainScreenOptions: MultiScreenPositionOptions,
secondaryScreenOptions: MultiScreenPositionOptions): Promise<void>;
/**
* Indicate the screen mode
*
* @enum { number }
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 13
*/
enum MultiScreenMode {
/**
* Indicate that the screen is in mirror mode.
*
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 13
*/
SCREEN_MIRROR = 0,
/**
* Indicate that the screen is in extend mode.
*
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 13
*/
SCREEN_EXTEND = 1
}
/**
* The parameter of making extend screen
*
* @interface MultiScreenPositionOptions
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 13
*/
interface MultiScreenPositionOptions {
/**
* Screen id
*
* @type { number }
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 13
*/
id: number;
/**
* The start coordinate X of the screen origin
*
* @type { number }
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 13
*/
startX: number;
/**
* The start coordinate Y of the screen origin
*
* @type { number }
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 13
*/
startY: number;
}
/**
* The parameter of making expand screen
*
* @interface ExpandOption
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
interface ExpandOption {
/**
* Screen id
*
* @type { number }
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
screenId: number;
/**
* The start coordinate X of the screen origin
*
* @type { number }
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
startX: number;
/**
* The start coordinate Y of the screen origin
*
* @type { number }
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
startY: number;
}
/**
* The parameter for creating virtual screen.
*
* @interface VirtualScreenOption
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
interface VirtualScreenOption {
/**
* Indicates the name of the virtual screen.
*
* @type { string }
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
name: string;
/**
* Indicates the width of the virtual screen.
*
* @type { number }
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
width: number;
/**
* Indicates the height of the virtual screen.
*
* @type { number }
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
height: number;
/**
* Indicates the density of the virtual screen.
*
* @type { number }
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
density: number;
/**
* Indicates the surface id of the virtual screen.
*
* @type { string }
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
surfaceId: string;
}
/**
* Indicate the source mode of the screen
*
* @enum { number }
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 10
*/
enum ScreenSourceMode {
/**
* Indicate that the screen is the default screen.
*
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 10
*/
SCREEN_MAIN = 0,
/**
* Indicate that the screen is in mirror mode.
*
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 10
*/
SCREEN_MIRROR = 1,
/**
* Indicate that the screen is in extend mode.
*
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 10
*/
SCREEN_EXTEND = 2,
/**
* Indicate that the screen stands alone.
*
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 10
*/
SCREEN_ALONE = 3
}
/**
* Interface for screen
*
* @interface Screen
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
interface Screen {
/**
* Screen id
*
* @type { number }
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
readonly id: number;
/**
* Group id
*
* @type { number }
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
readonly parent: number;
/**
* Mode supported by the screen
*
* @type { Array<ScreenModeInfo> }
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
readonly supportedModeInfo: Array<ScreenModeInfo>;
/**
* Currently active mode
*
* @type { number }
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
readonly activeModeIndex: number;
/**
* Orientation of the screen
*
* @type { Orientation }
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
readonly orientation: Orientation;
/**
* Source mode of the screen
*
* @type { ScreenSourceMode }
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 10
*/
readonly sourceMode: ScreenSourceMode;
/**
* Set the orientation of the screen
*
* @param { Orientation } orientation Screen orientation. orientation value must from enum Orientation.
* @param { AsyncCallback<void> } callback Callback used to return the result.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 1400003 - This display manager service works abnormally.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
setOrientation(orientation: Orientation, callback: AsyncCallback<void>): void;
/**
* Set the orientation of the screen
*
* @param { Orientation } orientation Screen orientation. orientation value must from enum Orientation.
* @returns { Promise<void> } Promise that returns no value.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 1400003 - This display manager service works abnormally.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
setOrientation(orientation: Orientation): Promise<void>;
/**
* Active the mode
*
* @param { number } modeIndex Index of the mode to set.
* @param { AsyncCallback<void> } callback Callback used to return the result.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types.
* @throws { BusinessError } 1400003 - This display manager service works abnormally.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
setScreenActiveMode(modeIndex: number, callback: AsyncCallback<void>): void;
/**
* Active the mode
*
* @param { number } modeIndex Index of the mode to set.
* @returns { Promise<void> } Promise that returns no value.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types.
* @throws { BusinessError } 1400003 - This display manager service works abnormally.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
setScreenActiveMode(modeIndex: number): Promise<void>;
/**
* Set display density of the screen
*
* @param { number } densityDpi Pixel density. The value ranges from 80 to 640.
* @param { AsyncCallback<void> } callback Callback used to return the result.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types.
* @throws { BusinessError } 1400003 - This display manager service works abnormally.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
setDensityDpi(densityDpi: number, callback: AsyncCallback<void>): void;
/**
* Set display density of the screen
*
* @param { number } densityDpi Pixel density. The value ranges from 80 to 640.
* @returns { Promise<void> } Promise that returns no value.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types.
* @throws { BusinessError } 1400003 - This display manager service works abnormally.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
setDensityDpi(densityDpi: number): Promise<void>;
}
/**
* Screen orientation
*
* @enum { number }
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
enum Orientation {
/**
* Indicates that the orientation of the screen is unspecified.
*
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
UNSPECIFIED = 0,
/**
* Indicates that the orientation of the screen is vertical.
*
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
VERTICAL = 1,
/**
* Indicates that the orientation of the screen is horizontal.
*
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
HORIZONTAL = 2,
/**
* Indicates that the orientation of the screen is reverse_vertical.
*
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
REVERSE_VERTICAL = 3,
/**
* Indicates that the orientation of the screen is reverse_horizontal.
*
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
REVERSE_HORIZONTAL = 4
}
/**
* The information of the screen
*
* @interface ScreenModeInfo
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
interface ScreenModeInfo {
/**
* Screen id
*
* @type { number }
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
id: number;
/**
* Indicates the width of the screen
*
* @type { number }
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
width: number;
/**
* Indicates the height of the screen
*
* @type { number }
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
height: number;
/**
* Indicates the refreshRate of the screen
*
* @type { number }
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
refreshRate: number;
}
}
export default screen;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lffl8796/interface_sdk-js.git
git@gitee.com:lffl8796/interface_sdk-js.git
lffl8796
interface_sdk-js
interface_sdk-js
master

搜索帮助