Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow caller to customize type parsing behavior #3

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

justjake
Copy link
Owner

@justjake justjake commented Jul 9, 2022

This PR adds a new SimpleType, SimpleTypeCustom. The custom type can contain arbitrary data, typed as unknown for now. The ts-simple-type will never produce this type by default.

Then, we allow the caller to extend the to-simple-type parser with a new optional callback argument: toCustomType.
toCustomType can either implement its own ts.Type -> SimpleType conversion, or it can return a "wrapper" function that will be called with ts-simple-type's default conversion of that ts.Type.

TODOs

  • changes in this branch break some existing to-simple-type tests, possibly because of changes to liftGeneric call pattern or implementation. This needs to be investigated.

@justjake justjake force-pushed the jake--known-types-2-less-generics branch from 49b3a7c to 5a84291 Compare July 21, 2022 15:00
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