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

chore(typings): declaring explicit nullable returns #3134

Merged
merged 11 commits into from Apr 15, 2019

Conversation

Projects
None yet
4 participants
@izexi
Copy link
Contributor

commented Mar 7, 2019

On some classes, there are often properties that are initialised null or have a conditional statement that could result into the property being null, some of these aren't reflected in the typings so I have added | null to where it's appropriate.

I also found that sometimes the properties were marked as optional via ? which infers that the return type could be undefined, which was a bit misleading so I changed those where applicable.

Client.presenceUpdate seems to return, so that has been reverted in this PR.

this.client.emit(Events.PRESENCE_UPDATE, old, member);

Lastly, typings for private properties, methods and events for WebSocketShard (covered in #3140) along with Guild.defaultRole, have been added in this PR (covered in #3126).

Status

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

Semantic versioning classification:

  • This PR changes the library's interface (methods or parameters added)
    • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)
  • This PR only includes non-code changes, like changes to documentation, README, etc.

izexi added some commits Mar 6, 2019

@kyranet
Copy link
Contributor

left a comment

Just a few things

Show resolved Hide resolved typings/index.d.ts Outdated
Show resolved Hide resolved typings/index.d.ts Outdated
Show resolved Hide resolved typings/index.d.ts Outdated

kyranet and others added some commits Mar 8, 2019

kyra suggestion #1
Co-Authored-By: izexi <43889168+izexi@users.noreply.github.com>

@SpaceEEC SpaceEEC added the t: typings label Mar 20, 2019

Show resolved Hide resolved typings/index.d.ts Outdated
Show resolved Hide resolved typings/index.d.ts Outdated
Show resolved Hide resolved typings/index.d.ts Outdated
Show resolved Hide resolved typings/index.d.ts Outdated

izexi added some commits Mar 20, 2019

@vladfrangu

This comment has been minimized.

Copy link
Contributor

commented Apr 14, 2019

This PR needs a rebase, due to typings changes 👀

izexi added some commits Mar 6, 2019

strict nullable & WebSocketManager private typings
missing semicolon

kyra suggestion #1

Co-Authored-By: izexi <43889168+izexi@users.noreply.github.com>

kyra suggestion #2&3

space's requested changes

space's requested change

@izexi izexi changed the title chore: declaring explicit nullable returns & WebSocketManager privates chore(typings): declaring explicit nullable returns Apr 14, 2019

@SpaceEEC SpaceEEC merged commit 0b1176d into discordjs:master Apr 15, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@izexi izexi deleted the izexi:nullable-typings branch Apr 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.