kernel-script 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +396 -0
- package/bun.lock +385 -0
- package/dist/core/bootstrap.d.ts +2 -0
- package/dist/core/commands.d.ts +15 -0
- package/dist/core/engine-hub.d.ts +8 -0
- package/dist/core/helper.d.ts +1 -0
- package/dist/core/hooks/use-queue.d.ts +36 -0
- package/dist/core/persistence-manager.d.ts +10 -0
- package/dist/core/queue-manager.d.ts +66 -0
- package/dist/core/registry.d.ts +3 -0
- package/dist/core/store/base-task.store.d.ts +39 -0
- package/dist/core/task-context.d.ts +23 -0
- package/dist/index.cjs +4051 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +3575 -0
- package/package.json +59 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Task } from './types/task';
|
|
2
|
+
export declare class TaskContext {
|
|
3
|
+
readonly task: Task;
|
|
4
|
+
readonly signal?: AbortSignal;
|
|
5
|
+
constructor(task: Task, signal?: AbortSignal);
|
|
6
|
+
/**
|
|
7
|
+
* Helper to execute an async operation while respecting the cancellation signal.
|
|
8
|
+
* Checks for abortion BEFORE and AFTER the operation.
|
|
9
|
+
*/
|
|
10
|
+
run<T>(fn: () => Promise<T> | T): Promise<T>;
|
|
11
|
+
/**
|
|
12
|
+
* Signal-aware sleep utility.
|
|
13
|
+
*/
|
|
14
|
+
sleep(ms: number): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Check if the task has been cancelled.
|
|
17
|
+
*/
|
|
18
|
+
get aborted(): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Throw if the task has been cancelled.
|
|
21
|
+
*/
|
|
22
|
+
throwIfAborted(): void;
|
|
23
|
+
}
|