-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: (iso.ts) Add ISODuration and update doc blocks
- Loading branch information
Showing
1 changed file
with
6 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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,13 +1,16 @@ | ||
import type { Nominal } from './nominal'; | ||
|
||
/** A string formatted as [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).*/ | ||
/** A string formatted as an [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code.*/ | ||
export type ISOCountry = Nominal<'ISOCountry', string>; | ||
|
||
/** A string formatted as [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1).*/ | ||
/** A string formatted as an [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) language code.*/ | ||
export type ISOLanguage = Nominal<'ISOLanguage', string>; | ||
|
||
/** A string formatted as `xx-YY`, where `xx` is an {@linkcode ISOLanguage} and `YY` is an {@linkcode ISOCountry}. */ | ||
export type ISOLocale = Nominal<'ISOLocale', string>; | ||
|
||
/** A string formatted as [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601).*/ | ||
/** A string formatted as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time.*/ | ||
export type ISOTimestamp = Nominal<'ISOTimestamp', string>; | ||
|
||
/** A string formatted as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations) length of time.*/ | ||
export type ISODuration = Nominal<'ISODuration', string>; |