IPFS interface definitions used by implementations for API compatibility.
$ npm install ipfs-core-types
IPFS interface definitions used by implementations for API compatibility.
The primary goal of this module is to define and ensure that IPFS core implementations and their respective HTTP client libraries implement the same interface, so that developers can quickly change between a local and a remote node without having to change their applications.
It offers set of typescript interface definitions that implementations can claim compatibility with and use typescript to validate those claims.
In JavaScript land:
$ npm install ipfs-core-types
Install ipfs-core-types as one of the dependencies of your project and use it to ensure your implementations API compatibility:
/**
* @implements {import('ipfs-core-types').RootAPI}
*/
class Root {
// your implementation goes here
}
import { RootAPI } from 'ipfs-core-types'
class Root implements RootAPI {
// your implementation goes here
}
In order to validate API compatibility you can run typescript over your implementation which will point out all the API compatibilities if there are some.
Feel free to join in. All welcome. Open an issue!
This repository falls under the IPFS Code of Conduct.
© 2010 - cnpmjs.org x YWFE | Home | YWFE