Skip to content

Commit

Permalink
feat: (iso.ts) Add ISODuration and update doc blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
dperuo authored Feb 21, 2024
1 parent 722a69e commit 53cca51
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/types/iso.ts
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>;

0 comments on commit 53cca51

Please sign in to comment.