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 Resolvable types #51

Open
not-so-smart opened this issue Aug 31, 2021 · 0 comments
Open

Add Resolvable types #51

not-so-smart opened this issue Aug 31, 2021 · 0 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@not-so-smart
Copy link
Member

Several methods could benefit from abstract resolvable types for parameters.

For example: Groups#add(user) could take a user ID string, a User object, or even a Member object.

Some possible resolvable types:

type UserResolvable = string | User;
type MemberResolvable = string | Member; // could User work here too?
type GroupResolvable = string | Group; // would it be a good idea to include Member here?

The corresponding class would have (static?) methods for resolving these.

Group.resolve(GroupResolvable): Group // do these need to be async...?
Member.resolve(MemberResolvable): Member
User.resolve(UserResolvable): User
@not-so-smart not-so-smart added enhancement New feature or request question Further information is requested labels Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant