mirror of
https://github.com/versia-pub/docs.git
synced 2025-12-06 06:18:19 +01:00
45 lines
888 B
Plaintext
45 lines
888 B
Plaintext
|
|
## ISO8601
|
|
|
|
```typescript
|
|
type Year = `${number}${number}${number}${number}`;
|
|
type Month = `${"0" | "1"}${number}`;
|
|
type Day = `${"0" | "1" | "2" | "3"}${number}`;
|
|
|
|
type DateString = `${Year}-${Month}-${Day}`;
|
|
|
|
type Hour = `${"0" | "1" | "2"}${number}`;
|
|
type Minute = `${"0" | "1" | "2" | "3" | "4" | "5"}${number}`;
|
|
type Second = `${"0" | "1" | "2" | "3" | "4" | "5"}${number}`;
|
|
|
|
type TimeString = `${Hour}:${Minute}:${Second}`;
|
|
|
|
type Offset = `${"Z" | "+" | "-"}${Hour}:${Minute}`;
|
|
|
|
type ISO8601 = `${DateString}T${TimeString}${Offset}`;
|
|
```
|
|
|
|
## UUID
|
|
|
|
```typescript
|
|
type UUID = `${number}-${number}-${number}-${number}-${number}`;
|
|
```
|
|
|
|
## URI
|
|
|
|
```typescript
|
|
type URI = string;
|
|
```
|
|
|
|
## Extensions
|
|
|
|
```typescript
|
|
type OrgNamespace = string;
|
|
type ExtensionName = string;
|
|
|
|
type ExtensionsKey = `${OrgNamespace}:${ExtensionName}`;
|
|
|
|
type Extensions = {
|
|
[key in ExtensionsKey]: any;
|
|
}
|
|
``` |