Skip to content

Commit

Permalink
lean towards cuddled typedefs
Browse files Browse the repository at this point in the history
  • Loading branch information
warner committed Aug 10, 2024
1 parent 5eb735b commit 2fef729
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions packages/SwingSet/src/controller/upgradeSwingset.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ const upgradeVatV0toV1 = (kvStore, defaultReapDirtThreshold, vatID) => {
* called during the upgrade, and it is responsible for doing a
* `hostStorage.commit()` afterwards.
*
* @param { SwingStoreKernelStorage } kernelStorage
* @returns { boolean } true if any changes were made
* @param {SwingStoreKernelStorage} kernelStorage
* @returns {boolean} true if any changes were made
*/
export const upgradeSwingset = kernelStorage => {
const { kvStore } = kernelStorage;
Expand Down
4 changes: 2 additions & 2 deletions packages/SwingSet/src/kernel/state/kernelKeeper.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,14 +449,14 @@ export default function makeKernelKeeper(

/**
*
* @returns { ReapDirtThreshold }
* @returns {ReapDirtThreshold}
*/
function getDefaultReapDirtThreshold() {
return JSON.parse(getRequired(DEFAULT_REAP_DIRT_THRESHOLD_KEY));
}

/**
* @param { ReapDirtThreshold } threshold
* @param {ReapDirtThreshold} threshold
*/
function setDefaultReapDirtThreshold(threshold) {
assert.typeof(threshold, 'object');
Expand Down
16 changes: 8 additions & 8 deletions packages/SwingSet/src/types-external.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ export {};
*/

/**
* @typedef { object } KernelOptions
* @property { ManagerType } [defaultManagerType]
* @property { number | 'never' } [defaultReapGCKrefs]
* @property { number | 'never' } [defaultReapInterval]
* @property { boolean } [relaxDurabilityRules]
* @property { number } [snapshotInitial]
* @property { number } [snapshotInterval]
* @property { boolean } [pinBootstrapRoot]
* @typedef {object} KernelOptions
* @property {ManagerType} [defaultManagerType]
* @property {number | 'never'} [defaultReapGCKrefs]
* @property {number | 'never'} [defaultReapInterval]
* @property {boolean} [relaxDurabilityRules]
* @property {number} [snapshotInitial]
* @property {number} [snapshotInterval]
* @property {boolean} [pinBootstrapRoot]
*/

/**
Expand Down
32 changes: 16 additions & 16 deletions packages/SwingSet/src/types-internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ export {};
* internal type represents the modified form passed to
* initializeKernel() and kernelKeeper.createStartingKernelState .
*
* @typedef { object } InternalKernelOptions
* @property { ManagerType } [defaultManagerType]
* @property { ReapDirtThreshold } [defaultReapDirtThreshold]
* @property { boolean } [relaxDurabilityRules]
* @property { number } [snapshotInitial]
* @property { number } [snapshotInterval]
* @typedef {object} InternalKernelOptions
* @property {ManagerType} [defaultManagerType]
* @property {ReapDirtThreshold} [defaultReapDirtThreshold]
* @property {boolean} [relaxDurabilityRules]
* @property {number} [snapshotInitial]
* @property {number} [snapshotInterval]
*
*
* The internal data that controls which worker we use (and how we use it) is
Expand Down Expand Up @@ -55,7 +55,7 @@ export {};
* @property { boolean } enableDisavow
*
* @typedef ChangeVatOptions
* @property { number } [reapInterval]
* @property {number} [reapInterval]
*/

/**
Expand All @@ -73,11 +73,11 @@ export {};
* which overrides the kernel-wide settings in
* 'kernel.defaultReapDirtThreshold'
*
* @typedef { object } ReapDirtThreshold
* @property { number | 'never' } [deliveries]
* @property { number | 'never' } [gcKrefs]
* @property { number | 'never' } [computrons]
* @property { boolean } [never]
* @typedef {object} ReapDirtThreshold
* @property {number | 'never'} [deliveries]
* @property {number | 'never'} [gcKrefs]
* @property {number | 'never'} [computrons]
* @property {boolean} [never]
*/

/**
Expand All @@ -86,10 +86,10 @@ export {};
* start with {} and accumulate dirt as deliveries are made, until a
* BOYD clears them.
*
* @typedef { object } Dirt
* @property { number } [deliveries]
* @property { number } [gcKrefs]
* @property { number } [computrons]
* @typedef {object} Dirt
* @property {number} [deliveries]
* @property {number} [gcKrefs]
* @property {number} [computrons]
*/

/**
Expand Down

0 comments on commit 2fef729

Please sign in to comment.