Skip to content

Commit adb4f79

Browse files
dmihaylotsvetomir
authored andcommitted
docs: update src files
1 parent 202baf4 commit adb4f79

File tree

4 files changed

+66
-62
lines changed

4 files changed

+66
-62
lines changed

src/cldr.d.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
*/
44
export interface DateFormatNameOptions {
55
/**
6-
* Specifies the type of names.
6+
* Specifies the type of the names.
77
*/
88
type: 'dayPeriods' | 'days' | 'months' | 'quarters' | 'eras';
99

1010
/**
11-
* Specifies the names form.
11+
* Specifies the form of the names.
1212
*/
1313
nameType: 'abbreviated' | 'narrow' | 'short' | 'wide';
1414

1515
/**
16-
* Specifies if the returned names should be converted to lower case.
16+
* Specifies whether the returned names should be converted to lower case.
1717
*/
1818
lower?: boolean;
1919

@@ -26,14 +26,14 @@ export interface DateFormatNameOptions {
2626
/**
2727
* Returns the names from the specified locale based on the options.
2828
*
29-
* @param locale The locale id which defines the locale from which the names should be retrieved.
30-
* @param options The options that determine the returned names.
31-
* @returns The date format names.
29+
* @param locale - The locale `id` which defines the locale from which the names should be retrieved.
30+
* @param options - The options that determine the returned names.
31+
* @returns - The date format names.
3232
*/
3333
export function dateFormatNames(locale: string, options: DateFormatNameOptions): any;
3434

3535
/**
36-
* Settings for the dateFieldName function.
36+
* Settings for the `dateFieldName` function.
3737
*/
3838
export interface DateFieldNameOptions {
3939
/**
@@ -60,7 +60,7 @@ export interface DateFieldNameOptions {
6060
}
6161

6262
/**
63-
* Returns a localized date field name based on a specific format specifier.
63+
* Returns a localized date-field name based on a specific format specifier.
6464
*
6565
* The available `type` values are:
6666
* - `era`
@@ -80,9 +80,9 @@ export interface DateFieldNameOptions {
8080
* - `narrow`
8181
* - `short`
8282
*
83-
* @param options Detailed configuration for the desired date field name.
84-
* @param locale The optional locale id. If not specified, the `"en"` locale id is used.
85-
* @returns The localized date field name from the current locale based on the option.
83+
* @param options - Detailed configuration for the desired date-field name.
84+
* @param locale - The optional locale `id`. If not specified, the `id` of the `"en"` locale is used.
85+
* @returns - The localized date-field name from the current locale based on the option.
8686
*
8787
*
8888
* @example
@@ -96,25 +96,25 @@ export interface DateFieldNameOptions {
9696
export function dateFieldName(options: DateFieldNameOptions, locale?: string): string;
9797

9898
/**
99-
* Returns the first day index starting from Sunday based on the specified locale.
99+
* Returns the first-day index starting from Sunday and based on the specified locale.
100100
*
101-
* @param locale The locale id.
102-
* @returns The first day index.
101+
* @param locale - The locale `id`.
102+
* @returns - The first-day index.
103103
*/
104104
export function firstDay(locale: string): number;
105105

106106
/**
107107
* Loads CLDR data.
108108
*
109-
* @param data The CLDR data to be loaded. Accepts multiple parameters.
109+
* @param data - The CLDR data to be loaded. Accepts multiple parameters.
110110
*/
111111
export function load(...data: any[]): void;
112112

113113
/**
114114
* Returns the number symbols from the specified locale.
115115
*
116-
* @param locale The locale id which defines the locale for which the number symbols should be returned.
117-
* @returns The number symbols.
116+
* @param locale - The locale `id` that defines the locale for which the number symbols should be returned.
117+
* @returns - The number symbols.
118118
*/
119119
export function numberSymbols(locale: string): any;
120120

src/dates.d.ts

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
import { DateFormatNameOptions } from './cldr';
22

33
/**
4-
* Settings for the formatDate and parseDate functions.
4+
* Settings for the `formatDate` and `parseDate` functions.
55
*/
66
export interface DateFormatOptions {
77
/**
8-
* Defines the skeleton format used to get the pattern from the locale calendar [`availableFormats`](http://www.unicode.org/reports/tr35/tr35-dates.html#availableFormats_appendItems).
8+
* Defines the skeleton format that is used to get the pattern from the
9+
* [`availableFormats`](http://www.unicode.org/reports/tr35/tr35-dates.html#availableFormats_appendItems) of the locale calendar.
910
*/
1011
skeleton?: string;
1112

1213
/**
13-
* Defines the exact pattern to be used to format the date.
14+
* Defines the exact pattern that will be used to format the date.
1415
*/
1516
pattern?: string;
1617

@@ -30,7 +31,7 @@ export interface DateFormatOptions {
3031
datetime?: 'short' | 'medium' | 'long' | 'full';
3132

3233
/**
33-
* Specifies how should the date era be formatted.
34+
* Specifies how the date era should be formatted.
3435
*/
3536
era?: 'narrow' | 'short' | 'long';
3637

@@ -60,7 +61,7 @@ export interface DateFormatOptions {
6061
hour?: 'numeric' | '2-digit';
6162

6263
/**
63-
* Specifies if a 12-hour time set should be used for the formatting.
64+
* Specifies whether a 12-hour time-set should be used for the formatting.
6465
*/
6566
hour12?: boolean;
6667

@@ -75,28 +76,28 @@ export interface DateFormatOptions {
7576
second?: 'numeric' | '2-digit';
7677

7778
/**
78-
* Specifies how the timezone should be formatted.
79+
* Specifies how the time-zone should be formatted.
7980
*/
8081
timeZoneName?: 'short' | 'long';
8182
}
8283

8384
/**
8485
* Converts a `Date` object to a string based on the specified format and locale.
8586
*
86-
* @param value Defines the date to be formatted.
87-
* @param format Defines a string representing a predefined or custom date format, or a configuration object.
88-
* @param locale The optional locale id. If not specified, the `"en"` locale id is used.
89-
* @returns The formatted date.
87+
* @param value - Defines the date that will be formatted.
88+
* @param format - Defines a string that represents a predefined or custom date format, or a configuration object.
89+
* @param locale - The optional locale `id`. If not specified, the `id` of the `"en"` locale is used.
90+
* @returns - The formatted date.
9091
*/
9192
export function formatDate(value: Date, format: string|DateFormatOptions, locale?: string): string;
9293

9394
/**
9495
* Converts a string to a `Date` object based on the specified format and locale.
9596
*
96-
* @param value Defines the string to be parsed.
97-
* @param format Defines a string representing a predefined or custom date format, a configuration object, or an array of formats that should be used to parse the value.
98-
* @param locale The optional locale id. If not specified, the `"en"` locale id is used.
99-
* @returns The parsed date.
97+
* @param value - Defines the string that will be parsed.
98+
* @param format - Defines a string that represents a predefined or custom date format, a configuration object, or an array of formats that should be used to parse the value.
99+
* @param locale - The optional locale `id`. If not specified, the `id` of the `"en"` locale is used.
100+
* @returns - The parsed date.
100101
*/
101102
export function parseDate(value: string, format?: string | DateFormatOptions | string[] | DateFormatOptions[], locale?: string): Date;
102103

@@ -121,10 +122,10 @@ export interface DateFormatPart {
121122
}
122123

123124
/**
124-
* Splits the date format into objects containing information about each part of the pattern.
125+
* Splits the date format into objects that contain information about each part of the pattern.
125126
*
126-
* @param format The format string or options.
127-
* @param locale The optional locale id. If not specified, the `"en"` locale id is used.
128-
* @returns The date format parts.
127+
* @param format - The format string or options.
128+
* @param locale - The optional locale `id`. If not specified, the `id` of the `"en"` locale is used.
129+
* @returns - The date format parts.
129130
*/
130131
export function splitDateFormat(format: string|DateFormatOptions, locale?: string): DateFormatPart[];

src/format.d.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
/**
22
* Formats dates and numbers based on the specified format and locale.
33
*
4-
* @param value The value to be formatted.
5-
* @param format A string representing a predefined or custom date or number format, or a configuration object.
6-
* @param locale The optional locale id. If not specified, the `"en"` locale id is used.
7-
* @returns The formatted value.
4+
* @param value - The value that will be formatted.
5+
* @param format - A string that represents a predefined or custom date or number format, or a configuration object.
6+
* @param locale - The optional locale `id`. If not specified, the `id` of the `"en"` locale is used.
7+
* @returns - The formatted value.
88
*/
99
export function toString(value: string | Date | number, format: string | any, locale?: string): string;
1010

1111
/**
1212
* Replaces the format string placeholders with the provided values based on the index.
1313
*
14-
* @param format The format string.
15-
* @param values The values that should be replaced in the format string.
16-
* @param locale The optional locale id. If not specified, the `"en"` locale id is used.
17-
* @returns The format string with replaced formatted values.
14+
* @param format - The format string.
15+
* @param values - The values that should be replaced in the format string.
16+
* @param locale - The optional locale `id`. If not specified, the `id` of the `"en"` locale is used.
17+
* @returns - The format string with replaced formatted values.
1818
*/
1919
export function format(format: string, values: any[], locale?: string): string;

src/numbers.d.ts

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Settings for the formatNumber and parseNumber functions.
2+
* Settings for the `formatNumber` and `parseNumber` functions.
33
*/
44
export interface NumberFormatOptions {
55

@@ -9,7 +9,8 @@ export interface NumberFormatOptions {
99
style?: 'decimal' | 'currency' | 'percent' | 'scientific';
1010

1111
/**
12-
* Defines the currency code of the currency used in the formatting. If not specified, the default currency for the locale is used.
12+
* Defines the currency code of the currency that is used in the formatting.
13+
* If not specified, the default currency for the locale is used.
1314
*/
1415
currency?: string;
1516

@@ -24,42 +25,44 @@ export interface NumberFormatOptions {
2425
useGrouping?: boolean;
2526

2627
/**
27-
* Defines the minimum number of integer digits to be used in the formatting.
28+
* Defines the minimum number of integer digits that will be used in the formatting.
2829
*/
2930
minimumIntegerDigits?: number;
3031

3132
/**
32-
* Defines the minimum number of fraction digits to use.
33-
* The default value for the decimal and percent formatting is 0 (zero).
34-
* The default value of the currency formatting is the number of digits for the currency from the supplemental `currencyData` or 2 if no info is provided for the currency.
33+
* Defines the minimum number of fraction digits that will be used.
34+
* The default value of the decimal and percent formatting is `0` (zero).
35+
* The default value of the currency formatting is the number of digits for the currency from the supplemental `currencyData`.
36+
* If no information about the currency is provided, the default value of the currency formatting is `2`.
3537
*/
3638
minimumFractionDigits?: number;
3739

3840
/**
39-
* Defines the maximum number of fraction digits to be used.
40-
* The default value of the decimal formatting is the greater one between `minimumFractionDigits` and 3.
41-
* The default value of the currency formatting is the greater one between `minimumFractionDigits` and the number of digits for the currency from the supplemental `currencyData` or 2 if no info is provided for the currency.
42-
* The default value of the percent formatting is the greater one between `minimumFractionDigits` and 0 (zero).
41+
* Defines the maximum number of fraction digits that will be used.
42+
* The default value of the decimal formatting is the greater one between `minimumFractionDigits` and `3`.
43+
* The default value of the currency formatting is the greater one between `minimumFractionDigits` and the number of digits for the currency from the supplemental `currencyData`.
44+
* If no information about the currency is provided, the default value of the currency formatting is the greater one between `minimumFractionDigits` and `2`.
45+
* The default value of the percent formatting is the greater one between `minimumFractionDigits` and `0` (zero).
4346
*/
4447
maximumFractionDigits?: number;
4548
}
4649

4750
/**
4851
* Converts a string to a `Number` based on the specified locale.
4952
*
50-
* @param value The string to be parsed.
51-
* @param locale The locale id defining the locale which information should be used to parse the string.
52-
* @param format The format used to parse the string. Usefull if parsing non-default currencies.
53-
* @returns The parsed number.
53+
* @param value - The string that will be parsed.
54+
* @param locale - The locale `id` that defines the locale whose information should be used to parse the string.
55+
* @param format - The format that is used to parse the string. Useful when non-default currencies are parsed.
56+
* @returns - The parsed number.
5457
*/
5558
export function parseNumber(value: string, locale?: string, format?: string|NumberFormatOptions): number;
5659

5760
/**
5861
* Converts a `Number` to a string based on the specified format and locale.
5962
*
60-
* @param value The number to be formatted.
61-
* @param format The format to be applied.
62-
* @param locale The locale id defining the locale which information should be used for the formatting.
63-
* @returns The formatted number.
63+
* @param value - The number that will be formatted.
64+
* @param format - The format that will be applied.
65+
* @param locale - The locale `id` that defines the locale whose information should be used for the formatting.
66+
* @returns - The formatted number.
6467
*/
65-
export function formatNumber(value: number, format: string|NumberFormatOptions, locale?: string): string;
68+
export function formatNumber(value: number, format: string|NumberFormatOptions, locale?: string): string;

0 commit comments

Comments
 (0)