-
Notifications
You must be signed in to change notification settings - Fork 11
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
refactor: indexable base #99
Conversation
and delete UserData type, using APIUser instead
because `avatar` was a property of UserData and `avatar_url` is a property of APIUser BREAKING CHANGE: User constructor no longer accepts `avatar` property; use `avatar_url` instead
first argument is now `client` to match other subclasses of `Base` BREAKING CHANGE: Channel constructor changed: `Channel(ChannelData)` -> `Channel(Client, ChannelData)`
`Message` -> `Message<T extends Channel>`
todo: fix the unsafe type assertion
todo: fix the unsafe type assertion
because this is different from User#avatar_url and I didn't know that at the time
(and extend `Base`)
this makes managers generic on their held data types AND the held data type's constructor. Also replaces the Indexable interface with the Base class, so BaseManager is now generic on Base instead of Indexable
@@ -27,7 +30,7 @@ export default class FormerGroupManager extends BaseManager<FormerGroup> impleme | |||
const user = this.client.users._upsert( | |||
new User(this.client, { | |||
id: data.user_id, | |||
avatar: data.image_url, | |||
avatar_url: data.image_url, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data.image_url
is of type string | null
, while avatar_url
is of type string
. This type error occurs in several places: FormerGroupManager.ts
, GroupManager.ts
, Message.ts
, and Relationship.ts
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh right, that's because I updated some stuff in the types repo and forgot to push those changes sorry
missed this one somehow the first time around
including groupme-api-types@2.0.0
🎉 This PR is included in version 3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This is a massive overhaul with a number of huge refactoring changes:
Base
class with_clone()
and_patch()
methods which all other structures extendBase
rather thanIndexable