File tree Expand file tree Collapse file tree 3 files changed +26
-20
lines changed Expand file tree Collapse file tree 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 {
2626 local : Local
2727}
2828
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 >
4848 bases : Bases
4949 codecs : Codecs
5050 hashers : Hashers
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ const { base58btc } = require('multiformats/bases/base58')
2020 * @typedef {import('./types').EndpointConfig } EndpointConfig
2121 * @typedef {import('./types').Options } Options
2222 * @typedef {import('multiformats/codecs/interface').BlockCodec<any, any> } BlockCodec
23+ * @typedef {import('./types').IPFSHTTPClient } IPFSHTTPClient
2324 */
2425
2526/**
@@ -49,7 +50,7 @@ function create (options = {}) {
4950 loadHasher : options . ipld && options . ipld . loadHasher
5051 } )
5152
52- /** @type {import('ipfs-core-types').IPFS & { getEndpointConfig: () => EndpointConfig } } */
53+ /** @type {IPFSHTTPClient } */
5354 const client = {
5455 add : require ( './add' ) ( options ) ,
5556 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'
22import { Agent as HttpsAgent } from 'https'
33import { Multiaddr } from 'multiaddr'
44import type { BlockCodec } from 'multiformats/codecs/interface'
5+ import type { IPFS } from 'ipfs-core-types'
56
67export interface Options {
78 host ?: string
@@ -40,3 +41,7 @@ export interface EndpointConfig {
4041 pathname : string
4142 'api-path' : string
4243}
44+
45+ export interface IPFSHTTPClient extends IPFS < HTTPClientExtraOptions > {
46+ getEndpointConfig : ( ) => EndpointConfig
47+ }
You can’t perform that action at this time.
0 commit comments