• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15import { AsyncCallback } from './basic';
16import { DataAbilityHelper } from './ability/dataAbilityHelper';
17
18/**
19 * This module provides settings data access abilities.
20 *
21 * @since 7
22 * @syscap SystemCapability.Applications.settings.Core
23 * @import import settings from '@ohos.settings'
24 * @permission N/A
25 */
26declare namespace settings {
27  /**
28   * Provides methods for setting time and date formats.
29   *
30   * @since 7
31   */
32  namespace date {
33    /**
34     * Indicates the date format.
35     *
36     * <p>The formats {@code mm/dd/yyyy}, {@code dd/mm/yyyy}, and {@code yyyy/mm/dd} are available.
37     *
38     * @since 7
39     */
40    const DATE_FORMAT: string
41
42    /**
43     * Specifies whether the time is displayed in 12-hour or 24-hour format.
44     *
45     * <p>If the value is {@code 12}, the 12-hour format is used. If the value is {@code 24}, the 24-hour format
46     * is used.
47     *
48     * @since 7
49     */
50    const TIME_FORMAT: string
51
52    /**
53     * Specifies whether the date, time, and time zone are automatically obtained from the Network
54     * Identity and Time Zone (NITZ).
55     *
56     * <p>If the value is {@code true}, the information is automatically obtained from NITZ.
57     * If the value is {@code false}, the information is not obtained from NITZ.
58     *
59     * @since 7
60     */
61    const AUTO_GAIN_TIME: string
62
63    /**
64     * Specifies whether the time zone is automatically obtained from NITZ.
65     *
66     * <p>If the value is {@code true}, the information is automatically obtained from NITZ. If the value
67     * is {@code false}, the information is not obtained from NITZ.
68     *
69     * @since 7
70     */
71    const AUTO_GAIN_TIME_ZONE: string
72  }
73
74    /**
75     * Provides methods for setting the display effect, including the font size, screen brightness, screen rotation,
76     * animation factor, and display color.
77     *
78     * @since 7
79     */
80  namespace display {
81    /**
82     * Indicates the scaling factor of fonts, which is a float number.
83     *
84     * @since 7
85     */
86    const FONT_SCALE: string
87
88    /**
89     * Indicates the screen brightness. The value ranges from 0 to 255.
90     *
91     * @since 7
92     */
93    const SCREEN_BRIGHTNESS_STATUS: string
94
95    /**
96     * Specifies whether automatic screen brightness adjustment is enabled.
97     *
98     * <p>If the value is {@code 1}, automatic adjustment is enabled. If the value is {@code 0}, automatic
99     * adjustment is disabled.
100     *
101     * @since 7
102     */
103    const AUTO_SCREEN_BRIGHTNESS: string
104
105    /**
106     * Indicates the value of {@code AUTO_SCREEN_BRIGHTNESS} when automatic screen brightness adjustment is used.
107     *
108     * @since 7
109     */
110    const AUTO_SCREEN_BRIGHTNESS_MODE: number
111
112    /**
113     * Indicates the value of {@code AUTO_SCREEN_BRIGHTNESS} when manual screen brightness adjustment is used.
114     *
115     * @since 7
116     */
117    const MANUAL_SCREEN_BRIGHTNESS_MODE: number
118
119    /**
120     * Indicates the duration that the device waits before going to sleep after a period of inactivity, in
121     * milliseconds.
122     *
123     * @since 7
124     */
125    const SCREEN_OFF_TIMEOUT: string
126
127    /**
128     * Indicates the screen rotation when no other policy is available.
129     *
130     * <p>This constant is invalid when auto-rotation is enabled. When auto-rotation is disabled, the following
131     * values are available:
132     *
133     * <ul>
134     * <li>{@code 0} - The screen rotates 0 degrees.
135     * <li>{@code 1} - The screen rotates 90 degrees.
136     * <li>{@code 2} - The screen rotates 180 degrees.
137     * <li>{@code 3} - The screen rotates 270 degrees.
138     * </ul>
139     *
140     * @since 7
141     */
142    const DEFAULT_SCREEN_ROTATION: string
143
144    /**
145     * Indicates the scaling factor for the animation duration.
146     *
147     * <p>This affects the start delay and duration of all such animations. If the value is {@code 0},
148     * the animation ends immediately. The default value is {@code 1}.
149     *
150     * @since 7
151     */
152    const ANIMATOR_DURATION_SCALE: string
153
154    /**
155     * Indicates the scaling factor for transition animations.
156     * If the value is {@code 0}, transition animations are disabled.
157     *
158     * @since 7
159     */
160    const TRANSITION_ANIMATION_SCALE: string
161
162    /**
163     * Indicates the scaling factor for normal window animations.
164     * If the value is {@code 0}, window animations are disabled.
165     *
166     * @since 7
167     */
168    const WINDOW_ANIMATION_SCALE: string
169
170    /**
171     * Specifies whether display color inversion is enabled.
172     *
173     * <p>If the value is {@code 1}, display color inversion is enabled. If the value is {@code 0}, display color
174     * inversion is disabled.
175     *
176     * @since 7
177     */
178    const DISPLAY_INVERSION_STATUS: string
179  }
180
181  /**
182   * Provides methods for setting general information about devices, including the device name, startup wizard,
183   * airplane mode, debugging information, accessibility feature switch, and touch exploration status.
184   *
185   * @since 7
186   */
187  namespace general {
188    /**
189     * Specifies whether the startup wizard has been run.
190     *
191     * <p>If the value is {@code 0}, the startup wizard has not been run. If the value is not {@code 0}, the startup
192     * wizard has been run.
193     *
194     * @since 7
195     */
196    const SETUP_WIZARD_FINISHED: string
197
198    /**
199     * Specifies what happens after the user presses the call end button if the user is not in a call.
200     *
201     * <ul>
202     * <li>{@code 0} - Nothing happens.
203     * <li>{@code 1} - The home screen is displayed.
204     * <li>{@code 2} - The device enters the sleep state and the screen is locked.
205     * <li>{@code 3} - The home screen is displayed. If the user is already on the home screen, the device enters
206     * the sleep state.
207     * </ul>
208     *
209     * @since 7
210     */
211    const END_BUTTON_ACTION: string
212
213    /**
214     * Specifies whether the accelerometer is used to change screen orientation, that is, whether auto-rotation is
215     * enabled.
216     *
217     * <p>The value {@code 1} indicates that the accelerometer is enabled by default, and {@code 0} indicates that
218     * the accelerometer is disabled by default.
219     *
220     * @since 7
221     */
222    const ACCELEROMETER_ROTATION_STATUS: string
223
224    /**
225     * Specifies whether airplane mode is enabled.
226     *
227     * <p>If the value is {@code 1}, airplane mode is enabled. If the value is {@code 0}, airplane mode is disabled.
228     *
229     * @since 7
230     */
231    const AIRPLANE_MODE_STATUS: string
232
233    /**
234     * Specifies whether the device is provisioned.
235     *
236     * <p>On a multi-user device with a single system user, the screen may be locked when the value is {@code true}.
237     * In addition, other abilities cannot be started on the system user unless they are marked to display over
238     * the screen lock.
239     *
240     * @since 7
241     */
242    const DEVICE_PROVISION_STATUS: string
243
244    /**
245     * Specifies whether the hard disk controller (HDC) on USB devices is enabled.
246     *
247     * <p>If the value is {@code true}, the HDC is enabled. If the value is {@code false}, the HDC is disabled.
248     *
249     * @since 7
250     */
251    const HDC_STATUS: string
252
253    /**
254     * Indicates the number of boot operations after the device is powered on.
255     *
256     * @since 7
257     */
258    const BOOT_COUNTING: string
259
260    /**
261     * Specifies whether contact metadata synchronization is enabled.
262     *
263     * <p>If the value is {@code true}, synchronization is enabled. If the value is {@code false},
264     * synchronization is disabled.
265     *
266     * @since 7
267     */
268    const CONTACT_METADATA_SYNC_STATUS: string
269
270    /**
271     * Specifies whether developer options are enabled.
272     *
273     * <p>If the value is {@code true}, developer options are enabled.
274     * If the value is {@code false}, developer options are disabled.
275     *
276     * @since 7
277     */
278    const DEVELOPMENT_SETTINGS_STATUS: string
279
280    /**
281     * Indicates the device name.
282     *
283     * @since 7
284     */
285    const DEVICE_NAME: string
286
287    /**
288     * Specifies whether USB mass storage is enabled.
289     *
290     * <p>If the value is {@code true}, USB mass storage is enabled.
291     * If the value is {@code false}, USB mass storage is disabled.
292     *
293     * @since 7
294     */
295    const USB_STORAGE_STATUS: string
296
297    /**
298     * Specifies whether the device waits for the debugger when starting an application to debug.
299     *
300     * <p>If the value is {@code 1}, the device waits for the debugger.
301     * If the value is {@code 0}, the system does not wait for the debugger, and so the application runs normally.
302     *
303     * @since 7
304     */
305    const DEBUGGER_WAITING: string
306
307    /**
308     * Indicates the bundle name of the application to debug.
309     *
310     * @since 7
311     */
312    const DEBUG_APP_PACKAGE: string
313
314    /**
315     * Specifies whether any accessibility feature is enabled.
316     *
317     * <p>If the value is {@code 1}, the accessibility feature is enabled. If the value is {@code 0}, the
318     * accessibility feature is disabled.
319     *
320     * @since 7
321     */
322    const ACCESSIBILITY_STATUS: string
323
324    /**
325     * Indicates the list of accessibility features that have been activated.
326     *
327     * @since 7
328     */
329    const ACTIVATED_ACCESSIBILITY_SERVICES: string
330
331    /**
332     * Indicates the default geographical location that can be used by the browser. Multiple geographical locations
333     * are separated by spaces.
334     *
335     * @since 7
336     */
337    const GEOLOCATION_ORIGINS_ALLOWED: string
338
339    /**
340     * Specifies whether an application should attempt to skip all introductory hints at the first startup. This is
341     * intended for temporary users or users who are familiar with the environment.
342     *
343     * <p>If the value is {@code 1}, the application attempts to skip all introductory hints at the first startup.
344     * If the value is {@code 0}, the application does not skip introductory hints at the first startup.
345     *
346     * @since 7
347     */
348    const SKIP_USE_HINTS: string
349
350    /**
351     * Indicates whether touch exploration is enabled.
352     *
353     * <p>If the value is {@code 1}, touch exploration is enabled. If the value is {@code 0}, touch exploration is
354     * disabled.
355     *
356     * @since 7
357     */
358    const TOUCH_EXPLORATION_STATUS: string
359  }
360
361  /**
362   * Provides methods for setting information about input methods, including automatic capitalization, automatic
363   * punctuation, autocorrect, password presentation, input method engine, and input method subtypes.
364   *
365   * @since 7
366   */
367  namespace input {
368    /**
369     * Indicates the default input method and its ID.
370     *
371     * @since 7
372     */
373    const DEFAULT_INPUT_METHOD: string
374
375    /**
376     * Indicates the default input method keyboard type and its ID.
377     *
378     * @since 7
379     */
380    const ACTIVATED_INPUT_METHOD_SUB_MODE: string
381
382    /**
383     * Indicates the list of input methods that have been activated.
384     *
385     * <p>The list is a string that contains the IDs of activated input methods. The IDs are separated by colons
386     * (:), and keyboardTypes of an input method are separated by semicolons (;). An example format is
387     * {@code ima0:keyboardType0;keyboardType1;ima1:ima2:keyboardTypes0}. The type of <b>imaID</b> is ElementName,
388     * and the type of <b>keyboard</b> is int.
389     *
390     * @since 7
391     */
392    const ACTIVATED_INPUT_METHODS: string
393
394    /**
395     * Specifies whether the input method selector is visible.
396     *
397     * <p>If the value is {@code 1}, the input method selector is visible. If the value is {@code 0}, the input
398     * method selector is invisible.
399     *
400     * @since 7
401     */
402    const SELECTOR_VISIBILITY_FOR_INPUT_METHOD: string
403
404    /**
405     * Specifies whether automatic capitalization is enabled for the text editor.
406     *
407     * <p>If the value is {@code 0}, automatic capitalization is disabled. If the value {@code 1}, automatic
408     * capitalization is enabled.
409     *
410     * @since 7
411     */
412    const AUTO_CAPS_TEXT_INPUT: string
413
414    /**
415     * Specifies whether automatic punctuation is enabled for the text editor. Automatic punctuation enables the
416     * text editor to convert two spaces into a period (.) and a space.
417     *
418     * <p>If the value is {@code 0}, automatic punctuation is disabled. If the value {@code 1}, automatic
419     * punctuation is enabled.
420     *
421     * @since 7
422     */
423    const AUTO_PUNCTUATE_TEXT_INPUT: string
424
425    /**
426     * Specifies whether autocorrect is enabled for the text editor. Autocorrect enables the text editor to correct
427     * typos.
428     *
429     * <p>If the value is {@code 0}, autocorrect is disabled. If the value {@code 1}, autocorrect is enabled.
430     *
431     * @since 7
432     */
433    const AUTO_REPLACE_TEXT_INPUT: string
434
435    /**
436     * Specifies whether password presentation is enabled in the text editor. Password presentation enables the
437     * text editor to show password characters when the user types them.
438     *
439     * <p>If the value is {@code 0}, password presentation is disabled. If the value {@code 1}, password
440     * presentation is enabled.
441     *
442     * @since 7
443     */
444    const SHOW_PASSWORD_TEXT_INPUT: string
445  }
446
447  /**
448   * Provides methods for setting network information, including the data roaming status, HTTP proxy configurations,
449   * and preferred networks.
450   *
451   * @since 7
452   */
453  namespace network {
454    /**
455     * Specifies whether data roaming is enabled.
456     *
457     * <p>If the value is {@code true}, data roaming is enabled. If the value is {@code false},
458     * data roaming is disabled.
459     *
460     * @since 7
461     */
462    const DATA_ROAMING_STATUS: string
463
464    /**
465     * Indicates the host name and port number of the global HTTP proxy.
466     * The host name and port number are separated by a colon (:).
467     *
468     * @since 7
469     */
470    const HTTP_PROXY_CFG: string
471
472    /**
473     * Indicates the user preferences of the network to use.
474     *
475     * @since 7
476     */
477    const NETWORK_PREFERENCE_USAGE: string
478  }
479
480  /**
481   * Provides methods for setting the answering mode of incoming and outgoing calls.
482   *
483   * @since 7
484   */
485  namespace phone {
486    /**
487     * Specifies whether real-time text (RTT) calling is enabled. If enabled, incoming and outgoing calls are
488     * answered as RTT calls when supported by the device and carrier. If the value is {@code 1}, RTT calling is
489     * enabled. If the value is {@code 0}, RTT calling is disabled.
490     *
491     * @since 7
492     */
493    const RTT_CALLING_STATUS: string
494  }
495
496  /**
497   * Provides methods for setting the sound effect, including the ringtone, dial tone, alarm sound, notification tone,
498   * and haptic feedback.
499   *
500   * @since 7
501   */
502  namespace sound {
503    /**
504     * Indicates whether the device vibrates when it is ringing for an incoming call.
505     *
506     * <p>This constant will be used by Phone and Settings applications. The value is of the boolean type.
507     * This constant affects only the scenario where the device rings for an incoming call. It does not affect
508     * any other application or scenario.
509     *
510     * @since 7
511     */
512    const VIBRATE_WHILE_RINGING: string
513
514    /**
515     * Indicates the storage area of the system default alarm.
516     *
517     * <p>You can obtain the URI of the system default alarm.
518     *
519     * @since 7
520     */
521    const DEFAULT_ALARM_ALERT: string
522
523    /**
524     * Indicates the type of the dual-tone multifrequency (DTMF) tone played when dialing.
525     *
526     * <p>The value {@code 0} indicates the normal short sound effect, and {@code 1} indicates the long sound
527     * effect.
528     *
529     * @since 7
530     */
531    const DTMF_TONE_TYPE_WHILE_DIALING: string
532
533    /**
534     * Specifies whether the DTMF tone is played when dialing.
535     *
536     * <p>If the value is {@code 1}, the DTMF tone is played. If the value is {@code 0}, the DTMF tone is not
537     * played.
538     *
539     * @since 7
540     */
541    const DTMF_TONE_WHILE_DIALING: string
542
543    /**
544     * Specifies which audio streams are affected by changes on the ringing mode and Do Not Disturb (DND) mode.
545     *
546     * <p>If you want a specific audio stream to be affected by changes of the ringing mode and DDN mode, set the
547     * corresponding bit to {@code 1}.
548     *
549     * @since 7
550     */
551    const AFFECTED_MODE_RINGER_STREAMS: string
552
553    /**
554     * Specifies which audio streams are affected by the mute mode.
555     *
556     * <p>If you want a specific audio stream to remain muted in mute mode, set the corresponding bit to {@code 1}.
557     *
558     * @since 7
559     */
560    const AFFECTED_MUTE_STREAMS: string
561
562    /**
563     * Indicates the storage area of the system default notification tone.
564     *
565     * <p>You can obtain the URI of the system default notification tone.
566     *
567     * @since 7
568     */
569    const DEFAULT_NOTIFICATION_SOUND: string
570
571    /**
572     * Indicates the storage area of the system default ringtone.
573     *
574     * <p>You can obtain the URI of the system default ringtone.
575     *
576     * @since 7
577     */
578    const DEFAULT_RINGTONE: string
579
580    /**
581     * Specifies whether the sound effects are enabled.
582     *
583     * <p>If the value is {@code 0}, the sound effects are disabled. If the value is {@code 1}, the sound effects
584     * are enabled.
585     *
586     * @since 7
587     */
588    const SOUND_EFFECTS_STATUS: string
589
590    /**
591     * Specifies whether the device vibrates for an event. This parameter is used inside the system.
592     *
593     * <p>If the value is {@code 1}, the device vibrates for an event. If the value is {@code 0}, the device does
594     * not vibrate for an event.
595     *
596     * @since 7
597     */
598    const VIBRATE_STATUS: string
599
600    /**
601     * Indicates whether the device enables haptic feedback.
602     *
603     * <p>The value is of the boolean type.
604     *
605     * @since 7
606     */
607    const HAPTIC_FEEDBACK_STATUS: string
608  }
609
610  /**
611   * Provides methods for setting information about text-to-speech (TTS) conversion, including the pitch, speech rate,
612   * engine, and plug-ins.
613   *
614   * @since 7
615   */
616  namespace TTS {
617    /**
618     * Indicates the default pitch of the text-to-speech (TTS) engine.
619     *
620     * <p>100 = 1x. If the value is set to {@code 200}, the frequency is twice the normal sound frequency.
621     *
622     * @since 7
623     */
624    const DEFAULT_TTS_PITCH: string
625
626    /**
627     * Indicates the default speech rate of the TTS engine. 100 = 1x.
628     *
629     * @since 7
630     */
631    const DEFAULT_TTS_RATE: string
632
633    /**
634     * Indicates the default TTS engine.
635     *
636     * @since 7
637     */
638    const DEFAULT_TTS_SYNTH: string
639
640    /**
641     * Indicates the list of activated plug-in packages used for TTS. Multiple plug-in packages are separated by
642     * spaces.
643     *
644     * @since 7
645     */
646    const ENABLED_TTS_PLUGINS: string
647  }
648
649  /**
650   * Provides methods for setting radio network information, including information about Bluetooth, Wi-Fi, Near Field
651   * Communication (NFC), and the airplane mode.
652   *
653   * @since 7
654   */
655  namespace wireless {
656  /**
657     * Specifies whether the device can be discovered or connected by other devices through Bluetooth.
658     *
659     * If the value is {@code 0}, the device cannot be connected or discovered. If the value is {@code 1}, the
660     * device can be connected but cannot be discovered. If the value is {@code 2}, the device can be connected
661     * and discovered.
662     *
663     * @since 7
664     */
665    const BLUETOOTH_DISCOVER_ABILITY_STATUS: string
666
667    /**
668     * Indicates the duration (in seconds) that the device can be discovered through Bluetooth.
669     *
670     * <p>After the duration expires, the device cannot be discovered through Bluetooth.
671     *
672     * @since 7
673     */
674    const BLUETOOTH_DISCOVER_TIMEOUT: string
675
676    /**
677     * Indicates the list of radio signals to be disabled when airplane mode is enabled. Multiple radio
678     * signals are separated by commas (,).
679     *
680     * <ul>
681     * <li>{@code BLUETOOTH_RADIO} - Bluetooth is disabled in airplane mode.
682     * <li>{@code CELL_RADIO} - Cellular radio is disabled in airplane mode.
683     * <li>{@code NFC_RADIO} - NFC is disabled in airplane mode.
684     * <li>{@code WIFI_RADIO} - Wi-Fi is disabled in airplane mode.
685     * </ul>
686     *
687     * @since 7
688     */
689    const AIRPLANE_MODE_RADIOS: string
690
691    /**
692     * Specifies whether Bluetooth is enabled.
693     *
694     * <p>If the value is {@code true}, Bluetooth is enabled. If the value is {@code false}, Bluetooth is disabled.
695     *
696     * @since 7
697     */
698    const BLUETOOTH_STATUS: string
699
700    /**
701     * A constant of {@code AIRPLANE_MODE_RADIOS} to indicate that Bluetooth is disabled in airplane mode.
702     *
703     * @since 7
704     */
705    const BLUETOOTH_RADIO: string
706
707    /**
708     * A constant of {@code AIRPLANE_MODE_RADIOS} to indicate that cellular radio is disabled in airplane mode.
709     *
710     * @since 7
711     */
712    const CELL_RADIO: string
713
714    /**
715     * A constant of {@code AIRPLANE_MODE_RADIOS} to indicate that NFC is disabled in airplane mode.
716     *
717     * @since 7
718     */
719    const NFC_RADIO: string
720
721    /**
722     * A constant of {@code AIRPLANE_MODE_RADIOS} to indicate that Wi-Fi is disabled in airplane mode.
723     *
724     * @since 7
725     */
726    const WIFI_RADIO: string
727
728    /**
729     * Specifies whether the Wi-Fi configuration created by the application of the device owner should be
730     * locked down.
731     *
732     * <p>If the value is {@code true}, the Wi-Fi configuration should be locked down.
733     * If the value is {@code false}, the Wi-Fi configuration should not be locked down.
734     *
735     * @since 7
736     */
737    const OWNER_LOCKDOWN_WIFI_CFG: string
738
739    /**
740     * Indicates the maximum number of attempts to obtain an IP address from the DHCP server.
741     *
742     * @since 7
743     */
744    const WIFI_DHCP_MAX_RETRY_COUNT: string
745
746    /**
747     * Indicates the maximum duration to hold a wake lock when waiting for the mobile data connection to
748     * establish after the Wi-Fi connection is disconnected.
749     *
750     * @since 7
751     */
752    const WIFI_TO_MOBILE_DATA_AWAKE_TIMEOUT: string
753
754    /**
755     * Specifies whether Wi-Fi is enabled.
756     *
757     * <p>If the value is {@code true}, Wi-Fi is enabled. If the value is {@code false}, Wi-Fi is disabled.
758     *
759     * @since 7
760     */
761    const WIFI_STATUS: string
762
763    /**
764     * Specifies whether Wi-Fi watchdog is enabled.
765     *
766     * <p>If the value is {@code true}, Wi-Fi watchdog is enabled.
767     * If the value is {@code false}, Wi-Fi watchdog is disabled.
768     *
769     * @since 7
770     */
771    const WIFI_WATCHDOG_STATUS: string
772  }
773
774  /**
775   * Constructs a URI for a specific name-value pair for monitoring data of the ability that uses the Data
776   * template.
777   *
778   * @param name Indicates the name of the setting to set.
779   * @return Returns the corresponding URI; returns {@code null} if the URI does not exist.
780   * @since 7
781   */
782  function getURI(name: string, callback: AsyncCallback<object>): void;
783  function getURI(name: string): Promise<object>;
784
785  /**
786   * Obtains the value of a specified character string in the database.
787   *
788   * @param dataAbilityHelper Indicates the {@link ohos.aafwk.ability.DataAbilityHelper} used to access
789   * the database.
790   * @param name Indicates the name of the character string.
791   * @return Returns the value of the character string in the table if any is found; returns {@code null}
792   * otherwise.
793   * @since 7
794   */
795  function getValue(dataAbilityHelper: DataAbilityHelper, name: string, callback: AsyncCallback<object>): void;
796  function getValue(dataAbilityHelper: DataAbilityHelper, name: string): Promise<object>;
797
798  /**
799   * Saves a character string name and its value to the database.
800   *
801   * @param dataAbilityHelper Indicates the {@link ohos.aafwk.ability.DataAbilityHelper} used to access
802   * the database.
803   * @param name Indicates the name of the character string.
804   * @param value Indicates the value of the character string.
805   * @return Returns {@code true} if the operation is successful; returns {@code false} otherwise.
806   * @since 7
807   * @systemapi Hide this for inner system use. SystemApi
808   */
809  function setValue(dataAbilityHelper: DataAbilityHelper, name: string, value: object, callback: AsyncCallback<boolean>): void;
810  function setValue(dataAbilityHelper: DataAbilityHelper, name: string, value: object): Promise<boolean>;
811
812  /**
813   * Enables or disables airplane mode.
814   *
815   * @param enable Specifies whether to enable airplane mode. The value {@code true} means to enable airplane
816   * mode, and {@code false} means to disable airplane mode.
817   * @return Returns {@code true} if the operation is successful; returns {@code false} otherwise.
818   * @since 7
819   */
820  function enableAirplaneMode(enable: boolean, callback: AsyncCallback<void>): void;
821  function enableAirplaneMode(enable: boolean): Promise<void>;
822
823  /**
824   * Checks whether a specified application can show as float window.
825   *
826   * @param context Indicates the application context.
827   * @return Returns {@code true} if the application can draw over other applications; returns {@code false}
828   * otherwise.
829   * @since 7
830   */
831  function canShowFloating(callback: AsyncCallback<boolean>): void;
832  function canShowFloating(): Promise<boolean>;
833
834  /**
835   * get settingsdata uri(synchronization method)
836   * @since 8
837   * @param name Indicates the name of the setting to set.
838   * @return Return settingsdata uri.
839   */
840   function getUriSync(name: string): string;
841
842   /**
843    * get value from settingsdata(synchronization method)
844    * @since 8
845    * @param dataAbilityHelper Indicates dataAbilityHelper instance
846    * @param name Indicates the name of the character string.
847    * @param defValue Indicates the default value of the character string.
848    * @return settingsdata value
849    */
850   function getValueSync(dataAbilityHelper: DataAbilityHelper, name: string, defValue: string): string;
851
852   /**
853    * set settingsdata value(synchronization method)
854    * @need permission ohos.permission.WRITE_SYSTEM_SETTING
855    * @since 8
856    * @param dataAbilityHelper Indicates dataAbilityHelper instance
857    * @param name Indicates the name of the character string.
858    * @param value Indicates the value of the character string.
859    * @return Returns {@code true} if the operation is successful; returns {@code false} otherwise.
860    */
861   function setValueSync(dataAbilityHelper: DataAbilityHelper, name: string, value: string): boolean;
862}
863
864export default settings;