This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree 3 files changed +26
-20
lines changed
3 files changed +26
-20
lines changed Original file line number Diff line number Diff line change @@ -26,25 +26,25 @@ interface RefsAPI extends Refs {
26
26
local : Local
27
27
}
28
28
29
- export interface IPFS extends RootAPI {
30
- bitswap : BitswapAPI
31
- block : BlockAPI
32
- bootstrap : BootstrapAPI
33
- config : ConfigAPI
34
- dag : DAGAPI
35
- dht : DHTAPI
36
- diag : DiagAPI
37
- files : FilesAPI
38
- key : KeyAPI
39
- log : LogAPI
40
- name : NameAPI
41
- object : ObjectAPI
42
- pin : PinAPI
43
- pubsub : PubsubAPI
44
- refs : RefsAPI
45
- repo : RepoAPI
46
- stats : StatsAPI
47
- swarm : SwarmAPI
29
+ export interface IPFS < OptionExtension = { } > extends RootAPI < OptionExtension > {
30
+ bitswap : BitswapAPI < OptionExtension >
31
+ block : BlockAPI < OptionExtension >
32
+ bootstrap : BootstrapAPI < OptionExtension >
33
+ config : ConfigAPI < OptionExtension >
34
+ dag : DAGAPI < OptionExtension >
35
+ dht : DHTAPI < OptionExtension >
36
+ diag : DiagAPI < OptionExtension >
37
+ files : FilesAPI < OptionExtension >
38
+ key : KeyAPI < OptionExtension >
39
+ log : LogAPI < OptionExtension >
40
+ name : NameAPI < OptionExtension >
41
+ object : ObjectAPI < OptionExtension >
42
+ pin : PinAPI < OptionExtension >
43
+ pubsub : PubsubAPI < OptionExtension >
44
+ refs : RefsAPI < OptionExtension >
45
+ repo : RepoAPI < OptionExtension >
46
+ stats : StatsAPI < OptionExtension >
47
+ swarm : SwarmAPI < OptionExtension >
48
48
bases : Bases
49
49
codecs : Codecs
50
50
hashers : Hashers
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ const { base58btc } = require('multiformats/bases/base58')
20
20
* @typedef {import('./types').EndpointConfig } EndpointConfig
21
21
* @typedef {import('./types').Options } Options
22
22
* @typedef {import('multiformats/codecs/interface').BlockCodec<any, any> } BlockCodec
23
+ * @typedef {import('./types').IPFSHTTPClient } IPFSHTTPClient
23
24
*/
24
25
25
26
/**
@@ -49,7 +50,7 @@ function create (options = {}) {
49
50
loadHasher : options . ipld && options . ipld . loadHasher
50
51
} )
51
52
52
- /** @type {import('ipfs-core-types').IPFS & { getEndpointConfig: () => EndpointConfig } } */
53
+ /** @type {IPFSHTTPClient } */
53
54
const client = {
54
55
add : require ( './add' ) ( options ) ,
55
56
addAll : require ( './add-all' ) ( options ) ,
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { Agent as HttpAgent } from 'http'
2
2
import { Agent as HttpsAgent } from 'https'
3
3
import { Multiaddr } from 'multiaddr'
4
4
import type { BlockCodec } from 'multiformats/codecs/interface'
5
+ import type { IPFS } from 'ipfs-core-types'
5
6
6
7
export interface Options {
7
8
host ?: string
@@ -40,3 +41,7 @@ export interface EndpointConfig {
40
41
pathname : string
41
42
'api-path' : string
42
43
}
44
+
45
+ export interface IPFSHTTPClient extends IPFS < HTTPClientExtraOptions > {
46
+ getEndpointConfig : ( ) => EndpointConfig
47
+ }
You can’t perform that action at this time.
0 commit comments