intl.js (5161B)
1 /* 2 * Copyright 2013 The Closure Compiler Authors 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 /** 18 * @fileoverview Definitions for the JS Internationalization API as defined in 19 * http://www.ecma-international.org/ecma-402/1.0/ 20 * 21 * @externs 22 */ 23 24 /** @const */ 25 var Intl = {}; 26 27 /** 28 * NOTE: this API is not from ecma402 and is subject to change. 29 * @param {string|Array.<string>=} opt_locales 30 * @param {{type: (string|undefined)}=} 31 * opt_options 32 * @constructor 33 */ 34 Intl.v8BreakIterator = function(opt_locales, opt_options) {}; 35 36 /** 37 * @param {string} text 38 */ 39 Intl.v8BreakIterator.prototype.adoptText = function(text) {}; 40 41 /** 42 * @return {string} 43 */ 44 Intl.v8BreakIterator.prototype.breakType = function() {}; 45 46 /** 47 * @return {number} 48 */ 49 Intl.v8BreakIterator.prototype.current = function() {}; 50 51 /** 52 * @return {number} 53 */ 54 Intl.v8BreakIterator.prototype.first = function() {}; 55 56 /** 57 * @return {number} 58 */ 59 Intl.v8BreakIterator.prototype.next = function() {}; 60 61 /** 62 * @constructor 63 * @param {string|Array.<string>=} opt_locales 64 * @param {{usage: (string|undefined), localeMatcher: (string|undefined), 65 * sensitivity: (string|undefined), ignorePunctuation: (boolean|undefined), 66 * numeric: (boolean|undefined), caseFirst: (string|undefined)}=} 67 * opt_options 68 */ 69 Intl.Collator = function(opt_locales, opt_options) {}; 70 71 /** 72 * @param {Array.<string>} locales 73 * @param {{localeMatcher: (string|undefined)}=} opt_options 74 */ 75 Intl.Collator.supportedLocalesOf = function(locales, opt_options) {}; 76 77 /** 78 * @param {string} arg1 79 * @param {string} arg2 80 * @return {number} 81 */ 82 Intl.Collator.prototype.compare = function(arg1, arg2) {}; 83 84 /** 85 * @return {{locale: string, usage: string, sensitivity: string, 86 * ignorePunctuation: boolean, collation: string, numeric: boolean, 87 * caseFirst: string}} 88 */ 89 Intl.Collator.prototype.resolvedOptions = function() {}; 90 91 /** 92 * @constructor 93 * @param {string|Array.<string>=} opt_locales 94 * @param {{localeMatcher: (string|undefined), useGrouping: (boolean|undefined), 95 * numberingSystem: (string|undefined), style: (string|undefined), 96 * currency: (string|undefined), currencyDisplay: (string|undefined), 97 * minimumIntegerDigits: (number|undefined), 98 * minimumFractionDigits: (number|undefined), 99 * maximumFractionDigits: (number|undefined), 100 * minimumSignificantDigits: (number|undefined), 101 * maximumSignificantDigits: (number|undefined)}=} 102 * opt_options 103 */ 104 Intl.NumberFormat = function(opt_locales, opt_options) {}; 105 106 /** 107 * @param {Array.<string>} locales 108 * @param {{localeMatcher: (string|undefined)}=} opt_options 109 */ 110 Intl.NumberFormat.supportedLocalesOf = function(locales, opt_options) {}; 111 112 /** 113 * @param {number} num 114 * @return {string} 115 */ 116 Intl.NumberFormat.prototype.format = function(num) {}; 117 118 /** 119 * @return {{locale: string, numberingSystem: string, style: string, 120 * currency: (string|undefined), currencyDisplay: (string|undefined), 121 * minimumIntegerDigits: number, minimumFractionDigits: number, 122 * maximumFractionDigits: number, minimumSignificantDigits: number, 123 * maximumSignificantDigits: number, useGrouping: boolean}} 124 */ 125 Intl.NumberFormat.prototype.resolvedOptions = function() {}; 126 127 /** 128 * @constructor 129 * @param {string|Array.<string>=} opt_locales 130 * @param {{localeMatcher: (string|undefined), 131 * formatMatcher: (string|undefined), calendar: (string|undefined), 132 * numberingSystem: (string|undefined), tz: (string|undefined), 133 * weekday: (string|undefined), era: (string|undefined), 134 * year: (string|undefined), month: (string|undefined), 135 * day: (string|undefined), hour: (string|undefined), 136 * minute: (string|undefined), second: (string|undefined), 137 * timeZoneName: (string|undefined), hour12: (boolean|undefined)}=} 138 * opt_options 139 */ 140 Intl.DateTimeFormat = function(opt_locales, opt_options) {}; 141 142 /** 143 * @param {Array.<string>} locales 144 * @param {{localeMatcher: string}=} opt_options 145 */ 146 Intl.DateTimeFormat.supportedLocalesOf = function(locales, opt_options) {}; 147 148 /** 149 * @param {number} date 150 * @return {string} 151 */ 152 Intl.DateTimeFormat.prototype.format = function(date) {}; 153 154 /** 155 * @return {{locale: string, calendar: string, numberingSystem: string, 156 * timeZone: (string|undefined), weekday: (string|undefined), 157 * era: (string|undefined), year: (string|undefined), 158 * month: (string|undefined), day: (string|undefined), 159 * hour: (string|undefined), minute: (string|undefined), 160 * second: (string|undefined), timeZoneName: (string|undefined), 161 * hour12: (boolean|undefined)}} 162 */ 163 Intl.DateTimeFormat.prototype.resolvedOptions = function() {};