docs: Do not generate API docs for internal functionality.

This commit is contained in:
Hayden Young
2023-06-27 21:51:00 +01:00
parent b5cd67bed1
commit d6c2330122
10 changed files with 26 additions and 12 deletions

View File

@@ -8,12 +8,6 @@
import IPFSAccessController from './ipfs.js'
import OrbitDBAccessController from './orbitdb.js'
/**
* An array of available access controllers.
* @name accessControllers
* @†ype []
* @return [] An array of access controllers.
*/
const accessControllers = {
ipfs: IPFSAccessController,
orbitdb: OrbitDBAccessController
@@ -23,6 +17,7 @@ const accessControllers = {
* Gets an access controller module specified by type.
* @param {string} type A valid access controller type.
* @return {AccessController} The access controller module.
* @private
*/
const getAccessController = (type) => {
if (!accessControllers[type]) {
@@ -39,6 +34,7 @@ const getAccessController = (type) => {
* already supported.
* @throws Given AccessController class needs to implement: type if the access
* controller module does not implement a type property.
* @static
*/
const addAccessController = (accessController) => {
if (!accessController.type) {
@@ -55,6 +51,7 @@ const addAccessController = (accessController) => {
/**
* Removes an access controller from the list.
* @param {string} type A valid access controller type.
* @static
*/
const removeAccessController = type => {
delete accessControllers[type]

View File

@@ -38,6 +38,7 @@ const type = 'ipfs'
* @instance
* @async
* @memberof module:AccessControllers.AccessControllers-IPFS
* @private
*/
/**

View File

@@ -19,6 +19,7 @@ const type = 'orbitdb'
* @instance
* @async
* @memberof module:AccessControllers.AccessControllers-OrbitDB
* @private
*/
/**

View File

@@ -7,11 +7,6 @@
import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
import { signMessage, verifyMessage } from '../../key-store.js'
/**
* The type of identity provider.
* @return string
* @const
*/
const type = 'publickey'
/**
@@ -19,6 +14,7 @@ const type = 'publickey'
* @param {module:Identity} identity
* @return {boolean} True if the identity is valid, false otherwise.
* @static
* @private
*/
const verifyIdentity = identity => {
const { id, publicKey, signatures } = identity
@@ -27,13 +23,16 @@ const verifyIdentity = identity => {
/**
* Instantiates the publickey identity provider.
* @return {module:IdentityProviders.IdentityProvider-PublicKey} A public key identity provider function.
* @return {module:IdentityProviders.IdentityProvider-PublicKey} A public key
* identity provider function.
* @private
*/
const PublicKeyIdentityProvider = ({ keystore }) => {
/**
* @namespace module:IdentityProviders.IdentityProvider-PublicKey
* @memberof module:IdentityProviders
* @description The instance returned by {@link module:IdentityProviders.IdentityProvider-PublicKey}.
* @private
*/
if (!keystore) {

View File

@@ -12,6 +12,7 @@ const ManifestStore = async ({ ipfs, storage } = {}) => {
/**
* @namespace module:Manifest~Manifest
* @description The instance returned by {@link module:Manifest~Manifest}.
* @private
*/
storage = storage || await ComposedStorage(

View File

@@ -3,6 +3,7 @@
* @memberof module:Log
* @description
* The lamport clock.
* @private
*/
/**

View File

@@ -9,6 +9,7 @@ import { compareClocks } from './clock.js'
* @param {Entry} a First entry
* @param {Entry} b Second entry
* @return {number} 1 if a is latest, -1 if b is latest
* @private
*/
function LastWriteWins (a, b) {
// Ultimate conflict resolution (take the first/left arg)
@@ -31,6 +32,7 @@ function LastWriteWins (a, b) {
* entries and return 1 if the first entry should be chosen and -1 if the
* second entry should be chosen.
* @return {number} 1 if a is greater, -1 if b is greater
* @private
*/
function SortByClocks (a, b, resolveConflict) {
// Compare the clocks
@@ -48,6 +50,7 @@ function SortByClocks (a, b, resolveConflict) {
* are the same. The function should take in two entries and return 1 if the
* first entry should be chosen and -1 if the second entry should be chosen.
* @return {number} 1 if a is greater, -1 if b is greater
* @private
*/
function SortByClockId (a, b, resolveConflict) {
// Sort by ID if clocks are concurrent,
@@ -63,6 +66,7 @@ function SortByClockId (a, b, resolveConflict) {
* @param {function(a, b)} [tiebreaker] The tiebreaker function to validate.
* @return {function(a, b)} 1 if a is greater, -1 if b is greater
* @throws {Error} if func ever returns 0
* @private
*/
function NoZeroes (func) {
const msg = `Your log's tiebreaker function, ${func.name}, has returned zero and therefore cannot be`

View File

@@ -2,6 +2,7 @@
* @namespace module:Log~Entry
* @memberof module:Log
* @description A log entry.
* @private
*/
import Clock from './clock.js'
import * as Block from 'multiformats/block'

View File

@@ -1,3 +1,9 @@
/**
* @namespace module:Log~Heads
* @memberof module:Log
* @description The log's heads.
* @private
*/
import Entry from './entry.js'
import MemoryStorage from '../storage/memory.js'
@@ -77,6 +83,7 @@ const Heads = async ({ storage, heads }) => {
*
* @param {Array<Entry>} entries Entries to search heads from
* @return {Array<Entry>}
* @private
*/
const findHeads = (entries) => {
entries = new Set(entries)

View File

@@ -6,6 +6,7 @@
* Implemented as a Merkle-CRDT as per the paper:
* "Merkle-CRDTs: Merkle-DAGs meet CRDTs"
* https://arxiv.org/abs/2004.00107
* @private
*/
import LRU from 'lru'
import Entry from './entry.js'
@@ -55,6 +56,7 @@ const Log = async (identity, { logId, logHeads, access, entryStorage, headsStora
/**
* @namespace Log
* @description The instance returned by {@link module:Log}.
* @private
*/
if (identity == null) {