Skip to content

Commit b2ccda8

Browse files
authored
remove Flow type declaration workaround for Intl (#1183)
1 parent d20e672 commit b2ccda8

File tree

2 files changed

+1
-44
lines changed

2 files changed

+1
-44
lines changed

src/expression/definitions/number_format.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,6 @@ import type {EvaluationContext} from '../evaluation_context';
55
import type {ParsingContext} from '../parsing_context';
66
import type {Type} from '../types';
77

8-
declare let Intl: {
9-
NumberFormat: {
10-
new (...args: any): Intl$NumberFormat;
11-
};
12-
};
13-
14-
declare class Intl$NumberFormat {
15-
constructor(locales?: string | string[], options?: NumberFormatOptions);
16-
format(a: number): string;
17-
resolvedOptions(): any;
18-
}
19-
20-
type NumberFormatOptions = {
21-
style?: 'decimal' | 'currency' | 'percent';
22-
currency?: null | string;
23-
minimumFractionDigits?: null | string;
24-
maximumFractionDigits?: null | string;
25-
};
26-
278
export class NumberFormat implements Expression {
289
type: Type;
2910
number: Expression;

src/expression/types/collator.ts

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,7 @@
1-
// Flow type declarations for Intl cribbed from
2-
// https://github.com/facebook/flow/issues/1270
3-
4-
declare let Intl: {
5-
Collator: {
6-
new (...args: any): Intl$Collator;
7-
};
8-
};
9-
10-
declare class Intl$Collator {
11-
constructor(locales?: string | string[], options?: CollatorOptions);
12-
compare(a: string, b: string): number;
13-
resolvedOptions(): any;
14-
}
15-
16-
type CollatorOptions = {
17-
localeMatcher?: 'lookup' | 'best fit';
18-
usage?: 'sort' | 'search';
19-
sensitivity?: 'base' | 'accent' | 'case' | 'variant';
20-
ignorePunctuation?: boolean;
21-
numeric?: boolean;
22-
caseFirst?: 'upper' | 'lower' | 'false';
23-
};
24-
251
export class Collator {
262
locale: string | null;
273
sensitivity: 'base' | 'accent' | 'case' | 'variant';
28-
collator: Intl$Collator;
4+
collator: Intl.Collator;
295

306
constructor(caseSensitive: boolean, diacriticSensitive: boolean, locale: string | null) {
317
if (caseSensitive)

0 commit comments

Comments
 (0)