-
Notifications
You must be signed in to change notification settings - Fork 30
Add strongly typed options to Intl modules #194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
glennsl
wants to merge
7
commits into
rescript-lang:main
from
glennsl:feat/intl/strongly-typed-options
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4589d1a
feat(Intl.DateTimeFormat): strongly typed options
glennsl bfd9778
feat(Intl.NumberFormat): strongly typed options
glennsl 03e4c66
feat(Intl.PluralRules): strongly typed options
glennsl ccb3ab4
feat(Intl.Collator): strongly typed options
glennsl ea199ea
feat(Intl.RelativeTimeFormat): strongly typed options
glennsl 25bd1af
feat(Intl.Locale): strongly typed options
glennsl 8298258
docs: update changelog
glennsl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,27 @@ | ||
type t | ||
|
||
type options = { | ||
usage?: [#sort | #search], | ||
localeMathcer?: [#lookup | #"best fit"], | ||
collation?: string, | ||
numeric?: bool, | ||
caseFirst?: [#upper | #lower | #"false"], | ||
sensitivity?: [#base | #accent | #case | #variant], | ||
ignorePunctuation?: bool, | ||
} | ||
|
||
@new external make: unit => t = "Intl.Collator" | ||
@new external makeWithLocale: string => t = "Intl.Collator" | ||
@new external makeWithLocales: array<string> => t = "Intl.Collator" | ||
@new external makeWithLocaleAndOptions: (string, {..}) => t = "Intl.Collator" | ||
@new external makeWithLocalesAndOptions: (array<string>, {..}) => t = "Intl.Collator" | ||
@new external makeWithOptions: (@as(json`undefined`) _, {..}) => t = "Intl.Collator" | ||
@new external makeWithLocaleAndOptions: (string, options) => t = "Intl.Collator" | ||
@new external makeWithLocalesAndOptions: (array<string>, options) => t = "Intl.Collator" | ||
@new external makeWithOptions: (@as(json`undefined`) _, options) => t = "Intl.Collator" | ||
|
||
@val external supportedLocalesOf: array<string> => t = "Intl.Collator.supportedLocalesOf" | ||
@val | ||
external supportedLocalesOfWithOptions: (array<string>, {..}) => t = | ||
external supportedLocalesOfWithOptions: (array<string>, options) => t = | ||
"Intl.Collator.supportedLocalesOf" | ||
|
||
@send external resolvedOptions: t => {..} = "resolvedOptions" | ||
@send external resolvedOptions: t => options = "resolvedOptions" | ||
|
||
@send external compare: (t, string, string) => int = "compare" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo (occurs several times)