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

Way of extending ActionType to have type definition for action added with setActionType #422

Open
JacopoPatroclo opened this issue Mar 26, 2024 · 0 comments

Comments

@JacopoPatroclo
Copy link

JacopoPatroclo commented Mar 26, 2024

Issue

Currently, when creating a new action type using the setActionType function, there's no direct provision to extend the ActionType type to include the new type and options type. It would be beneficial to add the ability to extend the ActionType type, simplifying the process for developers to share custom action types.

Proposal

It could be nice to have something like this:

declare module 'node-plop' {
   interface ActionType extends BaseActionType {
      type: 'your-type',
      someOption: string
   }
}

But of course, we need to make ActionType an interface and I'm not sure it's possible at this time. I would love to contribute to this enhancement. Let me know if it's something that makes sense to create.

If something is not clear I can extend my explanation with more examples.

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