Skip to content

Commit

Permalink
chore: update project
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Oct 26, 2023
1 parent 14c602d commit 46e5340
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 21 deletions.
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
"multiaddr",
"string"
],
"engines": {
"node": ">=18.0.0",
"npm": ">=8.6.0"
},
"type": "module",
"types": "./dist/src/index.d.ts",
"typesVersions": {
Expand Down Expand Up @@ -61,6 +57,7 @@
"eslintConfig": {
"extends": "ipfs",
"parserOptions": {
"project": true,
"sourceType": "module"
}
},
Expand Down
34 changes: 17 additions & 17 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export interface Multiaddr {
* // '/ip4/127.0.0.1/tcp/4001'
* ```
*/
toString: () => string
toString(): string

/**
* Returns Multiaddr as a JSON encoded object
Expand All @@ -122,7 +122,7 @@ export interface Multiaddr {
* // '/ip4/127.0.0.1/tcp/4001'
* ```
*/
toJSON: () => string
toJSON(): string

/**
* Returns Multiaddr as a convinient options object to be used with net.createConnection
Expand All @@ -135,7 +135,7 @@ export interface Multiaddr {
* // { family: 4, host: '127.0.0.1', transport: 'tcp', port: 4001 }
* ```
*/
toOptions: () => MultiaddrObject
toOptions(): MultiaddrObject

/**
* Returns the protocols the Multiaddr is defined with, as an array of objects, in
Expand All @@ -152,7 +152,7 @@ export interface Multiaddr {
* // { code: 6, size: 16, name: 'tcp' } ]
* ```
*/
protos: () => Protocol[]
protos(): Protocol[]

/**
* Returns the codes of the protocols in left-to-right order.
Expand All @@ -166,7 +166,7 @@ export interface Multiaddr {
* // [ 4, 6 ]
* ```
*/
protoCodes: () => number[]
protoCodes(): number[]

/**
* Returns the names of the protocols in left-to-right order.
Expand All @@ -180,7 +180,7 @@ export interface Multiaddr {
* // [ 'ip4', 'tcp' ]
* ```
*/
protoNames: () => string[]
protoNames(): string[]

/**
* Returns a tuple of parts
Expand All @@ -193,7 +193,7 @@ export interface Multiaddr {
* // [ [ 4, <Buffer 7f 00 00 01> ], [ 6, <Buffer 0f a1> ] ]
* ```
*/
tuples: () => Tuple[]
tuples(): Tuple[]

/**
* Returns a tuple of string/number parts
Expand All @@ -208,7 +208,7 @@ export interface Multiaddr {
* // [ [ 4, '127.0.0.1' ], [ 6, '4001' ] ]
* ```
*/
stringTuples: () => StringTuple[]
stringTuples(): StringTuple[]

/**
* Encapsulates a Multiaddr in another Multiaddr
Expand All @@ -232,7 +232,7 @@ export interface Multiaddr {
*
* @param {MultiaddrInput} addr - Multiaddr to add into this Multiaddr
*/
encapsulate: (addr: MultiaddrInput) => Multiaddr
encapsulate(addr: MultiaddrInput): Multiaddr

/**
* Decapsulates a Multiaddr from another Multiaddr
Expand All @@ -256,7 +256,7 @@ export interface Multiaddr {
*
* @param {Multiaddr | string} addr - Multiaddr to remove from this Multiaddr
*/
decapsulate: (addr: Multiaddr | string) => Multiaddr
decapsulate(addr: Multiaddr | string): Multiaddr

/**
* A more reliable version of `decapsulate` if you are targeting a
Expand All @@ -278,7 +278,7 @@ export interface Multiaddr {
* // '/ip4/127.0.0.1/tcp/8080'
* ```
*/
decapsulateCode: (code: number) => Multiaddr
decapsulateCode(code: number): Multiaddr

/**
* Extract the peerId if the multiaddr contains one
Expand All @@ -294,7 +294,7 @@ export interface Multiaddr {
* const peerId = mh1.getPeerId()
* ```
*/
getPeerId: () => string | null
getPeerId(): string | null

/**
* Extract the path if the multiaddr contains one
Expand All @@ -310,7 +310,7 @@ export interface Multiaddr {
* const path = mh1.getPath()
* ```
*/
getPath: () => string | null
getPath(): string | null

/**
* Checks if two Multiaddrs are the same
Expand All @@ -332,7 +332,7 @@ export interface Multiaddr {
* // false
* ```
*/
equals: (addr: { bytes: Uint8Array }) => boolean
equals(addr: { bytes: Uint8Array }): boolean

/**
* Resolve multiaddr if containing resolvable hostname.
Expand All @@ -351,7 +351,7 @@ export interface Multiaddr {
* // ]
* ```
*/
resolve: (options?: AbortOptions) => Promise<Multiaddr[]>
resolve(options?: AbortOptions): Promise<Multiaddr[]>

/**
* Gets a Multiaddrs node-friendly address object. Note that protocol information
Expand All @@ -368,7 +368,7 @@ export interface Multiaddr {
* // {family: 4, address: '127.0.0.1', port: 4001}
* ```
*/
nodeAddress: () => NodeAddress
nodeAddress(): NodeAddress

/**
* Returns if a Multiaddr is a Thin Waist address or not.
Expand Down Expand Up @@ -399,7 +399,7 @@ export interface Multiaddr {
* // false
* ```
*/
isThinWaistAddress: (addr?: Multiaddr) => boolean
isThinWaistAddress(addr?: Multiaddr): boolean
}

/**
Expand Down
7 changes: 7 additions & 0 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"entryPoints": [
"./src/index.ts",
"./src/convert.ts",
"./src/resolvers/index.ts"
]
}

0 comments on commit 46e5340

Please sign in to comment.