import { Diff } from 'deep-diff'; import { ActionType } from './Action'; import { ProvenanceGraph } from './ProvenanceGraph'; import { JsonValue } from './Serializers'; export declare type DiffExport = Diff; export declare type NodeID = string; export declare type Meta = { [key: string]: any; }; export declare type NodeMetadata = { createdOn?: number; eventType: S | 'Root'; } & Meta; declare type BaseArtifact = { timestamp: number; }; export declare type Annotation = BaseArtifact & { annotation: string; }; export declare type Artifact = BaseArtifact & { artifact: A; }; export declare type Artifacts = { annotations: Annotation[]; customArtifacts: Artifact[]; }; export interface BaseNode { id: NodeID; label: string; metadata: NodeMetadata; children: NodeID[]; actionType: ActionType; bookmarked: boolean; } export interface RootNode extends BaseNode { state: JsonValue; } export interface ChildNode extends BaseNode { parent: NodeID; artifacts: Artifacts; } export interface StateNode extends RootNode, ChildNode { } export interface DiffNode extends ChildNode { diffs: Diff[]; lastStateNode: NodeID; } export declare type ProvenanceNode = RootNode | StateNode | DiffNode; export declare type Nodes = { [key: string]: ProvenanceNode; }; export declare type CurrentNode = ProvenanceNode; /** * Function for checking if a node is a state node. * @template T Represents the given state of an application as defined in initProvenance. * @template S Represents the given event types in your application. * Event types are used to differentiate between different actions that create nodes. * @template A Represents the given "extra" type for storing metadata. * Extra is a way to store customized metadata. * @param _opts: Given node to check if it is a state node. */ export declare function isStateNode(node: ProvenanceNode): node is StateNode; /** * Function for checking if a node is a diff node. * @template T Represents the given state of an application as defined in initProvenance. * @template S Represents the given event types in your application. * Event types are used to differentiate between different actions that create nodes. * @template A Represents the given "extra" type for storing metadata. * Extra is a way to store customized metadata. * @param _opts: Given node to check if it is a diff node. */ export declare function isDiffNode(node: ProvenanceNode): node is DiffNode; /** * Function for checking if a node is a child node. * @template T Represents the given state of an application as defined in initProvenance. * @template S Represents the given event types in your application. * Event types are used to differentiate between different actions that create nodes. * @template A Represents the given "extra" type for storing metadata. * Extra is a way to store customized metadata. * @param _opts: Given node to check if it is a child node. */ export declare function isChildNode(node: ProvenanceNode): node is DiffNode | StateNode; /** * Function for checking if a node is the root node. * @template T Represents the given state of an application as defined in initProvenance. * @template S Represents the given event types in your application. * Event types are used to differentiate between different actions that create nodes. * @template A Represents the given "extra" type for storing metadata. * Extra is a way to store customized metadata. * @param _opts: Given node to check if it is root. */ export declare function isRootNode(node: ProvenanceNode): node is RootNode; /** `* Retrieve the state of a node. ` * @template T Represents the given state of an application as defined in initProvenance. * @template S Represents the given event types in your application. * Event types are used to differentiate between different actions that create nodes. * @template A Represents the given "extra" type for storing metadata. * Extra is a way to store customized metadata. * @param graph: Provenance Graph which we are searching for node in * @param _opts: Node which we want the state of */ export declare function getState(graph: ProvenanceGraph, node: ProvenanceNode): JsonValue; export {};