Skip to content
Discussion options

You must be logged in to vote

I would recommend @maurice's answer with the slight adjustment that you don't need an intersection to specify an index signature alongside literal keys:

const iItemMetadata = type({ key1: "string", key2: "string", "[string]": "string" });

const myRecord = type({ "[string]": iItemMetadata.array() });

Additionally, there will be an option to invoke builtin generics like Record directly on arbitrary definitions in the next release, so you will be able to use something like:

ark.Record("string", iItemMetadata)

Working on better docs for this now, sorry for the confusion in the meantime!

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@nidomiro
Comment options

@ssalbdivad
Comment options

@nidomiro
Comment options

Answer selected by BinToss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants