@just-in/core
Version:
A TypeScript-first framework for building adaptive digital health interventions.
23 lines • 981 B
TypeScript
import { Task, TaskRegistration } from './handler.type';
import { JEvent } from '../event/event.type';
import { JUser } from '../user-manager/user.type';
/**
* Registers a Task by its name, setting its type to `TASK` in the process.
* @param {TaskRegistration} task - The task to register, with the `type` set to `TASK`.
*/
export declare const registerTask: (task: TaskRegistration) => void;
/**
* Retrieves a Task by its name.
* @param {string} name - The name of the Task to retrieve.
* @returns {Task | undefined} - The Task if found, or undefined otherwise.
*/
export declare const getTaskByName: (name: string) => Task | undefined;
/**
* Executes a Task for a specific user and event.
*
* @param task - The Task to execute.
* @param event - The triggering event.
* @param user - The user for whom the Task is being executed.
*/
export declare function executeTask(task: Task, event: JEvent, user: JUser): Promise<void>;
//# sourceMappingURL=task.manager.d.ts.map