Skip to content

Support arbitrary keys in objects by falling back to the functional typed dict definition#21

Merged
TheLartians merged 4 commits into
mainfrom
lars/support-arbitrary-keys
Apr 22, 2026
Merged

Support arbitrary keys in objects by falling back to the functional typed dict definition#21
TheLartians merged 4 commits into
mainfrom
lars/support-arbitrary-keys

Conversation

@TheLartians
Copy link
Copy Markdown
Owner

@TheLartians TheLartians commented Apr 22, 2026

For example, the type

/** This is A */
export type A = {
  /** this is foo.bar */
  "foo.bar": string,
  /** this is a/b */
  "a/b": number,
  "undocumented": string,
}

is transpiled to

from typing import TypedDict

A = TypedDict("A", {
  "foo.bar": str,
  "a/b": float,
  "undocumented": str
})
"""
This is A
## Entries
"foo.bar": this is foo.bar
"a/b": this is a/b
"""

@TheLartians TheLartians merged commit 314c389 into main Apr 22, 2026
1 check passed
@TheLartians TheLartians deleted the lars/support-arbitrary-keys branch April 22, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant