46 Star 176 Fork 4.8K

OpenHarmony/interface_sdk-js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
@ohos.settings.d.ts 45.37 KB
一键复制 编辑 原始数据 按行查看 历史
guowei 提交于 4个月前 . 接口注释修改
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356
/*
* Copyright (c) 2022 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 BasicServicesKit
*/
import { AsyncCallback } from './@ohos.base';
import { DataAbilityHelper } from './ability/dataAbilityHelper';
import Context from './application/Context';
/**
* This module provides settings data access abilities.
*
* @namespace settings
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
/**
* This module provides settings data access abilities.
*
* @namespace settings
* @syscap SystemCapability.Applications.Settings.Core
* @atomicservice
* @since 18
*/
declare namespace settings {
/**
* Provide domain name for query.
*
* @namespace domainName
* @syscap SystemCapability.Applications.Settings.Core
* @since 11
*/
namespace domainName {
/**
* Provide the domain name for device shared Key.
*
* <p>This constants is a domain name for device level shared key.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 11
*/
const DEVICE_SHARED: string;
/**
* Provide the domain name for user property.
*
* <p>This constants is a domain name for user level key.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 11
*/
const USER_PROPERTY: string;
/**
* Provide the domain name for user security property.
*
* <p>This constants is a domain name for user security level key.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @systemapi
* @since 11
*/
const USER_SECURITY: string;
}
/**
* Provides methods for setting time and date formats.
*
* @namespace date
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
namespace date {
/**
* Indicates the date format.
*
* <p>The formats {@code mm/dd/yyyy}, {@code dd/mm/yyyy}, and {@code yyyy/mm/dd} are available.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const DATE_FORMAT: string
/**
* Specifies whether the time is displayed in 12-hour or 24-hour format.
*
* <p>If the value is {@code 12}, the 12-hour format is used. If the value is {@code 24}, the 24-hour format
* is used.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const TIME_FORMAT: string
/**
* Specifies whether the date, time, and time zone are automatically obtained from the Network
* Identity and Time Zone (NITZ).
*
* <p>If the value is {@code true}, the information is automatically obtained from NITZ.
* If the value is {@code false}, the information is not obtained from NITZ.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const AUTO_GAIN_TIME: string
/**
* Specifies whether the time zone is automatically obtained from NITZ.
*
* <p>If the value is {@code true}, the information is automatically obtained from NITZ. If the value
* is {@code false}, the information is not obtained from NITZ.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const AUTO_GAIN_TIME_ZONE: string
}
/**
* Provides methods for setting the display effect, including the font size, screen brightness, screen rotation,
* animation factor, and display color.
*
* @namespace display
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
namespace display {
/**
* Indicates the scaling factor of fonts, which is a float number.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const FONT_SCALE: string
/**
* Indicates the screen brightness. The value ranges from 0 to 255.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const SCREEN_BRIGHTNESS_STATUS: string
/**
* Specifies whether automatic screen brightness adjustment is enabled.
*
* <p>If the value is {@code 1}, automatic adjustment is enabled. If the value is {@code 0}, automatic
* adjustment is disabled.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const AUTO_SCREEN_BRIGHTNESS: string
/**
* Indicates the value of {@code AUTO_SCREEN_BRIGHTNESS} when automatic screen brightness adjustment is used.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const AUTO_SCREEN_BRIGHTNESS_MODE: number
/**
* Indicates the value of {@code AUTO_SCREEN_BRIGHTNESS} when manual screen brightness adjustment is used.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const MANUAL_SCREEN_BRIGHTNESS_MODE: number
/**
* Indicates the duration that the device waits before going to sleep after a period of inactivity, in
* milliseconds.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const SCREEN_OFF_TIMEOUT: string
/**
* Indicates the screen rotation when no other policy is available.
*
* <p>This constant is invalid when auto-rotation is enabled. When auto-rotation is disabled, the following
* values are available:
*
* <ul>
* <li>{@code 0} - The screen rotates 0 degrees.
* <li>{@code 1} - The screen rotates 90 degrees.
* <li>{@code 2} - The screen rotates 180 degrees.
* <li>{@code 3} - The screen rotates 270 degrees.
* </ul>
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const DEFAULT_SCREEN_ROTATION: string
/**
* Indicates the scaling factor for the animation duration.
*
* <p>This affects the start delay and duration of all such animations. If the value is {@code 0},
* the animation ends immediately. The default value is {@code 1}.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const ANIMATOR_DURATION_SCALE: string
/**
* Indicates the scaling factor for transition animations.
* If the value is {@code 0}, transition animations are disabled.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const TRANSITION_ANIMATION_SCALE: string
/**
* Indicates the scaling factor for normal window animations.
* If the value is {@code 0}, window animations are disabled.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const WINDOW_ANIMATION_SCALE: string
/**
* Specifies whether display color inversion is enabled.
*
* <p>If the value is {@code 1}, display color inversion is enabled. If the value is {@code 0}, display color
* inversion is disabled.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const DISPLAY_INVERSION_STATUS: string
}
/**
* Provides methods for setting general information about devices, including the device name, startup wizard,
* airplane mode, debugging information, accessibility feature switch, and touch exploration status.
*
* @namespace general
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
namespace general {
/**
* Specifies whether the startup wizard has been run.
*
* <p>If the value is {@code 0}, the startup wizard has not been run. If the value is not {@code 0}, the startup
* wizard has been run.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const SETUP_WIZARD_FINISHED: string
/**
* Specifies what happens after the user presses the call end button if the user is not in a call.
*
* <ul>
* <li>{@code 0} - Nothing happens.
* <li>{@code 1} - The home screen is displayed.
* <li>{@code 2} - The device enters the sleep state and the screen is locked.
* <li>{@code 3} - The home screen is displayed. If the user is already on the home screen, the device enters
* the sleep state.
* </ul>
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const END_BUTTON_ACTION: string
/**
* Specifies whether the accelerometer is used to change screen orientation, that is, whether auto-rotation is
* enabled.
*
* <p>The value {@code 1} indicates that the accelerometer is enabled by default, and {@code 0} indicates that
* the accelerometer is disabled by default.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const ACCELEROMETER_ROTATION_STATUS: string
/**
* Specifies whether airplane mode is enabled.
*
* <p>If the value is {@code 1}, airplane mode is enabled. If the value is {@code 0}, airplane mode is disabled.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const AIRPLANE_MODE_STATUS: string
/**
* Specifies whether the device is provisioned.
*
* <p>On a multi-user device with a single system user, the screen may be locked when the value is {@code true}.
* In addition, other abilities cannot be started on the system user unless they are marked to display over
* the screen lock.
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const DEVICE_PROVISION_STATUS: string
/**
* Specifies whether the hard disk controller (HDC) on USB devices is enabled.
*
* <p>If the value is {@code true}, the HDC is enabled. If the value is {@code false}, the HDC is disabled.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const HDC_STATUS: string
/**
* Indicates the number of boot operations after the device is powered on.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const BOOT_COUNTING: string
/**
* Specifies whether contact metadata synchronization is enabled.
*
* <p>If the value is {@code true}, synchronization is enabled. If the value is {@code false},
* synchronization is disabled.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const CONTACT_METADATA_SYNC_STATUS: string
/**
* Specifies whether developer options are enabled.
*
* <p>If the value is {@code true}, developer options are enabled.
* If the value is {@code false}, developer options are disabled.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const DEVELOPMENT_SETTINGS_STATUS: string
/**
* Indicates the device name.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const DEVICE_NAME: string
/**
* Specifies whether USB mass storage is enabled.
*
* <p>If the value is {@code true}, USB mass storage is enabled.
* If the value is {@code false}, USB mass storage is disabled.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const USB_STORAGE_STATUS: string
/**
* Specifies whether the device waits for the debugger when starting an application to debug.
*
* <p>If the value is {@code 1}, the device waits for the debugger.
* If the value is {@code 0}, the system does not wait for the debugger, and so the application runs normally.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const DEBUGGER_WAITING: string
/**
* Indicates the bundle name of the application to debug.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const DEBUG_APP_PACKAGE: string
/**
* Specifies whether any accessibility feature is enabled.
*
* <p>If the value is {@code 1}, the accessibility feature is enabled. If the value is {@code 0}, the
* accessibility feature is disabled.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const ACCESSIBILITY_STATUS: string
/**
* Indicates the list of accessibility features that have been activated.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const ACTIVATED_ACCESSIBILITY_SERVICES: string
/**
* Indicates the default geographical location that can be used by the browser. Multiple geographical locations
* are separated by spaces.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const GEOLOCATION_ORIGINS_ALLOWED: string
/**
* Specifies whether an application should attempt to skip all introductory hints at the first startup. This is
* intended for temporary users or users who are familiar with the environment.
*
* <p>If the value is {@code 1}, the application attempts to skip all introductory hints at the first startup.
* If the value is {@code 0}, the application does not skip introductory hints at the first startup.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const SKIP_USE_HINTS: string
/**
* Indicates whether touch exploration is enabled.
*
* <p>If the value is {@code 1}, touch exploration is enabled. If the value is {@code 0}, touch exploration is
* disabled.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const TOUCH_EXPLORATION_STATUS: string
}
/**
* Provides methods for setting information about input methods, including automatic capitalization, automatic
* punctuation, autocorrect, password presentation, input method engine, and input method subtypes.
*
* @namespace input
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
namespace input {
/**
* Indicates the default input method and its ID.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const DEFAULT_INPUT_METHOD: string
/**
* Indicates the default input method keyboard type and its ID.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const ACTIVATED_INPUT_METHOD_SUB_MODE: string
/**
* Indicates the list of input methods that have been activated.
*
* <p>The list is a string that contains the IDs of activated input methods. The IDs are separated by colons
* (:), and keyboardTypes of an input method are separated by semicolons (;). An example format is
* {@code ima0:keyboardType0;keyboardType1;ima1:ima2:keyboardTypes0}. The type of <b>imaID</b> is ElementName,
* and the type of <b>keyboard</b> is int.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const ACTIVATED_INPUT_METHODS: string
/**
* Specifies whether the input method selector is visible.
*
* <p>If the value is {@code 1}, the input method selector is visible. If the value is {@code 0}, the input
* method selector is invisible.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const SELECTOR_VISIBILITY_FOR_INPUT_METHOD: string
/**
* Specifies whether automatic capitalization is enabled for the text editor.
*
* <p>If the value is {@code 0}, automatic capitalization is disabled. If the value {@code 1}, automatic
* capitalization is enabled.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const AUTO_CAPS_TEXT_INPUT: string
/**
* Specifies whether automatic punctuation is enabled for the text editor. Automatic punctuation enables the
* text editor to convert two spaces into a period (.) and a space.
*
* <p>If the value is {@code 0}, automatic punctuation is disabled. If the value {@code 1}, automatic
* punctuation is enabled.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const AUTO_PUNCTUATE_TEXT_INPUT: string
/**
* Specifies whether autocorrect is enabled for the text editor. Autocorrect enables the text editor to correct
* typos.
*
* <p>If the value is {@code 0}, autocorrect is disabled. If the value {@code 1}, autocorrect is enabled.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const AUTO_REPLACE_TEXT_INPUT: string
/**
* Specifies whether password presentation is enabled in the text editor. Password presentation enables the
* text editor to show password characters when the user types them.
*
* <p>If the value is {@code 0}, password presentation is disabled. If the value {@code 1}, password
* presentation is enabled.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const SHOW_PASSWORD_TEXT_INPUT: string
}
/**
* Provides methods for setting network information, including the data roaming status, HTTP proxy configurations,
* and preferred networks.
*
* @namespace network
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
namespace network {
/**
* Specifies whether data roaming is enabled.
*
* <p>If the value is {@code true}, data roaming is enabled. If the value is {@code false},
* data roaming is disabled.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const DATA_ROAMING_STATUS: string
/**
* Indicates the host name and port number of the global HTTP proxy.
* The host name and port number are separated by a colon (:).
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const HTTP_PROXY_CFG: string
/**
* Indicates the user preferences of the network to use.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const NETWORK_PREFERENCE_USAGE: string
}
/**
* Provides methods for setting the answering mode of incoming and outgoing calls.
*
* @namespace phone
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
namespace phone {
/**
* Specifies whether real-time text (RTT) calling is enabled. If enabled, incoming and outgoing calls are
* answered as RTT calls when supported by the device and carrier. If the value is {@code 1}, RTT calling is
* enabled. If the value is {@code 0}, RTT calling is disabled.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const RTT_CALLING_STATUS: string
}
/**
* Provides methods for setting the sound effect, including the ringtone, dial tone, alarm sound, notification tone,
* and haptic feedback.
*
* @namespace sound
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
namespace sound {
/**
* Indicates whether the device vibrates when it is ringing for an incoming call.
*
* <p>This constant will be used by Phone and Settings applications. The value is of the boolean type.
* This constant affects only the scenario where the device rings for an incoming call. It does not affect
* any other application or scenario.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const VIBRATE_WHILE_RINGING: string
/**
* Indicates the storage area of the system default alarm.
*
* <p>You can obtain the URI of the system default alarm.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const DEFAULT_ALARM_ALERT: string
/**
* Indicates the type of the dual-tone multifrequency (DTMF) tone played when dialing.
*
* <p>The value {@code 0} indicates the normal short sound effect, and {@code 1} indicates the long sound
* effect.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const DTMF_TONE_TYPE_WHILE_DIALING: string
/**
* Specifies whether the DTMF tone is played when dialing.
*
* <p>If the value is {@code 1}, the DTMF tone is played. If the value is {@code 0}, the DTMF tone is not
* played.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const DTMF_TONE_WHILE_DIALING: string
/**
* Specifies which audio streams are affected by changes on the ringing mode and Do Not Disturb (DND) mode.
*
* <p>If you want a specific audio stream to be affected by changes of the ringing mode and DDN mode, set the
* corresponding bit to {@code 1}.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const AFFECTED_MODE_RINGER_STREAMS: string
/**
* Specifies which audio streams are affected by the mute mode.
*
* <p>If you want a specific audio stream to remain muted in mute mode, set the corresponding bit to {@code 1}.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const AFFECTED_MUTE_STREAMS: string
/**
* Indicates the storage area of the system default notification tone.
*
* <p>You can obtain the URI of the system default notification tone.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const DEFAULT_NOTIFICATION_SOUND: string
/**
* Indicates the storage area of the system default ringtone.
*
* <p>You can obtain the URI of the system default ringtone.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const DEFAULT_RINGTONE: string
/**
* Specifies whether the sound effects are enabled.
*
* <p>If the value is {@code 0}, the sound effects are disabled. If the value is {@code 1}, the sound effects
* are enabled.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const SOUND_EFFECTS_STATUS: string
/**
* Specifies whether the device vibrates for an event. This parameter is used inside the system.
*
* <p>If the value is {@code 1}, the device vibrates for an event. If the value is {@code 0}, the device does
* not vibrate for an event.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const VIBRATE_STATUS: string
/**
* Indicates whether the device enables haptic feedback.
*
* <p>The value is of the boolean type.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const HAPTIC_FEEDBACK_STATUS: string
}
/**
* Provides methods for setting information about text-to-speech (TTS) conversion, including the pitch, speech rate,
* engine, and plug-ins.
*
* @namespace TTS
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
namespace TTS {
/**
* Indicates the default pitch of the text-to-speech (TTS) engine.
*
* <p>100 = 1x. If the value is set to {@code 200}, the frequency is twice the normal sound frequency.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const DEFAULT_TTS_PITCH: string
/**
* Indicates the default speech rate of the TTS engine. 100 = 1x.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const DEFAULT_TTS_RATE: string
/**
* Indicates the default TTS engine.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const DEFAULT_TTS_SYNTH: string
/**
* Indicates the list of activated plug-in packages used for TTS. Multiple plug-in packages are separated by
* spaces.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const ENABLED_TTS_PLUGINS: string
}
/**
* Provides methods for setting radio network information, including information about Bluetooth, Wi-Fi, Near Field
* Communication (NFC), and the airplane mode.
*
* @namespace wireless
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
namespace wireless {
/**
* Specifies whether the device can be discovered or connected by other devices through Bluetooth.
*
* If the value is {@code 0}, the device cannot be connected or discovered. If the value is {@code 1}, the
* device can be connected but cannot be discovered. If the value is {@code 2}, the device can be connected
* and discovered.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const BLUETOOTH_DISCOVER_ABILITY_STATUS: string
/**
* Indicates the duration (in seconds) that the device can be discovered through Bluetooth.
*
* <p>After the duration expires, the device cannot be discovered through Bluetooth.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const BLUETOOTH_DISCOVER_TIMEOUT: string
/**
* Indicates the list of radio signals to be disabled when airplane mode is enabled. Multiple radio
* signals are separated by commas (,).
*
* <ul>
* <li>{@code BLUETOOTH_RADIO} - Bluetooth is disabled in airplane mode.
* <li>{@code CELL_RADIO} - Cellular radio is disabled in airplane mode.
* <li>{@code NFC_RADIO} - NFC is disabled in airplane mode.
* <li>{@code WIFI_RADIO} - Wi-Fi is disabled in airplane mode.
* </ul>
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const AIRPLANE_MODE_RADIOS: string
/**
* Specifies whether Bluetooth is enabled.
*
* <p>If the value is {@code true}, Bluetooth is enabled. If the value is {@code false}, Bluetooth is disabled.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const BLUETOOTH_STATUS: string
/**
* A constant of {@code AIRPLANE_MODE_RADIOS} to indicate that Bluetooth is disabled in airplane mode.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const BLUETOOTH_RADIO: string
/**
* A constant of {@code AIRPLANE_MODE_RADIOS} to indicate that cellular radio is disabled in airplane mode.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const CELL_RADIO: string
/**
* A constant of {@code AIRPLANE_MODE_RADIOS} to indicate that NFC is disabled in airplane mode.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const NFC_RADIO: string
/**
* A constant of {@code AIRPLANE_MODE_RADIOS} to indicate that Wi-Fi is disabled in airplane mode.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const WIFI_RADIO: string
/**
* Specifies whether the Wi-Fi configuration created by the application of the device owner should be
* locked down.
*
* <p>If the value is {@code true}, the Wi-Fi configuration should be locked down.
* If the value is {@code false}, the Wi-Fi configuration should not be locked down.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const OWNER_LOCKDOWN_WIFI_CFG: string
/**
* Indicates the maximum number of attempts to obtain an IP address from the DHCP server.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const WIFI_DHCP_MAX_RETRY_COUNT: string
/**
* Indicates the maximum duration to hold a wake lock when waiting for the mobile data connection to
* establish after the Wi-Fi connection is disconnected.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const WIFI_TO_MOBILE_DATA_AWAKE_TIMEOUT: string
/**
* Specifies whether Wi-Fi is enabled.
*
* <p>If the value is {@code true}, Wi-Fi is enabled. If the value is {@code false}, Wi-Fi is disabled.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const WIFI_STATUS: string
/**
* Specifies whether Wi-Fi watchdog is enabled.
*
* <p>If the value is {@code true}, Wi-Fi watchdog is enabled.
* If the value is {@code false}, Wi-Fi watchdog is disabled.
*
* @constant
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
const WIFI_WATCHDOG_STATUS: string
}
/**
* Constructs a URI for a specific name-value pair for monitoring data of the ability that uses the Data
* template.
*
* @param { string } name - Indicates the name of the setting to set.
* @param { AsyncCallback<object> } [callback] - The callback of getURI result.
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
* @deprecated since 9
*/
function getURI(name: string, callback: AsyncCallback<object>): void;
/**
* Constructs a URI for a specific name-value pair for monitoring data of the ability that uses the Data
* template.
*
* @param { string } name - Indicates the name of the setting to set.
* @returns { Promise<object> } Returns the corresponding URI; returns {@code null} if the URI does not exist.
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
* @deprecated since 9
*/
function getURI(name: string): Promise<object>;
/**
* Obtains the value of a specified character string in the database.
*
* @param { DataAbilityHelper } dataAbilityHelper - Indicates the {@link ohos.aafwk.ability.DataAbilityHelper} used
* to access the database.
* @param { string } name - Indicates the name of the character string.
* @param { AsyncCallback<object> } [callback] - The callback of getValue result.
* @syscap SystemCapability.Applications.Settings.Core
* @famodelonly
* @since 7
* @deprecated since 9
* @useinstead ohos.settings#getValue
*/
function getValue(dataAbilityHelper: DataAbilityHelper, name: string, callback: AsyncCallback<object>): void;
/**
* Obtains the value of a specified character string in the database.
*
* @param { DataAbilityHelper } dataAbilityHelper - Indicates the {@link ohos.aafwk.ability.DataAbilityHelper} used
* to access the database.
* @param { string } name - Indicates the name of the character string.
* @returns { Promise<object> } Returns the value of the character string in the domain if any is found; returns {@code
* null} otherwise.
* @syscap SystemCapability.Applications.Settings.Core
* @famodelonly
* @since 7
* @deprecated since 9
* @useinstead ohos.settings#getValue
*/
function getValue(dataAbilityHelper: DataAbilityHelper, name: string): Promise<object>;
/**
* Get value from settingsdata
*
* @param { Context } context - Indicates the Context or dataAbilityHelper used to access
* the database.
* @param { string } name - Indicates the name of the character string.
* @param { AsyncCallback<string> } [callback] - The callback of getValue result.
* @syscap SystemCapability.Applications.Settings.Core
* @StageModelOnly
* @since 10
*/
function getValue(context: Context, name: string, callback: AsyncCallback<string>): void;
/**
* Get value from settingsdata
* @param { Context } context - Indicates the Context or dataAbilityHelper used to access
* the database.
* @param { string } name - Indicates the name of the character string.
* @returns { Promise<string> } Returns the value of the character string in the domain if any is found; returns {@code
* null} otherwise.
* @syscap SystemCapability.Applications.Settings.Core
* @StageModelOnly
* @since 10
*/
function getValue(context: Context, name: string): Promise<string>;
/**
* Get value from settingsdata
* [USER_SECURE] domain need ohos.permission.MANAGE_SECURE_SETTINGS permission.
*
* @param { Context } context - Indicates the Context used to access the database.
* @param { string } name - Indicates the name of the character string.
* @param { string } domainName - Indicates the name of the domain name to set.
* @returns { Promise<string> } Returns the value of the character string in the domain if any is found; returns {@code
* null} otherwise.
* @syscap SystemCapability.Applications.Settings.Core
* @StageModelOnly
* @since 11
*/
function getValue(context: Context, name: string, domainName: string): Promise<string>;
/**
* Saves a character string name and its value to the database.
*
* @param { DataAbilityHelper } dataAbilityHelper - Indicates the {@link ohos.aafwk.ability.DataAbilityHelper} used
* to access the database.
* @param { string } name - Indicates the name of the character string.
* @param { object } value - Indicates the value of the character string.
* @param { AsyncCallback<boolean> } [callback] - The callback of setValue result.
* @syscap SystemCapability.Applications.Settings.Core
* @systemapi Hide this for inner system use.
* @famodelonly
* @since 7
* @deprecated since 9
* @useinstead ohos.settings#setValue
*/
function setValue(dataAbilityHelper: DataAbilityHelper, name: string, value: object, callback: AsyncCallback<boolean>): void;
/**
* Saves a character string name and its value to the database.
*
* @param { DataAbilityHelper } dataAbilityHelper - Indicates the {@link ohos.aafwk.ability.DataAbilityHelper} used
* to access the database.
* @param { string } name - Indicates the name of the character string.
* @param { object } value - Indicates the value of the character string.
* @returns { Promise<boolean> } Returns {@code true} if the operation is successful; returns {@code false} otherwise.
* @syscap SystemCapability.Applications.Settings.Core
* @systemapi Hide this for inner system use.
* @famodelonly
* @since 7
* @deprecated since 9
* @useinstead ohos.settings#setValue
*/
function setValue(dataAbilityHelper: DataAbilityHelper, name: string, value: object): Promise<boolean>;
/**
* Set settingsdata value.
*
* @permission ohos.permission.MANAGE_SETTINGS
* @param { Context } context - Indicates Context or dataAbilityHelper instance.
* @param { string } name - Indicates the name of the character string.
* @param { string } value - Indicates the value of the character string.
* @param { AsyncCallback<boolean> } [callback] - The callback of setValue result.
* @syscap SystemCapability.Applications.Settings.Core
* @StageModelOnly
* @since 10
*/
function setValue(context: Context, name: string, value: string, callback: AsyncCallback<boolean>): void;
/**
* Set settingsdata value.
*
* @permission ohos.permission.MANAGE_SETTINGS
* @param { Context } context - Indicates Context or dataAbilityHelper instance.
* @param { string } name - Indicates the name of the character string.
* @param { string } value - Indicates the value of the character string.
* @returns { Promise<boolean> } Returns {@code true} if the operation is successful; returns {@code false} otherwise.
* @syscap SystemCapability.Applications.Settings.Core
* @StageModelOnly
* @since 10
*/
function setValue(context: Context, name: string, value: string): Promise<boolean>;
/**
* Set settingsdata value.
* [DEVICE_SHARED, USER_PROPERTY] domain need ohos.permission.MANAGE_SETTINGS permission.
* [USER_SECURE] domain need ohos.permission.MANAGE_SECURE_SETTINGS permission.
*
* @permission ohos.permission.MANAGE_SECURE_SETTINGS or ohos.permission.MANAGE_SETTINGS
* @param { Context } context - Indicates Context instance.
* @param { string } name - Indicates the name of the character string.
* @param { string } value - Indicates the value of the character string.
* @param { string } domainName - Indicates the name of the domain name to set.
* @returns { Promise<boolean> } Returns {@code true} if the operation is successful; returns {@code false} otherwise.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Applications.Settings.Core
* @StageModelOnly
* @since 11
*/
function setValue(context: Context, name: string, value: string, domainName: string): Promise<boolean>;
/**
* Enables or disables airplane mode.
*
* @param { boolean } enable - Specifies whether to enable airplane mode. The value {@code true} means to enable
* airplane mode, and {@code false} means to disable airplane mode.
* @param { AsyncCallback<void> } [callback] - The callback of enableAirplaneMode result.
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
function enableAirplaneMode(enable: boolean, callback: AsyncCallback<void>): void;
/**
* Enables or disables airplane mode.
*
* @param { boolean } enable - Specifies whether to enable airplane mode. The value {@code true} means to enable
* airplane mode, and {@code false} means to disable airplane mode.
* @returns { Promise<void> } - Return Promise.
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
function enableAirplaneMode(enable: boolean): Promise<void>;
/**
* Checks whether a specified application can show as a floating window.
*
* @param { AsyncCallback<boolean> } [callback] - The callback of canShowFloating result.
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
function canShowFloating(callback: AsyncCallback<boolean>): void;
/**
* Checks whether a specified application can show as a floating window.
*
* @returns { Promise<boolean> } Returns {@code true} if the application can draw over other applications; returns
* {@code false} otherwise.
* @syscap SystemCapability.Applications.Settings.Core
* @since 7
*/
function canShowFloating(): Promise<boolean>;
/**
* Get settingsdata uri (synchronous method)
*
* @param { string } name - Indicates the name of the setting to set.
* @returns { string } Returns settingsdata uri.
* @syscap SystemCapability.Applications.Settings.Core
* @since 8
*/
function getUriSync(name: string): string;
/**
* Get value from settingsdata(synchronous method)
*
* @param { DataAbilityHelper } dataAbilityHelper - Indicates dataAbilityHelper instance.
* @param { string } name - Indicates the name of the character string.
* @param { string } defValue - Indicates the default value of the character string.
* @returns { string } Returns settingsdata value.
* @syscap SystemCapability.Applications.Settings.Core
* @famodelonly
* @since 8
* @deprecated since 9
* @useinstead ohos.settings#getValueSync
*/
function getValueSync(dataAbilityHelper: DataAbilityHelper, name: string, defValue: string): string;
/**
* Get value from settingsdata(synchronous method)
*
* @param { Context } context - Indicates Context or dataAbilityHelper instance
* @param { string } name - Indicates the name of the character string.
* @param { string } defValue - Indicates the default value of the character string.
* @returns { string } Returns settingsdata value.
* @syscap SystemCapability.Applications.Settings.Core
* @StageModelOnly
* @since 10
*/
function getValueSync(context: Context, name: string, defValue: string): string;
/**
* Get value from settingsdata(synchronous method).
* [USER_SECURE] domain need ohos.permission.MANAGE_SECURE_SETTINGS permission.
*
* @param { Context } context - Indicates Context instance
* @param { string } name - Indicates the name of the character string.
* @param { string } defValue - Indicates the default value of the character string.
* @param { string } domainName - Indicates the name of the domain name to set.
* @returns { string } Returns settingsdata value.
* @syscap SystemCapability.Applications.Settings.Core
* @StageModelOnly
* @since 11
*/
function getValueSync(context: Context, name: string, defValue: string, domainName: string): string;
/**
* Set settingsdata value(synchronous method)
*
* @permission ohos.permission.MANAGE_SECURE_SETTINGS
* @param { DataAbilityHelper } dataAbilityHelper Indicates dataAbilityHelper instance.
* @param { string } name Indicates the name of the character string.
* @param { string } value Indicates the value of the character string.
* @returns { boolean } Returns {@code true} if the operation is successful; returns {@code false} otherwise.
* @syscap SystemCapability.Applications.Settings.Core
* @famodelonly
* @since 8
* @deprecated since 9
* @useinstead ohos.settings#setValueSync
*/
function setValueSync(dataAbilityHelper: DataAbilityHelper, name: string, value: string): boolean;
/**
* Set settingsdata value(synchronous method)
*
* @permission ohos.permission.MANAGE_SETTINGS
* @param { Context } context - Indicates Context or dataAbilityHelper instance.
* @param { string } name - Indicates the name of the character string.
* @param { string } value - Indicates the value of the character string.
* @returns { boolean } Returns {@code true} if the operation is successful; returns {@code false} otherwise.
* @syscap SystemCapability.Applications.Settings.Core
* @StageModelOnly
* @since 10
*/
function setValueSync(context: Context, name: string, value: string): boolean;
/**
* Set settingsdata value(synchronous method).
* [DEVICE_SHARED, USER_PROPERTY] domain need ohos.permission.MANAGE_SETTINGS permission.
* [USER_SECURE] domain need ohos.permission.MANAGE_SECURE_SETTINGS permission.
*
* @permission ohos.permission.MANAGE_SECURE_SETTINGS or ohos.permission.MANAGE_SETTINGS
* @param { Context } context - Indicates Context instance.
* @param { string } name - Indicates the name of the character string.
* @param { string } value - Indicates the value of the character string.
* @param { string } domainName - Indicates the name of the domain name to set.
* @returns { boolean } Returns {@code true} if the operation is successful; returns {@code false} otherwise.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Applications.Settings.Core
* @StageModelOnly
* @since 11
*/
function setValueSync(context: Context, name: string, value: string, domainName: string): boolean;
/**
* Monitor registration key(synchronous method)
* [USER_SECURE] domain need ohos.permission.MANAGE_SECURE_SETTINGS permission.
*
* @param { Context } context - Indicates Context instance.
* @param { string } name - Indicates the name of the character string.
* @param { string } domainName - Indicates the name of the domain name to set.
* @param { AsyncCallback<void> } observer - callback when monitored key value is changed.
* @returns { boolean } Returns {@code true} if the operation is successful; returns {@code false} otherwise.
* @syscap SystemCapability.Applications.Settings.Core
* @StageModelOnly
* @since 11
*/
function registerKeyObserver(context: Context, name: string, domainName: string, observer: AsyncCallback<void>): boolean;
/**
* Monitor unregister key(synchronous method)
* [USER_SECURE] domain need ohos.permission.MANAGE_SECURE_SETTINGS permission.
*
* @param { Context } context - Indicates Context instance.
* @param { string } name - Indicates the name of the character string.
* @param { string } domainName - Indicates the name of the domain name to set.
* @returns { boolean } Returns {@code true} if the operation is successful; returns {@code false} otherwise.
* @syscap SystemCapability.Applications.Settings.Core
* @StageModelOnly
* @since 11
*/
function unregisterKeyObserver(context: Context, name: string, domainName: string): boolean;
/**
* Open the network manager settings page.
*
* @param { Context } context - Indicates Context instance.
* @returns { Promise<boolean> } The promise returned by the function.
* @throws { BusinessError } 14800000 - Parameter error.
* @throws { BusinessError } 14800010 - Original service error.
* @atomicservice
* @since 18
*/
function openNetworkManagerSettings(context: Context): Promise<boolean>;
}
export default settings;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openharmony/interface_sdk-js.git
git@gitee.com:openharmony/interface_sdk-js.git
openharmony
interface_sdk-js
interface_sdk-js
master

搜索帮助