-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix StdioOverrideFunction Type export
This was a case of bad management of the types in play and their exposure outside the package. The fix that works for both package maintenance, and external users is to ensure that the type is available and copied into the final npm package. Finally this would have been caught with a test, which has now been added. - Fix #40 - Add dedicated type file for StdioOverrideFunction - Change type file paths to be relative - Move all type files to the `src` folder to make things easier - Add Makefile rules to copy over `.d.ts` files so they are in the package
- Loading branch information
Showing
7 changed files
with
78 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ | |
!index.* | ||
!*LICENSE | ||
!libmagic-wrapper.* | ||
!LibmagicModule.d.ts | ||
!StdioOverrideFunction.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
type StdioOverrideFunction = ( | ||
stdioName: "stdout" | "stderr", | ||
text: string, | ||
) => void; | ||
import StdioOverrideFunction from "./StdioOverrideFunction"; | ||
|
||
interface LibmagicModule extends EmscriptenModule { | ||
FS: typeof FS; | ||
ccall: typeof ccall; | ||
cwrap: typeof cwrap; | ||
printOverride: StdioOverrideFunction; | ||
} | ||
|
||
export default LibmagicModule; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
type StdioOverrideFunction = ( | ||
stdioName: "stdout" | "stderr", | ||
text: string, | ||
) => void; | ||
|
||
export default StdioOverrideFunction; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
import LibmagicModule from "./LibmagicModule"; | ||
|
||
declare const factory: EmscriptenModuleFactory<LibmagicModule>; | ||
export default factory; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters