add typescript types
This commit is contained in:
parent
ff9971389e
commit
1c29eb22a2
|
@ -4,6 +4,7 @@ pnpm-lock.yaml
|
|||
package-lock.json
|
||||
coverage
|
||||
*~
|
||||
lib/*.d.ts
|
||||
|
||||
# For misc scripts and experiments:
|
||||
/gitignored
|
||||
|
|
|
@ -174,6 +174,7 @@ module.exports = class HubObserver {
|
|||
|
||||
/**
|
||||
* @param {string} pubkey
|
||||
* @returns {`/${string}`}
|
||||
*/
|
||||
#getMultiaddr(pubkey) {
|
||||
return `/tunnel/${this.#hubPubkey}.${pubkey}/shse/${pubkey}`
|
||||
|
|
|
@ -3,7 +3,7 @@ const DuplexPair = require('pull-pair/duplex') // @ts-ignore
|
|||
const Notify = require('pull-notify')
|
||||
const debug = require('debug')('ppppp:hub-client')
|
||||
const makeTunnelPlugin = require('./ms-tunnel')
|
||||
const { ErrorDuplex, msaddrToMultiaddr, multiaddrToMsaddr } = require('./utils')
|
||||
const { ErrorDuplex } = require('./utils')
|
||||
|
||||
const HUBS_SUBDOMAIN = 'hubs'
|
||||
|
||||
|
|
12
package.json
12
package.json
|
@ -9,10 +9,13 @@
|
|||
"type": "git",
|
||||
"url": "git@github.com:staltz/ppppp-hub-client.git"
|
||||
},
|
||||
"main": "index.js",
|
||||
"main": "lib/index.js",
|
||||
"files": [
|
||||
"lib/**/*.js"
|
||||
"*.js",
|
||||
"lib/*.js",
|
||||
"lib/*.d.ts"
|
||||
],
|
||||
"types": "types/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"require": "./lib/index.js"
|
||||
|
@ -46,7 +49,10 @@
|
|||
"typescript": "^5.1.3"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node --test",
|
||||
"clean-check": "tsc --build --clean",
|
||||
"prepublishOnly": "npm run clean-check && tsc --build",
|
||||
"postpublish": "npm run clean-check",
|
||||
"test": "npm run clean-check && node --test",
|
||||
"format-code": "prettier --write \"(lib|test)/**/*.js\"",
|
||||
"format-code-staged": "pretty-quick --staged --pattern \"(lib|test)/**/*.js\"",
|
||||
"coverage": "c8 --reporter=lcov npm run test"
|
||||
|
|
Loading…
Reference in New Issue