arktypea
arktype8mo ago
mailliW

Bracket Notation on Generics

Is there any way to do something like this? 🤔

scope({
  BaseType: { entityType: "string" },
  "Version<Entity extends BaseType, HashKeyPattern>": {
    "...": "VersionCore & AiVersionFields",
    data: "Entity",
    HK: "HashKeyPattern",
    SK: "StandardVersionSK",
    EntityType: 'Entity["entityType"]',
  },
})
image.png
Was this page helpful?