Parcourir la source

[php] Add externs for `IntlCalendar`, `IntlDateFormatter`, `IntlIterator`, `IntlTimeZone` and `NumberFormatter` classes (#10265)

* [php] Add extern for `NumberFormatter` class

* [php] Add extern for `IntlTimeZone` class

* [php] Add extern for `IntlDateFormatter` class

* [php] Add extern for `IntlIterator` class

* [php] Add extern for `IntlCalendar` class

* [php] Fixed the `IntlTimeZone` externs

* [php] Fixed the `IntlDateFormatter` externs
Cédric Belin il y a 4 ans
Parent
commit
aa1236d24e

+ 120 - 0
std/php/IntlCalendar.hx

@@ -0,0 +1,120 @@
+/*
+ * Copyright (C)2005-2021 Haxe Foundation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package php;
+
+import haxe.extern.EitherType;
+
+/**
+	@see https://www.php.net/manual/en/class.intlcalendar.php
+**/
+@:native("IntlCalendar")
+extern class IntlCalendar {
+	@:phpClassConst static final DOW_FRIDAY: Int;
+	@:phpClassConst static final DOW_MONDAY: Int;
+	@:phpClassConst static final DOW_SATURDAY: Int;
+	@:phpClassConst static final DOW_SUNDAY: Int;
+	@:phpClassConst static final DOW_THURSDAY: Int;
+	@:phpClassConst static final DOW_TUESDAY: Int;
+	@:phpClassConst static final DOW_TYPE_WEEKDAY: Int;
+	@:phpClassConst static final DOW_TYPE_WEEKEND_CEASE: Int;
+	@:phpClassConst static final DOW_TYPE_WEEKEND_OFFSET: Int;
+	@:phpClassConst static final DOW_TYPE_WEEKEND: Int;
+	@:phpClassConst static final DOW_WEDNESDAY: Int;
+	@:phpClassConst static final FIELD_AM_PM: Int;
+	@:phpClassConst static final FIELD_DATE: Int;
+	@:phpClassConst static final FIELD_DAY_OF_MONTH: Int;
+	@:phpClassConst static final FIELD_DAY_OF_WEEK_IN_MONTH: Int;
+	@:phpClassConst static final FIELD_DAY_OF_WEEK: Int;
+	@:phpClassConst static final FIELD_DAY_OF_YEAR: Int;
+	@:phpClassConst static final FIELD_DOW_LOCAL: Int;
+	@:phpClassConst static final FIELD_DST_OFFSET: Int;
+	@:phpClassConst static final FIELD_ERA: Int;
+	@:phpClassConst static final FIELD_EXTENDED_YEAR: Int;
+	@:phpClassConst static final FIELD_FIELD_COUNT: Int;
+	@:phpClassConst static final FIELD_HOUR_OF_DAY: Int;
+	@:phpClassConst static final FIELD_HOUR: Int;
+	@:phpClassConst static final FIELD_IS_LEAP_MONTH: Int;
+	@:phpClassConst static final FIELD_JULIAN_DAY: Int;
+	@:phpClassConst static final FIELD_MILLISECOND: Int;
+	@:phpClassConst static final FIELD_MILLISECONDS_IN_DAY: Int;
+	@:phpClassConst static final FIELD_MINUTE: Int;
+	@:phpClassConst static final FIELD_MONTH: Int;
+	@:phpClassConst static final FIELD_SECOND: Int;
+	@:phpClassConst static final FIELD_WEEK_OF_MONTH: Int;
+	@:phpClassConst static final FIELD_WEEK_OF_YEAR: Int;
+	@:phpClassConst static final FIELD_YEAR_WOY: Int;
+	@:phpClassConst static final FIELD_YEAR: Int;
+	@:phpClassConst static final FIELD_ZONE_OFFSET: Int;
+	@:phpClassConst static final WALLTIME_FIRST: Int;
+	@:phpClassConst static final WALLTIME_LAST: Int;
+	@:phpClassConst static final WALLTIME_NEXT_VALID: Int;
+
+	static function createInstance(timeZone: EitherType<Null<String>, EitherType<DateTimeZone, IntlTimeZone>> = null, locale: Null<String> = ""): Null<IntlCalendar>;
+	static function fromDateTime(dateTime: EitherType<DateTime, String>): Null<IntlCalendar>;
+	static function getAvailableLocales(): NativeIndexedArray<String>;
+	static function getKeywordValuesForLocale(key: String, locale: String, commonlyUsed: Bool): EitherType<NativeIterator<Int, String>, Bool>;
+	static function getNow(): Float;
+
+	function add(field: Int, amount: Int): Bool;
+	function after(other: IntlCalendar): Bool;
+	function before(other: IntlCalendar): Bool;
+	function clear(field: Null<Int> = null): Bool;
+	function equals(other: IntlCalendar): Bool;
+	function fieldDifference(when: Float, field: Int): EitherType<Int, Bool>;
+	function get(field: Int): Int;
+	function getActualMaximum(field: Int): EitherType<Int, Bool>;
+	function getActualMinimum(field: Int): EitherType<Int, Bool>;
+	function getDayOfWeekType(dayOfWeek: Int): EitherType<Int, Bool>;
+	function getErrorCode(): Int;
+	function getErrorMessage(): String;
+	function getFirstDayOfWeek(): EitherType<Int, Bool>;
+	function getGreatestMinimum(field: Int): EitherType<Int, Bool>;
+	function getLeastMaximum(field: Int): EitherType<Int, Bool>;
+	function getLocale(localeType: Int): EitherType<String, Bool>;
+	function getMaximum(field: Int): EitherType<Int, Bool>;
+	function getMinimalDaysInFirstWeek(): EitherType<Int, Bool>;
+	function getMinimum(field: Int): EitherType<Int, Bool>;
+	function getRepeatedWallTimeOption(): Int;
+	function getSkippedWallTimeOption(): Int;
+	function getTime(): Float;
+	function getTimeZone(): IntlTimeZone;
+	function getType(): String;
+	function getWeekendTransition(dayOfWeek: Int): EitherType<Int, Bool>;
+	function inDaylightTime(): Bool;
+	function isEquivalentTo(other: IntlCalendar): Bool;
+	function isLenient(): Bool;
+	function isSet(field: Int): Bool;
+	function isWeekend(date: Null<Float> = null): Bool;
+	function roll(field: Int, amountOrUpOrDown: EitherType<Bool, Int>): Bool;
+	function setFirstDayOfWeek(dayOfWeek: Int): Bool;
+	function setLenient(isLenient: Bool): Bool;
+	function setMinimalDaysInFirstWeek(minimalDays: Int): Bool;
+	function setRepeatedWallTimeOption(wallTimeOption: Int): Bool;
+	function setSkippedWallTimeOption(wallTimeOption: Int): Bool;
+	function setTime(date: Float): Bool;
+	function setTimeZone(timeZone: EitherType<Null<String>, EitherType<DateTimeZone, IntlTimeZone>>): Bool;
+	function toDateTime(): EitherType<DateTime, Bool>;
+
+	@:overload(function(year: Int, month: Int, dayOfMonth: Null<Int> = null, hour: Null<Int> = null, minute: Null<Int> = null, second: Null<Int> = null): Bool {})
+	function set(field: Int, value: Int): Bool;
+}

+ 72 - 0
std/php/IntlDateFormatter.hx

@@ -0,0 +1,72 @@
+/*
+ * Copyright (C)2005-2021 Haxe Foundation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package php;
+
+import haxe.extern.EitherType;
+
+/**
+	@see https://www.php.net/manual/en/class.intldateformatter.php
+**/
+@:native("IntlDateFormatter")
+extern class IntlDateFormatter {
+	@:phpClassConst static final FULL: Int;
+	@:phpClassConst static final GREGORIAN: Int;
+	@:phpClassConst static final LONG: Int;
+	@:phpClassConst static final MEDIUM: Int;
+	@:phpClassConst static final NONE: Int;
+	@:phpClassConst static final RELATIVE_FULL: Int;
+	@:phpClassConst static final RELATIVE_LONG: Int;
+	@:phpClassConst static final RELATIVE_MEDIUM: Int;
+	@:phpClassConst static final RELATIVE_SHORT: Int;
+	@:phpClassConst static final SHORT: Int;
+	@:phpClassConst static final TRADITIONAL: Int;
+
+	function new(locale: Null<String>, dateType: Int, timeType: Int, timezone: EitherType<String, EitherType<DateTimeZone, IntlTimeZone>> = null,
+		calendar: EitherType<Int, IntlCalendar> = null, pattern: String = "");
+
+	static function create(locale: Null<String>, dateType: Int, timeType: Int,
+		timezone: EitherType<String, EitherType<DateTimeZone, IntlTimeZone>> = null,
+		calendar: EitherType<Int, IntlCalendar> = null, pattern: String = ""): Null<IntlDateFormatter>;
+
+	static function formatObject(datetime: EitherType<IntlCalendar, DateTime>, format: EitherType<Int, EitherType<NativeIndexedArray<Int>, String>> = null,
+		locale: String = null): EitherType<String, Bool>;
+
+	function format(datetime: EitherType<Int, EitherType<Float, EitherType<String, EitherType<DateTimeInterface, EitherType<IntlCalendar, NativeAssocArray<Int>>>>>>): EitherType<String, Bool>;
+	function getCalendar(): EitherType<Int, Bool>;
+	function getCalendarObject(): EitherType<Null<IntlCalendar>, Bool>;
+	function getDateType(): EitherType<Int, Bool>;
+	function getErrorCode(): Int;
+	function getErrorMessage(): String;
+	function getLocale(?type: Int): EitherType<String, Bool>;
+	function getPattern(): EitherType<String, Bool>;
+	function getTimeType(): EitherType<Int, Bool>;
+	function getTimeZone(): EitherType<IntlTimeZone, Bool>;
+	function getTimeZoneId(): EitherType<String, Bool>;
+	function isLenient(): Bool;
+	function localtime(string: String, offset: Ref<Int> = null): EitherType<NativeAssocArray<Int>, Bool>;
+	function parse(string: String, offset: Ref<Int> = null): EitherType<Int, EitherType<Float, Bool>>;
+	function setCalendar(calendar: EitherType<Null<IntlCalendar>, Int>): Bool;
+	function setLenient(lenient: Bool): Bool;
+	function setPattern(pattern: String): Bool;
+	function setTimeZone(timezone: EitherType<Null<String>, EitherType<IntlTimeZone, DateTimeZone>>): Null<Bool>;
+}

+ 35 - 0
std/php/IntlIterator.hx

@@ -0,0 +1,35 @@
+/*
+ * Copyright (C)2005-2021 Haxe Foundation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package php;
+
+/**
+	@see https://www.php.net/manual/en/class.intliterator.php
+**/
+@:native("IntlIterator")
+extern class IntlIterator<K, V> implements NativeIterator<K, V> {
+	function current(): V;
+	function key(): K;
+	function next(): Void;
+	function rewind(): Void;
+	function valid(): Bool;
+}

+ 60 - 0
std/php/IntlTimeZone.hx

@@ -0,0 +1,60 @@
+/*
+ * Copyright (C)2005-2021 Haxe Foundation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package php;
+
+import haxe.extern.EitherType;
+
+/**
+	@see https://www.php.net/manual/en/class.intltimezone.php
+**/
+@:native("IntlTimeZone")
+extern class IntlTimeZone {
+	@:phpClassConst static final DISPLAY_LONG: Int;
+	@:phpClassConst static final DISPLAY_SHORT: Int;
+
+	static function countEquivalentIDs(zoneId: String): Int;
+	static function createDefault(): IntlTimeZone;
+	static function createEnumeration(countryOrRawOffset: Any): IntlIterator<Int, String>;
+	static function createTimeZone(zoneId: String): IntlTimeZone;
+	static function createTimeZoneIDEnumeration(zoneType: Int, ?region: String, ?rawOffset: Int): EitherType<IntlIterator<Int, String>, Bool>;
+	static function fromDateTimeZone(zoneId: DateTimeZone): IntlTimeZone;
+	static function getCanonicalID(zoneId: String, isSystemID: Ref<Bool>): String;
+	static function getEquivalentID(zoneId: String, index: Int): String;
+	static function getGMT(): IntlTimeZone;
+	static function getIDForWindowsID(timezone: String, ?region: String): EitherType<String, Bool>;
+	static function getRegion(zoneId: String): EitherType<String, Bool>;
+	static function getTZDataVersion(): String;
+	static function getUnknown(): Null<IntlTimeZone>;
+	static function getWindowsID(timezone: String): EitherType<String, Bool>;
+
+	function getDisplayName(?isDaylight: Bool, ?style: Int, ?locale: String): String;
+	function getDSTSavings(): Int;
+	function getErrorCode(): Int;
+	function getErrorMessage(): String;
+	function getID(): String;
+	function getOffset(date: Float, local: Bool, rawOffset: Ref<Int>, dstOffset: Ref<Int>): Bool;
+	function getRawOffset(): Int;
+	function hasSameRules(otherTimeZone: IntlTimeZone): Bool;
+	function toDateTimeZone(): DateTimeZone;
+	function useDaylightTime(): Bool;
+}

+ 126 - 0
std/php/NumberFormatter.hx

@@ -0,0 +1,126 @@
+/*
+ * Copyright (C)2005-2021 Haxe Foundation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package php;
+
+import haxe.extern.EitherType;
+
+/**
+	@see https://www.php.net/manual/en/class.numberformatter.php
+**/
+@:native("NumberFormatter")
+extern class NumberFormatter {
+	@:phpClassConst static final CURRENCY: Int;
+	@:phpClassConst static final CURRENCY_ACCOUNTING: Int;
+	@:phpClassConst static final CURRENCY_CODE: Int;
+	@:phpClassConst static final CURRENCY_SYMBOL: Int;
+	@:phpClassConst static final DECIMAL: Int;
+	@:phpClassConst static final DECIMAL_ALWAYS_SHOWN: Int;
+	@:phpClassConst static final DECIMAL_SEPARATOR_SYMBOL: Int;
+	@:phpClassConst static final DEFAULT_RULESET: Int;
+	@:phpClassConst static final DEFAULT_STYLE: Int;
+	@:phpClassConst static final DIGIT_SYMBOL: Int;
+	@:phpClassConst static final DURATION: Int;
+	@:phpClassConst static final EXPONENTIAL_SYMBOL: Int;
+	@:phpClassConst static final FORMAT_WIDTH: Int;
+	@:phpClassConst static final FRACTION_DIGITS: Int;
+	@:phpClassConst static final GROUPING_SEPARATOR_SYMBOL: Int;
+	@:phpClassConst static final GROUPING_SIZE: Int;
+	@:phpClassConst static final GROUPING_USED: Int;
+	@:phpClassConst static final IGNORE: Int;
+	@:phpClassConst static final INFINITY_SYMBOL: Int;
+	@:phpClassConst static final INTEGER_DIGITS: Int;
+	@:phpClassConst static final INTL_CURRENCY_SYMBOL: Int;
+	@:phpClassConst static final LENIENT_PARSE: Int;
+	@:phpClassConst static final MAX_FRACTION_DIGITS: Int;
+	@:phpClassConst static final MAX_INTEGER_DIGITS: Int;
+	@:phpClassConst static final MAX_SIGNIFICANT_DIGITS: Int;
+	@:phpClassConst static final MIN_FRACTION_DIGITS: Int;
+	@:phpClassConst static final MIN_INTEGER_DIGITS: Int;
+	@:phpClassConst static final MIN_SIGNIFICANT_DIGITS: Int;
+	@:phpClassConst static final MINUS_SIGN_SYMBOL: Int;
+	@:phpClassConst static final MONETARY_GROUPING_SEPARATOR_SYMBOL: Int;
+	@:phpClassConst static final MONETARY_SEPARATOR_SYMBOL: Int;
+	@:phpClassConst static final MULTIPLIER: Int;
+	@:phpClassConst static final NAN_SYMBOL: Int;
+	@:phpClassConst static final NEGATIVE_PREFIX: Int;
+	@:phpClassConst static final NEGATIVE_SUFFIX: Int;
+	@:phpClassConst static final ORDINAL: Int;
+	@:phpClassConst static final PAD_AFTER_PREFIX: Int;
+	@:phpClassConst static final PAD_AFTER_SUFFIX: Int;
+	@:phpClassConst static final PAD_BEFORE_PREFIX: Int;
+	@:phpClassConst static final PAD_BEFORE_SUFFIX: Int;
+	@:phpClassConst static final PAD_ESCAPE_SYMBOL: Int;
+	@:phpClassConst static final PADDING_CHARACTER: Int;
+	@:phpClassConst static final PADDING_POSITION: Int;
+	@:phpClassConst static final PARSE_INT_ONLY: Int;
+	@:phpClassConst static final PATTERN_DECIMAL: Int;
+	@:phpClassConst static final PATTERN_RULEBASED: Int;
+	@:phpClassConst static final PATTERN_SEPARATOR_SYMBOL: Int;
+	@:phpClassConst static final PERCENT: Int;
+	@:phpClassConst static final PERCENT_SYMBOL: Int;
+	@:phpClassConst static final PERMILL_SYMBOL: Int;
+	@:phpClassConst static final PLUS_SIGN_SYMBOL: Int;
+	@:phpClassConst static final POSITIVE_PREFIX: Int;
+	@:phpClassConst static final POSITIVE_SUFFIX: Int;
+	@:phpClassConst static final PUBLIC_RULESETS: Int;
+	@:phpClassConst static final ROUND_CEILING: Int;
+	@:phpClassConst static final ROUND_DOWN: Int;
+	@:phpClassConst static final ROUND_FLOOR: Int;
+	@:phpClassConst static final ROUND_HALFDOWN: Int;
+	@:phpClassConst static final ROUND_HALFEVEN: Int;
+	@:phpClassConst static final ROUND_HALFUP: Int;
+	@:phpClassConst static final ROUND_UP: Int;
+	@:phpClassConst static final ROUNDING_INCREMENT: Int;
+	@:phpClassConst static final ROUNDING_MODE: Int;
+	@:phpClassConst static final SCIENTIFIC: Int;
+	@:phpClassConst static final SECONDARY_GROUPING_SIZE: Int;
+	@:phpClassConst static final SIGNIFICANT_DIGIT_SYMBOL: Int;
+	@:phpClassConst static final SIGNIFICANT_DIGITS_USED: Int;
+	@:phpClassConst static final SPELLOUT: Int;
+	@:phpClassConst static final TYPE_CURRENCY: Int;
+	@:phpClassConst static final TYPE_DEFAULT: Int;
+	@:phpClassConst static final TYPE_DOUBLE: Int;
+	@:phpClassConst static final TYPE_INT32: Int;
+	@:phpClassConst static final TYPE_INT64: Int;
+	@:phpClassConst static final ZERO_DIGIT_SYMBOL: Int;
+
+	function new(locale: String, style: Int, ?pattern: String);
+
+	static function create(locale: String, style: Int, ?pattern: String): EitherType<NumberFormatter, Bool>;
+
+	function formatCurrency(value: Float, currency: String): EitherType<String, Bool>;
+	function format(value: EitherType<Int, Float>, ?type: Int): EitherType<String, Bool>;
+	function getAttribute(attr: Int): EitherType<Int, Bool>;
+	function getErrorCode(): Int;
+	function getErrorMessage(): String;
+	function getLocale(?type: Int): String;
+	function getPattern(): EitherType<String, Bool>;
+	function getSymbol(attr: Int): EitherType<String, Bool>;
+	function getTextAttribute(attr: Int): EitherType<String, Bool>;
+	function parseCurrency(value: String, currency: Ref<String>, ?position: Ref<Int>): EitherType<Float, Bool>;
+	function parse(value: String, ?type: Int, ?position: Ref<Int>): EitherType<Int, EitherType<Float, EitherType<String, Bool>>>;
+	function setAttribute(attr: Int, value: Int): Bool;
+	function setPattern(pattern: String): Bool;
+	function setSymbol(attr: Int, value: String): Bool;
+	function setTextAttribute(attr: Int, value: String): Bool;
+}