2016-03-13 16:08:39 +08:00
|
|
|
import {Plugin, Cordova} from './plugin';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name Globalization
|
|
|
|
* @description
|
|
|
|
* @usage
|
2016-03-25 01:00:18 +08:00
|
|
|
* ```js
|
|
|
|
* import {Globalization} from 'ionic-native';
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* ```
|
2016-03-13 16:08:39 +08:00
|
|
|
*/
|
|
|
|
@Plugin({
|
2016-04-30 11:56:49 +08:00
|
|
|
plugin: 'cordova-plugin-globalization',
|
|
|
|
pluginRef: 'navigator.globalization',
|
2016-06-16 06:17:02 +08:00
|
|
|
repo: 'https://github.com/apache/cordova-plugin-globalization'
|
2016-03-13 16:08:39 +08:00
|
|
|
})
|
|
|
|
export class Globalization {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the BCP-47 compliant language identifier tag to the successCallback with a properties object as a parameter. That object should have a value property with a String value.
|
2016-04-30 11:56:49 +08:00
|
|
|
* @return {Promise<{value: string}>}
|
2016-03-13 16:08:39 +08:00
|
|
|
*/
|
|
|
|
@Cordova()
|
2016-04-30 11:56:49 +08:00
|
|
|
static getPreferredLanguage(): Promise<{value: string}> {return; }
|
2016-03-13 16:08:39 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the BCP 47 compliant locale identifier string to the successCallback with a properties object as a parameter.
|
2016-04-30 11:56:49 +08:00
|
|
|
* @return {Promise<{value: string}>}
|
2016-03-13 16:08:39 +08:00
|
|
|
*/
|
|
|
|
@Cordova()
|
2016-04-30 11:56:49 +08:00
|
|
|
static getLocaleName(): Promise<{value: string}> {return; }
|
2016-03-13 16:08:39 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Converts date to string
|
|
|
|
* @param date
|
|
|
|
* @param options
|
2016-04-30 11:56:49 +08:00
|
|
|
* @return {Promise<{value: string}>}
|
2016-03-13 16:08:39 +08:00
|
|
|
*/
|
|
|
|
@Cordova({
|
2016-04-30 11:56:49 +08:00
|
|
|
successIndex: 1,
|
|
|
|
errorIndex: 2
|
2016-03-13 16:08:39 +08:00
|
|
|
})
|
2016-04-30 11:56:49 +08:00
|
|
|
static dateToString(date: Date, options: {formatLength: string, selector: string}): Promise<{value: string}> {return; }
|
2016-03-13 16:08:39 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param dateString
|
|
|
|
* @param options
|
|
|
|
*/
|
|
|
|
@Cordova({
|
2016-04-30 11:56:49 +08:00
|
|
|
successIndex: 1,
|
|
|
|
errorIndex: 2
|
2016-03-13 16:08:39 +08:00
|
|
|
})
|
2016-04-30 11:56:49 +08:00
|
|
|
static stringToDate(dateString: string, options: {formatLength: string, selector: string}): Promise<{year: number, month: number, day: number, hour: number, minute: number, second: number, millisecond: number}> {return; }
|
2016-03-13 16:08:39 +08:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param options
|
|
|
|
*/
|
|
|
|
@Cordova({
|
2016-04-30 11:56:49 +08:00
|
|
|
callbackOrder: 'reverse'
|
2016-03-13 16:08:39 +08:00
|
|
|
})
|
2016-04-30 11:56:49 +08:00
|
|
|
static getDatePattern(options: {formatLength: string, selector: string}): Promise<{pattern: string}> {return; }
|
2016-03-13 16:08:39 +08:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param options
|
|
|
|
*/
|
|
|
|
@Cordova({
|
2016-04-30 11:56:49 +08:00
|
|
|
callbackOrder: 'reverse'
|
2016-03-13 16:08:39 +08:00
|
|
|
})
|
2016-04-30 11:56:49 +08:00
|
|
|
static getDateNames(options: {type: string, item: string}): Promise<{value: Array<string>}> {return; }
|
2016-03-13 16:08:39 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Check if day light saving is active
|
|
|
|
* @param date
|
|
|
|
*/
|
|
|
|
@Cordova()
|
2016-04-30 11:56:49 +08:00
|
|
|
static isDayLightSavingsTime(date: Date): Promise<{dst: string}> {return; }
|
2016-03-13 16:08:39 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get first day of week
|
|
|
|
*/
|
|
|
|
@Cordova()
|
2016-04-30 11:56:49 +08:00
|
|
|
static getFirstDayOfWeek(): Promise<{value: string}> {return; }
|
2016-03-13 16:08:39 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param options
|
|
|
|
*/
|
|
|
|
@Cordova({
|
2016-04-30 11:56:49 +08:00
|
|
|
successIndex: 1,
|
|
|
|
errorIndex: 2
|
2016-03-13 16:08:39 +08:00
|
|
|
})
|
2016-04-30 11:56:49 +08:00
|
|
|
static numberToString(options: {type: string}): Promise<{value: string}> {return; }
|
2016-03-13 16:08:39 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
2016-04-30 11:56:49 +08:00
|
|
|
* @param stringToConvert
|
2016-03-13 16:08:39 +08:00
|
|
|
* @param options
|
|
|
|
*/
|
|
|
|
@Cordova({
|
2016-04-30 11:56:49 +08:00
|
|
|
successIndex: 1,
|
|
|
|
errorIndex: 2
|
2016-03-13 16:08:39 +08:00
|
|
|
})
|
2016-06-01 18:56:04 +08:00
|
|
|
static stringToNumber(stringToConvert: string, options: {type: string}): Promise<{value: number|string}> {return; }
|
2016-03-13 16:08:39 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param options
|
|
|
|
*/
|
|
|
|
@Cordova({
|
2016-04-30 11:56:49 +08:00
|
|
|
callbackOrder: 'reverse'
|
2016-03-13 16:08:39 +08:00
|
|
|
})
|
2016-04-30 11:56:49 +08:00
|
|
|
static getNumberPattern(options: {type: string}): Promise<{pattern: string, symbol: string, fraction: number, rounding: number, positive: string, negative: string, decimal: string, grouping: string}> {return; }
|
2016-03-13 16:08:39 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param currencyCode
|
|
|
|
*/
|
|
|
|
@Cordova()
|
2016-04-30 11:56:49 +08:00
|
|
|
static getCurrencyPattern(currencyCode: string): Promise<{pattern: string, code: string, fraction: number, rounding: number, decimal: number, grouping: string}> {return; }
|
2016-03-13 16:08:39 +08:00
|
|
|
|
2016-06-16 06:17:02 +08:00
|
|
|
}
|