161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (c) 2021 Huawei Device Co., Ltd. 361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 461847f8eSopenharmony_ci * you may not use this file except in compliance with the License. 561847f8eSopenharmony_ci * You may obtain a copy of the License at 661847f8eSopenharmony_ci * 761847f8eSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 861847f8eSopenharmony_ci * 961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and 1361847f8eSopenharmony_ci * limitations under the License. 1461847f8eSopenharmony_ci */ 1561847f8eSopenharmony_ci 1661847f8eSopenharmony_ci/** 1761847f8eSopenharmony_ci * @file 1861847f8eSopenharmony_ci * @kit LocalizationKit 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ciimport { BusinessError } from './@ohos.base'; 2261847f8eSopenharmony_ci 2361847f8eSopenharmony_ci/** 2461847f8eSopenharmony_ci * Provides international settings related APIs. 2561847f8eSopenharmony_ci * 2661847f8eSopenharmony_ci * @namespace i18n 2761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 2861847f8eSopenharmony_ci * @since 7 2961847f8eSopenharmony_ci */ 3061847f8eSopenharmony_ci/** 3161847f8eSopenharmony_ci * Provides international settings related APIs. 3261847f8eSopenharmony_ci * 3361847f8eSopenharmony_ci * @namespace i18n 3461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 3561847f8eSopenharmony_ci * @crossplatform 3661847f8eSopenharmony_ci * @form 3761847f8eSopenharmony_ci * @atomicservice 3861847f8eSopenharmony_ci * @since 11 3961847f8eSopenharmony_ci */ 4061847f8eSopenharmony_cideclare namespace i18n { 4161847f8eSopenharmony_ci /** 4261847f8eSopenharmony_ci * Obtains the country or region name localized for display on a given locale. 4361847f8eSopenharmony_ci * 4461847f8eSopenharmony_ci * @param { string } country - The locale whose country or region name will be displayed. 4561847f8eSopenharmony_ci * @param { string } locale - The locale used to display the country or region. 4661847f8eSopenharmony_ci * @param { boolean } [sentenceCase] - Specifies whether the country or region name is displayed in sentence case. 4761847f8eSopenharmony_ci * @returns { string } the country or region name localized for display on a given locale. 4861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 4961847f8eSopenharmony_ci * @since 7 5061847f8eSopenharmony_ci * @deprecated since 9 5161847f8eSopenharmony_ci * @useinstead ohos.System.getDisplayCountry 5261847f8eSopenharmony_ci */ 5361847f8eSopenharmony_ci export function getDisplayCountry(country: string, locale: string, sentenceCase?: boolean): string; 5461847f8eSopenharmony_ci 5561847f8eSopenharmony_ci /** 5661847f8eSopenharmony_ci * Obtains the language name localized for display on a given locale. 5761847f8eSopenharmony_ci * 5861847f8eSopenharmony_ci * @param { string } language - The locale whose language name will be displayed. 5961847f8eSopenharmony_ci * @param { string } locale - The locale used to display the language. 6061847f8eSopenharmony_ci * @param { boolean } [sentenceCase] - Specifies whether the language name is displayed in sentence case. 6161847f8eSopenharmony_ci * @returns { string } the language name localized for display on a given locale. 6261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 6361847f8eSopenharmony_ci * @since 7 6461847f8eSopenharmony_ci * @deprecated since 9 6561847f8eSopenharmony_ci * @useinstead ohos.System.getDisplayLanguage 6661847f8eSopenharmony_ci */ 6761847f8eSopenharmony_ci export function getDisplayLanguage(language: string, locale: string, sentenceCase?: boolean): string; 6861847f8eSopenharmony_ci 6961847f8eSopenharmony_ci /** 7061847f8eSopenharmony_ci * Obtains the language currently used by the system. 7161847f8eSopenharmony_ci * 7261847f8eSopenharmony_ci * @returns { string } the language currently used by the system. 7361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 7461847f8eSopenharmony_ci * @since 7 7561847f8eSopenharmony_ci * @deprecated since 9 7661847f8eSopenharmony_ci * @useinstead ohos.System.getSystemLanguage 7761847f8eSopenharmony_ci */ 7861847f8eSopenharmony_ci export function getSystemLanguage(): string; 7961847f8eSopenharmony_ci 8061847f8eSopenharmony_ci /** 8161847f8eSopenharmony_ci * Obtains the region currently used by the system. 8261847f8eSopenharmony_ci * 8361847f8eSopenharmony_ci * @returns { string } the region currently used by the system. 8461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 8561847f8eSopenharmony_ci * @since 7 8661847f8eSopenharmony_ci * @deprecated since 9 8761847f8eSopenharmony_ci * @useinstead ohos.System.getSystemRegion 8861847f8eSopenharmony_ci */ 8961847f8eSopenharmony_ci export function getSystemRegion(): string; 9061847f8eSopenharmony_ci 9161847f8eSopenharmony_ci /** 9261847f8eSopenharmony_ci * Obtains the locale currently used by the system. 9361847f8eSopenharmony_ci * 9461847f8eSopenharmony_ci * @returns { string } the locale currently used by the system. 9561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 9661847f8eSopenharmony_ci * @since 7 9761847f8eSopenharmony_ci * @deprecated since 9 9861847f8eSopenharmony_ci * @useinstead ohos.System.getSystemLocale 9961847f8eSopenharmony_ci */ 10061847f8eSopenharmony_ci export function getSystemLocale(): string; 10161847f8eSopenharmony_ci 10261847f8eSopenharmony_ci /** 10361847f8eSopenharmony_ci * Provides system functions. 10461847f8eSopenharmony_ci * 10561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 10661847f8eSopenharmony_ci * @since 9 10761847f8eSopenharmony_ci */ 10861847f8eSopenharmony_ci /** 10961847f8eSopenharmony_ci * Provides system functions. 11061847f8eSopenharmony_ci * 11161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 11261847f8eSopenharmony_ci * @crossplatform 11361847f8eSopenharmony_ci * @since 10 11461847f8eSopenharmony_ci */ 11561847f8eSopenharmony_ci /** 11661847f8eSopenharmony_ci * Provides system functions. 11761847f8eSopenharmony_ci * 11861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 11961847f8eSopenharmony_ci * @crossplatform 12061847f8eSopenharmony_ci * @form 12161847f8eSopenharmony_ci * @atomicservice 12261847f8eSopenharmony_ci * @since 11 12361847f8eSopenharmony_ci */ 12461847f8eSopenharmony_ci export class System { 12561847f8eSopenharmony_ci /** 12661847f8eSopenharmony_ci * Obtains the country or region name localized for display on a given locale. 12761847f8eSopenharmony_ci * 12861847f8eSopenharmony_ci * @param { string } country - The locale whose country or region name will be displayed. 12961847f8eSopenharmony_ci * @param { string } locale - The locale used to display the country or region. 13061847f8eSopenharmony_ci * @param { boolean } [sentenceCase] - Specifies whether the country or region name is displayed in sentence case. 13161847f8eSopenharmony_ci * @returns { string } the country or region name localized for display on a given locale. 13261847f8eSopenharmony_ci * @throws { BusinessError } 401 - check param failed 13361847f8eSopenharmony_ci * @throws { BusinessError } 890001 - param value not valid 13461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 13561847f8eSopenharmony_ci * @since 9 13661847f8eSopenharmony_ci */ 13761847f8eSopenharmony_ci /** 13861847f8eSopenharmony_ci * Obtains the country or region name localized for display on a given locale. 13961847f8eSopenharmony_ci * 14061847f8eSopenharmony_ci * @param { string } country - The locale whose country or region name will be displayed. It must be a valid country. 14161847f8eSopenharmony_ci * @param { string } locale - The locale used to display the country or region. It must be a valid locale. 14261847f8eSopenharmony_ci * @param { boolean } [sentenceCase] - Specifies whether the country or region name is displayed in sentence case. 14361847f8eSopenharmony_ci * @returns { string } the country or region name localized for display on a given locale. 14461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 14561847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 14661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 14761847f8eSopenharmony_ci * @crossplatform 14861847f8eSopenharmony_ci * @since 10 14961847f8eSopenharmony_ci */ 15061847f8eSopenharmony_ci /** 15161847f8eSopenharmony_ci * Obtains the country or region name localized for display on a given locale. 15261847f8eSopenharmony_ci * 15361847f8eSopenharmony_ci * @param { string } country - The locale whose country or region name will be displayed. It must be a valid country. 15461847f8eSopenharmony_ci * @param { string } locale - The locale used to display the country or region. It must be a valid locale. 15561847f8eSopenharmony_ci * @param { boolean } [sentenceCase] - Specifies whether the country or region name is displayed in sentence case. 15661847f8eSopenharmony_ci * @returns { string } the country or region name localized for display on a given locale. 15761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 15861847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 15961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 16061847f8eSopenharmony_ci * @crossplatform 16161847f8eSopenharmony_ci * @atomicservice 16261847f8eSopenharmony_ci * @since 12 16361847f8eSopenharmony_ci */ 16461847f8eSopenharmony_ci static getDisplayCountry(country: string, locale: string, sentenceCase?: boolean): string; 16561847f8eSopenharmony_ci 16661847f8eSopenharmony_ci /** 16761847f8eSopenharmony_ci * Obtains the language name localized for display on a given locale. 16861847f8eSopenharmony_ci * 16961847f8eSopenharmony_ci * @param { string } language - The locale whose language name will be displayed. 17061847f8eSopenharmony_ci * @param { string } locale - The locale used to display the language. 17161847f8eSopenharmony_ci * @param { boolean } [sentenceCase] - Specifies whether the language name is displayed in sentence case. 17261847f8eSopenharmony_ci * @returns { string } the language name localized for display on a given locale. 17361847f8eSopenharmony_ci * @throws { BusinessError } 401 - check param failed 17461847f8eSopenharmony_ci * @throws { BusinessError } 890001 - param value not valid 17561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 17661847f8eSopenharmony_ci * @since 9 17761847f8eSopenharmony_ci */ 17861847f8eSopenharmony_ci /** 17961847f8eSopenharmony_ci * Obtains the language name localized for display on a given locale. 18061847f8eSopenharmony_ci * 18161847f8eSopenharmony_ci * @param { string } language - The locale whose language name will be displayed. 18261847f8eSopenharmony_ci * @param { string } locale - The locale used to display the language. 18361847f8eSopenharmony_ci * @param { boolean } [sentenceCase] - Specifies whether the language name is displayed in sentence case. 18461847f8eSopenharmony_ci * @returns { string } the language name localized for display on a given locale. 18561847f8eSopenharmony_ci * @throws { BusinessError } 401 - check param failed 18661847f8eSopenharmony_ci * @throws { BusinessError } 890001 - param value not valid 18761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 18861847f8eSopenharmony_ci * @crossplatform 18961847f8eSopenharmony_ci * @since 10 19061847f8eSopenharmony_ci */ 19161847f8eSopenharmony_ci /** 19261847f8eSopenharmony_ci * Obtains the language name localized for display on a given locale. 19361847f8eSopenharmony_ci * 19461847f8eSopenharmony_ci * @param { string } language - The locale whose language name will be displayed. It must be a valid language. 19561847f8eSopenharmony_ci * @param { string } locale - The locale used to display the language. It must be a valid locale. 19661847f8eSopenharmony_ci * @param { boolean } [sentenceCase] - Specifies whether the language name is displayed in sentence case. 19761847f8eSopenharmony_ci * @returns { string } the language name localized for display on a given locale. 19861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 19961847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 20061847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 20161847f8eSopenharmony_ci * @crossplatform 20261847f8eSopenharmony_ci * @atomicservice 20361847f8eSopenharmony_ci * @since 11 20461847f8eSopenharmony_ci */ 20561847f8eSopenharmony_ci static getDisplayLanguage(language: string, locale: string, sentenceCase?: boolean): string; 20661847f8eSopenharmony_ci 20761847f8eSopenharmony_ci /** 20861847f8eSopenharmony_ci * Obtains all languages supported by the system. 20961847f8eSopenharmony_ci * 21061847f8eSopenharmony_ci * @returns { Array<string> } all languages supported by the system. 21161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 21261847f8eSopenharmony_ci * @since 9 21361847f8eSopenharmony_ci */ 21461847f8eSopenharmony_ci /** 21561847f8eSopenharmony_ci * Obtains all languages supported by the system. 21661847f8eSopenharmony_ci * 21761847f8eSopenharmony_ci * @returns { Array<string> } all languages supported by the system. 21861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 21961847f8eSopenharmony_ci * @atomicservice 22061847f8eSopenharmony_ci * @since 12 22161847f8eSopenharmony_ci */ 22261847f8eSopenharmony_ci static getSystemLanguages(): Array<string>; 22361847f8eSopenharmony_ci 22461847f8eSopenharmony_ci /** 22561847f8eSopenharmony_ci * Obtains all regions supported by the system in the language. 22661847f8eSopenharmony_ci * 22761847f8eSopenharmony_ci * @param { string } language - The language used to get the list of regions. It must be a valid language. 22861847f8eSopenharmony_ci * @returns { Array<string> } all countries or regions supported by the system in the language. 22961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 23061847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 23161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 23261847f8eSopenharmony_ci * @since 9 23361847f8eSopenharmony_ci */ 23461847f8eSopenharmony_ci /** 23561847f8eSopenharmony_ci * Obtains all regions supported by the system in the language. 23661847f8eSopenharmony_ci * 23761847f8eSopenharmony_ci * @param { string } language - The language used to get the list of regions. It must be a valid language. 23861847f8eSopenharmony_ci * @returns { Array<string> } all countries or regions supported by the system in the language. 23961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 24061847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 24161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 24261847f8eSopenharmony_ci * @atomicservice 24361847f8eSopenharmony_ci * @since 12 24461847f8eSopenharmony_ci */ 24561847f8eSopenharmony_ci static getSystemCountries(language: string): Array<string>; 24661847f8eSopenharmony_ci 24761847f8eSopenharmony_ci /** 24861847f8eSopenharmony_ci * Determine whether the current language or region is recommended. 24961847f8eSopenharmony_ci * 25061847f8eSopenharmony_ci * @param { string } language - The language code. It must be a valid language. 25161847f8eSopenharmony_ci * @param { string } [region] - The region code. It must be a valid region. 25261847f8eSopenharmony_ci * @returns { boolean } whether the current language or region is recommended. 25361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 25461847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 25561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 25661847f8eSopenharmony_ci * @since 9 25761847f8eSopenharmony_ci */ 25861847f8eSopenharmony_ci /** 25961847f8eSopenharmony_ci * Determine whether the current language or region is recommended. 26061847f8eSopenharmony_ci * 26161847f8eSopenharmony_ci * @param { string } language - The language code. It must be a valid language. 26261847f8eSopenharmony_ci * @param { string } [region] - The region code. It must be a valid region. 26361847f8eSopenharmony_ci * @returns { boolean } whether the current language or region is recommended. 26461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 26561847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 26661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 26761847f8eSopenharmony_ci * @atomicservice 26861847f8eSopenharmony_ci * @since 12 26961847f8eSopenharmony_ci */ 27061847f8eSopenharmony_ci static isSuggested(language: string, region?: string): boolean; 27161847f8eSopenharmony_ci 27261847f8eSopenharmony_ci /** 27361847f8eSopenharmony_ci * Obtains the language currently used by the system. 27461847f8eSopenharmony_ci * 27561847f8eSopenharmony_ci * @returns { string } the language currently used by the system. 27661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 27761847f8eSopenharmony_ci * @since 9 27861847f8eSopenharmony_ci */ 27961847f8eSopenharmony_ci /** 28061847f8eSopenharmony_ci * Obtains the language currently used by the system. 28161847f8eSopenharmony_ci * 28261847f8eSopenharmony_ci * @returns { string } the language currently used by the system. 28361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 28461847f8eSopenharmony_ci * @crossplatform 28561847f8eSopenharmony_ci * @since 10 28661847f8eSopenharmony_ci */ 28761847f8eSopenharmony_ci /** 28861847f8eSopenharmony_ci * Obtains the language currently used by the system. 28961847f8eSopenharmony_ci * 29061847f8eSopenharmony_ci * @returns { string } the language currently used by the system. 29161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 29261847f8eSopenharmony_ci * @crossplatform 29361847f8eSopenharmony_ci * @form 29461847f8eSopenharmony_ci * @atomicservice 29561847f8eSopenharmony_ci * @since 11 29661847f8eSopenharmony_ci */ 29761847f8eSopenharmony_ci static getSystemLanguage(): string; 29861847f8eSopenharmony_ci 29961847f8eSopenharmony_ci /** 30061847f8eSopenharmony_ci * Set the language currently used by the system. 30161847f8eSopenharmony_ci * 30261847f8eSopenharmony_ci * @permission ohos.permission.UPDATE_CONFIGURATION 30361847f8eSopenharmony_ci * @param { string } language - The language to be used. It must be a valid language. 30461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 30561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 30661847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 30761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 30861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 30961847f8eSopenharmony_ci * @since 9 31061847f8eSopenharmony_ci */ 31161847f8eSopenharmony_ci static setSystemLanguage(language: string): void; 31261847f8eSopenharmony_ci 31361847f8eSopenharmony_ci /** 31461847f8eSopenharmony_ci * Obtains the region currently used by the system. 31561847f8eSopenharmony_ci * 31661847f8eSopenharmony_ci * @returns { string } the region currently used by the system. 31761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 31861847f8eSopenharmony_ci * @since 9 31961847f8eSopenharmony_ci */ 32061847f8eSopenharmony_ci /** 32161847f8eSopenharmony_ci * Obtains the region currently used by the system. 32261847f8eSopenharmony_ci * 32361847f8eSopenharmony_ci * @returns { string } the region currently used by the system. 32461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 32561847f8eSopenharmony_ci * @crossplatform 32661847f8eSopenharmony_ci * @since 10 32761847f8eSopenharmony_ci */ 32861847f8eSopenharmony_ci /** 32961847f8eSopenharmony_ci * Obtains the region currently used by the system. 33061847f8eSopenharmony_ci * 33161847f8eSopenharmony_ci * @returns { string } the region currently used by the system. 33261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 33361847f8eSopenharmony_ci * @crossplatform 33461847f8eSopenharmony_ci * @atomicservice 33561847f8eSopenharmony_ci * @since 12 33661847f8eSopenharmony_ci */ 33761847f8eSopenharmony_ci static getSystemRegion(): string; 33861847f8eSopenharmony_ci 33961847f8eSopenharmony_ci /** 34061847f8eSopenharmony_ci * Set the region currently used by the system. 34161847f8eSopenharmony_ci * 34261847f8eSopenharmony_ci * @permission ohos.permission.UPDATE_CONFIGURATION 34361847f8eSopenharmony_ci * @param { string } region - The region to be used. It must be a valid region. 34461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 34561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 34661847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 34761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 34861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 34961847f8eSopenharmony_ci * @since 9 35061847f8eSopenharmony_ci */ 35161847f8eSopenharmony_ci static setSystemRegion(region: string): void; 35261847f8eSopenharmony_ci 35361847f8eSopenharmony_ci /** 35461847f8eSopenharmony_ci * Obtains the locale currently used by the system. 35561847f8eSopenharmony_ci * 35661847f8eSopenharmony_ci * @returns { string } the locale currently used by the system. 35761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 35861847f8eSopenharmony_ci * @since 9 35961847f8eSopenharmony_ci */ 36061847f8eSopenharmony_ci /** 36161847f8eSopenharmony_ci * Obtains the locale currently used by the system. 36261847f8eSopenharmony_ci * 36361847f8eSopenharmony_ci * @returns { string } the locale currently used by the system. 36461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 36561847f8eSopenharmony_ci * @crossplatform 36661847f8eSopenharmony_ci * @since 10 36761847f8eSopenharmony_ci */ 36861847f8eSopenharmony_ci /** 36961847f8eSopenharmony_ci * Obtains the locale currently used by the system. 37061847f8eSopenharmony_ci * 37161847f8eSopenharmony_ci * @returns { string } the locale currently used by the system. 37261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 37361847f8eSopenharmony_ci * @crossplatform 37461847f8eSopenharmony_ci * @atomicservice 37561847f8eSopenharmony_ci * @since 11 37661847f8eSopenharmony_ci */ 37761847f8eSopenharmony_ci static getSystemLocale(): string; 37861847f8eSopenharmony_ci 37961847f8eSopenharmony_ci /** 38061847f8eSopenharmony_ci * Set the locale currently used by the system. 38161847f8eSopenharmony_ci * 38261847f8eSopenharmony_ci * @permission ohos.permission.UPDATE_CONFIGURATION 38361847f8eSopenharmony_ci * @param { string } locale - The locale to be used. It must be a valid locale. 38461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 38561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 38661847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 38761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 38861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 38961847f8eSopenharmony_ci * @since 9 39061847f8eSopenharmony_ci */ 39161847f8eSopenharmony_ci static setSystemLocale(locale: string): void; 39261847f8eSopenharmony_ci 39361847f8eSopenharmony_ci /** 39461847f8eSopenharmony_ci * Check out whether system is 24-hour system. 39561847f8eSopenharmony_ci * 39661847f8eSopenharmony_ci * @returns { boolean } a boolean represent whether system is 24-hour system. 39761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 39861847f8eSopenharmony_ci * @since 9 39961847f8eSopenharmony_ci */ 40061847f8eSopenharmony_ci /** 40161847f8eSopenharmony_ci * Check out whether system is 24-hour system. 40261847f8eSopenharmony_ci * 40361847f8eSopenharmony_ci * @returns { boolean } a boolean represent whether system is 24-hour system. 40461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 40561847f8eSopenharmony_ci * @crossplatform 40661847f8eSopenharmony_ci * @since 10 40761847f8eSopenharmony_ci */ 40861847f8eSopenharmony_ci /** 40961847f8eSopenharmony_ci * Check out whether system is 24-hour system. 41061847f8eSopenharmony_ci * 41161847f8eSopenharmony_ci * @returns { boolean } a boolean represent whether system is 24-hour system. 41261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 41361847f8eSopenharmony_ci * @crossplatform 41461847f8eSopenharmony_ci * @form 41561847f8eSopenharmony_ci * @since 11 41661847f8eSopenharmony_ci */ 41761847f8eSopenharmony_ci /** 41861847f8eSopenharmony_ci * Check out whether system is 24-hour system. 41961847f8eSopenharmony_ci * 42061847f8eSopenharmony_ci * @returns { boolean } a boolean represent whether system is 24-hour system. 42161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 42261847f8eSopenharmony_ci * @crossplatform 42361847f8eSopenharmony_ci * @form 42461847f8eSopenharmony_ci * @atomicservice 42561847f8eSopenharmony_ci * @since 12 42661847f8eSopenharmony_ci */ 42761847f8eSopenharmony_ci static is24HourClock(): boolean; 42861847f8eSopenharmony_ci 42961847f8eSopenharmony_ci /** 43061847f8eSopenharmony_ci * Set 24-hour system. 43161847f8eSopenharmony_ci * 43261847f8eSopenharmony_ci * @permission ohos.permission.UPDATE_CONFIGURATION 43361847f8eSopenharmony_ci * @param { boolean } option - represent the boolean to be set. 43461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 43561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 43661847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 43761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 43861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 43961847f8eSopenharmony_ci * @since 9 44061847f8eSopenharmony_ci */ 44161847f8eSopenharmony_ci static set24HourClock(option: boolean): void; 44261847f8eSopenharmony_ci 44361847f8eSopenharmony_ci /** 44461847f8eSopenharmony_ci * Add one language to preferred language List. 44561847f8eSopenharmony_ci * 44661847f8eSopenharmony_ci * @permission ohos.permission.UPDATE_CONFIGURATION 44761847f8eSopenharmony_ci * @param { string } language - the language to be added. It must be a valid language. 44861847f8eSopenharmony_ci * @param { number } [index] - the position of preferred language list to be inserted. 44961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 45061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 45161847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 45261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 45361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 45461847f8eSopenharmony_ci * @since 9 45561847f8eSopenharmony_ci */ 45661847f8eSopenharmony_ci static addPreferredLanguage(language: string, index?: number): void; 45761847f8eSopenharmony_ci 45861847f8eSopenharmony_ci /** 45961847f8eSopenharmony_ci * Remove one language from preferred language list. 46061847f8eSopenharmony_ci * 46161847f8eSopenharmony_ci * @permission ohos.permission.UPDATE_CONFIGURATION 46261847f8eSopenharmony_ci * @param { number } index - the position of removed language in preferred language list. 46361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 46461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 46561847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 46661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 46761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 46861847f8eSopenharmony_ci * @since 9 46961847f8eSopenharmony_ci */ 47061847f8eSopenharmony_ci static removePreferredLanguage(index: number): void; 47161847f8eSopenharmony_ci 47261847f8eSopenharmony_ci /** 47361847f8eSopenharmony_ci * Access the system preferred language list. 47461847f8eSopenharmony_ci * 47561847f8eSopenharmony_ci * @returns { Array<string> } a string Array represent the preferred language list. 47661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 47761847f8eSopenharmony_ci * @since 9 47861847f8eSopenharmony_ci */ 47961847f8eSopenharmony_ci /** 48061847f8eSopenharmony_ci * Access the system preferred language list. 48161847f8eSopenharmony_ci * 48261847f8eSopenharmony_ci * @returns { Array<string> } a string Array represent the preferred language list. 48361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 48461847f8eSopenharmony_ci * @atomicservice 48561847f8eSopenharmony_ci * @since 12 48661847f8eSopenharmony_ci */ 48761847f8eSopenharmony_ci static getPreferredLanguageList(): Array<string>; 48861847f8eSopenharmony_ci 48961847f8eSopenharmony_ci /** 49061847f8eSopenharmony_ci * Get the first preferred language of system. 49161847f8eSopenharmony_ci * 49261847f8eSopenharmony_ci * @returns { string } a string represent the first preferred language of system. 49361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 49461847f8eSopenharmony_ci * @since 9 49561847f8eSopenharmony_ci */ 49661847f8eSopenharmony_ci /** 49761847f8eSopenharmony_ci * Get the first preferred language of system. 49861847f8eSopenharmony_ci * 49961847f8eSopenharmony_ci * @returns { string } a string represent the first preferred language of system. 50061847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 50161847f8eSopenharmony_ci * @atomicservice 50261847f8eSopenharmony_ci * @since 12 50361847f8eSopenharmony_ci */ 50461847f8eSopenharmony_ci static getFirstPreferredLanguage(): string; 50561847f8eSopenharmony_ci 50661847f8eSopenharmony_ci /** 50761847f8eSopenharmony_ci * Set the preferred language of App. 50861847f8eSopenharmony_ci * 50961847f8eSopenharmony_ci * @param { string } language - the language to be set. It must be a valid language. 51061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 51161847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 51261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 51361847f8eSopenharmony_ci * @since 11 51461847f8eSopenharmony_ci */ 51561847f8eSopenharmony_ci /** 51661847f8eSopenharmony_ci * Set the preferred language of App. 51761847f8eSopenharmony_ci * 51861847f8eSopenharmony_ci * @param { string } language - the language to be set. It must be a valid language. 51961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 52061847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 52161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 52261847f8eSopenharmony_ci * @atomicservice 52361847f8eSopenharmony_ci * @since 12 52461847f8eSopenharmony_ci */ 52561847f8eSopenharmony_ci static setAppPreferredLanguage(language: string): void; 52661847f8eSopenharmony_ci 52761847f8eSopenharmony_ci /** 52861847f8eSopenharmony_ci * Get the preferred language of App. 52961847f8eSopenharmony_ci * 53061847f8eSopenharmony_ci * @returns { string } a string represent the preferred language of App. 53161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 53261847f8eSopenharmony_ci * @since 9 53361847f8eSopenharmony_ci */ 53461847f8eSopenharmony_ci /** 53561847f8eSopenharmony_ci * Get the preferred language of App. 53661847f8eSopenharmony_ci * 53761847f8eSopenharmony_ci * @returns { string } a string represent the preferred language of App. 53861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 53961847f8eSopenharmony_ci * @atomicservice 54061847f8eSopenharmony_ci * @since 12 54161847f8eSopenharmony_ci */ 54261847f8eSopenharmony_ci static getAppPreferredLanguage(): string; 54361847f8eSopenharmony_ci 54461847f8eSopenharmony_ci /** 54561847f8eSopenharmony_ci * Set whether to use local digit. 54661847f8eSopenharmony_ci * 54761847f8eSopenharmony_ci * @permission ohos.permission.UPDATE_CONFIGURATION 54861847f8eSopenharmony_ci * @param { boolean } flag - a boolean variable represents whether to use local digit 54961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 55061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 55161847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 55261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 55361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 55461847f8eSopenharmony_ci * @since 9 55561847f8eSopenharmony_ci */ 55661847f8eSopenharmony_ci static setUsingLocalDigit(flag: boolean): void; 55761847f8eSopenharmony_ci 55861847f8eSopenharmony_ci /** 55961847f8eSopenharmony_ci * Get whether to use local digit. 56061847f8eSopenharmony_ci * 56161847f8eSopenharmony_ci * @returns { boolean } a boolean represents whether to use local digit. 56261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 56361847f8eSopenharmony_ci * @since 9 56461847f8eSopenharmony_ci */ 56561847f8eSopenharmony_ci /** 56661847f8eSopenharmony_ci * Get whether to use local digit. 56761847f8eSopenharmony_ci * 56861847f8eSopenharmony_ci * @returns { boolean } a boolean represents whether to use local digit. 56961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 57061847f8eSopenharmony_ci * @atomicservice 57161847f8eSopenharmony_ci * @since 12 57261847f8eSopenharmony_ci */ 57361847f8eSopenharmony_ci static getUsingLocalDigit(): boolean; 57461847f8eSopenharmony_ci } 57561847f8eSopenharmony_ci 57661847f8eSopenharmony_ci /** 57761847f8eSopenharmony_ci * Provides util functions. 57861847f8eSopenharmony_ci * 57961847f8eSopenharmony_ci * @interface Util 58061847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 58161847f8eSopenharmony_ci * @since 8 58261847f8eSopenharmony_ci * @deprecated since 9 58361847f8eSopenharmony_ci * @useinstead ohos.i18n/i18n.I18NUtil 58461847f8eSopenharmony_ci */ 58561847f8eSopenharmony_ci export interface Util { 58661847f8eSopenharmony_ci /** 58761847f8eSopenharmony_ci * Convert from unit to unit and format according to the locale. 58861847f8eSopenharmony_ci * 58961847f8eSopenharmony_ci * @param { UnitInfo } fromUnit - Information of the unit to be converted. 59061847f8eSopenharmony_ci * @param { UnitInfo } toUnit - Information about the unit to be converted to. 59161847f8eSopenharmony_ci * @param { number } value - Indicates the number to be formatted. 59261847f8eSopenharmony_ci * @param { string } locale - The locale to be used. 59361847f8eSopenharmony_ci * @param { string } [style] - The style of format. 59461847f8eSopenharmony_ci * @returns { string } converted number and unit. 59561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 59661847f8eSopenharmony_ci * @since 8 59761847f8eSopenharmony_ci * @deprecated since 9 59861847f8eSopenharmony_ci * @useinstead ohos.i18n/i18n.I18NUtil#unitConvert 59961847f8eSopenharmony_ci */ 60061847f8eSopenharmony_ci unitConvert(fromUnit: UnitInfo, toUnit: UnitInfo, value: number, locale: string, style?: string): string; 60161847f8eSopenharmony_ci } 60261847f8eSopenharmony_ci 60361847f8eSopenharmony_ci /** 60461847f8eSopenharmony_ci * Provides util functions. 60561847f8eSopenharmony_ci * 60661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 60761847f8eSopenharmony_ci * @since 9 60861847f8eSopenharmony_ci */ 60961847f8eSopenharmony_ci /** 61061847f8eSopenharmony_ci * Provides util functions. 61161847f8eSopenharmony_ci * 61261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 61361847f8eSopenharmony_ci * @crossplatform 61461847f8eSopenharmony_ci * @since 10 61561847f8eSopenharmony_ci */ 61661847f8eSopenharmony_ci /** 61761847f8eSopenharmony_ci * Provides util functions. 61861847f8eSopenharmony_ci * 61961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 62061847f8eSopenharmony_ci * @crossplatform 62161847f8eSopenharmony_ci * @atomicservice 62261847f8eSopenharmony_ci * @since 12 62361847f8eSopenharmony_ci */ 62461847f8eSopenharmony_ci export class I18NUtil { 62561847f8eSopenharmony_ci /** 62661847f8eSopenharmony_ci * Convert from unit to unit and format according to the locale. 62761847f8eSopenharmony_ci * 62861847f8eSopenharmony_ci * @param { UnitInfo } fromUnit - Information of the unit to be converted. 62961847f8eSopenharmony_ci * @param { UnitInfo } toUnit - Information about the unit to be converted to. 63061847f8eSopenharmony_ci * @param { number } value - Indicates the number to be formatted. 63161847f8eSopenharmony_ci * @param { string } locale - The locale to be used. 63261847f8eSopenharmony_ci * @param { string } [style] - The style of format. 63361847f8eSopenharmony_ci * @returns { string } converted number and unit. 63461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 63561847f8eSopenharmony_ci * @since 9 63661847f8eSopenharmony_ci */ 63761847f8eSopenharmony_ci /** 63861847f8eSopenharmony_ci * Convert from unit to unit and format according to the locale. 63961847f8eSopenharmony_ci * 64061847f8eSopenharmony_ci * @param { UnitInfo } fromUnit - Information of the unit to be converted. 64161847f8eSopenharmony_ci * @param { UnitInfo } toUnit - Information about the unit to be converted to. 64261847f8eSopenharmony_ci * @param { number } value - Indicates the number to be formatted. 64361847f8eSopenharmony_ci * @param { string } locale - The locale to be used. 64461847f8eSopenharmony_ci * @param { string } [style] - The style of format. 64561847f8eSopenharmony_ci * @returns { string } converted number and unit. 64661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 64761847f8eSopenharmony_ci * @atomicservice 64861847f8eSopenharmony_ci * @since 12 64961847f8eSopenharmony_ci */ 65061847f8eSopenharmony_ci static unitConvert(fromUnit: UnitInfo, toUnit: UnitInfo, value: number, locale: string, style?: string): string; 65161847f8eSopenharmony_ci 65261847f8eSopenharmony_ci /** 65361847f8eSopenharmony_ci * Get the order of year, month, day in the specified locale. Year, month, day are separated by '-'. 65461847f8eSopenharmony_ci * 'y' stands for year, 'L' stands for month, d stands for day. 65561847f8eSopenharmony_ci * 65661847f8eSopenharmony_ci * @param { string } locale - Information of the locale 65761847f8eSopenharmony_ci * @returns { string } the string of 'y', 'L', 'd' joined by '-'. 65861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 65961847f8eSopenharmony_ci * @since 9 66061847f8eSopenharmony_ci */ 66161847f8eSopenharmony_ci /** 66261847f8eSopenharmony_ci * Get the order of year, month, day in the specified locale. Year, month, day are separated by '-'. 66361847f8eSopenharmony_ci * 'y' stands for year, 'L' stands for month, d stands for day. 66461847f8eSopenharmony_ci * 66561847f8eSopenharmony_ci * @param { string } locale - Information of the locale. 66661847f8eSopenharmony_ci * @returns { string } the string of 'y', 'L', 'd' joined by '-'. 66761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 66861847f8eSopenharmony_ci * @crossplatform 66961847f8eSopenharmony_ci * @since 10 67061847f8eSopenharmony_ci */ 67161847f8eSopenharmony_ci /** 67261847f8eSopenharmony_ci * Get the order of year, month, day in the specified locale. Year, month, day are separated by '-'. 67361847f8eSopenharmony_ci * 'y' stands for year, 'L' stands for month, d stands for day. 67461847f8eSopenharmony_ci * 67561847f8eSopenharmony_ci * @param { string } locale - Information of the locale. 67661847f8eSopenharmony_ci * @returns { string } the string of 'y', 'L', 'd' joined by '-'. 67761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 67861847f8eSopenharmony_ci * @crossplatform 67961847f8eSopenharmony_ci * @atomicservice 68061847f8eSopenharmony_ci * @since 12 68161847f8eSopenharmony_ci */ 68261847f8eSopenharmony_ci static getDateOrder(locale: string): string; 68361847f8eSopenharmony_ci 68461847f8eSopenharmony_ci /** 68561847f8eSopenharmony_ci * Get the time period name for the specified hour. 68661847f8eSopenharmony_ci * 68761847f8eSopenharmony_ci * @param { number } hour - the hour value. 68861847f8eSopenharmony_ci * @param { string } [locale] - specified the locale. Use current app locale by default. It must be a valid locale. 68961847f8eSopenharmony_ci * @returns { string } the string of time period name. The return value may be empty string 69061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 69161847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 69261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 69361847f8eSopenharmony_ci * @since 11 69461847f8eSopenharmony_ci */ 69561847f8eSopenharmony_ci /** 69661847f8eSopenharmony_ci * Get the time period name for the specified hour. 69761847f8eSopenharmony_ci * 69861847f8eSopenharmony_ci * @param { number } hour - the hour value. 69961847f8eSopenharmony_ci * @param { string } [locale] - specified the locale. Use current app locale by default. It must be a valid locale. 70061847f8eSopenharmony_ci * @returns { string } the string of time period name. The return value may be empty string 70161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 70261847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 70361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 70461847f8eSopenharmony_ci * @atomicservice 70561847f8eSopenharmony_ci * @since 12 70661847f8eSopenharmony_ci */ 70761847f8eSopenharmony_ci static getTimePeriodName(hour:number, locale?: string): string; 70861847f8eSopenharmony_ci 70961847f8eSopenharmony_ci /** 71061847f8eSopenharmony_ci * Get the best matched locale in the specified list. 71161847f8eSopenharmony_ci * 71261847f8eSopenharmony_ci * @param { string } locale - the origin locale. It must be a valid locale. 71361847f8eSopenharmony_ci * @param { string[] } localeList - a list of locales to be matched. It must be a valid locale. 71461847f8eSopenharmony_ci * @returns { string } the string of the best matched locale name. 71561847f8eSopenharmony_ci * The return value may be empty string due to none is matched. 71661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 71761847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 71861847f8eSopenharmony_ci * @static 71961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 72061847f8eSopenharmony_ci * @crossplatform 72161847f8eSopenharmony_ci * @atomicservice 72261847f8eSopenharmony_ci * @since 12 72361847f8eSopenharmony_ci */ 72461847f8eSopenharmony_ci static getBestMatchLocale(locale: string, localeList: string[]): string; 72561847f8eSopenharmony_ci 72661847f8eSopenharmony_ci /** 72761847f8eSopenharmony_ci * Get a three-letter abbreviation of the specified language. 72861847f8eSopenharmony_ci * 72961847f8eSopenharmony_ci * @param { string } locale - the origin locale or language code. It must be a valid locale. 73061847f8eSopenharmony_ci * @returns { string } 3 letter language code. 73161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 73261847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 73361847f8eSopenharmony_ci * @static 73461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 73561847f8eSopenharmony_ci * @atomicservice 73661847f8eSopenharmony_ci * @since 12 73761847f8eSopenharmony_ci */ 73861847f8eSopenharmony_ci static getThreeLetterLanguage(locale: string): string; 73961847f8eSopenharmony_ci 74061847f8eSopenharmony_ci /** 74161847f8eSopenharmony_ci * Get a three-letter abbreviation of the specified region. 74261847f8eSopenharmony_ci * 74361847f8eSopenharmony_ci * @param { string } locale - the origin locale or region code. It must be a valid locale. 74461847f8eSopenharmony_ci * @returns { string } 3 letter region code. 74561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 74661847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 74761847f8eSopenharmony_ci * @static 74861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 74961847f8eSopenharmony_ci * @atomicservice 75061847f8eSopenharmony_ci * @since 12 75161847f8eSopenharmony_ci */ 75261847f8eSopenharmony_ci static getThreeLetterRegion(locale: string): string; 75361847f8eSopenharmony_ci } 75461847f8eSopenharmony_ci 75561847f8eSopenharmony_ci /** 75661847f8eSopenharmony_ci * Provides the options of unit. 75761847f8eSopenharmony_ci * 75861847f8eSopenharmony_ci * @interface UnitInfo 75961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 76061847f8eSopenharmony_ci * @since 8 76161847f8eSopenharmony_ci */ 76261847f8eSopenharmony_ci /** 76361847f8eSopenharmony_ci * Provides the options of unit. 76461847f8eSopenharmony_ci * 76561847f8eSopenharmony_ci * @interface UnitInfo 76661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 76761847f8eSopenharmony_ci * @atomicservice 76861847f8eSopenharmony_ci * @since 12 76961847f8eSopenharmony_ci */ 77061847f8eSopenharmony_ci export interface UnitInfo { 77161847f8eSopenharmony_ci /** 77261847f8eSopenharmony_ci * Unit name. 77361847f8eSopenharmony_ci * 77461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 77561847f8eSopenharmony_ci * @since 8 77661847f8eSopenharmony_ci */ 77761847f8eSopenharmony_ci /** 77861847f8eSopenharmony_ci * Unit name. 77961847f8eSopenharmony_ci * 78061847f8eSopenharmony_ci * @type { string } 78161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 78261847f8eSopenharmony_ci * @atomicservice 78361847f8eSopenharmony_ci * @since 12 78461847f8eSopenharmony_ci */ 78561847f8eSopenharmony_ci unit: string; 78661847f8eSopenharmony_ci 78761847f8eSopenharmony_ci /** 78861847f8eSopenharmony_ci * The measurement system of the unit. 78961847f8eSopenharmony_ci * 79061847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 79161847f8eSopenharmony_ci * @since 8 79261847f8eSopenharmony_ci */ 79361847f8eSopenharmony_ci /** 79461847f8eSopenharmony_ci * The measurement system of the unit. 79561847f8eSopenharmony_ci * 79661847f8eSopenharmony_ci * @type { string } 79761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 79861847f8eSopenharmony_ci * @atomicservice 79961847f8eSopenharmony_ci * @since 12 80061847f8eSopenharmony_ci */ 80161847f8eSopenharmony_ci measureSystem: string; 80261847f8eSopenharmony_ci } 80361847f8eSopenharmony_ci 80461847f8eSopenharmony_ci /** 80561847f8eSopenharmony_ci * Provides the options of PhoneNumberFormat. 80661847f8eSopenharmony_ci * 80761847f8eSopenharmony_ci * @interface PhoneNumberFormatOptions 80861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 80961847f8eSopenharmony_ci * @since 8 81061847f8eSopenharmony_ci */ 81161847f8eSopenharmony_ci /** 81261847f8eSopenharmony_ci * Provides the options of PhoneNumberFormat. 81361847f8eSopenharmony_ci * 81461847f8eSopenharmony_ci * @interface PhoneNumberFormatOptions 81561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 81661847f8eSopenharmony_ci * @crossplatform 81761847f8eSopenharmony_ci * @since 11 81861847f8eSopenharmony_ci */ 81961847f8eSopenharmony_ci /** 82061847f8eSopenharmony_ci * Provides the options of PhoneNumberFormat. 82161847f8eSopenharmony_ci * 82261847f8eSopenharmony_ci * @interface PhoneNumberFormatOptions 82361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 82461847f8eSopenharmony_ci * @crossplatform 82561847f8eSopenharmony_ci * @atomicservice 82661847f8eSopenharmony_ci * @since 12 82761847f8eSopenharmony_ci */ 82861847f8eSopenharmony_ci export interface PhoneNumberFormatOptions { 82961847f8eSopenharmony_ci /** 83061847f8eSopenharmony_ci * Indicates the type to format phone number. 83161847f8eSopenharmony_ci * 83261847f8eSopenharmony_ci * @type { string } 83361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 83461847f8eSopenharmony_ci * @since 8 83561847f8eSopenharmony_ci */ 83661847f8eSopenharmony_ci /** 83761847f8eSopenharmony_ci * Indicates the type to format phone number. 83861847f8eSopenharmony_ci * 83961847f8eSopenharmony_ci * @type { ?string } 84061847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 84161847f8eSopenharmony_ci * @since 9 84261847f8eSopenharmony_ci */ 84361847f8eSopenharmony_ci /** 84461847f8eSopenharmony_ci * Indicates the type to format phone number. 84561847f8eSopenharmony_ci * 84661847f8eSopenharmony_ci * @type { ?string } 84761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 84861847f8eSopenharmony_ci * @crossplatform 84961847f8eSopenharmony_ci * @since 11 85061847f8eSopenharmony_ci */ 85161847f8eSopenharmony_ci /** 85261847f8eSopenharmony_ci * Indicates the type to format phone number. 85361847f8eSopenharmony_ci * 85461847f8eSopenharmony_ci * @type { ?string } 85561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 85661847f8eSopenharmony_ci * @crossplatform 85761847f8eSopenharmony_ci * @atomicservice 85861847f8eSopenharmony_ci * @since 12 85961847f8eSopenharmony_ci */ 86061847f8eSopenharmony_ci type?: string; 86161847f8eSopenharmony_ci } 86261847f8eSopenharmony_ci 86361847f8eSopenharmony_ci /** 86461847f8eSopenharmony_ci * Provides the API for formatting phone number strings 86561847f8eSopenharmony_ci * 86661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 86761847f8eSopenharmony_ci * @since 8 86861847f8eSopenharmony_ci */ 86961847f8eSopenharmony_ci /** 87061847f8eSopenharmony_ci * Provides the API for formatting phone number strings 87161847f8eSopenharmony_ci * 87261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 87361847f8eSopenharmony_ci * @crossplatform 87461847f8eSopenharmony_ci * @since 11 87561847f8eSopenharmony_ci */ 87661847f8eSopenharmony_ci /** 87761847f8eSopenharmony_ci * Provides the API for formatting phone number strings 87861847f8eSopenharmony_ci * 87961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 88061847f8eSopenharmony_ci * @crossplatform 88161847f8eSopenharmony_ci * @atomicservice 88261847f8eSopenharmony_ci * @since 12 88361847f8eSopenharmony_ci */ 88461847f8eSopenharmony_ci export class PhoneNumberFormat { 88561847f8eSopenharmony_ci /** 88661847f8eSopenharmony_ci * A constructor used to create a PhoneNumberFormat object. 88761847f8eSopenharmony_ci * 88861847f8eSopenharmony_ci * @param { string } country - Indicates a character string containing the country information for the PhoneNumberFormat object. 88961847f8eSopenharmony_ci * @param { PhoneNumberFormatOptions } [options] - format types: "E164", "RFC3966", "INTERNATIONAL", "NATIONAL". 89061847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 89161847f8eSopenharmony_ci * @since 8 89261847f8eSopenharmony_ci */ 89361847f8eSopenharmony_ci /** 89461847f8eSopenharmony_ci * A constructor used to create a PhoneNumberFormat object. 89561847f8eSopenharmony_ci * 89661847f8eSopenharmony_ci * @param { string } country - Indicates a character string containing the country information for the PhoneNumberFormat object. 89761847f8eSopenharmony_ci * @param { PhoneNumberFormatOptions } [options] - format types: "E164", "RFC3966", "INTERNATIONAL", "NATIONAL". 89861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 89961847f8eSopenharmony_ci * @crossplatform 90061847f8eSopenharmony_ci * @since 11 90161847f8eSopenharmony_ci */ 90261847f8eSopenharmony_ci /** 90361847f8eSopenharmony_ci * A constructor used to create a PhoneNumberFormat object. 90461847f8eSopenharmony_ci * 90561847f8eSopenharmony_ci * @param { string } country - Indicates a character string containing the country information for the PhoneNumberFormat object. 90661847f8eSopenharmony_ci * @param { PhoneNumberFormatOptions } [options] - format types: "E164", "RFC3966", "INTERNATIONAL", "NATIONAL". 90761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 90861847f8eSopenharmony_ci * @crossplatform 90961847f8eSopenharmony_ci * @atomicservice 91061847f8eSopenharmony_ci * @since 12 91161847f8eSopenharmony_ci */ 91261847f8eSopenharmony_ci constructor(country: string, options?: PhoneNumberFormatOptions); 91361847f8eSopenharmony_ci 91461847f8eSopenharmony_ci /** 91561847f8eSopenharmony_ci * Judge whether phone number is valid. 91661847f8eSopenharmony_ci * 91761847f8eSopenharmony_ci * @param { string } number - Indicates the input phone number. 91861847f8eSopenharmony_ci * @returns { boolean } a boolean indicates whether the input phone number is valid. 91961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 92061847f8eSopenharmony_ci * @since 8 92161847f8eSopenharmony_ci */ 92261847f8eSopenharmony_ci /** 92361847f8eSopenharmony_ci * Judge whether phone number is valid. 92461847f8eSopenharmony_ci * 92561847f8eSopenharmony_ci * @param { string } number - Indicates the input phone number. 92661847f8eSopenharmony_ci * @returns { boolean } a boolean indicates whether the input phone number is valid. 92761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 92861847f8eSopenharmony_ci * @crossplatform 92961847f8eSopenharmony_ci * @since 11 93061847f8eSopenharmony_ci */ 93161847f8eSopenharmony_ci /** 93261847f8eSopenharmony_ci * Judge whether phone number is valid. 93361847f8eSopenharmony_ci * 93461847f8eSopenharmony_ci * @param { string } number - Indicates the input phone number. 93561847f8eSopenharmony_ci * @returns { boolean } a boolean indicates whether the input phone number is valid. 93661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 93761847f8eSopenharmony_ci * @crossplatform 93861847f8eSopenharmony_ci * @atomicservice 93961847f8eSopenharmony_ci * @since 12 94061847f8eSopenharmony_ci */ 94161847f8eSopenharmony_ci isValidNumber(number: string): boolean; 94261847f8eSopenharmony_ci 94361847f8eSopenharmony_ci /** 94461847f8eSopenharmony_ci * Obtains the formatted phone number strings of number. 94561847f8eSopenharmony_ci * 94661847f8eSopenharmony_ci * @param { string } number - Indicates the input phone number to be formatted. 94761847f8eSopenharmony_ci * @returns { string } the formatted phone number. 94861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 94961847f8eSopenharmony_ci * @since 8 95061847f8eSopenharmony_ci */ 95161847f8eSopenharmony_ci /** 95261847f8eSopenharmony_ci * Obtains the formatted phone number strings of number. 95361847f8eSopenharmony_ci * 95461847f8eSopenharmony_ci * @param { string } number - Indicates the input phone number to be formatted. 95561847f8eSopenharmony_ci * @returns { string } the formatted phone number. 95661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 95761847f8eSopenharmony_ci * @crossplatform 95861847f8eSopenharmony_ci * @since 11 95961847f8eSopenharmony_ci */ 96061847f8eSopenharmony_ci /** 96161847f8eSopenharmony_ci * Obtains the formatted phone number strings of number. 96261847f8eSopenharmony_ci * 96361847f8eSopenharmony_ci * @param { string } number - Indicates the input phone number to be formatted. 96461847f8eSopenharmony_ci * @returns { string } the formatted phone number. 96561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 96661847f8eSopenharmony_ci * @crossplatform 96761847f8eSopenharmony_ci * @atomicservice 96861847f8eSopenharmony_ci * @since 12 96961847f8eSopenharmony_ci */ 97061847f8eSopenharmony_ci format(number: string): string; 97161847f8eSopenharmony_ci 97261847f8eSopenharmony_ci /** 97361847f8eSopenharmony_ci * Determine the location by phone number, and return it according to the specified regional language. 97461847f8eSopenharmony_ci * 97561847f8eSopenharmony_ci * @param { string } number - input phone number. 97661847f8eSopenharmony_ci * @param { string } locale - locale ID. 97761847f8eSopenharmony_ci * @returns { string } a string represents phone number's location. 97861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 97961847f8eSopenharmony_ci * @since 9 98061847f8eSopenharmony_ci */ 98161847f8eSopenharmony_ci /** 98261847f8eSopenharmony_ci * Determine the location by phone number, and return it according to the specified regional language. 98361847f8eSopenharmony_ci * 98461847f8eSopenharmony_ci * @param { string } number - input phone number. 98561847f8eSopenharmony_ci * @param { string } locale - locale ID. 98661847f8eSopenharmony_ci * @returns { string } a string represents phone number's location. 98761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 98861847f8eSopenharmony_ci * @atomicservice 98961847f8eSopenharmony_ci * @since 12 99061847f8eSopenharmony_ci */ 99161847f8eSopenharmony_ci getLocationName(number: string, locale: string): string; 99261847f8eSopenharmony_ci } 99361847f8eSopenharmony_ci 99461847f8eSopenharmony_ci /** 99561847f8eSopenharmony_ci * Get a Calendar instance specified by locale and type. 99661847f8eSopenharmony_ci * 99761847f8eSopenharmony_ci * @param { string } locale - The locale used to get calendar. 99861847f8eSopenharmony_ci * @param { string } [type] - If type is not specified, get locale's default Calendar, else get the specified type of Calendar. 99961847f8eSopenharmony_ci * such as buddhist, chinese, coptic, ethiopic, hebrew, gregory, indian, islamic_civil, islamic_tbla, islamic_umalqura, 100061847f8eSopenharmony_ci * japanese, persian. 100161847f8eSopenharmony_ci * @returns { Calendar } Calendar object 100261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 100361847f8eSopenharmony_ci * @since 8 100461847f8eSopenharmony_ci */ 100561847f8eSopenharmony_ci /** 100661847f8eSopenharmony_ci * Get a Calendar instance specified by locale and type. 100761847f8eSopenharmony_ci * 100861847f8eSopenharmony_ci * @param { string } locale - The locale used to get calendar. 100961847f8eSopenharmony_ci * @param { string } [type] - If type is not specified, get locale's default Calendar, else get the specified type of Calendar. 101061847f8eSopenharmony_ci * such as buddhist, chinese, coptic, ethiopic, hebrew, gregory, indian, islamic_civil, islamic_tbla, islamic_umalqura, 101161847f8eSopenharmony_ci * japanese, persian. 101261847f8eSopenharmony_ci * @returns { Calendar } Calendar object 101361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 101461847f8eSopenharmony_ci * @crossplatform 101561847f8eSopenharmony_ci * @since 10 101661847f8eSopenharmony_ci */ 101761847f8eSopenharmony_ci /** 101861847f8eSopenharmony_ci * Get a Calendar instance specified by locale and type. 101961847f8eSopenharmony_ci * 102061847f8eSopenharmony_ci * @param { string } locale - The locale used to get calendar. 102161847f8eSopenharmony_ci * @param { string } [type] - If type is not specified, get locale's default Calendar, else get the specified type of Calendar. 102261847f8eSopenharmony_ci * such as buddhist, chinese, coptic, ethiopic, hebrew, gregory, indian, islamic_civil, islamic_tbla, islamic_umalqura, 102361847f8eSopenharmony_ci * japanese, persian. 102461847f8eSopenharmony_ci * @returns { Calendar } Calendar object 102561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 102661847f8eSopenharmony_ci * @crossplatform 102761847f8eSopenharmony_ci * @atomicservice 102861847f8eSopenharmony_ci * @since 12 102961847f8eSopenharmony_ci */ 103061847f8eSopenharmony_ci export function getCalendar(locale: string, type?: string): Calendar; 103161847f8eSopenharmony_ci 103261847f8eSopenharmony_ci /** 103361847f8eSopenharmony_ci * Provides the API for accessing Calendar name, time and date related information. 103461847f8eSopenharmony_ci * 103561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 103661847f8eSopenharmony_ci * @since 7 103761847f8eSopenharmony_ci */ 103861847f8eSopenharmony_ci /** 103961847f8eSopenharmony_ci * Provides the API for accessing Calendar name, time and date related information. 104061847f8eSopenharmony_ci * 104161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 104261847f8eSopenharmony_ci * @crossplatform 104361847f8eSopenharmony_ci * @since 10 104461847f8eSopenharmony_ci */ 104561847f8eSopenharmony_ci /** 104661847f8eSopenharmony_ci * Provides the API for accessing Calendar name, time and date related information. 104761847f8eSopenharmony_ci * 104861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 104961847f8eSopenharmony_ci * @crossplatform 105061847f8eSopenharmony_ci * @atomicservice 105161847f8eSopenharmony_ci * @since 12 105261847f8eSopenharmony_ci */ 105361847f8eSopenharmony_ci export class Calendar { 105461847f8eSopenharmony_ci /** 105561847f8eSopenharmony_ci * set the date. 105661847f8eSopenharmony_ci * 105761847f8eSopenharmony_ci * @param { Date } date - Date object used to set the time and date. 105861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 105961847f8eSopenharmony_ci * @since 8 106061847f8eSopenharmony_ci */ 106161847f8eSopenharmony_ci /** 106261847f8eSopenharmony_ci * set the date. 106361847f8eSopenharmony_ci * 106461847f8eSopenharmony_ci * @param { Date } date - Date object used to set the time and date. 106561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 106661847f8eSopenharmony_ci * @crossplatform 106761847f8eSopenharmony_ci * @since 10 106861847f8eSopenharmony_ci */ 106961847f8eSopenharmony_ci /** 107061847f8eSopenharmony_ci * set the date. 107161847f8eSopenharmony_ci * 107261847f8eSopenharmony_ci * @param { Date } date - Date object used to set the time and date. 107361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 107461847f8eSopenharmony_ci * @crossplatform 107561847f8eSopenharmony_ci * @atomicservice 107661847f8eSopenharmony_ci * @since 12 107761847f8eSopenharmony_ci */ 107861847f8eSopenharmony_ci setTime(date: Date): void; 107961847f8eSopenharmony_ci 108061847f8eSopenharmony_ci /** 108161847f8eSopenharmony_ci * set the time. 108261847f8eSopenharmony_ci * 108361847f8eSopenharmony_ci * @param { number } time - Indicates the elapsed milliseconds from 1970.1.1 00:00:00 GMT. 108461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 108561847f8eSopenharmony_ci * @since 8 108661847f8eSopenharmony_ci */ 108761847f8eSopenharmony_ci /** 108861847f8eSopenharmony_ci * set the time. 108961847f8eSopenharmony_ci * 109061847f8eSopenharmony_ci * @param { number } time - Indicates the elapsed milliseconds from 1970.1.1 00:00:00 GMT. 109161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 109261847f8eSopenharmony_ci * @crossplatform 109361847f8eSopenharmony_ci * @since 10 109461847f8eSopenharmony_ci */ 109561847f8eSopenharmony_ci /** 109661847f8eSopenharmony_ci * set the time. 109761847f8eSopenharmony_ci * 109861847f8eSopenharmony_ci * @param { number } time - Indicates the elapsed milliseconds from 1970.1.1 00:00:00 GMT. 109961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 110061847f8eSopenharmony_ci * @crossplatform 110161847f8eSopenharmony_ci * @atomicservice 110261847f8eSopenharmony_ci * @since 12 110361847f8eSopenharmony_ci */ 110461847f8eSopenharmony_ci setTime(time: number): void; 110561847f8eSopenharmony_ci 110661847f8eSopenharmony_ci /** 110761847f8eSopenharmony_ci * Set the time 110861847f8eSopenharmony_ci * 110961847f8eSopenharmony_ci * @param { number } year - The year field of the calendar, ranges from 0 to 9999. 111061847f8eSopenharmony_ci * @param { number } month - The month field of the calendar, ranges from 0 to 11. 111161847f8eSopenharmony_ci * @param { number } date - The day field of the calendar, ranges from 1 to 31. 111261847f8eSopenharmony_ci * @param { number } hour - The hour field of the calendar, ranges from 0 to 23. 111361847f8eSopenharmony_ci * @param { number } minute - The minute field of the calendar, ranges from 0 to 59. 111461847f8eSopenharmony_ci * @param { number } second - the second field of the calendar, ranges from 0 to 59. 111561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 111661847f8eSopenharmony_ci * @since 8 111761847f8eSopenharmony_ci */ 111861847f8eSopenharmony_ci /** 111961847f8eSopenharmony_ci * Set the time 112061847f8eSopenharmony_ci * 112161847f8eSopenharmony_ci * @param { number } year - The year field of the calendar, ranges from 0 to 9999. 112261847f8eSopenharmony_ci * @param { number } month - The month field of the calendar, ranges from 0 to 11. 112361847f8eSopenharmony_ci * @param { number } date - The day field of the calendar, ranges from 1 to 31. 112461847f8eSopenharmony_ci * @param { number } hour - The hour field of the calendar, ranges from 0 to 23. 112561847f8eSopenharmony_ci * @param { number } minute - The minute field of the calendar, ranges from 0 to 59. 112661847f8eSopenharmony_ci * @param { number } second - the second field of the calendar, ranges from 0 to 59. 112761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 112861847f8eSopenharmony_ci * @crossplatform 112961847f8eSopenharmony_ci * @since 10 113061847f8eSopenharmony_ci */ 113161847f8eSopenharmony_ci /** 113261847f8eSopenharmony_ci * Set the time 113361847f8eSopenharmony_ci * 113461847f8eSopenharmony_ci * @param { number } year - The year field of the calendar, ranges from 0 to 9999. 113561847f8eSopenharmony_ci * @param { number } month - The month field of the calendar, ranges from 0 to 11. 113661847f8eSopenharmony_ci * @param { number } date - The day field of the calendar, ranges from 1 to 31. 113761847f8eSopenharmony_ci * @param { number } hour - The hour field of the calendar, ranges from 0 to 23. 113861847f8eSopenharmony_ci * @param { number } minute - The minute field of the calendar, ranges from 0 to 59. 113961847f8eSopenharmony_ci * @param { number } second - the second field of the calendar, ranges from 0 to 59. 114061847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 114161847f8eSopenharmony_ci * @crossplatform 114261847f8eSopenharmony_ci * @atomicservice 114361847f8eSopenharmony_ci * @since 12 114461847f8eSopenharmony_ci */ 114561847f8eSopenharmony_ci set(year: number, month: number, date: number, hour?: number, minute?: number, second?: number): void; 114661847f8eSopenharmony_ci 114761847f8eSopenharmony_ci /** 114861847f8eSopenharmony_ci * Set the timezone of this calendar. 114961847f8eSopenharmony_ci * 115061847f8eSopenharmony_ci * @param { string } timezone - The id of a timezone. 115161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 115261847f8eSopenharmony_ci * @since 8 115361847f8eSopenharmony_ci */ 115461847f8eSopenharmony_ci /** 115561847f8eSopenharmony_ci * Set the timezone of this calendar. 115661847f8eSopenharmony_ci * 115761847f8eSopenharmony_ci * @param { string } timezone - The id of a timezone. 115861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 115961847f8eSopenharmony_ci * @crossplatform 116061847f8eSopenharmony_ci * @since 10 116161847f8eSopenharmony_ci */ 116261847f8eSopenharmony_ci /** 116361847f8eSopenharmony_ci * Set the timezone of this calendar. 116461847f8eSopenharmony_ci * 116561847f8eSopenharmony_ci * @param { string } timezone - The id of a timezone. 116661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 116761847f8eSopenharmony_ci * @crossplatform 116861847f8eSopenharmony_ci * @atomicservice 116961847f8eSopenharmony_ci * @since 12 117061847f8eSopenharmony_ci */ 117161847f8eSopenharmony_ci setTimeZone(timezone: string): void; 117261847f8eSopenharmony_ci 117361847f8eSopenharmony_ci /** 117461847f8eSopenharmony_ci * Get the timezone id of this calendar instance. 117561847f8eSopenharmony_ci * 117661847f8eSopenharmony_ci * @returns { string } the timezone id of this calendar. 117761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 117861847f8eSopenharmony_ci * @since 8 117961847f8eSopenharmony_ci */ 118061847f8eSopenharmony_ci /** 118161847f8eSopenharmony_ci * Get the timezone id of this calendar instance. 118261847f8eSopenharmony_ci * 118361847f8eSopenharmony_ci * @returns { string } the timezone id of this calendar. 118461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 118561847f8eSopenharmony_ci * @crossplatform 118661847f8eSopenharmony_ci * @since 10 118761847f8eSopenharmony_ci */ 118861847f8eSopenharmony_ci /** 118961847f8eSopenharmony_ci * Get the timezone id of this calendar instance. 119061847f8eSopenharmony_ci * 119161847f8eSopenharmony_ci * @returns { string } the timezone id of this calendar. 119261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 119361847f8eSopenharmony_ci * @crossplatform 119461847f8eSopenharmony_ci * @atomicservice 119561847f8eSopenharmony_ci * @since 12 119661847f8eSopenharmony_ci */ 119761847f8eSopenharmony_ci getTimeZone(): string; 119861847f8eSopenharmony_ci 119961847f8eSopenharmony_ci /** 120061847f8eSopenharmony_ci * Get the start day of a week. 1 indicates Sunday, 7 indicates Saturday. 120161847f8eSopenharmony_ci * 120261847f8eSopenharmony_ci * @returns { number } start day of a week. 120361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 120461847f8eSopenharmony_ci * @since 8 120561847f8eSopenharmony_ci */ 120661847f8eSopenharmony_ci /** 120761847f8eSopenharmony_ci * Get the start day of a week. 1 indicates Sunday, 7 indicates Saturday. 120861847f8eSopenharmony_ci * 120961847f8eSopenharmony_ci * @returns { number } start day of a week. 121061847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 121161847f8eSopenharmony_ci * @crossplatform 121261847f8eSopenharmony_ci * @since 10 121361847f8eSopenharmony_ci */ 121461847f8eSopenharmony_ci /** 121561847f8eSopenharmony_ci * Get the start day of a week. 1 indicates Sunday, 7 indicates Saturday. 121661847f8eSopenharmony_ci * 121761847f8eSopenharmony_ci * @returns { number } start day of a week. 121861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 121961847f8eSopenharmony_ci * @crossplatform 122061847f8eSopenharmony_ci * @atomicservice 122161847f8eSopenharmony_ci * @since 12 122261847f8eSopenharmony_ci */ 122361847f8eSopenharmony_ci getFirstDayOfWeek(): number; 122461847f8eSopenharmony_ci 122561847f8eSopenharmony_ci /** 122661847f8eSopenharmony_ci * Set the start day of a week. 1 indicates Sunday, 7 indicates Saturday. 122761847f8eSopenharmony_ci * 122861847f8eSopenharmony_ci * @param { number } value - Indicates the start day of a week. 1 indicates Sunday, 7 indicates Saturday. 122961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 123061847f8eSopenharmony_ci * @since 8 123161847f8eSopenharmony_ci */ 123261847f8eSopenharmony_ci /** 123361847f8eSopenharmony_ci * Set the start day of a week. 1 indicates Sunday, 7 indicates Saturday. 123461847f8eSopenharmony_ci * 123561847f8eSopenharmony_ci * @param { number } value - Indicates the start day of a week. 1 indicates Sunday, 7 indicates Saturday. 123661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 123761847f8eSopenharmony_ci * @crossplatform 123861847f8eSopenharmony_ci * @since 10 123961847f8eSopenharmony_ci */ 124061847f8eSopenharmony_ci /** 124161847f8eSopenharmony_ci * Set the start day of a week. 1 indicates Sunday, 7 indicates Saturday. 124261847f8eSopenharmony_ci * 124361847f8eSopenharmony_ci * @param { number } value - Indicates the start day of a week. 1 indicates Sunday, 7 indicates Saturday. 124461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 124561847f8eSopenharmony_ci * @crossplatform 124661847f8eSopenharmony_ci * @atomicservice 124761847f8eSopenharmony_ci * @since 12 124861847f8eSopenharmony_ci */ 124961847f8eSopenharmony_ci setFirstDayOfWeek(value: number): void; 125061847f8eSopenharmony_ci 125161847f8eSopenharmony_ci /** 125261847f8eSopenharmony_ci * Get the minimal days of a week, which is needed for the first day of a year. 125361847f8eSopenharmony_ci * 125461847f8eSopenharmony_ci * @returns { number } the minimal days of a week. 125561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 125661847f8eSopenharmony_ci * @since 8 125761847f8eSopenharmony_ci */ 125861847f8eSopenharmony_ci /** 125961847f8eSopenharmony_ci * Get the minimal days of a week, which is needed for the first day of a year. 126061847f8eSopenharmony_ci * 126161847f8eSopenharmony_ci * @returns { number } the minimal days of a week. 126261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 126361847f8eSopenharmony_ci * @crossplatform 126461847f8eSopenharmony_ci * @since 10 126561847f8eSopenharmony_ci */ 126661847f8eSopenharmony_ci /** 126761847f8eSopenharmony_ci * Get the minimal days of a week, which is needed for the first day of a year. 126861847f8eSopenharmony_ci * 126961847f8eSopenharmony_ci * @returns { number } the minimal days of a week. 127061847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 127161847f8eSopenharmony_ci * @crossplatform 127261847f8eSopenharmony_ci * @atomicservice 127361847f8eSopenharmony_ci * @since 12 127461847f8eSopenharmony_ci */ 127561847f8eSopenharmony_ci getMinimalDaysInFirstWeek(): number; 127661847f8eSopenharmony_ci 127761847f8eSopenharmony_ci /** 127861847f8eSopenharmony_ci * Set the minimal days of a week, which is needed for the first week of a year. 127961847f8eSopenharmony_ci * 128061847f8eSopenharmony_ci * @param { number } value - The value to be set. 128161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 128261847f8eSopenharmony_ci * @since 8 128361847f8eSopenharmony_ci */ 128461847f8eSopenharmony_ci /** 128561847f8eSopenharmony_ci * Set the minimal days of a week, which is needed for the first week of a year. 128661847f8eSopenharmony_ci * 128761847f8eSopenharmony_ci * @param { number } value - The value to be set. 128861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 128961847f8eSopenharmony_ci * @crossplatform 129061847f8eSopenharmony_ci * @since 10 129161847f8eSopenharmony_ci */ 129261847f8eSopenharmony_ci /** 129361847f8eSopenharmony_ci * Set the minimal days of a week, which is needed for the first week of a year. 129461847f8eSopenharmony_ci * 129561847f8eSopenharmony_ci * @param { number } value - The value to be set. 129661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 129761847f8eSopenharmony_ci * @crossplatform 129861847f8eSopenharmony_ci * @atomicservice 129961847f8eSopenharmony_ci * @since 12 130061847f8eSopenharmony_ci */ 130161847f8eSopenharmony_ci setMinimalDaysInFirstWeek(value: number): void; 130261847f8eSopenharmony_ci 130361847f8eSopenharmony_ci /** 130461847f8eSopenharmony_ci * Get the associated value with the field. 130561847f8eSopenharmony_ci * 130661847f8eSopenharmony_ci * @param { string } field - Field values such as era, year, month, week_of_year, week_of_month, date, day_of_year, day_of_week 130761847f8eSopenharmony_ci * day_of_week_in_month, hour, hour_of_day, minute, second, millisecond, zone_offset, dst_offset, year_woy, 130861847f8eSopenharmony_ci * dow_local, extended_year, julian_day, milliseconds_in_day, is_leap_month. 130961847f8eSopenharmony_ci * @returns { number } the associated value. 131061847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 131161847f8eSopenharmony_ci * @since 8 131261847f8eSopenharmony_ci */ 131361847f8eSopenharmony_ci /** 131461847f8eSopenharmony_ci * Get the associated value with the field. 131561847f8eSopenharmony_ci * 131661847f8eSopenharmony_ci * @param { string } field - Field values such as era, year, month, week_of_year, week_of_month, date, day_of_year, day_of_week 131761847f8eSopenharmony_ci * day_of_week_in_month, hour, hour_of_day, minute, second, millisecond, zone_offset, dst_offset, year_woy, 131861847f8eSopenharmony_ci * dow_local, extended_year, julian_day, milliseconds_in_day, is_leap_month. 131961847f8eSopenharmony_ci * @returns { number } the associated value. 132061847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 132161847f8eSopenharmony_ci * @crossplatform 132261847f8eSopenharmony_ci * @since 10 132361847f8eSopenharmony_ci */ 132461847f8eSopenharmony_ci /** 132561847f8eSopenharmony_ci * Get the associated value with the field. 132661847f8eSopenharmony_ci * 132761847f8eSopenharmony_ci * @param { string } field - Field values such as era, year, month, week_of_year, week_of_month, date, day_of_year, day_of_week 132861847f8eSopenharmony_ci * day_of_week_in_month, hour, hour_of_day, minute, second, millisecond, zone_offset, dst_offset, year_woy, 132961847f8eSopenharmony_ci * dow_local, extended_year, julian_day, milliseconds_in_day, is_leap_month. 133061847f8eSopenharmony_ci * @returns { number } the associated value. 133161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 133261847f8eSopenharmony_ci * @crossplatform 133361847f8eSopenharmony_ci * @atomicservice 133461847f8eSopenharmony_ci * @since 12 133561847f8eSopenharmony_ci */ 133661847f8eSopenharmony_ci get(field: string): number; 133761847f8eSopenharmony_ci 133861847f8eSopenharmony_ci /** 133961847f8eSopenharmony_ci * Get calendar's name localized for display in the given locale. 134061847f8eSopenharmony_ci * 134161847f8eSopenharmony_ci * @param { string } locale - Locale used to get the localized name for this calendar. It must be a valid locale. 134261847f8eSopenharmony_ci * @returns { string } the localized name of this calendar. 134361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 134461847f8eSopenharmony_ci * @since 8 134561847f8eSopenharmony_ci */ 134661847f8eSopenharmony_ci /** 134761847f8eSopenharmony_ci * Get calendar's name localized for display in the given locale. 134861847f8eSopenharmony_ci * 134961847f8eSopenharmony_ci * @param { string } locale - Locale used to get the localized name for this calendar. It must be a valid locale. 135061847f8eSopenharmony_ci * @returns { string } the localized name of this calendar. 135161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 135261847f8eSopenharmony_ci * @atomicservice 135361847f8eSopenharmony_ci * @since 12 135461847f8eSopenharmony_ci */ 135561847f8eSopenharmony_ci getDisplayName(locale: string): string; 135661847f8eSopenharmony_ci 135761847f8eSopenharmony_ci /** 135861847f8eSopenharmony_ci * Returns true if the given date is a weekend day. If the date is not given, 135961847f8eSopenharmony_ci * the date object of this calendar is used. 136061847f8eSopenharmony_ci * 136161847f8eSopenharmony_ci * @param { Date } [date] - Date object whose attribute is desired. 136261847f8eSopenharmony_ci * @returns { boolean } whether the date is a weekend day. 136361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 136461847f8eSopenharmony_ci * @since 8 136561847f8eSopenharmony_ci */ 136661847f8eSopenharmony_ci /** 136761847f8eSopenharmony_ci * Returns true if the given date is a weekend day. If the date is not given, 136861847f8eSopenharmony_ci * the date object of this calendar is used. 136961847f8eSopenharmony_ci * 137061847f8eSopenharmony_ci * @param { Date } [date] - Date object whose attribute is desired. 137161847f8eSopenharmony_ci * @returns { boolean } whether the date is a weekend day. 137261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 137361847f8eSopenharmony_ci * @crossplatform 137461847f8eSopenharmony_ci * @since 10 137561847f8eSopenharmony_ci */ 137661847f8eSopenharmony_ci /** 137761847f8eSopenharmony_ci * Returns true if the given date is a weekend day. If the date is not given, 137861847f8eSopenharmony_ci * the date object of this calendar is used. 137961847f8eSopenharmony_ci * 138061847f8eSopenharmony_ci * @param { Date } [date] - Date object whose attribute is desired. 138161847f8eSopenharmony_ci * @returns { boolean } whether the date is a weekend day. 138261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 138361847f8eSopenharmony_ci * @crossplatform 138461847f8eSopenharmony_ci * @atomicservice 138561847f8eSopenharmony_ci * @since 12 138661847f8eSopenharmony_ci */ 138761847f8eSopenharmony_ci isWeekend(date?: Date): boolean; 138861847f8eSopenharmony_ci 138961847f8eSopenharmony_ci /** 139061847f8eSopenharmony_ci * Adds or subtract the specified amount of time to the given calendar field. 139161847f8eSopenharmony_ci * 139261847f8eSopenharmony_ci * @param { string } field - field values such as year, month, week_of_year, week_of_month, date, day_of_year, day_of_week 139361847f8eSopenharmony_ci * day_of_week_in_month, hour, hour_of_day, minute, second, millisecond 139461847f8eSopenharmony_ci * @param { number } amount - the amount of date or time to be added to the field. 139561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 139661847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 139761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 139861847f8eSopenharmony_ci * @crossplatform 139961847f8eSopenharmony_ci * @since 11 140061847f8eSopenharmony_ci */ 140161847f8eSopenharmony_ci /** 140261847f8eSopenharmony_ci * Adds or subtract the specified amount of time to the given calendar field. 140361847f8eSopenharmony_ci * 140461847f8eSopenharmony_ci * @param { string } field - field values such as year, month, week_of_year, week_of_month, date, day_of_year, day_of_week 140561847f8eSopenharmony_ci * day_of_week_in_month, hour, hour_of_day, minute, second, millisecond 140661847f8eSopenharmony_ci * @param { number } amount - the amount of date or time to be added to the field. 140761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 140861847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 140961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 141061847f8eSopenharmony_ci * @crossplatform 141161847f8eSopenharmony_ci * @atomicservice 141261847f8eSopenharmony_ci * @since 12 141361847f8eSopenharmony_ci */ 141461847f8eSopenharmony_ci add(field: string, amount: number): void; 141561847f8eSopenharmony_ci 141661847f8eSopenharmony_ci /** 141761847f8eSopenharmony_ci * Get the UTC milliseconds. 141861847f8eSopenharmony_ci * 141961847f8eSopenharmony_ci * @returns { number } the calendar time as UTC milliseconds. 142061847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 142161847f8eSopenharmony_ci * @crossplatform 142261847f8eSopenharmony_ci * @since 11 142361847f8eSopenharmony_ci */ 142461847f8eSopenharmony_ci /** 142561847f8eSopenharmony_ci * Get the UTC milliseconds. 142661847f8eSopenharmony_ci * 142761847f8eSopenharmony_ci * @returns { number } the calendar time as UTC milliseconds. 142861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 142961847f8eSopenharmony_ci * @crossplatform 143061847f8eSopenharmony_ci * @atomicservice 143161847f8eSopenharmony_ci * @since 12 143261847f8eSopenharmony_ci */ 143361847f8eSopenharmony_ci getTimeInMillis(): number; 143461847f8eSopenharmony_ci 143561847f8eSopenharmony_ci /** 143661847f8eSopenharmony_ci * Returns days comparison result. 143761847f8eSopenharmony_ci * 143861847f8eSopenharmony_ci * @param { Date } date - Date object to be compared. 143961847f8eSopenharmony_ci * @returns { number } value of of the comparison result. A positive value indicates that the date is later, 144061847f8eSopenharmony_ci * and a negative value indicates that the date is earlier. 144161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 144261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 144361847f8eSopenharmony_ci * @crossplatform 144461847f8eSopenharmony_ci * @since 11 144561847f8eSopenharmony_ci */ 144661847f8eSopenharmony_ci /** 144761847f8eSopenharmony_ci * Returns days comparison result. 144861847f8eSopenharmony_ci * 144961847f8eSopenharmony_ci * @param { Date } date - Date object to be compared. 145061847f8eSopenharmony_ci * @returns { number } value of of the comparison result. A positive value indicates that the date is later, 145161847f8eSopenharmony_ci * and a negative value indicates that the date is earlier. 145261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 145361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 145461847f8eSopenharmony_ci * @crossplatform 145561847f8eSopenharmony_ci * @atomicservice 145661847f8eSopenharmony_ci * @since 12 145761847f8eSopenharmony_ci */ 145861847f8eSopenharmony_ci compareDays(date: Date): number; 145961847f8eSopenharmony_ci } 146061847f8eSopenharmony_ci 146161847f8eSopenharmony_ci /** 146261847f8eSopenharmony_ci * Judge whether the locale is RTL locale. 146361847f8eSopenharmony_ci * 146461847f8eSopenharmony_ci * @param { string } locale - The locale to be used. 146561847f8eSopenharmony_ci * @returns { boolean } true representing the locale is an RTL locale 146661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 146761847f8eSopenharmony_ci * @since 7 146861847f8eSopenharmony_ci */ 146961847f8eSopenharmony_ci /** 147061847f8eSopenharmony_ci * Judge whether the locale is RTL locale. 147161847f8eSopenharmony_ci * 147261847f8eSopenharmony_ci * @param { string } locale - The locale to be used. 147361847f8eSopenharmony_ci * @returns { boolean } true representing the locale is an RTL locale 147461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 147561847f8eSopenharmony_ci * @crossplatform 147661847f8eSopenharmony_ci * @since 10 147761847f8eSopenharmony_ci */ 147861847f8eSopenharmony_ci /** 147961847f8eSopenharmony_ci * Judge whether the locale is RTL locale. 148061847f8eSopenharmony_ci * 148161847f8eSopenharmony_ci * @param { string } locale - The locale to be used. 148261847f8eSopenharmony_ci * @returns { boolean } true representing the locale is an RTL locale 148361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 148461847f8eSopenharmony_ci * @crossplatform 148561847f8eSopenharmony_ci * @atomicservice 148661847f8eSopenharmony_ci * @since 12 148761847f8eSopenharmony_ci */ 148861847f8eSopenharmony_ci export function isRTL(locale: string): boolean; 148961847f8eSopenharmony_ci 149061847f8eSopenharmony_ci /** 149161847f8eSopenharmony_ci * Obtains a BreakIterator object for finding the location of break point in text. 149261847f8eSopenharmony_ci * 149361847f8eSopenharmony_ci * @param { string } locale - the returned BreakIterator will adapt the rule, specified by the locale, to break text. 149461847f8eSopenharmony_ci * @returns { BreakIterator } a newly constructed BreakIterator object. 149561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 149661847f8eSopenharmony_ci * @since 8 149761847f8eSopenharmony_ci */ 149861847f8eSopenharmony_ci /** 149961847f8eSopenharmony_ci * Obtains a BreakIterator object for finding the location of break point in text. 150061847f8eSopenharmony_ci * 150161847f8eSopenharmony_ci * @param { string } locale - the returned BreakIterator will adapt the rule, specified by the locale, to break text. 150261847f8eSopenharmony_ci * @returns { BreakIterator } a newly constructed BreakIterator object. 150361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 150461847f8eSopenharmony_ci * @atomicservice 150561847f8eSopenharmony_ci * @since 12 150661847f8eSopenharmony_ci */ 150761847f8eSopenharmony_ci export function getLineInstance(locale: string): BreakIterator; 150861847f8eSopenharmony_ci 150961847f8eSopenharmony_ci /** 151061847f8eSopenharmony_ci * The BreakIterator class is used for finding the location of break point in text. 151161847f8eSopenharmony_ci * 151261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 151361847f8eSopenharmony_ci * @since 8 151461847f8eSopenharmony_ci */ 151561847f8eSopenharmony_ci /** 151661847f8eSopenharmony_ci * The BreakIterator class is used for finding the location of break point in text. 151761847f8eSopenharmony_ci * 151861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 151961847f8eSopenharmony_ci * @atomicservice 152061847f8eSopenharmony_ci * @since 12 152161847f8eSopenharmony_ci */ 152261847f8eSopenharmony_ci export class BreakIterator { 152361847f8eSopenharmony_ci /** 152461847f8eSopenharmony_ci * Obtains the current position of the BreakIterator instance. 152561847f8eSopenharmony_ci * 152661847f8eSopenharmony_ci * @returns { number } the current position of the BreakIterator instance. 152761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 152861847f8eSopenharmony_ci * @since 8 152961847f8eSopenharmony_ci */ 153061847f8eSopenharmony_ci /** 153161847f8eSopenharmony_ci * Obtains the current position of the BreakIterator instance. 153261847f8eSopenharmony_ci * 153361847f8eSopenharmony_ci * @returns { number } the current position of the BreakIterator instance. 153461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 153561847f8eSopenharmony_ci * @atomicservice 153661847f8eSopenharmony_ci * @since 12 153761847f8eSopenharmony_ci */ 153861847f8eSopenharmony_ci current(): number; 153961847f8eSopenharmony_ci 154061847f8eSopenharmony_ci /** 154161847f8eSopenharmony_ci * Set the BreakIterator's position to the first break point, the first break point is always the beginning of the 154261847f8eSopenharmony_ci * processed text. 154361847f8eSopenharmony_ci * 154461847f8eSopenharmony_ci * @returns { number } the index of the first break point. 154561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 154661847f8eSopenharmony_ci * @since 8 154761847f8eSopenharmony_ci */ 154861847f8eSopenharmony_ci /** 154961847f8eSopenharmony_ci * Set the BreakIterator's position to the first break point, the first break point is always the beginning of the 155061847f8eSopenharmony_ci * processed text. 155161847f8eSopenharmony_ci * 155261847f8eSopenharmony_ci * @returns { number } the index of the first break point. 155361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 155461847f8eSopenharmony_ci * @atomicservice 155561847f8eSopenharmony_ci * @since 12 155661847f8eSopenharmony_ci */ 155761847f8eSopenharmony_ci first(): number; 155861847f8eSopenharmony_ci 155961847f8eSopenharmony_ci /** 156061847f8eSopenharmony_ci * Set the BreakIterator's position to the last break point. the last break point is always the index beyond the 156161847f8eSopenharmony_ci * last character of the processed text. 156261847f8eSopenharmony_ci * 156361847f8eSopenharmony_ci * @returns { number } the index of the last break point. 156461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 156561847f8eSopenharmony_ci * @since 8 156661847f8eSopenharmony_ci */ 156761847f8eSopenharmony_ci /** 156861847f8eSopenharmony_ci * Set the BreakIterator's position to the last break point. the last break point is always the index beyond the 156961847f8eSopenharmony_ci * last character of the processed text. 157061847f8eSopenharmony_ci * 157161847f8eSopenharmony_ci * @returns { number } the index of the last break point. 157261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 157361847f8eSopenharmony_ci * @atomicservice 157461847f8eSopenharmony_ci * @since 12 157561847f8eSopenharmony_ci */ 157661847f8eSopenharmony_ci last(): number; 157761847f8eSopenharmony_ci 157861847f8eSopenharmony_ci /** 157961847f8eSopenharmony_ci * Set the BreakIterator's position to the nth break point from the current break point. 158061847f8eSopenharmony_ci * 158161847f8eSopenharmony_ci * @param { number } [index] - indicates the number of break points to advance. If index is not given, n is treated as 1. 158261847f8eSopenharmony_ci * @returns { number } the index of the BreakIterator after moving. If there is not enough break points, returns -1. 158361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 158461847f8eSopenharmony_ci * @since 8 158561847f8eSopenharmony_ci */ 158661847f8eSopenharmony_ci /** 158761847f8eSopenharmony_ci * Set the BreakIterator's position to the nth break point from the current break point. 158861847f8eSopenharmony_ci * 158961847f8eSopenharmony_ci * @param { number } [index] - indicates the number of break points to advance. If index is not given, n is treated as 1. 159061847f8eSopenharmony_ci * @returns { number } the index of the BreakIterator after moving. If there is not enough break points, returns -1. 159161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 159261847f8eSopenharmony_ci * @atomicservice 159361847f8eSopenharmony_ci * @since 12 159461847f8eSopenharmony_ci */ 159561847f8eSopenharmony_ci next(index?: number): number; 159661847f8eSopenharmony_ci 159761847f8eSopenharmony_ci /** 159861847f8eSopenharmony_ci * Set the BreakIterator's position to the break point preceding the current break point. 159961847f8eSopenharmony_ci * 160061847f8eSopenharmony_ci * @returns { number } the index of the BreakIterator after moving. If there is not enough break points, returns -1. 160161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 160261847f8eSopenharmony_ci * @since 8 160361847f8eSopenharmony_ci */ 160461847f8eSopenharmony_ci /** 160561847f8eSopenharmony_ci * Set the BreakIterator's position to the break point preceding the current break point. 160661847f8eSopenharmony_ci * 160761847f8eSopenharmony_ci * @returns { number } the index of the BreakIterator after moving. If there is not enough break points, returns -1. 160861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 160961847f8eSopenharmony_ci * @atomicservice 161061847f8eSopenharmony_ci * @since 12 161161847f8eSopenharmony_ci */ 161261847f8eSopenharmony_ci previous(): number; 161361847f8eSopenharmony_ci 161461847f8eSopenharmony_ci /** 161561847f8eSopenharmony_ci * Set the text to be processed. 161661847f8eSopenharmony_ci * 161761847f8eSopenharmony_ci * @param { string } text - Indicates the text to be processed by the BreakIterator. 161861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 161961847f8eSopenharmony_ci * @since 8 162061847f8eSopenharmony_ci */ 162161847f8eSopenharmony_ci /** 162261847f8eSopenharmony_ci * Set the text to be processed. 162361847f8eSopenharmony_ci * 162461847f8eSopenharmony_ci * @param { string } text - Indicates the text to be processed by the BreakIterator. 162561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 162661847f8eSopenharmony_ci * @atomicservice 162761847f8eSopenharmony_ci * @since 12 162861847f8eSopenharmony_ci */ 162961847f8eSopenharmony_ci setLineBreakText(text: string): void; 163061847f8eSopenharmony_ci 163161847f8eSopenharmony_ci /** 163261847f8eSopenharmony_ci * Set the BreakIterator's position to the first break point following the specified offset. 163361847f8eSopenharmony_ci * 163461847f8eSopenharmony_ci * @param { number } offset 163561847f8eSopenharmony_ci * @returns { number } the index of the BreakIterator after moving. If there is not enough break points, returns -1. 163661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 163761847f8eSopenharmony_ci * @since 8 163861847f8eSopenharmony_ci */ 163961847f8eSopenharmony_ci /** 164061847f8eSopenharmony_ci * Set the BreakIterator's position to the first break point following the specified offset. 164161847f8eSopenharmony_ci * 164261847f8eSopenharmony_ci * @param { number } offset 164361847f8eSopenharmony_ci * @returns { number } the index of the BreakIterator after moving. If there is not enough break points, returns -1. 164461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 164561847f8eSopenharmony_ci * @atomicservice 164661847f8eSopenharmony_ci * @since 12 164761847f8eSopenharmony_ci */ 164861847f8eSopenharmony_ci following(offset: number): number; 164961847f8eSopenharmony_ci 165061847f8eSopenharmony_ci /** 165161847f8eSopenharmony_ci * Obtains the text being processed. 165261847f8eSopenharmony_ci * 165361847f8eSopenharmony_ci * @returns { string } the text that is processed by the BreakIterator. 165461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 165561847f8eSopenharmony_ci * @since 8 165661847f8eSopenharmony_ci */ 165761847f8eSopenharmony_ci /** 165861847f8eSopenharmony_ci * Obtains the text being processed. 165961847f8eSopenharmony_ci * 166061847f8eSopenharmony_ci * @returns { string } the text that is processed by the BreakIterator. 166161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 166261847f8eSopenharmony_ci * @atomicservice 166361847f8eSopenharmony_ci * @since 12 166461847f8eSopenharmony_ci */ 166561847f8eSopenharmony_ci getLineBreakText(): string; 166661847f8eSopenharmony_ci 166761847f8eSopenharmony_ci /** 166861847f8eSopenharmony_ci * Returns true if the position indicated by the offset is a break point, otherwise false. The BreakIterator's 166961847f8eSopenharmony_ci * position will be set to the position indicated by the offset if it returns true, otherwise the BreakIterator 167061847f8eSopenharmony_ci * will be moved to the break point following the offset. 167161847f8eSopenharmony_ci * 167261847f8eSopenharmony_ci * @param { number } offset The offset to be checked. 167361847f8eSopenharmony_ci * @returns { boolean } true if the offset is a break point. 167461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 167561847f8eSopenharmony_ci * @since 8 167661847f8eSopenharmony_ci */ 167761847f8eSopenharmony_ci /** 167861847f8eSopenharmony_ci * Returns true if the position indicated by the offset is a break point, otherwise false. The BreakIterator's 167961847f8eSopenharmony_ci * position will be set to the position indicated by the offset if it returns true, otherwise the BreakIterator 168061847f8eSopenharmony_ci * will be moved to the break point following the offset. 168161847f8eSopenharmony_ci * 168261847f8eSopenharmony_ci * @param { number } offset The offset to be checked. 168361847f8eSopenharmony_ci * @returns { boolean } true if the offset is a break point. 168461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 168561847f8eSopenharmony_ci * @atomicservice 168661847f8eSopenharmony_ci * @since 12 168761847f8eSopenharmony_ci */ 168861847f8eSopenharmony_ci isBoundary(offset: number): boolean; 168961847f8eSopenharmony_ci } 169061847f8eSopenharmony_ci 169161847f8eSopenharmony_ci /** 169261847f8eSopenharmony_ci * Get IndexUtil object. 169361847f8eSopenharmony_ci * 169461847f8eSopenharmony_ci * @param { string } [locale] - Indicates a character string containing the locale information, including 169561847f8eSopenharmony_ci * the language and optionally the script and region, for the NumberFormat object. 169661847f8eSopenharmony_ci * @returns { IndexUtil } IndexUtil object. 169761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 169861847f8eSopenharmony_ci * @since 8 169961847f8eSopenharmony_ci */ 170061847f8eSopenharmony_ci /** 170161847f8eSopenharmony_ci * Get IndexUtil object. 170261847f8eSopenharmony_ci * 170361847f8eSopenharmony_ci * @param { string } [locale] - Indicates a character string containing the locale information, including 170461847f8eSopenharmony_ci * the language and optionally the script and region, for the NumberFormat object. 170561847f8eSopenharmony_ci * @returns { IndexUtil } IndexUtil object. 170661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 170761847f8eSopenharmony_ci * @atomicservice 170861847f8eSopenharmony_ci * @since 12 170961847f8eSopenharmony_ci */ 171061847f8eSopenharmony_ci export function getInstance(locale?: string): IndexUtil; 171161847f8eSopenharmony_ci 171261847f8eSopenharmony_ci /** 171361847f8eSopenharmony_ci * Sequence text can be grouped under the specified area, 171461847f8eSopenharmony_ci * and grouping index with different lengths can be specified. 171561847f8eSopenharmony_ci * 171661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 171761847f8eSopenharmony_ci * @since 8 171861847f8eSopenharmony_ci */ 171961847f8eSopenharmony_ci /** 172061847f8eSopenharmony_ci * Sequence text can be grouped under the specified area, 172161847f8eSopenharmony_ci * and grouping index with different lengths can be specified. 172261847f8eSopenharmony_ci * 172361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 172461847f8eSopenharmony_ci * @atomicservice 172561847f8eSopenharmony_ci * @since 12 172661847f8eSopenharmony_ci */ 172761847f8eSopenharmony_ci export class IndexUtil { 172861847f8eSopenharmony_ci /** 172961847f8eSopenharmony_ci * Get a list of labels for use as a UI index 173061847f8eSopenharmony_ci * 173161847f8eSopenharmony_ci * @returns { Array<string> } a list of labels 173261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 173361847f8eSopenharmony_ci * @since 8 173461847f8eSopenharmony_ci */ 173561847f8eSopenharmony_ci /** 173661847f8eSopenharmony_ci * Get a list of labels for use as a UI index 173761847f8eSopenharmony_ci * 173861847f8eSopenharmony_ci * @returns { Array<string> } a list of labels 173961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 174061847f8eSopenharmony_ci * @atomicservice 174161847f8eSopenharmony_ci * @since 12 174261847f8eSopenharmony_ci */ 174361847f8eSopenharmony_ci getIndexList(): Array<string>; 174461847f8eSopenharmony_ci 174561847f8eSopenharmony_ci /** 174661847f8eSopenharmony_ci * Add the index characters from a Locale to the index. 174761847f8eSopenharmony_ci * 174861847f8eSopenharmony_ci * @param { string } locale - The locale whose index characters are to be added. 174961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 175061847f8eSopenharmony_ci * @since 8 175161847f8eSopenharmony_ci */ 175261847f8eSopenharmony_ci /** 175361847f8eSopenharmony_ci * Add the index characters from a Locale to the index. 175461847f8eSopenharmony_ci * 175561847f8eSopenharmony_ci * @param { string } locale - The locale whose index characters are to be added. 175661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 175761847f8eSopenharmony_ci * @atomicservice 175861847f8eSopenharmony_ci * @since 12 175961847f8eSopenharmony_ci */ 176061847f8eSopenharmony_ci addLocale(locale: string): void; 176161847f8eSopenharmony_ci 176261847f8eSopenharmony_ci /** 176361847f8eSopenharmony_ci * Get corresponding index of the input text. 176461847f8eSopenharmony_ci * 176561847f8eSopenharmony_ci * @param { string } text - input text 176661847f8eSopenharmony_ci * @returns { string } index of the input text 176761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 176861847f8eSopenharmony_ci * @since 8 176961847f8eSopenharmony_ci */ 177061847f8eSopenharmony_ci /** 177161847f8eSopenharmony_ci * Get corresponding index of the input text. 177261847f8eSopenharmony_ci * 177361847f8eSopenharmony_ci * @param { string } text - input text 177461847f8eSopenharmony_ci * @returns { string } index of the input text 177561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 177661847f8eSopenharmony_ci * @atomicservice 177761847f8eSopenharmony_ci * @since 12 177861847f8eSopenharmony_ci */ 177961847f8eSopenharmony_ci getIndex(text: string): string; 178061847f8eSopenharmony_ci } 178161847f8eSopenharmony_ci 178261847f8eSopenharmony_ci /** 178361847f8eSopenharmony_ci * Provides the API for accessing unicode character properties. For example, determine whether a character is a number. 178461847f8eSopenharmony_ci * 178561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 178661847f8eSopenharmony_ci * @since 8 178761847f8eSopenharmony_ci * @deprecated since 9 178861847f8eSopenharmony_ci * @useinstead Unicode 178961847f8eSopenharmony_ci */ 179061847f8eSopenharmony_ci export class Character { 179161847f8eSopenharmony_ci /** 179261847f8eSopenharmony_ci * Determines whether the specified code point is a digit character 179361847f8eSopenharmony_ci * 179461847f8eSopenharmony_ci * @param { string } char - the character to be tested 179561847f8eSopenharmony_ci * @returns { boolean } true if the character is a digit character 179661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 179761847f8eSopenharmony_ci * @since 8 179861847f8eSopenharmony_ci * @deprecated since 9 179961847f8eSopenharmony_ci * @useinstead Unicode.isDigit 180061847f8eSopenharmony_ci */ 180161847f8eSopenharmony_ci isDigit(char: string): boolean; 180261847f8eSopenharmony_ci 180361847f8eSopenharmony_ci /** 180461847f8eSopenharmony_ci * Determines if the specified character is a space character or not. 180561847f8eSopenharmony_ci * 180661847f8eSopenharmony_ci * @param { string } char - the character to be tested 180761847f8eSopenharmony_ci * @returns { boolean } true if the character is a space character 180861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 180961847f8eSopenharmony_ci * @since 8 181061847f8eSopenharmony_ci * @deprecated since 9 181161847f8eSopenharmony_ci * @useinstead Unicode.isSpaceChar 181261847f8eSopenharmony_ci */ 181361847f8eSopenharmony_ci isSpaceChar(char: string): boolean; 181461847f8eSopenharmony_ci 181561847f8eSopenharmony_ci /** 181661847f8eSopenharmony_ci * Determines if the specified character is a whitespace character 181761847f8eSopenharmony_ci * 181861847f8eSopenharmony_ci * @param { string } char - the character to be tested 181961847f8eSopenharmony_ci * @returns { boolean } true if the character is a whitespace character 182061847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 182161847f8eSopenharmony_ci * @since 8 182261847f8eSopenharmony_ci * @deprecated since 9 182361847f8eSopenharmony_ci * @useinstead Unicode.isWhitespace 182461847f8eSopenharmony_ci */ 182561847f8eSopenharmony_ci isWhitespace(char: string): boolean; 182661847f8eSopenharmony_ci 182761847f8eSopenharmony_ci /** 182861847f8eSopenharmony_ci * Determines if the specified character is a RTL character or not. 182961847f8eSopenharmony_ci * 183061847f8eSopenharmony_ci * @param { string } char - the character to be tested 183161847f8eSopenharmony_ci * @returns { boolean } true if the character is a RTL character 183261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 183361847f8eSopenharmony_ci * @since 8 183461847f8eSopenharmony_ci * @deprecated since 9 183561847f8eSopenharmony_ci * @useinstead Unicode.isRTL 183661847f8eSopenharmony_ci */ 183761847f8eSopenharmony_ci isRTL(char: string): boolean; 183861847f8eSopenharmony_ci 183961847f8eSopenharmony_ci /** 184061847f8eSopenharmony_ci * Determines if the specified character is a Ideographic character or not. 184161847f8eSopenharmony_ci * 184261847f8eSopenharmony_ci * @param { string } char - the character to be tested 184361847f8eSopenharmony_ci * @returns { boolean } true if the character is a Ideographic character 184461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 184561847f8eSopenharmony_ci * @since 8 184661847f8eSopenharmony_ci * @deprecated since 9 184761847f8eSopenharmony_ci * @useinstead Unicode.isIdeograph 184861847f8eSopenharmony_ci */ 184961847f8eSopenharmony_ci isIdeograph(char: string): boolean; 185061847f8eSopenharmony_ci 185161847f8eSopenharmony_ci /** 185261847f8eSopenharmony_ci * Determines if the specified character is a Letter or not. 185361847f8eSopenharmony_ci * 185461847f8eSopenharmony_ci * @param { string } char - the character to be tested 185561847f8eSopenharmony_ci * @returns { boolean } true if the character is a Letter 185661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 185761847f8eSopenharmony_ci * @since 8 185861847f8eSopenharmony_ci * @deprecated since 9 185961847f8eSopenharmony_ci * @useinstead Unicode.isLetter 186061847f8eSopenharmony_ci */ 186161847f8eSopenharmony_ci isLetter(char: string): boolean; 186261847f8eSopenharmony_ci 186361847f8eSopenharmony_ci /** 186461847f8eSopenharmony_ci * Determines if the specified character is a LowerCase character or not. 186561847f8eSopenharmony_ci * 186661847f8eSopenharmony_ci * @param { string } char - the character to be tested 186761847f8eSopenharmony_ci * @returns { boolean } true if the character is a LowerCase character 186861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 186961847f8eSopenharmony_ci * @since 8 187061847f8eSopenharmony_ci * @deprecated since 9 187161847f8eSopenharmony_ci * @useinstead Unicode.isLowerCase 187261847f8eSopenharmony_ci */ 187361847f8eSopenharmony_ci isLowerCase(char: string): boolean; 187461847f8eSopenharmony_ci 187561847f8eSopenharmony_ci /** 187661847f8eSopenharmony_ci * Determines if the specified character is a UpperCase character or not. 187761847f8eSopenharmony_ci * 187861847f8eSopenharmony_ci * @param { string } char - the character to be tested 187961847f8eSopenharmony_ci * @returns { boolean } true if the character is a UpperCase character 188061847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 188161847f8eSopenharmony_ci * @since 8 188261847f8eSopenharmony_ci * @deprecated since 9 188361847f8eSopenharmony_ci * @useinstead Unicode.isUpperCase 188461847f8eSopenharmony_ci */ 188561847f8eSopenharmony_ci isUpperCase(char: string): boolean; 188661847f8eSopenharmony_ci 188761847f8eSopenharmony_ci /** 188861847f8eSopenharmony_ci * Get the general category value of the specified character. 188961847f8eSopenharmony_ci * 189061847f8eSopenharmony_ci * @param { string } char - the character to be tested 189161847f8eSopenharmony_ci * @returns { string } the general category of the specified character. 189261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 189361847f8eSopenharmony_ci * @since 8 189461847f8eSopenharmony_ci * @deprecated since 9 189561847f8eSopenharmony_ci * @useinstead Unicode.getType 189661847f8eSopenharmony_ci */ 189761847f8eSopenharmony_ci getType(char: string): string; 189861847f8eSopenharmony_ci } 189961847f8eSopenharmony_ci 190061847f8eSopenharmony_ci /** 190161847f8eSopenharmony_ci * Provides the API for accessing unicode character properties. For example, determine whether a character is a number. 190261847f8eSopenharmony_ci * 190361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 190461847f8eSopenharmony_ci * @since 9 190561847f8eSopenharmony_ci */ 190661847f8eSopenharmony_ci /** 190761847f8eSopenharmony_ci * Provides the API for accessing unicode character properties. For example, determine whether a character is a number. 190861847f8eSopenharmony_ci * 190961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 191061847f8eSopenharmony_ci * @crossplatform 191161847f8eSopenharmony_ci * @since 10 191261847f8eSopenharmony_ci */ 191361847f8eSopenharmony_ci /** 191461847f8eSopenharmony_ci * Provides the API for accessing unicode character properties. For example, determine whether a character is a number. 191561847f8eSopenharmony_ci * 191661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 191761847f8eSopenharmony_ci * @crossplatform 191861847f8eSopenharmony_ci * @atomicservice 191961847f8eSopenharmony_ci * @since 12 192061847f8eSopenharmony_ci */ 192161847f8eSopenharmony_ci export class Unicode { 192261847f8eSopenharmony_ci /** 192361847f8eSopenharmony_ci * Determines whether the specified code point is a digit character 192461847f8eSopenharmony_ci * 192561847f8eSopenharmony_ci * @param { string } char - the character to be tested 192661847f8eSopenharmony_ci * @returns { boolean } true if the character is a digit character 192761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 192861847f8eSopenharmony_ci * @since 9 192961847f8eSopenharmony_ci */ 193061847f8eSopenharmony_ci /** 193161847f8eSopenharmony_ci * Determines whether the specified code point is a digit character 193261847f8eSopenharmony_ci * 193361847f8eSopenharmony_ci * @param { string } char - the character to be tested 193461847f8eSopenharmony_ci * @returns { boolean } true if the character is a digit character 193561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 193661847f8eSopenharmony_ci * @crossplatform 193761847f8eSopenharmony_ci * @since 10 193861847f8eSopenharmony_ci */ 193961847f8eSopenharmony_ci /** 194061847f8eSopenharmony_ci * Determines whether the specified code point is a digit character 194161847f8eSopenharmony_ci * 194261847f8eSopenharmony_ci * @param { string } char - the character to be tested 194361847f8eSopenharmony_ci * @returns { boolean } true if the character is a digit character 194461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 194561847f8eSopenharmony_ci * @crossplatform 194661847f8eSopenharmony_ci * @atomicservice 194761847f8eSopenharmony_ci * @since 12 194861847f8eSopenharmony_ci */ 194961847f8eSopenharmony_ci static isDigit(char: string): boolean; 195061847f8eSopenharmony_ci 195161847f8eSopenharmony_ci /** 195261847f8eSopenharmony_ci * Determines if the specified character is a space character or not. 195361847f8eSopenharmony_ci * 195461847f8eSopenharmony_ci * @param { string } char - the character to be tested 195561847f8eSopenharmony_ci * @returns { boolean } true if the character is a space character 195661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 195761847f8eSopenharmony_ci * @since 9 195861847f8eSopenharmony_ci */ 195961847f8eSopenharmony_ci /** 196061847f8eSopenharmony_ci * Determines if the specified character is a space character or not. 196161847f8eSopenharmony_ci * 196261847f8eSopenharmony_ci * @param { string } char - the character to be tested 196361847f8eSopenharmony_ci * @returns { boolean } true if the character is a space character 196461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 196561847f8eSopenharmony_ci * @crossplatform 196661847f8eSopenharmony_ci * @since 10 196761847f8eSopenharmony_ci */ 196861847f8eSopenharmony_ci /** 196961847f8eSopenharmony_ci * Determines if the specified character is a space character or not. 197061847f8eSopenharmony_ci * 197161847f8eSopenharmony_ci * @param { string } char - the character to be tested 197261847f8eSopenharmony_ci * @returns { boolean } true if the character is a space character 197361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 197461847f8eSopenharmony_ci * @crossplatform 197561847f8eSopenharmony_ci * @atomicservice 197661847f8eSopenharmony_ci * @since 12 197761847f8eSopenharmony_ci */ 197861847f8eSopenharmony_ci static isSpaceChar(char: string): boolean; 197961847f8eSopenharmony_ci 198061847f8eSopenharmony_ci /** 198161847f8eSopenharmony_ci * Determines if the specified character is a whitespace character 198261847f8eSopenharmony_ci * 198361847f8eSopenharmony_ci * @param { string } char - the character to be tested 198461847f8eSopenharmony_ci * @returns { boolean } true if the character is a whitespace character 198561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 198661847f8eSopenharmony_ci * @since 9 198761847f8eSopenharmony_ci */ 198861847f8eSopenharmony_ci /** 198961847f8eSopenharmony_ci * Determines if the specified character is a whitespace character 199061847f8eSopenharmony_ci * 199161847f8eSopenharmony_ci * @param { string } char - the character to be tested 199261847f8eSopenharmony_ci * @returns { boolean } true if the character is a whitespace character 199361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 199461847f8eSopenharmony_ci * @crossplatform 199561847f8eSopenharmony_ci * @since 10 199661847f8eSopenharmony_ci */ 199761847f8eSopenharmony_ci /** 199861847f8eSopenharmony_ci * Determines if the specified character is a whitespace character 199961847f8eSopenharmony_ci * 200061847f8eSopenharmony_ci * @param { string } char - the character to be tested 200161847f8eSopenharmony_ci * @returns { boolean } true if the character is a whitespace character 200261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 200361847f8eSopenharmony_ci * @crossplatform 200461847f8eSopenharmony_ci * @atomicservice 200561847f8eSopenharmony_ci * @since 12 200661847f8eSopenharmony_ci */ 200761847f8eSopenharmony_ci static isWhitespace(char: string): boolean; 200861847f8eSopenharmony_ci 200961847f8eSopenharmony_ci /** 201061847f8eSopenharmony_ci * Determines if the specified character is a RTL character or not. 201161847f8eSopenharmony_ci * 201261847f8eSopenharmony_ci * @param { string } char - the character to be tested 201361847f8eSopenharmony_ci * @returns { boolean } true if the character is a RTL character 201461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 201561847f8eSopenharmony_ci * @since 9 201661847f8eSopenharmony_ci */ 201761847f8eSopenharmony_ci /** 201861847f8eSopenharmony_ci * Determines if the specified character is a RTL character or not. 201961847f8eSopenharmony_ci * 202061847f8eSopenharmony_ci * @param { string } char - the character to be tested 202161847f8eSopenharmony_ci * @returns { boolean } true if the character is a RTL character 202261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 202361847f8eSopenharmony_ci * @crossplatform 202461847f8eSopenharmony_ci * @since 10 202561847f8eSopenharmony_ci */ 202661847f8eSopenharmony_ci /** 202761847f8eSopenharmony_ci * Determines if the specified character is a RTL character or not. 202861847f8eSopenharmony_ci * 202961847f8eSopenharmony_ci * @param { string } char - the character to be tested 203061847f8eSopenharmony_ci * @returns { boolean } true if the character is a RTL character 203161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 203261847f8eSopenharmony_ci * @crossplatform 203361847f8eSopenharmony_ci * @atomicservice 203461847f8eSopenharmony_ci * @since 12 203561847f8eSopenharmony_ci */ 203661847f8eSopenharmony_ci static isRTL(char: string): boolean; 203761847f8eSopenharmony_ci 203861847f8eSopenharmony_ci /** 203961847f8eSopenharmony_ci * Determines if the specified character is a Ideographic character or not. 204061847f8eSopenharmony_ci * 204161847f8eSopenharmony_ci * @param { string } char - the character to be tested 204261847f8eSopenharmony_ci * @returns { boolean } true if the character is a Ideographic character 204361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 204461847f8eSopenharmony_ci * @since 9 204561847f8eSopenharmony_ci */ 204661847f8eSopenharmony_ci /** 204761847f8eSopenharmony_ci * Determines if the specified character is a Ideographic character or not. 204861847f8eSopenharmony_ci * 204961847f8eSopenharmony_ci * @param { string } char - the character to be tested 205061847f8eSopenharmony_ci * @returns { boolean } true if the character is a Ideographic character 205161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 205261847f8eSopenharmony_ci * @crossplatform 205361847f8eSopenharmony_ci * @since 10 205461847f8eSopenharmony_ci */ 205561847f8eSopenharmony_ci /** 205661847f8eSopenharmony_ci * Determines if the specified character is a Ideographic character or not. 205761847f8eSopenharmony_ci * 205861847f8eSopenharmony_ci * @param { string } char - the character to be tested 205961847f8eSopenharmony_ci * @returns { boolean } true if the character is a Ideographic character 206061847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 206161847f8eSopenharmony_ci * @crossplatform 206261847f8eSopenharmony_ci * @atomicservice 206361847f8eSopenharmony_ci * @since 12 206461847f8eSopenharmony_ci */ 206561847f8eSopenharmony_ci static isIdeograph(char: string): boolean; 206661847f8eSopenharmony_ci 206761847f8eSopenharmony_ci /** 206861847f8eSopenharmony_ci * Determines if the specified character is a Letter or not. 206961847f8eSopenharmony_ci * 207061847f8eSopenharmony_ci * @param { string } char - the character to be tested 207161847f8eSopenharmony_ci * @returns { boolean } true if the character is a Letter 207261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 207361847f8eSopenharmony_ci * @since 9 207461847f8eSopenharmony_ci */ 207561847f8eSopenharmony_ci /** 207661847f8eSopenharmony_ci * Determines if the specified character is a Letter or not. 207761847f8eSopenharmony_ci * 207861847f8eSopenharmony_ci * @param { string } char - the character to be tested 207961847f8eSopenharmony_ci * @returns { boolean } true if the character is a Letter 208061847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 208161847f8eSopenharmony_ci * @crossplatform 208261847f8eSopenharmony_ci * @since 10 208361847f8eSopenharmony_ci */ 208461847f8eSopenharmony_ci /** 208561847f8eSopenharmony_ci * Determines if the specified character is a Letter or not. 208661847f8eSopenharmony_ci * 208761847f8eSopenharmony_ci * @param { string } char - the character to be tested 208861847f8eSopenharmony_ci * @returns { boolean } true if the character is a Letter 208961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 209061847f8eSopenharmony_ci * @crossplatform 209161847f8eSopenharmony_ci * @atomicservice 209261847f8eSopenharmony_ci * @since 12 209361847f8eSopenharmony_ci */ 209461847f8eSopenharmony_ci static isLetter(char: string): boolean; 209561847f8eSopenharmony_ci 209661847f8eSopenharmony_ci /** 209761847f8eSopenharmony_ci * Determines if the specified character is a LowerCase character or not. 209861847f8eSopenharmony_ci * 209961847f8eSopenharmony_ci * @param { string } char - the character to be tested 210061847f8eSopenharmony_ci * @returns { boolean } true if the character is a LowerCase character 210161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 210261847f8eSopenharmony_ci * @since 9 210361847f8eSopenharmony_ci */ 210461847f8eSopenharmony_ci /** 210561847f8eSopenharmony_ci * Determines if the specified character is a LowerCase character or not. 210661847f8eSopenharmony_ci * 210761847f8eSopenharmony_ci * @param { string } char - the character to be tested 210861847f8eSopenharmony_ci * @returns { boolean } true if the character is a LowerCase character 210961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 211061847f8eSopenharmony_ci * @crossplatform 211161847f8eSopenharmony_ci * @since 10 211261847f8eSopenharmony_ci */ 211361847f8eSopenharmony_ci /** 211461847f8eSopenharmony_ci * Determines if the specified character is a LowerCase character or not. 211561847f8eSopenharmony_ci * 211661847f8eSopenharmony_ci * @param { string } char - the character to be tested 211761847f8eSopenharmony_ci * @returns { boolean } true if the character is a LowerCase character 211861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 211961847f8eSopenharmony_ci * @crossplatform 212061847f8eSopenharmony_ci * @atomicservice 212161847f8eSopenharmony_ci * @since 12 212261847f8eSopenharmony_ci */ 212361847f8eSopenharmony_ci static isLowerCase(char: string): boolean; 212461847f8eSopenharmony_ci 212561847f8eSopenharmony_ci /** 212661847f8eSopenharmony_ci * Determines if the specified character is a UpperCase character or not. 212761847f8eSopenharmony_ci * 212861847f8eSopenharmony_ci * @param { string } char - the character to be tested 212961847f8eSopenharmony_ci * @returns { boolean } true if the character is a UpperCase character 213061847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 213161847f8eSopenharmony_ci * @since 9 213261847f8eSopenharmony_ci */ 213361847f8eSopenharmony_ci /** 213461847f8eSopenharmony_ci * Determines if the specified character is a UpperCase character or not. 213561847f8eSopenharmony_ci * 213661847f8eSopenharmony_ci * @param { string } char - the character to be tested 213761847f8eSopenharmony_ci * @returns { boolean } true if the character is a UpperCase character 213861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 213961847f8eSopenharmony_ci * @crossplatform 214061847f8eSopenharmony_ci * @since 10 214161847f8eSopenharmony_ci */ 214261847f8eSopenharmony_ci /** 214361847f8eSopenharmony_ci * Determines if the specified character is a UpperCase character or not. 214461847f8eSopenharmony_ci * 214561847f8eSopenharmony_ci * @param { string } char - the character to be tested 214661847f8eSopenharmony_ci * @returns { boolean } true if the character is a UpperCase character 214761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 214861847f8eSopenharmony_ci * @crossplatform 214961847f8eSopenharmony_ci * @atomicservice 215061847f8eSopenharmony_ci * @since 12 215161847f8eSopenharmony_ci */ 215261847f8eSopenharmony_ci static isUpperCase(char: string): boolean; 215361847f8eSopenharmony_ci 215461847f8eSopenharmony_ci /** 215561847f8eSopenharmony_ci * Get the general category value of the specified character. 215661847f8eSopenharmony_ci * 215761847f8eSopenharmony_ci * @param { string } char - the character to be tested 215861847f8eSopenharmony_ci * @returns { string } the general category of the specified character. 215961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 216061847f8eSopenharmony_ci * @since 9 216161847f8eSopenharmony_ci */ 216261847f8eSopenharmony_ci /** 216361847f8eSopenharmony_ci * Get the general category value of the specified character. 216461847f8eSopenharmony_ci * 216561847f8eSopenharmony_ci * @param { string } char - the character to be tested 216661847f8eSopenharmony_ci * @returns { string } the general category of the specified character. 216761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 216861847f8eSopenharmony_ci * @crossplatform 216961847f8eSopenharmony_ci * @since 10 217061847f8eSopenharmony_ci */ 217161847f8eSopenharmony_ci /** 217261847f8eSopenharmony_ci * Get the general category value of the specified character. 217361847f8eSopenharmony_ci * 217461847f8eSopenharmony_ci * @param { string } char - the character to be tested 217561847f8eSopenharmony_ci * @returns { string } the general category of the specified character. 217661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 217761847f8eSopenharmony_ci * @crossplatform 217861847f8eSopenharmony_ci * @atomicservice 217961847f8eSopenharmony_ci * @since 12 218061847f8eSopenharmony_ci */ 218161847f8eSopenharmony_ci static getType(char: string): string; 218261847f8eSopenharmony_ci } 218361847f8eSopenharmony_ci 218461847f8eSopenharmony_ci /** 218561847f8eSopenharmony_ci * check out whether system is 24-hour system. 218661847f8eSopenharmony_ci * 218761847f8eSopenharmony_ci * @returns { boolean } a boolean represent whether system is 24-hour system. 218861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 218961847f8eSopenharmony_ci * @since 7 219061847f8eSopenharmony_ci * @deprecated since 9 219161847f8eSopenharmony_ci * @useinstead ohos.i18n/i18n.System#is24HourClock 219261847f8eSopenharmony_ci */ 219361847f8eSopenharmony_ci export function is24HourClock(): boolean; 219461847f8eSopenharmony_ci 219561847f8eSopenharmony_ci /** 219661847f8eSopenharmony_ci * set 24-hour system. 219761847f8eSopenharmony_ci * 219861847f8eSopenharmony_ci * @permission ohos.permission.UPDATE_CONFIGURATION 219961847f8eSopenharmony_ci * @param { boolean } option - represent the boolean to be set. 220061847f8eSopenharmony_ci * @returns { boolean } a boolean represent whether setting 24-hour system success. 220161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 220261847f8eSopenharmony_ci * @since 7 220361847f8eSopenharmony_ci * @deprecated since 9 220461847f8eSopenharmony_ci * @useinstead ohos.i18n/i18n.System#set24HourClock 220561847f8eSopenharmony_ci */ 220661847f8eSopenharmony_ci export function set24HourClock(option: boolean): boolean; 220761847f8eSopenharmony_ci 220861847f8eSopenharmony_ci /** 220961847f8eSopenharmony_ci * Add one language to preferred language List. 221061847f8eSopenharmony_ci * 221161847f8eSopenharmony_ci * @permission ohos.permission.UPDATE_CONFIGURATION 221261847f8eSopenharmony_ci * @param { string } language - the language to be added. 221361847f8eSopenharmony_ci * @param { number } [index] - the position of preferred language list to be inserted. 221461847f8eSopenharmony_ci * @returns { boolean } a boolean represent whether language added success. 221561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 221661847f8eSopenharmony_ci * @since 8 221761847f8eSopenharmony_ci * @deprecated since 9 221861847f8eSopenharmony_ci * @useinstead ohos.i18n/i18n.System#addPreferredLanguage 221961847f8eSopenharmony_ci */ 222061847f8eSopenharmony_ci export function addPreferredLanguage(language: string, index?: number): boolean; 222161847f8eSopenharmony_ci 222261847f8eSopenharmony_ci /** 222361847f8eSopenharmony_ci * Remove one language from preferred language list. 222461847f8eSopenharmony_ci * 222561847f8eSopenharmony_ci * @permission ohos.permission.UPDATE_CONFIGURATION 222661847f8eSopenharmony_ci * @param { number } index - the position of removed language in preferred language list. 222761847f8eSopenharmony_ci * @returns { boolean } a boolean represent whether removed success. 222861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 222961847f8eSopenharmony_ci * @since 8 223061847f8eSopenharmony_ci * @deprecated since 9 223161847f8eSopenharmony_ci * @useinstead ohos.i18n/i18n.System#removePreferredLanguage 223261847f8eSopenharmony_ci */ 223361847f8eSopenharmony_ci export function removePreferredLanguage(index: number): boolean; 223461847f8eSopenharmony_ci 223561847f8eSopenharmony_ci /** 223661847f8eSopenharmony_ci * Access the system preferred language list. 223761847f8eSopenharmony_ci * 223861847f8eSopenharmony_ci * @returns { Array<string> } a string Array represent the preferred language list. 223961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 224061847f8eSopenharmony_ci * @since 8 224161847f8eSopenharmony_ci * @deprecated since 9 224261847f8eSopenharmony_ci * @useinstead ohos.i18n/i18n.System#getPreferredLanguageList 224361847f8eSopenharmony_ci */ 224461847f8eSopenharmony_ci export function getPreferredLanguageList(): Array<string>; 224561847f8eSopenharmony_ci 224661847f8eSopenharmony_ci /** 224761847f8eSopenharmony_ci * Get the first preferred language of system. 224861847f8eSopenharmony_ci * 224961847f8eSopenharmony_ci * @returns { string } a string represent the first preferred language of system. 225061847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 225161847f8eSopenharmony_ci * @since 8 225261847f8eSopenharmony_ci * @deprecated since 9 225361847f8eSopenharmony_ci * @useinstead ohos.i18n/i18n.System#getFirstPreferredLanguage 225461847f8eSopenharmony_ci */ 225561847f8eSopenharmony_ci export function getFirstPreferredLanguage(): string; 225661847f8eSopenharmony_ci 225761847f8eSopenharmony_ci /** 225861847f8eSopenharmony_ci * Get the default TimeZone object or the TimeZone object corresponds to zoneID. 225961847f8eSopenharmony_ci * 226061847f8eSopenharmony_ci * @param { string } [zoneID] - TimeZone ID used to create TimeZone Object. 226161847f8eSopenharmony_ci * @returns { TimeZone } a TimeZone object corresponds to zoneID. 226261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 226361847f8eSopenharmony_ci * @since 7 226461847f8eSopenharmony_ci */ 226561847f8eSopenharmony_ci /** 226661847f8eSopenharmony_ci * Get the default TimeZone object or the TimeZone object corresponds to zoneID. 226761847f8eSopenharmony_ci * 226861847f8eSopenharmony_ci * @param { string } [zoneID] - TimeZone ID used to create TimeZone Object. 226961847f8eSopenharmony_ci * @returns { TimeZone } a TimeZone object corresponds to zoneID. 227061847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 227161847f8eSopenharmony_ci * @crossplatform 227261847f8eSopenharmony_ci * @since 10 227361847f8eSopenharmony_ci */ 227461847f8eSopenharmony_ci /** 227561847f8eSopenharmony_ci * Get the default TimeZone object or the TimeZone object corresponds to zoneID. 227661847f8eSopenharmony_ci * 227761847f8eSopenharmony_ci * @param { string } [zoneID] - TimeZone ID used to create TimeZone Object. 227861847f8eSopenharmony_ci * @returns { TimeZone } a TimeZone object corresponds to zoneID. 227961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 228061847f8eSopenharmony_ci * @crossplatform 228161847f8eSopenharmony_ci * @atomicservice 228261847f8eSopenharmony_ci * @since 12 228361847f8eSopenharmony_ci */ 228461847f8eSopenharmony_ci export function getTimeZone(zoneID?: string): TimeZone; 228561847f8eSopenharmony_ci 228661847f8eSopenharmony_ci /** 228761847f8eSopenharmony_ci * Provides the API for accessing TimeZone name, rawOffset and offset information. 228861847f8eSopenharmony_ci * 228961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 229061847f8eSopenharmony_ci * @since 7 229161847f8eSopenharmony_ci */ 229261847f8eSopenharmony_ci /** 229361847f8eSopenharmony_ci * Provides the API for accessing TimeZone name, rawOffset and offset information. 229461847f8eSopenharmony_ci * 229561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 229661847f8eSopenharmony_ci * @crossplatform 229761847f8eSopenharmony_ci * @since 10 229861847f8eSopenharmony_ci */ 229961847f8eSopenharmony_ci /** 230061847f8eSopenharmony_ci * Provides the API for accessing TimeZone name, rawOffset and offset information. 230161847f8eSopenharmony_ci * 230261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 230361847f8eSopenharmony_ci * @crossplatform 230461847f8eSopenharmony_ci * @atomicservice 230561847f8eSopenharmony_ci * @since 12 230661847f8eSopenharmony_ci */ 230761847f8eSopenharmony_ci export class TimeZone { 230861847f8eSopenharmony_ci /** 230961847f8eSopenharmony_ci * Get the id of the TimeZone object. 231061847f8eSopenharmony_ci * 231161847f8eSopenharmony_ci * @returns { string } a string represents the timezone id. 231261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 231361847f8eSopenharmony_ci * @since 7 231461847f8eSopenharmony_ci */ 231561847f8eSopenharmony_ci /** 231661847f8eSopenharmony_ci * Get the id of the TimeZone object. 231761847f8eSopenharmony_ci * 231861847f8eSopenharmony_ci * @returns { string } a string represents the timezone id. 231961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 232061847f8eSopenharmony_ci * @crossplatform 232161847f8eSopenharmony_ci * @since 10 232261847f8eSopenharmony_ci */ 232361847f8eSopenharmony_ci /** 232461847f8eSopenharmony_ci * Get the id of the TimeZone object. 232561847f8eSopenharmony_ci * 232661847f8eSopenharmony_ci * @returns { string } a string represents the timezone id. 232761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 232861847f8eSopenharmony_ci * @crossplatform 232961847f8eSopenharmony_ci * @atomicservice 233061847f8eSopenharmony_ci * @since 12 233161847f8eSopenharmony_ci */ 233261847f8eSopenharmony_ci getID(): string; 233361847f8eSopenharmony_ci 233461847f8eSopenharmony_ci /** 233561847f8eSopenharmony_ci * Get the displayName of the TimeZone Object under the locale. 233661847f8eSopenharmony_ci * 233761847f8eSopenharmony_ci * @param { string } [locale] - the locale tag use to display timezone object's name. 233861847f8eSopenharmony_ci * @param { boolean } [isDST] - wether consider daylight saving time when display timezone object's name. 233961847f8eSopenharmony_ci * @returns { string } a string represents the display name. 234061847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 234161847f8eSopenharmony_ci * @since 7 234261847f8eSopenharmony_ci */ 234361847f8eSopenharmony_ci /** 234461847f8eSopenharmony_ci * Get the displayName of the TimeZone Object under the locale. 234561847f8eSopenharmony_ci * 234661847f8eSopenharmony_ci * @param { string } [locale] - the locale tag use to display timezone object's name. 234761847f8eSopenharmony_ci * @param { boolean } [isDST] - wether consider daylight saving time when display timezone object's name. 234861847f8eSopenharmony_ci * @returns { string } a string represents the display name. 234961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 235061847f8eSopenharmony_ci * @atomicservice 235161847f8eSopenharmony_ci * @since 12 235261847f8eSopenharmony_ci */ 235361847f8eSopenharmony_ci getDisplayName(locale?: string, isDST?: boolean): string; 235461847f8eSopenharmony_ci 235561847f8eSopenharmony_ci /** 235661847f8eSopenharmony_ci * Get the raw offset of the TimeZone object. 235761847f8eSopenharmony_ci * 235861847f8eSopenharmony_ci * @returns { number } a number represents the raw offset. 235961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 236061847f8eSopenharmony_ci * @since 7 236161847f8eSopenharmony_ci */ 236261847f8eSopenharmony_ci /** 236361847f8eSopenharmony_ci * Get the raw offset of the TimeZone object. 236461847f8eSopenharmony_ci * 236561847f8eSopenharmony_ci * @returns { number } a number represents the raw offset. 236661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 236761847f8eSopenharmony_ci * @crossplatform 236861847f8eSopenharmony_ci * @since 10 236961847f8eSopenharmony_ci */ 237061847f8eSopenharmony_ci /** 237161847f8eSopenharmony_ci * Get the raw offset of the TimeZone object. 237261847f8eSopenharmony_ci * 237361847f8eSopenharmony_ci * @returns { number } a number represents the raw offset. 237461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 237561847f8eSopenharmony_ci * @crossplatform 237661847f8eSopenharmony_ci * @atomicservice 237761847f8eSopenharmony_ci * @since 12 237861847f8eSopenharmony_ci */ 237961847f8eSopenharmony_ci getRawOffset(): number; 238061847f8eSopenharmony_ci 238161847f8eSopenharmony_ci /** 238261847f8eSopenharmony_ci * Get the offset of the TimeZone object. 238361847f8eSopenharmony_ci * 238461847f8eSopenharmony_ci * @param { number } [date] - Indicates a date use to compute offset. 238561847f8eSopenharmony_ci * @returns { number } a number represents the offset with date. 238661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 238761847f8eSopenharmony_ci * @since 7 238861847f8eSopenharmony_ci */ 238961847f8eSopenharmony_ci /** 239061847f8eSopenharmony_ci * Get the offset of the TimeZone object. 239161847f8eSopenharmony_ci * 239261847f8eSopenharmony_ci * @param { number } [date] - Indicates a date use to compute offset. 239361847f8eSopenharmony_ci * @returns { number } a number represents the offset with date. 239461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 239561847f8eSopenharmony_ci * @crossplatform 239661847f8eSopenharmony_ci * @since 10 239761847f8eSopenharmony_ci */ 239861847f8eSopenharmony_ci /** 239961847f8eSopenharmony_ci * Get the offset of the TimeZone object. 240061847f8eSopenharmony_ci * 240161847f8eSopenharmony_ci * @param { number } [date] - Indicates a date use to compute offset. 240261847f8eSopenharmony_ci * @returns { number } a number represents the offset with date. 240361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 240461847f8eSopenharmony_ci * @crossplatform 240561847f8eSopenharmony_ci * @atomicservice 240661847f8eSopenharmony_ci * @since 12 240761847f8eSopenharmony_ci */ 240861847f8eSopenharmony_ci getOffset(date?: number): number; 240961847f8eSopenharmony_ci 241061847f8eSopenharmony_ci /** 241161847f8eSopenharmony_ci * Get available TimeZone ID list. 241261847f8eSopenharmony_ci * 241361847f8eSopenharmony_ci * @returns { Array<string> } a string array represents the available TimeZone ID list. 241461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 241561847f8eSopenharmony_ci * @since 9 241661847f8eSopenharmony_ci */ 241761847f8eSopenharmony_ci /** 241861847f8eSopenharmony_ci * Get available TimeZone ID list. 241961847f8eSopenharmony_ci * 242061847f8eSopenharmony_ci * @returns { Array<string> } a string array represents the available TimeZone ID list. 242161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 242261847f8eSopenharmony_ci * @crossplatform 242361847f8eSopenharmony_ci * @since 10 242461847f8eSopenharmony_ci */ 242561847f8eSopenharmony_ci /** 242661847f8eSopenharmony_ci * Get available TimeZone ID list. 242761847f8eSopenharmony_ci * 242861847f8eSopenharmony_ci * @returns { Array<string> } a string array represents the available TimeZone ID list. 242961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 243061847f8eSopenharmony_ci * @crossplatform 243161847f8eSopenharmony_ci * @atomicservice 243261847f8eSopenharmony_ci * @since 12 243361847f8eSopenharmony_ci */ 243461847f8eSopenharmony_ci static getAvailableIDs(): Array<string>; 243561847f8eSopenharmony_ci 243661847f8eSopenharmony_ci /** 243761847f8eSopenharmony_ci * Get available Zone City ID list. 243861847f8eSopenharmony_ci * 243961847f8eSopenharmony_ci * @returns { Array<string> } a string array represents the available Zone City ID list. 244061847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 244161847f8eSopenharmony_ci * @since 9 244261847f8eSopenharmony_ci */ 244361847f8eSopenharmony_ci /** 244461847f8eSopenharmony_ci * Get available Zone City ID list. 244561847f8eSopenharmony_ci * 244661847f8eSopenharmony_ci * @returns { Array<string> } a string array represents the available Zone City ID list. 244761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 244861847f8eSopenharmony_ci * @atomicservice 244961847f8eSopenharmony_ci * @since 12 245061847f8eSopenharmony_ci */ 245161847f8eSopenharmony_ci static getAvailableZoneCityIDs(): Array<string>; 245261847f8eSopenharmony_ci 245361847f8eSopenharmony_ci /** 245461847f8eSopenharmony_ci * Get City display name in a certain locale. 245561847f8eSopenharmony_ci * 245661847f8eSopenharmony_ci * @param { string } cityID - Zone City ID. 245761847f8eSopenharmony_ci * @param { string } locale - locale used to display city name. 245861847f8eSopenharmony_ci * @returns { string } a string represents the display name of City in locale. 245961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 246061847f8eSopenharmony_ci * @since 9 246161847f8eSopenharmony_ci */ 246261847f8eSopenharmony_ci /** 246361847f8eSopenharmony_ci * Get City display name in a certain locale. 246461847f8eSopenharmony_ci * 246561847f8eSopenharmony_ci * @param { string } cityID - Zone City ID. 246661847f8eSopenharmony_ci * @param { string } locale - locale used to display city name. 246761847f8eSopenharmony_ci * @returns { string } a string represents the display name of City in locale. 246861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 246961847f8eSopenharmony_ci * @atomicservice 247061847f8eSopenharmony_ci * @since 12 247161847f8eSopenharmony_ci */ 247261847f8eSopenharmony_ci static getCityDisplayName(cityID: string, locale: string): string; 247361847f8eSopenharmony_ci 247461847f8eSopenharmony_ci /** 247561847f8eSopenharmony_ci * Get TimeZone Object from city ID. 247661847f8eSopenharmony_ci * 247761847f8eSopenharmony_ci * @param { string } cityID - Zone City ID. 247861847f8eSopenharmony_ci * @returns { TimeZone } a TimeZone Object from city ID. 247961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 248061847f8eSopenharmony_ci * @since 9 248161847f8eSopenharmony_ci */ 248261847f8eSopenharmony_ci /** 248361847f8eSopenharmony_ci * Get TimeZone Object from city ID. 248461847f8eSopenharmony_ci * 248561847f8eSopenharmony_ci * @param { string } cityID - Zone City ID. 248661847f8eSopenharmony_ci * @returns { TimeZone } a TimeZone Object from city ID. 248761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 248861847f8eSopenharmony_ci * @atomicservice 248961847f8eSopenharmony_ci * @since 12 249061847f8eSopenharmony_ci */ 249161847f8eSopenharmony_ci static getTimezoneFromCity(cityID: string): TimeZone; 249261847f8eSopenharmony_ci 249361847f8eSopenharmony_ci /** 249461847f8eSopenharmony_ci * Get the possible time zones from the specified longitude and latitude. 249561847f8eSopenharmony_ci * 249661847f8eSopenharmony_ci * @param { number } longitude value 249761847f8eSopenharmony_ci * @param { number } latitude value 249861847f8eSopenharmony_ci * @returns { Array<TimeZone> } Returns a TimeZone array from the specified longitude and latitude. 249961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 250061847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 250161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 250261847f8eSopenharmony_ci * @since 10 250361847f8eSopenharmony_ci */ 250461847f8eSopenharmony_ci 250561847f8eSopenharmony_ci /** 250661847f8eSopenharmony_ci * Get the possible time zones from the specified longitude and latitude. 250761847f8eSopenharmony_ci * 250861847f8eSopenharmony_ci * @param { number } longitude value 250961847f8eSopenharmony_ci * @param { number } latitude value 251061847f8eSopenharmony_ci * @returns { Array<TimeZone> } Returns a TimeZone array from the specified longitude and latitude. 251161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 251261847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 251361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 251461847f8eSopenharmony_ci * @atomicservice 251561847f8eSopenharmony_ci * @since 12 251661847f8eSopenharmony_ci */ 251761847f8eSopenharmony_ci static getTimezonesByLocation(longitude: number, latitude: number): Array<TimeZone>; 251861847f8eSopenharmony_ci } 251961847f8eSopenharmony_ci 252061847f8eSopenharmony_ci /** 252161847f8eSopenharmony_ci * Provides the API for transliterate text from one format to another. 252261847f8eSopenharmony_ci * 252361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 252461847f8eSopenharmony_ci * @since 9 252561847f8eSopenharmony_ci */ 252661847f8eSopenharmony_ci /** 252761847f8eSopenharmony_ci * Provides the API for transliterate text from one format to another. 252861847f8eSopenharmony_ci * 252961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 253061847f8eSopenharmony_ci * @atomicservice 253161847f8eSopenharmony_ci * @since 12 253261847f8eSopenharmony_ci */ 253361847f8eSopenharmony_ci export class Transliterator { 253461847f8eSopenharmony_ci /** 253561847f8eSopenharmony_ci * Get a string array of all available transliterator ids. 253661847f8eSopenharmony_ci * 253761847f8eSopenharmony_ci * @returns { string[] } a string array of all available transliterator ids. 253861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 253961847f8eSopenharmony_ci * @since 9 254061847f8eSopenharmony_ci */ 254161847f8eSopenharmony_ci /** 254261847f8eSopenharmony_ci * Get a string array of all available transliterator ids. 254361847f8eSopenharmony_ci * 254461847f8eSopenharmony_ci * @returns { string[] } a string array of all available transliterator ids. 254561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 254661847f8eSopenharmony_ci * @atomicservice 254761847f8eSopenharmony_ci * @since 12 254861847f8eSopenharmony_ci */ 254961847f8eSopenharmony_ci static getAvailableIDs(): string[]; 255061847f8eSopenharmony_ci 255161847f8eSopenharmony_ci /** 255261847f8eSopenharmony_ci * Get a Transliterator that is specified by id name. 255361847f8eSopenharmony_ci * 255461847f8eSopenharmony_ci * @param { string } id - specified the type of Transliterator. id is formed by source and dest. Transliterator will transliterate 255561847f8eSopenharmony_ci * the input string from source format to the dest format. For example, a Simplified Chinese to Latn 255661847f8eSopenharmony_ci * Transliterator will transform the text written in Chinese to Latn characters. 255761847f8eSopenharmony_ci * @returns { Transliterator } Transliterator that is specified by id name. 255861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 255961847f8eSopenharmony_ci * @since 9 256061847f8eSopenharmony_ci */ 256161847f8eSopenharmony_ci /** 256261847f8eSopenharmony_ci * Get a Transliterator that is specified by id name. 256361847f8eSopenharmony_ci * 256461847f8eSopenharmony_ci * @param { string } id - specified the type of Transliterator. id is formed by source and dest. Transliterator will transliterate 256561847f8eSopenharmony_ci * the input string from source format to the dest format. For example, a Simplified Chinese to Latn 256661847f8eSopenharmony_ci * Transliterator will transform the text written in Chinese to Latn characters. 256761847f8eSopenharmony_ci * @returns { Transliterator } Transliterator that is specified by id name. 256861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 256961847f8eSopenharmony_ci * @atomicservice 257061847f8eSopenharmony_ci * @since 12 257161847f8eSopenharmony_ci */ 257261847f8eSopenharmony_ci static getInstance(id: string): Transliterator; 257361847f8eSopenharmony_ci 257461847f8eSopenharmony_ci /** 257561847f8eSopenharmony_ci * Transform the input text. 257661847f8eSopenharmony_ci * 257761847f8eSopenharmony_ci * @param { string } text - text to be transliterated. 257861847f8eSopenharmony_ci * @returns { string } the output text that is transliterated from source format to the dest format. 257961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 258061847f8eSopenharmony_ci * @since 9 258161847f8eSopenharmony_ci */ 258261847f8eSopenharmony_ci /** 258361847f8eSopenharmony_ci * Transform the input text. 258461847f8eSopenharmony_ci * 258561847f8eSopenharmony_ci * @param { string } text - text to be transliterated. 258661847f8eSopenharmony_ci * @returns { string } the output text that is transliterated from source format to the dest format. 258761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 258861847f8eSopenharmony_ci * @atomicservice 258961847f8eSopenharmony_ci * @since 12 259061847f8eSopenharmony_ci */ 259161847f8eSopenharmony_ci transform(text: string): string; 259261847f8eSopenharmony_ci } 259361847f8eSopenharmony_ci 259461847f8eSopenharmony_ci /** 259561847f8eSopenharmony_ci * Enumerates the Normalizer modes. 259661847f8eSopenharmony_ci * 259761847f8eSopenharmony_ci * @enum { number } 259861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 259961847f8eSopenharmony_ci * @since 10 260061847f8eSopenharmony_ci */ 260161847f8eSopenharmony_ci /** 260261847f8eSopenharmony_ci * Enumerates the Normalizer modes. 260361847f8eSopenharmony_ci * 260461847f8eSopenharmony_ci * @enum { number } 260561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 260661847f8eSopenharmony_ci * @atomicservice 260761847f8eSopenharmony_ci * @since 12 260861847f8eSopenharmony_ci */ 260961847f8eSopenharmony_ci export enum NormalizerMode { 261061847f8eSopenharmony_ci /** 261161847f8eSopenharmony_ci * Normalization form C, characters are decomposed and then re-composed by canonical equivalence 261261847f8eSopenharmony_ci * 261361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 261461847f8eSopenharmony_ci * @since 10 261561847f8eSopenharmony_ci */ 261661847f8eSopenharmony_ci /** 261761847f8eSopenharmony_ci * Normalization form C, characters are decomposed and then re-composed by canonical equivalence 261861847f8eSopenharmony_ci * 261961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 262061847f8eSopenharmony_ci * @atomicservice 262161847f8eSopenharmony_ci * @since 12 262261847f8eSopenharmony_ci */ 262361847f8eSopenharmony_ci NFC = 1, 262461847f8eSopenharmony_ci /** 262561847f8eSopenharmony_ci * Normalization form D, characters are decomposed by canonical equivalence 262661847f8eSopenharmony_ci * 262761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 262861847f8eSopenharmony_ci * @since 10 262961847f8eSopenharmony_ci */ 263061847f8eSopenharmony_ci /** 263161847f8eSopenharmony_ci * Normalization form D, characters are decomposed by canonical equivalence 263261847f8eSopenharmony_ci * 263361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 263461847f8eSopenharmony_ci * @atomicservice 263561847f8eSopenharmony_ci * @since 12 263661847f8eSopenharmony_ci */ 263761847f8eSopenharmony_ci NFD = 2, 263861847f8eSopenharmony_ci /** 263961847f8eSopenharmony_ci * Normalization form KC, characters are decomposed by compatibility, then re-composed by canonical equivalence 264061847f8eSopenharmony_ci * 264161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 264261847f8eSopenharmony_ci * @since 10 264361847f8eSopenharmony_ci */ 264461847f8eSopenharmony_ci /** 264561847f8eSopenharmony_ci * Normalization form KC, characters are decomposed by compatibility, then re-composed by canonical equivalence 264661847f8eSopenharmony_ci * 264761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 264861847f8eSopenharmony_ci * @atomicservice 264961847f8eSopenharmony_ci * @since 12 265061847f8eSopenharmony_ci */ 265161847f8eSopenharmony_ci NFKC = 3, 265261847f8eSopenharmony_ci /** 265361847f8eSopenharmony_ci * Normalization form KD, characters are decomposed by compatibility 265461847f8eSopenharmony_ci * 265561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 265661847f8eSopenharmony_ci * @since 10 265761847f8eSopenharmony_ci */ 265861847f8eSopenharmony_ci /** 265961847f8eSopenharmony_ci * Normalization form KD, characters are decomposed by compatibility 266061847f8eSopenharmony_ci * 266161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 266261847f8eSopenharmony_ci * @atomicservice 266361847f8eSopenharmony_ci * @since 12 266461847f8eSopenharmony_ci */ 266561847f8eSopenharmony_ci NFKD = 4 266661847f8eSopenharmony_ci } 266761847f8eSopenharmony_ci 266861847f8eSopenharmony_ci /** 266961847f8eSopenharmony_ci * Provides the API for text encoding normalization. 267061847f8eSopenharmony_ci * 267161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 267261847f8eSopenharmony_ci * @since 10 267361847f8eSopenharmony_ci */ 267461847f8eSopenharmony_ci /** 267561847f8eSopenharmony_ci * Provides the API for text encoding normalization. 267661847f8eSopenharmony_ci * 267761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 267861847f8eSopenharmony_ci * @atomicservice 267961847f8eSopenharmony_ci * @since 12 268061847f8eSopenharmony_ci */ 268161847f8eSopenharmony_ci export class Normalizer { 268261847f8eSopenharmony_ci /** 268361847f8eSopenharmony_ci * Get a Normalizer that is specified by normalize mode. 268461847f8eSopenharmony_ci * 268561847f8eSopenharmony_ci * @param { NormalizerMode } mode - specified the mode of Normalizer. It must be a valid mode. 268661847f8eSopenharmony_ci * @returns { Normalizer } Transliterator that is specified by id name. 268761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 268861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 268961847f8eSopenharmony_ci * @since 10 269061847f8eSopenharmony_ci */ 269161847f8eSopenharmony_ci /** 269261847f8eSopenharmony_ci * Get a Normalizer that is specified by normalize mode. 269361847f8eSopenharmony_ci * 269461847f8eSopenharmony_ci * @param { NormalizerMode } mode - specified the mode of Normalizer. It must be a valid mode. 269561847f8eSopenharmony_ci * @returns { Normalizer } Transliterator that is specified by id name. 269661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 269761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 269861847f8eSopenharmony_ci * @atomicservice 269961847f8eSopenharmony_ci * @since 12 270061847f8eSopenharmony_ci */ 270161847f8eSopenharmony_ci static getInstance(mode: NormalizerMode): Normalizer; 270261847f8eSopenharmony_ci 270361847f8eSopenharmony_ci /** 270461847f8eSopenharmony_ci * Get a normalized string of specified mode. 270561847f8eSopenharmony_ci * 270661847f8eSopenharmony_ci * @param { string } text - text to normalized. 270761847f8eSopenharmony_ci * @returns { string } a normalized string from source. 270861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 270961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 271061847f8eSopenharmony_ci * @since 10 271161847f8eSopenharmony_ci */ 271261847f8eSopenharmony_ci /** 271361847f8eSopenharmony_ci * Get a normalized string of specified mode. 271461847f8eSopenharmony_ci * 271561847f8eSopenharmony_ci * @param { string } text - text to normalized. 271661847f8eSopenharmony_ci * @returns { string } a normalized string from source. 271761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 271861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 271961847f8eSopenharmony_ci * @atomicservice 272061847f8eSopenharmony_ci * @since 12 272161847f8eSopenharmony_ci */ 272261847f8eSopenharmony_ci normalize(text: string): string; 272361847f8eSopenharmony_ci } 272461847f8eSopenharmony_ci 272561847f8eSopenharmony_ci /** 272661847f8eSopenharmony_ci * Enumerates the locale suggestion type modes. 272761847f8eSopenharmony_ci * 272861847f8eSopenharmony_ci * @enum { number } 272961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 273061847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 273161847f8eSopenharmony_ci * @since 10 273261847f8eSopenharmony_ci */ 273361847f8eSopenharmony_ci export enum SuggestionType { 273461847f8eSopenharmony_ci /** 273561847f8eSopenharmony_ci * No correlation between language and region. 273661847f8eSopenharmony_ci * 273761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 273861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 273961847f8eSopenharmony_ci * @since 10 274061847f8eSopenharmony_ci */ 274161847f8eSopenharmony_ci SUGGESTION_TYPE_NONE = 0, 274261847f8eSopenharmony_ci /** 274361847f8eSopenharmony_ci * The language related to the specified region 274461847f8eSopenharmony_ci * 274561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 274661847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 274761847f8eSopenharmony_ci * @since 10 274861847f8eSopenharmony_ci */ 274961847f8eSopenharmony_ci SUGGESTION_TYPE_RELATED = 1, 275061847f8eSopenharmony_ci /** 275161847f8eSopenharmony_ci * The region is SIM card region. 275261847f8eSopenharmony_ci * 275361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 275461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 275561847f8eSopenharmony_ci * @since 10 275661847f8eSopenharmony_ci */ 275761847f8eSopenharmony_ci SUGGESTION_TYPE_SIM = 2, 275861847f8eSopenharmony_ci } 275961847f8eSopenharmony_ci 276061847f8eSopenharmony_ci /** 276161847f8eSopenharmony_ci * Provides the options which is used to sort the locales. 276261847f8eSopenharmony_ci * 276361847f8eSopenharmony_ci * @interface SortOptions 276461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 276561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 276661847f8eSopenharmony_ci * @since 10 276761847f8eSopenharmony_ci */ 276861847f8eSopenharmony_ci export interface SortOptions { 276961847f8eSopenharmony_ci /** 277061847f8eSopenharmony_ci * Locale code. 277161847f8eSopenharmony_ci * 277261847f8eSopenharmony_ci * @type { ?string } 277361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 277461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 277561847f8eSopenharmony_ci * @since 10 277661847f8eSopenharmony_ci */ 277761847f8eSopenharmony_ci locale?: string; 277861847f8eSopenharmony_ci 277961847f8eSopenharmony_ci /** 278061847f8eSopenharmony_ci * Whether to use local names for sorting 278161847f8eSopenharmony_ci * 278261847f8eSopenharmony_ci * @type { ?boolean } 278361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 278461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 278561847f8eSopenharmony_ci * @since 10 278661847f8eSopenharmony_ci */ 278761847f8eSopenharmony_ci isUseLocalName?: boolean; 278861847f8eSopenharmony_ci 278961847f8eSopenharmony_ci /** 279061847f8eSopenharmony_ci * Whether to put the suggested item at the top 279161847f8eSopenharmony_ci * 279261847f8eSopenharmony_ci * @type { ?boolean } 279361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 279461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 279561847f8eSopenharmony_ci * @since 10 279661847f8eSopenharmony_ci */ 279761847f8eSopenharmony_ci isSuggestedFirst?: boolean; 279861847f8eSopenharmony_ci } 279961847f8eSopenharmony_ci 280061847f8eSopenharmony_ci /** 280161847f8eSopenharmony_ci * Provide information for a language or region 280261847f8eSopenharmony_ci * 280361847f8eSopenharmony_ci * @interface LocaleItem 280461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 280561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 280661847f8eSopenharmony_ci * @since 10 280761847f8eSopenharmony_ci */ 280861847f8eSopenharmony_ci export interface LocaleItem { 280961847f8eSopenharmony_ci /** 281061847f8eSopenharmony_ci * language or region id. 281161847f8eSopenharmony_ci * 281261847f8eSopenharmony_ci * @type { string } 281361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 281461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 281561847f8eSopenharmony_ci * @since 10 281661847f8eSopenharmony_ci */ 281761847f8eSopenharmony_ci id: string; 281861847f8eSopenharmony_ci 281961847f8eSopenharmony_ci /** 282061847f8eSopenharmony_ci * The suggestion type of the language or region. 282161847f8eSopenharmony_ci * 282261847f8eSopenharmony_ci * @type { SuggestionType } 282361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 282461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 282561847f8eSopenharmony_ci * @since 10 282661847f8eSopenharmony_ci */ 282761847f8eSopenharmony_ci suggestionType: SuggestionType; 282861847f8eSopenharmony_ci 282961847f8eSopenharmony_ci /** 283061847f8eSopenharmony_ci * The display name of the language or region in specified language 283161847f8eSopenharmony_ci * 283261847f8eSopenharmony_ci * @type { string } 283361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 283461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 283561847f8eSopenharmony_ci * @since 10 283661847f8eSopenharmony_ci */ 283761847f8eSopenharmony_ci displayName: string; 283861847f8eSopenharmony_ci 283961847f8eSopenharmony_ci /** 284061847f8eSopenharmony_ci * The display name of the language or region in local language 284161847f8eSopenharmony_ci * @type { ?string } 284261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 284361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 284461847f8eSopenharmony_ci * @since 10 284561847f8eSopenharmony_ci */ 284661847f8eSopenharmony_ci localName?: string; 284761847f8eSopenharmony_ci } 284861847f8eSopenharmony_ci 284961847f8eSopenharmony_ci /** 285061847f8eSopenharmony_ci * Provides the informations of one time zone city. 285161847f8eSopenharmony_ci * 285261847f8eSopenharmony_ci * @interface TimeZoneCityItem 285361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 285461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 285561847f8eSopenharmony_ci * @since 10 285661847f8eSopenharmony_ci */ 285761847f8eSopenharmony_ci export interface TimeZoneCityItem { 285861847f8eSopenharmony_ci /** 285961847f8eSopenharmony_ci * Time zone id. 286061847f8eSopenharmony_ci * 286161847f8eSopenharmony_ci * @type { string } 286261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 286361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 286461847f8eSopenharmony_ci * @since 10 286561847f8eSopenharmony_ci */ 286661847f8eSopenharmony_ci zoneId: string; 286761847f8eSopenharmony_ci 286861847f8eSopenharmony_ci /** 286961847f8eSopenharmony_ci * City id. 287061847f8eSopenharmony_ci * 287161847f8eSopenharmony_ci * @type { string } 287261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 287361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 287461847f8eSopenharmony_ci * @since 10 287561847f8eSopenharmony_ci */ 287661847f8eSopenharmony_ci cityId: string; 287761847f8eSopenharmony_ci 287861847f8eSopenharmony_ci /** 287961847f8eSopenharmony_ci * The display name of the city. 288061847f8eSopenharmony_ci * 288161847f8eSopenharmony_ci * @type { string } 288261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 288361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 288461847f8eSopenharmony_ci * @since 10 288561847f8eSopenharmony_ci */ 288661847f8eSopenharmony_ci cityDisplayName: string; 288761847f8eSopenharmony_ci 288861847f8eSopenharmony_ci /** 288961847f8eSopenharmony_ci * The time zone offset for the city. 289061847f8eSopenharmony_ci * @type { number } 289161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 289261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 289361847f8eSopenharmony_ci * @since 10 289461847f8eSopenharmony_ci */ 289561847f8eSopenharmony_ci offset: number; 289661847f8eSopenharmony_ci 289761847f8eSopenharmony_ci /** 289861847f8eSopenharmony_ci * The display name of the time zone for the city. 289961847f8eSopenharmony_ci * 290061847f8eSopenharmony_ci * @type { string } 290161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 290261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 290361847f8eSopenharmony_ci * @since 10 290461847f8eSopenharmony_ci */ 290561847f8eSopenharmony_ci zoneDisplayName: string; 290661847f8eSopenharmony_ci 290761847f8eSopenharmony_ci /** 290861847f8eSopenharmony_ci * The time zone raw offset for the city. 290961847f8eSopenharmony_ci * @type { ?number } 291061847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 291161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 291261847f8eSopenharmony_ci * @since 10 291361847f8eSopenharmony_ci */ 291461847f8eSopenharmony_ci rawOffset?: number; 291561847f8eSopenharmony_ci } 291661847f8eSopenharmony_ci 291761847f8eSopenharmony_ci /** 291861847f8eSopenharmony_ci * Provide some functions for settings and startup guide to select language or region. 291961847f8eSopenharmony_ci * 292061847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 292161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 292261847f8eSopenharmony_ci * @since 10 292361847f8eSopenharmony_ci */ 292461847f8eSopenharmony_ci export class SystemLocaleManager { 292561847f8eSopenharmony_ci /** 292661847f8eSopenharmony_ci * A constructor used to create a SystemLocaleManager object. 292761847f8eSopenharmony_ci * 292861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 292961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 293061847f8eSopenharmony_ci * @since 10 293161847f8eSopenharmony_ci */ 293261847f8eSopenharmony_ci constructor(); 293361847f8eSopenharmony_ci 293461847f8eSopenharmony_ci /** 293561847f8eSopenharmony_ci * Obtains sorted language array for setting or startup guide app. 293661847f8eSopenharmony_ci * 293761847f8eSopenharmony_ci * @param { Array<string> } languages - The languages whose name will be sorted and displayed. 293861847f8eSopenharmony_ci * @param { SortOptions } options - Sort options for locale item. 293961847f8eSopenharmony_ci * @returns { Array<LocaleItem> } Locale Informations sorted for specified options. 294061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 294161847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 294261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 294361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 294461847f8eSopenharmony_ci * @since 10 294561847f8eSopenharmony_ci */ 294661847f8eSopenharmony_ci /** 294761847f8eSopenharmony_ci * Obtains sorted language array for setting or startup guide app. 294861847f8eSopenharmony_ci * 294961847f8eSopenharmony_ci * @param { Array<string> } languages - The languages whose name will be sorted and displayed. 295061847f8eSopenharmony_ci * @param { SortOptions } options - Sort options for locale item. 295161847f8eSopenharmony_ci * @returns { Array<LocaleItem> } Locale Informations sorted for specified options. 295261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 295361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 295461847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 295561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 295661847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 295761847f8eSopenharmony_ci * @since 12 295861847f8eSopenharmony_ci */ 295961847f8eSopenharmony_ci getLanguageInfoArray(languages: Array<string>, options?: SortOptions): Array<LocaleItem>; 296061847f8eSopenharmony_ci 296161847f8eSopenharmony_ci /** 296261847f8eSopenharmony_ci * Obtains sorted region array for setting or startup guide app. 296361847f8eSopenharmony_ci * 296461847f8eSopenharmony_ci * @param { Array<string> } regions - The regions whose name will be sorted and displayed. 296561847f8eSopenharmony_ci * @param { SortOptions } options - Sort options for locale item. 296661847f8eSopenharmony_ci * @returns { Array<LocaleItem> } Locale Informations sorted for specified options. 296761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 296861847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 296961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 297061847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 297161847f8eSopenharmony_ci * @since 10 297261847f8eSopenharmony_ci */ 297361847f8eSopenharmony_ci /** 297461847f8eSopenharmony_ci * Obtains sorted region array for setting or startup guide app. 297561847f8eSopenharmony_ci * 297661847f8eSopenharmony_ci * @param { Array<string> } regions - The regions whose name will be sorted and displayed. 297761847f8eSopenharmony_ci * @param { SortOptions } options - Sort options for locale item. 297861847f8eSopenharmony_ci * @returns { Array<LocaleItem> } Locale Informations sorted for specified options. 297961847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 298061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 298161847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 298261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 298361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 298461847f8eSopenharmony_ci * @since 12 298561847f8eSopenharmony_ci */ 298661847f8eSopenharmony_ci getRegionInfoArray(regions: Array<string>, options?: SortOptions): Array<LocaleItem>; 298761847f8eSopenharmony_ci 298861847f8eSopenharmony_ci /** 298961847f8eSopenharmony_ci * Obtains sorted time zone city info array for showing time zone list 299061847f8eSopenharmony_ci * 299161847f8eSopenharmony_ci * @returns { Array<TimeZoneCityItem> } Time zone city information sorted by city name. 299261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 299361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 299461847f8eSopenharmony_ci * @since 10 299561847f8eSopenharmony_ci */ 299661847f8eSopenharmony_ci /** 299761847f8eSopenharmony_ci * Obtains sorted time zone city info array for showing time zone list 299861847f8eSopenharmony_ci * 299961847f8eSopenharmony_ci * @returns { Array<TimeZoneCityItem> } Time zone city information sorted by city name. 300061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 300161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 300261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 300361847f8eSopenharmony_ci * @since 12 300461847f8eSopenharmony_ci */ 300561847f8eSopenharmony_ci static getTimeZoneCityItemArray(): Array<TimeZoneCityItem>; 300661847f8eSopenharmony_ci } 300761847f8eSopenharmony_ci 300861847f8eSopenharmony_ci /** 300961847f8eSopenharmony_ci * Provides the informations of one holiday. 301061847f8eSopenharmony_ci * 301161847f8eSopenharmony_ci * @interface HolidayInfoItem 301261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 301361847f8eSopenharmony_ci * @since 11 301461847f8eSopenharmony_ci */ 301561847f8eSopenharmony_ci /** 301661847f8eSopenharmony_ci * Provides the informations of one holiday. 301761847f8eSopenharmony_ci * 301861847f8eSopenharmony_ci * @interface HolidayInfoItem 301961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 302061847f8eSopenharmony_ci * @atomicservice 302161847f8eSopenharmony_ci * @since 12 302261847f8eSopenharmony_ci */ 302361847f8eSopenharmony_ci export interface HolidayInfoItem { 302461847f8eSopenharmony_ci /** 302561847f8eSopenharmony_ci * Holiday base name. 302661847f8eSopenharmony_ci * 302761847f8eSopenharmony_ci * @type { string } 302861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 302961847f8eSopenharmony_ci * @since 11 303061847f8eSopenharmony_ci */ 303161847f8eSopenharmony_ci /** 303261847f8eSopenharmony_ci * Holiday base name. 303361847f8eSopenharmony_ci * 303461847f8eSopenharmony_ci * @type { string } 303561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 303661847f8eSopenharmony_ci * @atomicservice 303761847f8eSopenharmony_ci * @since 12 303861847f8eSopenharmony_ci */ 303961847f8eSopenharmony_ci baseName: string; 304061847f8eSopenharmony_ci 304161847f8eSopenharmony_ci /** 304261847f8eSopenharmony_ci * Holiday start year. 304361847f8eSopenharmony_ci * 304461847f8eSopenharmony_ci * @type { number } 304561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 304661847f8eSopenharmony_ci * @since 11 304761847f8eSopenharmony_ci */ 304861847f8eSopenharmony_ci /** 304961847f8eSopenharmony_ci * Holiday start year. 305061847f8eSopenharmony_ci * 305161847f8eSopenharmony_ci * @type { number } 305261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 305361847f8eSopenharmony_ci * @atomicservice 305461847f8eSopenharmony_ci * @since 12 305561847f8eSopenharmony_ci */ 305661847f8eSopenharmony_ci year: number; 305761847f8eSopenharmony_ci 305861847f8eSopenharmony_ci /** 305961847f8eSopenharmony_ci * Holiday start month. 306061847f8eSopenharmony_ci * 306161847f8eSopenharmony_ci * @type { number } 306261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 306361847f8eSopenharmony_ci * @since 11 306461847f8eSopenharmony_ci */ 306561847f8eSopenharmony_ci /** 306661847f8eSopenharmony_ci * Holiday start month. 306761847f8eSopenharmony_ci * 306861847f8eSopenharmony_ci * @type { number } 306961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 307061847f8eSopenharmony_ci * @atomicservice 307161847f8eSopenharmony_ci * @since 12 307261847f8eSopenharmony_ci */ 307361847f8eSopenharmony_ci month: number; 307461847f8eSopenharmony_ci 307561847f8eSopenharmony_ci /** 307661847f8eSopenharmony_ci * Holiday start day. 307761847f8eSopenharmony_ci * 307861847f8eSopenharmony_ci * @type { number } 307961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 308061847f8eSopenharmony_ci * @since 11 308161847f8eSopenharmony_ci */ 308261847f8eSopenharmony_ci /** 308361847f8eSopenharmony_ci * Holiday start day. 308461847f8eSopenharmony_ci * 308561847f8eSopenharmony_ci * @type { number } 308661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 308761847f8eSopenharmony_ci * @atomicservice 308861847f8eSopenharmony_ci * @since 12 308961847f8eSopenharmony_ci */ 309061847f8eSopenharmony_ci day: number; 309161847f8eSopenharmony_ci 309261847f8eSopenharmony_ci /** 309361847f8eSopenharmony_ci * Holiday local name array. 309461847f8eSopenharmony_ci * 309561847f8eSopenharmony_ci * @type { ?Array<HolidayLocalName> } 309661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 309761847f8eSopenharmony_ci * @since 11 309861847f8eSopenharmony_ci */ 309961847f8eSopenharmony_ci /** 310061847f8eSopenharmony_ci * Holiday local name array. 310161847f8eSopenharmony_ci * 310261847f8eSopenharmony_ci * @type { ?Array<HolidayLocalName> } 310361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 310461847f8eSopenharmony_ci * @atomicservice 310561847f8eSopenharmony_ci * @since 12 310661847f8eSopenharmony_ci */ 310761847f8eSopenharmony_ci localNames?: Array<HolidayLocalName>; 310861847f8eSopenharmony_ci } 310961847f8eSopenharmony_ci 311061847f8eSopenharmony_ci /** 311161847f8eSopenharmony_ci * Provides the informations holiday locale name. 311261847f8eSopenharmony_ci * 311361847f8eSopenharmony_ci * @interface HolidayLocalName 311461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 311561847f8eSopenharmony_ci * @since 11 311661847f8eSopenharmony_ci */ 311761847f8eSopenharmony_ci /** 311861847f8eSopenharmony_ci * Provides the informations holiday locale name. 311961847f8eSopenharmony_ci * 312061847f8eSopenharmony_ci * @interface HolidayLocalName 312161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 312261847f8eSopenharmony_ci * @atomicservice 312361847f8eSopenharmony_ci * @since 12 312461847f8eSopenharmony_ci */ 312561847f8eSopenharmony_ci export interface HolidayLocalName { 312661847f8eSopenharmony_ci /** 312761847f8eSopenharmony_ci * Holiday locale name language id. 312861847f8eSopenharmony_ci * 312961847f8eSopenharmony_ci * @type { string } 313061847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 313161847f8eSopenharmony_ci * @since 11 313261847f8eSopenharmony_ci */ 313361847f8eSopenharmony_ci /** 313461847f8eSopenharmony_ci * Holiday locale name language id. 313561847f8eSopenharmony_ci * 313661847f8eSopenharmony_ci * @type { string } 313761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 313861847f8eSopenharmony_ci * @atomicservice 313961847f8eSopenharmony_ci * @since 12 314061847f8eSopenharmony_ci */ 314161847f8eSopenharmony_ci language: string; 314261847f8eSopenharmony_ci 314361847f8eSopenharmony_ci /** 314461847f8eSopenharmony_ci * Holiday local name. 314561847f8eSopenharmony_ci * 314661847f8eSopenharmony_ci * @type { string } 314761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 314861847f8eSopenharmony_ci * @since 11 314961847f8eSopenharmony_ci */ 315061847f8eSopenharmony_ci /** 315161847f8eSopenharmony_ci * Holiday local name. 315261847f8eSopenharmony_ci * 315361847f8eSopenharmony_ci * @type { string } 315461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 315561847f8eSopenharmony_ci * @atomicservice 315661847f8eSopenharmony_ci * @since 12 315761847f8eSopenharmony_ci */ 315861847f8eSopenharmony_ci name: string; 315961847f8eSopenharmony_ci } 316061847f8eSopenharmony_ci 316161847f8eSopenharmony_ci /** 316261847f8eSopenharmony_ci * Provide some functions to manage holidays in a country or region. Partly follows the RFC2445 standard. 316361847f8eSopenharmony_ci * 316461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 316561847f8eSopenharmony_ci * @since 11 316661847f8eSopenharmony_ci */ 316761847f8eSopenharmony_ci /** 316861847f8eSopenharmony_ci * Provide some functions to manage holidays in a country or region. Partly follows the RFC2445 standard. 316961847f8eSopenharmony_ci * 317061847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 317161847f8eSopenharmony_ci * @atomicservice 317261847f8eSopenharmony_ci * @since 12 317361847f8eSopenharmony_ci */ 317461847f8eSopenharmony_ci export class HolidayManager { 317561847f8eSopenharmony_ci /** 317661847f8eSopenharmony_ci * A constructor used to create a HolidayManager object. 317761847f8eSopenharmony_ci * 317861847f8eSopenharmony_ci * @param { String } icsPath - the path of the iCalendar format file to create HolidayManager object. 317961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 318061847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 318161847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 318261847f8eSopenharmony_ci * @since 11 318361847f8eSopenharmony_ci */ 318461847f8eSopenharmony_ci /** 318561847f8eSopenharmony_ci * A constructor used to create a HolidayManager object. 318661847f8eSopenharmony_ci * 318761847f8eSopenharmony_ci * @param { String } icsPath - the path of the iCalendar format file to create HolidayManager object. 318861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 318961847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 319061847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 319161847f8eSopenharmony_ci * @atomicservice 319261847f8eSopenharmony_ci * @since 12 319361847f8eSopenharmony_ci */ 319461847f8eSopenharmony_ci constructor(icsPath: String); 319561847f8eSopenharmony_ci 319661847f8eSopenharmony_ci /** 319761847f8eSopenharmony_ci * Returns true if the given date is a holiday. If the date is not given, 319861847f8eSopenharmony_ci * the date object of current time is used. 319961847f8eSopenharmony_ci * 320061847f8eSopenharmony_ci * @param { Date } [date] - Date object whose attribute is desired. 320161847f8eSopenharmony_ci * @returns { boolean } whether the date is a holiday day. 320261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 320361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 320461847f8eSopenharmony_ci * @since 11 320561847f8eSopenharmony_ci */ 320661847f8eSopenharmony_ci /** 320761847f8eSopenharmony_ci * Returns true if the given date is a holiday. If the date is not given, 320861847f8eSopenharmony_ci * the date object of current time is used. 320961847f8eSopenharmony_ci * 321061847f8eSopenharmony_ci * @param { Date } [date] - Date object whose attribute is desired. 321161847f8eSopenharmony_ci * @returns { boolean } whether the date is a holiday day. 321261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 321361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 321461847f8eSopenharmony_ci * @atomicservice 321561847f8eSopenharmony_ci * @since 12 321661847f8eSopenharmony_ci */ 321761847f8eSopenharmony_ci isHoliday(date?: Date): boolean; 321861847f8eSopenharmony_ci 321961847f8eSopenharmony_ci /** 322061847f8eSopenharmony_ci * Obtains holiday info array for a specified year 322161847f8eSopenharmony_ci * 322261847f8eSopenharmony_ci * @param { number } [year] - specified holiday year. If the year is not given, 322361847f8eSopenharmony_ci * the current year is used. 322461847f8eSopenharmony_ci * @returns { Array<HolidayInfoItem> } holiday information array for one year. 322561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 322661847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 322761847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 322861847f8eSopenharmony_ci * @since 11 322961847f8eSopenharmony_ci */ 323061847f8eSopenharmony_ci /** 323161847f8eSopenharmony_ci * Obtains holiday info array for a specified year 323261847f8eSopenharmony_ci * 323361847f8eSopenharmony_ci * @param { number } [year] - specified holiday year. If the year is not given, 323461847f8eSopenharmony_ci * the current year is used. 323561847f8eSopenharmony_ci * @returns { Array<HolidayInfoItem> } holiday information array for one year. 323661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 323761847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 323861847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 323961847f8eSopenharmony_ci * @atomicservice 324061847f8eSopenharmony_ci * @since 12 324161847f8eSopenharmony_ci */ 324261847f8eSopenharmony_ci getHolidayInfoItemArray(year?: number): Array<HolidayInfoItem>; 324361847f8eSopenharmony_ci } 324461847f8eSopenharmony_ci 324561847f8eSopenharmony_ci /** 324661847f8eSopenharmony_ci * Provides the informations of one entity. 324761847f8eSopenharmony_ci * 324861847f8eSopenharmony_ci * @interface EntityInfoItem 324961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 325061847f8eSopenharmony_ci * @since 11 325161847f8eSopenharmony_ci */ 325261847f8eSopenharmony_ci /** 325361847f8eSopenharmony_ci * Provides the informations of one entity. 325461847f8eSopenharmony_ci * 325561847f8eSopenharmony_ci * @interface EntityInfoItem 325661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 325761847f8eSopenharmony_ci * @atomicservice 325861847f8eSopenharmony_ci * @since 12 325961847f8eSopenharmony_ci */ 326061847f8eSopenharmony_ci export interface EntityInfoItem { 326161847f8eSopenharmony_ci /** 326261847f8eSopenharmony_ci * Entity begin position. 326361847f8eSopenharmony_ci * 326461847f8eSopenharmony_ci * @type { number } 326561847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 326661847f8eSopenharmony_ci * @since 11 326761847f8eSopenharmony_ci */ 326861847f8eSopenharmony_ci /** 326961847f8eSopenharmony_ci * Entity begin position. 327061847f8eSopenharmony_ci * 327161847f8eSopenharmony_ci * @type { number } 327261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 327361847f8eSopenharmony_ci * @atomicservice 327461847f8eSopenharmony_ci * @since 12 327561847f8eSopenharmony_ci */ 327661847f8eSopenharmony_ci begin: number; 327761847f8eSopenharmony_ci 327861847f8eSopenharmony_ci /** 327961847f8eSopenharmony_ci * Entity end position. 328061847f8eSopenharmony_ci * 328161847f8eSopenharmony_ci * @type { number } 328261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 328361847f8eSopenharmony_ci * @since 11 328461847f8eSopenharmony_ci */ 328561847f8eSopenharmony_ci /** 328661847f8eSopenharmony_ci * Entity end position. 328761847f8eSopenharmony_ci * 328861847f8eSopenharmony_ci * @type { number } 328961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 329061847f8eSopenharmony_ci * @atomicservice 329161847f8eSopenharmony_ci * @since 12 329261847f8eSopenharmony_ci */ 329361847f8eSopenharmony_ci end: number; 329461847f8eSopenharmony_ci 329561847f8eSopenharmony_ci /** 329661847f8eSopenharmony_ci * Entity type. Field values such as phone_number, date 329761847f8eSopenharmony_ci * 329861847f8eSopenharmony_ci * @type { string } 329961847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 330061847f8eSopenharmony_ci * @since 11 330161847f8eSopenharmony_ci */ 330261847f8eSopenharmony_ci /** 330361847f8eSopenharmony_ci * Entity type. Field values such as phone_number, date 330461847f8eSopenharmony_ci * 330561847f8eSopenharmony_ci * @type { string } 330661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 330761847f8eSopenharmony_ci * @atomicservice 330861847f8eSopenharmony_ci * @since 12 330961847f8eSopenharmony_ci */ 331061847f8eSopenharmony_ci type: string; 331161847f8eSopenharmony_ci } 331261847f8eSopenharmony_ci 331361847f8eSopenharmony_ci /** 331461847f8eSopenharmony_ci * Provide some functions to find named entity in text. 331561847f8eSopenharmony_ci * 331661847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 331761847f8eSopenharmony_ci * @since 11 331861847f8eSopenharmony_ci */ 331961847f8eSopenharmony_ci /** 332061847f8eSopenharmony_ci * Provide some functions to find named entity in text. 332161847f8eSopenharmony_ci * 332261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 332361847f8eSopenharmony_ci * @atomicservice 332461847f8eSopenharmony_ci * @since 12 332561847f8eSopenharmony_ci */ 332661847f8eSopenharmony_ci export class EntityRecognizer { 332761847f8eSopenharmony_ci /** 332861847f8eSopenharmony_ci * A constructor used to create a EntityRecognizer object. 332961847f8eSopenharmony_ci * 333061847f8eSopenharmony_ci * @param { string } [locale] - specified the locale. Use current app locale by default. It must be a valid locale. 333161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 333261847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 333361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 333461847f8eSopenharmony_ci * @since 11 333561847f8eSopenharmony_ci */ 333661847f8eSopenharmony_ci /** 333761847f8eSopenharmony_ci * A constructor used to create a EntityRecognizer object. 333861847f8eSopenharmony_ci * 333961847f8eSopenharmony_ci * @param { string } [locale] - specified the locale. Use current app locale by default. It must be a valid locale. 334061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 334161847f8eSopenharmony_ci * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. 334261847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 334361847f8eSopenharmony_ci * @atomicservice 334461847f8eSopenharmony_ci * @since 12 334561847f8eSopenharmony_ci */ 334661847f8eSopenharmony_ci constructor(locale?: string); 334761847f8eSopenharmony_ci 334861847f8eSopenharmony_ci /** 334961847f8eSopenharmony_ci * Obtains holiday info array for a specified text 335061847f8eSopenharmony_ci * 335161847f8eSopenharmony_ci * @param { string } text - the text to find entities. 335261847f8eSopenharmony_ci * @returns { Array<EntityInfoItem> } entity information array found. 335361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 335461847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 335561847f8eSopenharmony_ci * @since 11 335661847f8eSopenharmony_ci */ 335761847f8eSopenharmony_ci /** 335861847f8eSopenharmony_ci * Obtains holiday info array for a specified text 335961847f8eSopenharmony_ci * 336061847f8eSopenharmony_ci * @param { string } text - the text to find entities. 336161847f8eSopenharmony_ci * @returns { Array<EntityInfoItem> } entity information array found. 336261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 336361847f8eSopenharmony_ci * @syscap SystemCapability.Global.I18n 336461847f8eSopenharmony_ci * @atomicservice 336561847f8eSopenharmony_ci * @since 12 336661847f8eSopenharmony_ci */ 336761847f8eSopenharmony_ci findEntityInfo(text: string): Array<EntityInfoItem>; 336861847f8eSopenharmony_ci } 336961847f8eSopenharmony_ci} 337061847f8eSopenharmony_ciexport default i18n; 3371