Skip to content

Commit 0bec760

Browse files
authored
Merge pull request #62 from tabkram/feature/doc
feat: update and complete ts-doc for models
2 parents f0829fd + 0436290 commit 0bec760

3 files changed

Lines changed: 39 additions & 2 deletions

File tree

src/common/models/engineTrace.model.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,31 @@
11
import { EngineEdgeData } from './engineEdgeData.model';
22
import { EngineNodeData } from './engineNodeData.model';
33

4+
/**
5+
* Represents a node in the engine, which is an individual component or entity.
6+
*/
47
export interface EngineNode {
58
data: EngineNodeData;
69
group: 'nodes';
710
}
811

12+
/**
13+
* Represents an edge in the engine, which defines a relationship or connection between nodes.
14+
*/
915
export interface EngineEdge {
1016
data: EngineEdgeData;
1117
group: 'edges';
1218
}
1319

20+
/**
21+
* Represents a **graph structure** as an array of **nodes** and **edges** in the engine.
22+
*
23+
* This structure includes:
24+
* - `EngineNode`: Represents the nodes in the graph, which are individual components or entities with their own properties and characteristics.
25+
* - `EngineEdge`: Represents the edges in the graph, which define the relationships or dependencies between nodes, showing how entities are connected.
26+
*
27+
* The array allows for a complete representation of the system as a graph, where nodes are linked by edges, enabling the modeling of workflows, processes, or complex relationships.
28+
*/
1429
export type EngineTrace = Array<EngineNode | EngineEdge>;
1530

1631

src/common/models/executionTrace.model.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/**
2+
* Represents an execution trace with information about inputs, outputs, errors, and timing.
3+
*/
14
export interface ExecutionTrace<I, O> {
25
id: string;
36
inputs?: I;
@@ -11,6 +14,14 @@ export interface ExecutionTrace<I, O> {
1114
elapsedTime?: string;
1215
}
1316

17+
/**
18+
* Defines how to extract specific data from an `ExecutionTrace`.
19+
*
20+
* Each property can either be a:
21+
* - `boolean`: If `true`, include all data for the property.
22+
* - `Array<string>`: A list of specific keys to extract from the property.
23+
* - `Function`: A function that processes the data of the property and returns a value.
24+
*/
1425
export interface ExecutionTraceExtractor<I, O> {
1526
inputs?: boolean | Array<string> | ((i: I) => unknown);
1627
outputs?: boolean | Array<string> | ((o: O) => unknown);

src/common/models/timer.model.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
1-
2-
export interface TimerDetailsModel{
1+
/**
2+
* Represents details of a timed execution.
3+
*/
4+
export interface TimerDetailsModel {
5+
/** Unique identifier for the execution. */
36
executionId: string;
7+
8+
/** The timestamp when execution started. */
49
startTime: Date | undefined;
10+
11+
/** The timestamp when execution ended. */
512
endTime: Date | undefined;
13+
14+
/** Total execution time in milliseconds. */
615
duration: number | undefined;
16+
17+
/** Human-readable duration of the execution. */
718
elapsedTime: string | undefined;
819
}

0 commit comments

Comments
 (0)