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