Skip to content

Commit

Permalink
react-intl libdef [nfc]: Say "Omit" instead of "Exclude"
Browse files Browse the repository at this point in the history
This doesn't actually improve Flow coverage or change any types;
both Omit and Exclude are utility types in TypeScript that Flow
doesn't have. But in the original TypeScript, the use of Exclude for
these was a mistake; they should have been Omit; see discussion at
  zulip#5308 (comment)

We're about to go through all uses of Omit and replace them with
something that works; these will then be fixed.
  • Loading branch information
chrisbobbe committed Mar 31, 2022
1 parent 4b13b36 commit 9cb5b27
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions flow-typed/react-intl_vx.x.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ declare module 'react-intl' {
future: RelativeTimeData;
past: RelativeTimeData;
}
declare export type FormatDateOptions = Exclude<DateTimeFormatOptions, 'localeMatcher'> &
declare export type FormatDateOptions = Omit<DateTimeFormatOptions, 'localeMatcher'> &
CustomFormatConfig;
declare export type FormatDisplayNameOptions = Exclude<DisplayNamesOptions, 'localeMatcher'>;
declare export type FormatDisplayNameOptions = Omit<DisplayNamesOptions, 'localeMatcher'>;
declare class FormatError mixins Error {
+code: $Values<typeof ErrorCode>;

Expand All @@ -186,12 +186,12 @@ declare module 'react-intl' {
constructor(msg: string, code: $Values<typeof ErrorCode>, originalMessage?: string): this;
toString(): string;
}
declare export type FormatListOptions = Exclude<IntlListFormatOptions, 'localeMatcher'>;
declare export type FormatNumberOptions = Exclude<NumberFormatOptions, 'localeMatcher'> &
declare export type FormatListOptions = Omit<IntlListFormatOptions, 'localeMatcher'>;
declare export type FormatNumberOptions = Omit<NumberFormatOptions, 'localeMatcher'> &
CustomFormatConfig;
declare export type FormatPluralOptions = Exclude<Intl$PluralRulesOptions, 'localeMatcher'> &
declare export type FormatPluralOptions = Omit<Intl$PluralRulesOptions, 'localeMatcher'> &
CustomFormatConfig;
declare export type FormatRelativeTimeOptions = Exclude<
declare export type FormatRelativeTimeOptions = Omit<
IntlRelativeTimeFormatOptions,
'localeMatcher', > &
CustomFormatConfig;
Expand Down

0 comments on commit 9cb5b27

Please sign in to comment.