Skip to content

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

Description

@patroza

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>()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions