-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add ts typedefs * fix: address review comments * feat: add type checking to CI * Update index.d.ts Co-authored-by: Alex Potsides <[email protected]> * Update .github/workflows/typecheck.yml Co-authored-by: Alex Potsides <[email protected]>
- Loading branch information
1 parent
7f2a9b9
commit b8fcda8
Showing
7 changed files
with
489 additions
and
977 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
on: | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
name: Typecheck | ||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [14.x] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Restore dependencies | ||
id: cache-modules | ||
uses: actions/checkout@v2 | ||
with: | ||
path: node_modules | ||
key: ${{ matrix.node-version }}-${{ runner.OS }}-build-${{ hashFiles('package.json') }} | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Typecheck | ||
uses: gozala/[email protected] |
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,3 @@ | ||
node_modules | ||
npm-debug.* | ||
*.tsbuildinfo |
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,16 @@ | ||
interface Err<Code> extends Error { | ||
code: Code | ||
} | ||
|
||
interface CreateError { | ||
<Code extends string|number, Ext extends Object> ( | ||
error:Error, | ||
code: Code, | ||
ext: Ext | ||
): Err<Code> & Ext | ||
<Code extends string|number> (error:Error, code:Code): Err<Code> | ||
<Ext extends Object> (error:Error, ext:Ext): Err<undefined> & Ext | ||
} | ||
|
||
declare var createError:CreateError | ||
export = createError |
Oops, something went wrong.