From 8f44e6e7202078fda56fa629b3f8e0838cc5c89a Mon Sep 17 00:00:00 2001 From: Erik Marks Date: Thu, 7 Mar 2024 22:46:38 -0800 Subject: [PATCH] refactor(daemon): Remove typedefs --- packages/daemon/src/daemon.js | 11 ++--------- packages/daemon/src/host.js | 11 +++-------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/packages/daemon/src/daemon.js b/packages/daemon/src/daemon.js index b292cab3d8..fca23e9abf 100644 --- a/packages/daemon/src/daemon.js +++ b/packages/daemon/src/daemon.js @@ -78,11 +78,6 @@ const getDerivedId = (path, rootNonce, digester) => { return nonce; }; -/** - * @template T - * @typedef {import('./types.js').IncarnateResult} IncarnateResult - */ - /** * @param {import('./types.js').DaemonicPowers} powers * @param {Promise} webletPortP @@ -904,10 +899,9 @@ const makeDaemonCore = async ( * Incarnates a `handle` formula and synchronously adds it to the formula graph. * The returned promise is resolved after the formula is persisted. * - * @typedef {import('./types.js').ExternalHandle} ExternalHandle * @param {string} formulaNumber - The formula number of the handle to incarnate. * @param {string} targetFormulaIdentifier - The formula identifier of the handle's target. - * @returns {IncarnateResult} The incarnated handle. + * @returns {import('./types.js').IncarnateResult} The incarnated handle. */ const incarnateNumberedHandle = (formulaNumber, targetFormulaIdentifier) => { /** @type {import('./types.js').HandleFormula} */ @@ -924,9 +918,8 @@ const makeDaemonCore = async ( * Incarnates a `pet-store` formula and synchronously adds it to the formula graph. * The returned promise is resolved after the formula is persisted. * - * @typedef {import('./types.js').PetStore} PetStore * @param {string} formulaNumber - The formula number of the pet store to incarnate. - * @returns {IncarnateResult} The incarnated pet store. + * @returns {import('./types.js').IncarnateResult} The incarnated pet store. */ const incarnateNumberedPetStore = async formulaNumber => { /** @type {import('./types.js').PetStoreFormula} */ diff --git a/packages/daemon/src/host.js b/packages/daemon/src/host.js index 707ce7db3d..93f8f3a90e 100644 --- a/packages/daemon/src/host.js +++ b/packages/daemon/src/host.js @@ -8,11 +8,6 @@ import { makeDeferredTasks } from './deferred-tasks.js'; const { quote: q } = assert; -/** - * @template {Record} T - * @typedef {import('./types.js').DeferredTasks} DeferredTasks - */ - /** * @param {object} args * @param {import('./types.js').DaemonCore['provideValueForFormulaIdentifier']} args.provideValueForFormulaIdentifier @@ -156,7 +151,7 @@ export const makeHostMaker = ({ } } - /** @type {DeferredTasks} */ + /** @type {import('./types.js').DeferredTasks} */ const tasks = makeDeferredTasks(); if (petName !== undefined) { tasks.push(identifiers => @@ -247,7 +242,7 @@ export const makeHostMaker = ({ /** * @param {string | 'MAIN' | 'NEW'} workerName - * @param {DeferredTasks<{ workerFormulaIdentifier: string }>['push']} deferTask + * @param {import('./types.js').DeferredTasks<{ workerFormulaIdentifier: string }>['push']} deferTask * @returns {string | undefined} */ const provideWorkerFormulaIdentifierSync = (workerName, deferTask) => { @@ -308,7 +303,7 @@ export const makeHostMaker = ({ throw new Error('Evaluator requires one pet name for each code name'); } - /** @type {DeferredTasks} */ + /** @type {import('./types.js').DeferredTasks} */ const tasks = makeDeferredTasks(); const workerFormulaIdentifier = provideWorkerFormulaIdentifierSync(