diff --git a/API.md b/API.md index 76cfcbd..b28a203 100644 --- a/API.md +++ b/API.md @@ -369,6 +369,7 @@ Main connection process for a browser based application, options { transports Array of abbreviations of transports e.g. ["HTTP","IPFS"] as provided in URL defaulttransports Array of abbreviations of transports to use if transports is unset + paused Array of abbreviations of transports that should be paused (not started) statuselement HTML element to build status display under ... Entire options is passed to each setup0 and will include options for each Transport } diff --git a/Transport.js b/Transport.js index 11b298c..f23b865 100644 --- a/Transport.js +++ b/Transport.js @@ -53,7 +53,7 @@ class Transport { return t.p_setup2(verbose, cb); // And connect } - togglePaused(cb) { //TODO-API //TODO-SW move to Transports > TransportsProxy > UI + togglePaused(cb) { //TODO-SW move to Transports > TransportsProxy > UI /* Switch the state of the transport between STATUS_CONNECTED and STATUS_PAUSED, in the paused state it will not be used for transport but, in some cases, will still do background tasks like serving files. diff --git a/TransportIPFS.js b/TransportIPFS.js index eedbc59..1198146 100644 --- a/TransportIPFS.js +++ b/TransportIPFS.js @@ -109,7 +109,7 @@ class TransportIPFS extends Transport { return t; } - async p_setup1(verbose, cb) { //TODO-API + async p_setup1(verbose, cb) { try { if (verbose) console.log("IPFS starting and connecting"); this.status = Transport.STATUS_STARTING; // Should display, but probably not refreshed in most case @@ -309,7 +309,7 @@ class TransportIPFS extends Transport { console.log(err.message); } } - async p_f_createReadStream(url, {verbose=false}={}) { // Asynchronously return a function that can be used in createReadStream TODO-API + async p_f_createReadStream(url, {verbose=false}={}) { // Asynchronously return a function that can be used in createReadStream verbose = true; if (verbose) console.log("p_f_createReadStream",url); const mh = TransportIPFS.multihashFrom(url); diff --git a/TransportWEBTORRENT.js b/TransportWEBTORRENT.js index 11fcc22..af57b44 100644 --- a/TransportWEBTORRENT.js +++ b/TransportWEBTORRENT.js @@ -218,7 +218,7 @@ class TransportWEBTORRENT extends Transport { } - async p_f_createReadStream(url, {verbose=false, wanturl=false}={}) { //TODO-API + async p_f_createReadStream(url, {verbose=false, wanturl=false}={}) { /* Fetch bytes progressively, using a node.js readable stream, based on a url of the form: No assumption is made about the data in terms of size or structure. diff --git a/Transports.js b/Transports.js index 922e6e1..306ab66 100644 --- a/Transports.js +++ b/Transports.js @@ -34,7 +34,7 @@ class Transports { static async p_connectedNamesParm() { // Doesnt strictly need to be async, but for consistency with Proxy it has to be. return (await this.p_connectedNames()).map(n => "transport="+n).join('&') } - static async p_statuses() { //TODO-API + static async p_statuses() { /* resolves to: a dictionary of statuses of transports, e.g. { TransportHTTP: STATUS_CONNECTED } */ @@ -91,7 +91,7 @@ class Transports { return urls; } } - static resolveNamesWith(cb) { //TODO-API + static resolveNamesWith(cb) { // Set a callback for p_resolveNames this.namingcb = cb; } @@ -515,7 +515,7 @@ class Transports { } } - static async p_connect(options, verbose) { //TODO-API paused + static async p_connect(options, verbose) { /* This is a standardish starting process, feel free to subclass or replace ! It will connect to a set of standard transports and is intended to work inside a browser.