Skip to content

Commit

Permalink
feat: use string literal for tags
Browse files Browse the repository at this point in the history
  • Loading branch information
yamiteru committed Apr 27, 2024
1 parent 1429c78 commit cfdd45c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export type Brand<$Name extends string, $Props = None> = {

export type AnyBrand = Brand<any, any>;

export type Tag<$Name extends string> = [name: $Name];
export type Tag<$Name extends string> = {
readonly [$$Name in $Name as `__${$$Name}_brand`]: never;
};

export type AnyTag = Tag<any>;

Expand Down

0 comments on commit cfdd45c

Please sign in to comment.