Skip to content

Replace TypeScript source code + build step with ESM JavaScript and hand-written index.d.ts and make Constructor options extendable by plugins #45

Closed
@gr2m

Description

@gr2m

optimize the code of index.js and index.d.ts instead.

I think it would also be cool if plugins could extend the constructor options, so something like this would be possible

import { Base } from "javascript-plugin-architecture-with-typescript-definitions";
import { myPlugin } from "my-plugin"

const MyThing = Base.plugin(myPlugin)

const thing = new MyThing({
  myPlugin: {
    some: "option"
  }
})

By importing from "my-plugin", the constructor options for Base would be expanded with something a type for the myPlugin key

I'm not sure how to do this, but I think it's possible by merging interfaces?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions