Compare commits

4 Commits

Author SHA1 Message Date
413139eb32 add uuid 2025-08-12 09:32:45 +02:00
c105e493df add brand 2025-08-12 09:32:41 +02:00
5f6d3208ac refactor dir to single file 2025-08-12 09:32:37 +02:00
3a4ceb22f4 initial aws types 2025-07-07 16:10:06 +02:00
3 changed files with 23 additions and 0 deletions

16
src/aws.d.ts vendored Normal file
View File

@@ -0,0 +1,16 @@
type AccountId = `${number}`;
type Region = `${string}-${string}-${number}`;
type Arn<
S extends string,
R extends Region | "",
T extends string
> = `arn:aws:${S}:${R}:${AccountId}:${T}`;
type RegionalArn<S extends string, T extends string> = Arn<S, Region, T>;
type GlobalArn<S extends string, T extends string> = Arn<S, "", T>;
type RuleArn = RegionalArn<"events", `rule/${string}/${string}`>;
type RoleArn = GlobalArn<"iam", `role/${string}`>;
type SqsArn = RegionalArn<"sqs", string>;
type LambdaArn = RegionalArn<"lambda", `function:${string}`>;

1
src/brand.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
type Brand<T, B> = T & { readonly __brand: B };

6
src/uuid.d.ts vendored Normal file
View File

@@ -0,0 +1,6 @@
type VariantNibble = "8" | "9" | "A" | "B";
type UUID<V extends '4'|'7'> = `${string}-${string}-${V}${string}-${VariantNibble}${string}-${string}`
type UUIDv4 = UUID<'4'>;
type UUIDv7 = UUID<'7'>;