-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apparently TypeScript doesn’t like parsing JSDoc comments in imported libraries, so this might help users who are using m3api with TypeScript, and/or users whose IDEs use TypeScript information. I’m not sure putting the files in a separate types/ directory is the best approach, but I like it better than clutting the root directory with them, even though I haven’t yet found a way to inform TypeScript about the types/ directory (other than the "types" entrypoint in package.json which only points at one file and makes importing 'm3api' work). I don’t want to build the files during packaging – I think it’s a desirable characteristic that the published m3api package is just the same files as in Git (with some unneeded files excluded). A new test:types script checks that the .d.ts files stay in sync with the .js source files. The new GitHub actions job is meant to extend this check to completely new files, which would be missed by test:types (and I don’t want to run `git add` there).
- Loading branch information
1 parent
31b4482
commit deba54f
Showing
20 changed files
with
738 additions
and
39 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"include": [ "*.js" ], | ||
"compilerOptions": { | ||
"allowJs": true, | ||
"declaration": true, | ||
"declarationDir": "types", | ||
"declarationMap": true, | ||
"emitDeclarationOnly": true, | ||
"skipLibCheck": true | ||
} | ||
} |
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,11 @@ | ||
# m3api types | ||
|
||
These TypeScript declaration files are compiled from the JSDoc comments in the JavaScript source files. | ||
They are offered in the hope that some will find them useful, | ||
but they should not be considered an integral part of m3api. | ||
(They are also not a part of its stable or even internal interface.) | ||
|
||
Suggestions to improve the types are welcome, | ||
provided that the improvements can be implemented in the JS files | ||
without negatively impacting the JS code too much. | ||
(For instance, the way the files are currently distributed could perhaps be improved.) |
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,5 @@ | ||
export default class BrowserSession extends FetchBrowserSession { | ||
} | ||
import { FetchBrowserSession } from './fetch-browser.js'; | ||
export { ApiErrors, ApiWarnings, set } from "./core.js"; | ||
//# sourceMappingURL=browser.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,2 @@ | ||
export function mixCombiningSessionInto(otherClass: any): void; | ||
//# sourceMappingURL=combine.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.