Closed
Description
Initially we can do:
{
additionalMethods: {
approximateSize: true
}
}
Which is enough to start using that in deferred-leveldown
(Level/deferred-leveldown#35) and level-packager
levelup
. @ralphtheninja WDYT?
Later we can add function signature info. I propose to stick with boolean properties, so that we can describe multiple signatures (e.g. callbacks and promises):
{
additionalMethods: {
approximateSize: {
sync: false,
callback: true,
promise: false
}
}
}
With that in place, a db wrapper could do things like:
wrapper.prototype.approximateSize = function (..) {
if (this.db.supports.additionalMethods.approximateSize.promise) {
return db.approximateSize(..)
} else {
// Wrap in promise
}
}
Even later, we can add a return type to the manifest. Mainly for streams. Not sure what that should look like. Perhaps:
{
additionalMethods: {
createWriteStream: {
sync: false,
writable: true
}
}
}