react-native-nitro-input 0.3.7 → 0.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -69,6 +69,37 @@ export interface NumberFormatPart {
69
69
  value: string
70
70
  }
71
71
 
72
+ /**
73
+ * One value as `NitroNumber` rolls it: the figure its digits show, rounded and
74
+ * trimmed as the format prints it, and the text around it.
75
+ */
76
+ export interface NumberFigure {
77
+ /** The figure as the digits show it, signed: 1.2 for "1.2K", 2.12 for "$2.12"; 0 (never -0) when it rounds to nothing, or for NaN and infinities. */
78
+ value: number
79
+ /** The fraction digits this value shows ("$1,234" 0, "$1,234.50" 2); the format's maximum for NaN and infinities. */
80
+ fractionDigits: number
81
+ /** The text before the number, without the sign. */
82
+ prefix: string
83
+ /** The text after the number, without the sign. */
84
+ suffix: string
85
+ }
86
+
87
+ /** The shape of a format, as `NitroNumber` and `NitroInput` lay a number out. */
88
+ export interface NumberFormatLayout {
89
+ prefix: string
90
+ suffix: string
91
+ /** Empty when the format does not group. */
92
+ groupingSeparator: string
93
+ decimalSeparator: string
94
+ /** A negative amount's sign comes after the prefix ("$-5"), not before it ("-$5"). */
95
+ signAfterAffix: boolean
96
+ minusSign: string
97
+ /** The group nearest the decimal point and every one before it ([3, 2]: 12,34,567). */
98
+ groupingSizes: number[]
99
+ /** The format's digits 0…9, or empty for Latin ones. */
100
+ digitGlyphs: string[]
101
+ }
102
+
72
103
  /**
73
104
  * A number formatter with the API of `Intl.NumberFormat`. It learns a
74
105
  * locale's format once from the platform (Foundation on iOS, ICU on Android)
@@ -80,6 +111,10 @@ export interface NitroNumberFormat extends HybridObject<{ ios: 'c++'; android: '
80
111
  format(value: number | Int64 | string): string
81
112
  formatToParts(value: number | Int64 | string): NumberFormatPart[]
82
113
  resolvedOptions(): ResolvedNumberFormatOptions
114
+ /** For the components, not part of `Intl.NumberFormat`: what `value` shows, as a figure. */
115
+ figure(value: number | Int64 | string): NumberFigure
116
+ /** For the components, not part of `Intl.NumberFormat`: the shape of the format. */
117
+ layout(): NumberFormatLayout
83
118
  }
84
119
 
85
120
  export interface NitroNumberFormatFactory extends HybridObject<{ ios: 'c++'; android: 'c++' }> {