Skip to content
This repository was archived by the owner on Jan 31, 2023. It is now read-only.

Typescript Types #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ build/
*.mobileprovision
dist/
package-lock.json

types/
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"lint": "standardx -v",
"readme": "node ./bin/generate-docs.js",
"build-types": "tsc",
"test": "cd test && npm install --silent --no-audit && npm test",
"test:node": "node ./test/node/index.js",
"test:ios-simulator": "cd test && npm install --silent --no-audit && npm run test:ios-simulator",
Expand All @@ -29,10 +30,12 @@
"homepage": "https://github.com/socketsupply/io#readme",
"description": "Socket Runtime JavaScript interface",
"devDependencies": {
"@types/node": "18.8.5",
"acorn": "8.8.0",
"acorn-walk": "8.2.0",
"esbuild": "0.15.9",
"tapzero": "*"
"tapzero": "*",
"typescript": "4.8.4"
},
"dependencies": {
"buffer": "6.0.3"
Expand Down
24 changes: 24 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
// Change this to match your project
"include": ["**/*"],
"exclude": ["test", "bin", "repl", "types"],
"compilerOptions": {
// Includes BigInt, among other features.
"lib": ["es2020"],
// Tells TypeScript to read JS files, as
// normally they are ignored as source files
"allowJs": true,
// Generate d.ts files
"declaration": true,
// This compiler run should
// only output d.ts files
"emitDeclarationOnly": true,
// Types should go into this directory.
// Removing this would place the .d.ts files
// next to the .js files
"outDir": "types",
// go to js file when using IDE functions like
// "Go to Definition" in VSCode
"declarationMap": true
}
}