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

Add support for json annotation that indicates a particular value should be a companion/type #263

Open
patroza opened this issue Mar 29, 2023 · 0 comments

Comments

@patroza
Copy link

patroza commented Mar 29, 2023

If there is a const in a module, how do I mark that one as a type/companion in tsplus json definitions?
Basically @effect/io/Scope now has a const Scope which is a Tag<Scope, Scope>, so the companion part of

    {
      "definitionName": "Scope",
      "definitionKind": "interface",
      "extensions": [
        {
          "kind": "type",
          "typeName": "effect/io/Scope"
        },
        {
          "kind": "companion",
          "typeName": "effect/io/Scope.Ops"
        }
      ]
    }

no longer works 🙂
the way I would've done it manually in the source would be:

/* @tsplus type @effect/io/Scope.Ops */
export interface ScopeOps extends Tag<Scope, Scope> {}
export const Scope: ScopeOps = Tag<Scope>()
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

No branches or pull requests

1 participant