Skip to content

Commit

Permalink
refactor(daemon): Remove typedefs
Browse files Browse the repository at this point in the history
  • Loading branch information
rekmarks committed Mar 8, 2024
1 parent c73fcf7 commit 8f44e6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
11 changes: 2 additions & 9 deletions packages/daemon/src/daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,6 @@ const getDerivedId = (path, rootNonce, digester) => {
return nonce;
};

/**
* @template T
* @typedef {import('./types.js').IncarnateResult<T>} IncarnateResult
*/

/**
* @param {import('./types.js').DaemonicPowers} powers
* @param {Promise<number>} webletPortP
Expand Down Expand Up @@ -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<ExternalHandle>} The incarnated handle.
* @returns {import('./types.js').IncarnateResult<import('./types.js').ExternalHandle>} The incarnated handle.
*/
const incarnateNumberedHandle = (formulaNumber, targetFormulaIdentifier) => {
/** @type {import('./types.js').HandleFormula} */
Expand All @@ -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<PetStore>} The incarnated pet store.
* @returns {import('./types.js').IncarnateResult<import('./types.js').PetStore>} The incarnated pet store.
*/
const incarnateNumberedPetStore = async formulaNumber => {
/** @type {import('./types.js').PetStoreFormula} */
Expand Down
11 changes: 3 additions & 8 deletions packages/daemon/src/host.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ import { makeDeferredTasks } from './deferred-tasks.js';

const { quote: q } = assert;

/**
* @template {Record<string, string | string[]>} T
* @typedef {import('./types.js').DeferredTasks<T>} DeferredTasks
*/

/**
* @param {object} args
* @param {import('./types.js').DaemonCore['provideValueForFormulaIdentifier']} args.provideValueForFormulaIdentifier
Expand Down Expand Up @@ -156,7 +151,7 @@ export const makeHostMaker = ({
}
}

/** @type {DeferredTasks<import('./types.js').GuestDeferredTaskParams>} */
/** @type {import('./types.js').DeferredTasks<import('./types.js').GuestDeferredTaskParams>} */
const tasks = makeDeferredTasks();
if (petName !== undefined) {
tasks.push(identifiers =>
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -308,7 +303,7 @@ export const makeHostMaker = ({
throw new Error('Evaluator requires one pet name for each code name');
}

/** @type {DeferredTasks<import('./types.js').EvalDeferredTaskParams>} */
/** @type {import('./types.js').DeferredTasks<import('./types.js').EvalDeferredTaskParams>} */
const tasks = makeDeferredTasks();

const workerFormulaIdentifier = provideWorkerFormulaIdentifierSync(
Expand Down

0 comments on commit 8f44e6e

Please sign in to comment.