Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

feat: export some types so they render in docs #211

Merged
merged 4 commits into from
Oct 27, 2021
Merged

feat: export some types so they render in docs #211

merged 4 commits into from
Oct 27, 2021

Conversation

cherryblossom000
Copy link
Contributor

@cherryblossom000 cherryblossom000 commented Oct 1, 2021

Please describe the changes this PR makes and why it should be merged:

This PR exports the following:

  • CreateAudioResourceOptions (parameter type in createAudioResource)
  • JoinConfig (parameter type in createVoiceConnection and VoiceConnection#rejoin)
  • SpeakingMap (type of VoiceReceiver#speaking) and SpeakingMapEvents

This is mainly so that these types show in the documentation, but I think these should be exported regardless of the documentation anyway.

There are some more unexported types referenced in the docs that I haven't exported because they seem more internal:

  • Awaited
  • Edge (AudioResource#edges)
  • Networking (VoiceConnection(Connecting|Ready)State#networking)
  • ConnectionData (VoiceReceiver#connectionData which is @internal)

(if these should be exported as well I'll export them as well)

This PR also documents the overloads for createAudioResource and getVoiceConnections. Currently, no documentation is rendered for these two functions as TypeDoc only considers the documentation for each overload.

https://typedoc.org/guides/options/#excludeinternal

Status and versioning classification:

  • This PR changes the library's interface (methods or parameters added)

I think this counts as changing the library's interface because it exports some more types.


Unrelated to the PR but maybe the TypeDoc --excludeInternal option might be handy to exclude documenting @internal items?

Exports the following:
- `CreateAudioResourceOptions` (parameter type in `createAudioResource`)
- `JoinConfig` (parameter type in `createVoiceConnection` and `VoiceConnection#rejoin`)
- `SpeakingMap` (type of `VoiceReceiver#speaking`) and `SpeakingMapEvents`
This is mainly so that these types show in the documentation.

There are some more unexported types referenced in the docs that I haven't exported because they
seem more internal:
- `Awaited`
- `Edge`
- `Networking`

This commit also documents the overloads for `createAudioResource` and `getVoiceConnections`.
Previously, no documentation would be rendered for these two functions as Typedoc only considers the
documentation for each overload.
@codecov
Copy link

codecov bot commented Oct 1, 2021

Codecov Report

Merging #211 (eb6f5ba) into main (f1869a9) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #211   +/-   ##
=======================================
  Coverage   73.84%   73.84%           
=======================================
  Files          21       21           
  Lines         906      906           
  Branches      221      221           
=======================================
  Hits          669      669           
  Misses        235      235           
  Partials        2        2           
Impacted Files Coverage Δ
src/DataStore.ts 100.00% <ø> (ø)
src/audio/AudioResource.ts 96.66% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f1869a9...eb6f5ba. Read the comment docs.

src/DataStore.ts Outdated Show resolved Hide resolved
src/DataStore.ts Outdated Show resolved Hide resolved
@iCrawl iCrawl merged commit a6dad47 into discordjs:main Oct 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants