Skip to content

Commit

Permalink
Export StreamType to expose Stream's type to users of the library, ra…
Browse files Browse the repository at this point in the history
…ther than the entire class
  • Loading branch information
sholtrop committed Dec 7, 2020
1 parent 3904f86 commit f5e17c8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion native_client/javascript/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export interface Metadata {
* Provides an interface to a DeepSpeech stream. The constructor cannot be called
* directly, use :js:func:`Model.createStream`.
*/
export class Stream {
class Stream {
/** @internal */
_impl: any;

Expand Down Expand Up @@ -134,6 +134,12 @@ export class Stream {
return result;
}
}
/**
* Exposes the type of Stream without actually exposing the class.
* Because the Stream class should not be instantiated directly,
* but instead be created via :js:func:`Model.createStream`.
*/
export type StreamType = Stream;

/**
* An object providing an interface to a trained DeepSpeech model.
Expand Down

0 comments on commit f5e17c8

Please sign in to comment.