Skip to content

Commit

Permalink
fix produced .d.ts
Browse files Browse the repository at this point in the history
- fix index.d.ts to properly use commonjs "export =" syntax
- output the native .d.ts. while the end user should not
  need to call C++ methods, this way we reduce transitive
  typechecking errors.
  • Loading branch information
mildsunrise committed Nov 2, 2023
1 parent 7d5e0bb commit ea62f68
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export * from "./build/types/AudioCodecs";

export type { default as AudioDecoder } from "./build/types/AudioDecoder";
export type { default as AudioEncoder } from "./build/types/AudioEncoder";
export type AudioDecoder = import("./build/types/AudioDecoder");
export type AudioEncoder = import("./build/types/AudioEncoder");
export type AudioEncoderIncomingStreamTrack = import("./build/types/AudioEncoderIncomingStreamTrack");

export type {
default as IncomingStreamTrackBridge,
ActiveEncodingInfo, ActiveLayersInfo,
EncodingStats, LayerStats, MediaStats, PacketWaitTime, TrackStats,
} from "./build/types/AudioEncoderIncomingStreamTrack";
File renamed without changes.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Audio codecs for Media and RTMP servers",
"main": "index.js",
"scripts": {
"prepare": "tsc --checkJs false",
"prepare": "tsc --checkJs false && mkdir -p build/src && cp src/*.d.ts build/src",
"check": "tsc --noEmit --emitDeclarationOnly false",
"configure": "node-gyp configure",
"swig": "swig -javascript -node -c++ src/audio-codecs.i",
Expand Down

0 comments on commit ea62f68

Please sign in to comment.