diff --git a/packages/access-client/src/agent.js b/packages/access-client/src/agent.js index 8baadc89a..caa70e87e 100644 --- a/packages/access-client/src/agent.js +++ b/packages/access-client/src/agent.js @@ -25,11 +25,19 @@ import { const HOST = 'https://access.web3.storage' /** - * @template {string} T - * @param {Ucanto.Principal} principal - * @param {typeof fetch} _fetch - * @param {URL} url - * @param {Ucanto.Transport.Channel} [channel] + * Creates a Ucanto connection for the w3access API + * + * Usage: + * + * ```js + * import { connection } from '@web3-storage/access/agent' + * ``` + * + * @template {string} T - DID method + * @param {Ucanto.Principal} principal - w3access API Principal + * @param {typeof fetch} _fetch - fetch implementation to use + * @param {URL} url - w3access API URL + * @param {Ucanto.Transport.Channel} [channel] - Ucanto channel to use * @returns {Ucanto.ConnectionView} */ export function connection(principal, _fetch, url, channel) { @@ -51,8 +59,15 @@ export function connection(principal, _fetch, url, channel) { } /** - * @template {Ucanto.Signer} T * Agent + * + * Usage: + * + * ```js + * import { Agent } from '@web3-storage/access/agent' + * ``` + * + * @template {Ucanto.Signer} T - Ucanto Signer ie. ed25519, RSA or others */ export class Agent { /** @type {Ucanto.Principal<"key">|undefined} */ diff --git a/packages/access-client/src/encoding.js b/packages/access-client/src/encoding.js index 84109c343..535360aa5 100644 --- a/packages/access-client/src/encoding.js +++ b/packages/access-client/src/encoding.js @@ -1,7 +1,7 @@ /** * Encoding utilities * - * These can be imported directly with: + * It is recommended that you import directly with: * ```js * import * as Encoding from '@web3-storage/access/encoding' * diff --git a/packages/access-client/src/stores/store-conf.js b/packages/access-client/src/stores/store-conf.js index e66f10f03..97732e7c3 100644 --- a/packages/access-client/src/stores/store-conf.js +++ b/packages/access-client/src/stores/store-conf.js @@ -21,7 +21,13 @@ import * as Ucanto from '@ucanto/interface' */ /** - * Store implementation with "conf" + * Store implementation with "[conf](https://github.com/sindresorhus/conf)" + * + * Usage: + * + * ```js + * import { StoreConf } from '@web3-storage/access/stores/store-conf' + * ``` * * @implements {Store} */ diff --git a/packages/access-client/src/stores/store-indexeddb.js b/packages/access-client/src/stores/store-indexeddb.js index 743c548cc..e748bb882 100644 --- a/packages/access-client/src/stores/store-indexeddb.js +++ b/packages/access-client/src/stores/store-indexeddb.js @@ -14,6 +14,12 @@ const DATA_ID = 1 /** * Store implementation for the browser. * + * Usage: + * + * ```js + * import { StoreIndexedDB } from '@web3-storage/access/stores/store-indexeddb' + * ``` + * * @implements {Store} */ export class StoreIndexedDB {