nope-js-node
Version:
NoPE Runtime for Nodejs. For Browser-Support please use nope-browser
125 lines (124 loc) • 6.8 kB
TypeScript
/**
* @author Martin Karkowski
* @email m.karkowski@zema.de
* @desc [description]
*/
export type PORT_AVOID_TOKEN = "transition.input.avoid";
export type PORT_CONSUME_TOKEN = "transition.input.consume";
export type PORT_REQUIRE_TOKEN = "transition.input.require";
export type PORT_PRODUCE_TOKEN = "transition.output.produce";
export type PORT_PLACE = "place";
export type VALID_PETRINET_PORTS = PORT_AVOID_TOKEN | PORT_CONSUME_TOKEN | PORT_REQUIRE_TOKEN | PORT_PRODUCE_TOKEN | PORT_PLACE;
export type PORT_DATA = "data";
export type PORT_EVENT = "event";
export type PORT_FUNCTION = "function";
export type VALID_BASE_PORTS = PORT_DATA | PORT_EVENT | PORT_FUNCTION;
export type PORT_FLOW_OP_EXECUTE = "flow.operation.start";
export type PORT_FLOW_OP_DONE = "flow.operation.done";
export type PORT_FLOW_OP_ERROR = "flow.operation.error";
export type VALID_FLOW_PORTS = PORT_FLOW_OP_EXECUTE | PORT_FLOW_OP_DONE | PORT_FLOW_OP_ERROR;
export type PORT_ACTION_FIRE = "transition.control.fire";
export type PORT_ACTION_FIRED = "transition.control.fired";
export type PORT_ACTION_RELEASE = "transition.control.release";
export type PORT_ACTION_LOCK = "transition.control.lock";
export type VALID_ACTION_PORTS = PORT_ACTION_FIRE | PORT_ACTION_FIRED | PORT_ACTION_RELEASE | PORT_ACTION_LOCK;
export type PORT_SERVICE_DONE = "service.done";
export type PORT_SERVICE_ERROR = "service.error";
export type PORT_SERVICE_RESULT = "service.result";
export type VALID_SERVICE_PORTS = PORT_SERVICE_DONE | PORT_SERVICE_ERROR | PORT_SERVICE_RESULT;
export type VALID_PORTS = VALID_PETRINET_PORTS | VALID_BASE_PORTS | VALID_FLOW_PORTS | VALID_ACTION_PORTS | VALID_SERVICE_PORTS;
export type NODE_TYPE_GROUP = "node:group";
export type NODE_TYPE_CONSTANT = "node:data:constant";
export type NODE_TYPE_DATA_TO_TOKEN = "node:converter:data-to-token";
export type NODE_TYPE_TOKEN_TO_DATA = "node:converter:token-to-data";
export type NODE_TYPE_DATA_TO_ON_TRUE = "node:converter:data-to-on-true";
export type NODE_TYPE_DATA_TO_ON_CHANGE = "node:converter:data-to-on-change";
export type NODE_TYPE_EVENT_TO_DATA = "node:converter:event-to-data";
export type NODE_TYPE_START = "node:flow:start";
export type NODE_TYPE_FLOW_OPERATION = "node:flow:operation";
export type NODE_TYPE_FLOW_SYNC = "node:flow:sync";
export type NODE_TYPE_FLOW_IF = "node:flow:if";
export type NODE_TYPE_WAIT_FOR = "node:flow:wait-for";
export type NODE_TYPE_PLACE = "node:petrinet:place";
export type NODE_TYPE_TRANSITION = "node:petrinet:transition";
export type NODE_TYPE_VAR = "node:data:constant";
export type NODE_TYPE_DATA_IF = "node:data:if";
export type NODE_TYPE_BOOL_NOT = "node:bool:not";
export type NODE_TYPE_BOOL_OR = "node:bool:or";
export type NODE_TYPE_BOOL_AND = "node:bool:and";
export type NODE_TYPE_BOOL_XOR = "node:bool:xor";
export type NODE_TYPE_MODULE = "node:module";
export type VALID_NODES = NODE_TYPE_GROUP | NODE_TYPE_CONSTANT | NODE_TYPE_DATA_TO_TOKEN | NODE_TYPE_START | NODE_TYPE_FLOW_OPERATION | NODE_TYPE_FLOW_SYNC | NODE_TYPE_FLOW_IF | NODE_TYPE_WAIT_FOR | NODE_TYPE_PLACE | NODE_TYPE_TOKEN_TO_DATA | NODE_TYPE_TRANSITION | NODE_TYPE_VAR | NODE_TYPE_MODULE | NODE_TYPE_DATA_IF | NODE_TYPE_BOOL_NOT | NODE_TYPE_BOOL_OR | NODE_TYPE_BOOL_AND | NODE_TYPE_BOOL_XOR | NODE_TYPE_DATA_TO_ON_TRUE | NODE_TYPE_DATA_TO_ON_CHANGE | NODE_TYPE_EVENT_TO_DATA | VALID_PORTS;
export declare const PORT_AVOID_TOKEN: PORT_AVOID_TOKEN;
export declare const PORT_CONSUME_TOKEN: PORT_CONSUME_TOKEN;
export declare const PORT_REQUIRE_TOKEN: PORT_REQUIRE_TOKEN;
export declare const PORT_PRODUCE_TOKEN: PORT_PRODUCE_TOKEN;
export declare const PORT_PLACE: PORT_PLACE;
export declare const VALID_PETRINET_PORTS: VALID_PETRINET_PORTS[];
export declare const PORT_DATA: PORT_DATA;
export declare const PORT_EVENT: PORT_EVENT;
export declare const PORT_FUNCTION: PORT_FUNCTION;
export declare const VALID_BASE_PORTS: VALID_BASE_PORTS[];
export declare const PORT_FLOW_OP_EXECUTE: PORT_FLOW_OP_EXECUTE;
export declare const PORT_FLOW_OP_DONE: PORT_FLOW_OP_DONE;
export declare const PORT_FLOW_OP_ERROR: PORT_FLOW_OP_ERROR;
export declare const VALID_FLOW_PORTS: VALID_FLOW_PORTS[];
export declare const PORT_ACTION_FIRE: PORT_ACTION_FIRE;
export declare const PORT_ACTION_FIRED: PORT_ACTION_FIRED;
export declare const PORT_ACTION_RELEASE: PORT_ACTION_RELEASE;
export declare const PORT_ACTION_LOCK: PORT_ACTION_LOCK;
export declare const VALID_ACTION_PORTS: VALID_ACTION_PORTS[];
export declare const PORT_SERVICE_DONE: PORT_SERVICE_DONE;
export declare const PORT_SERVICE_ERROR: PORT_SERVICE_ERROR;
export declare const PORT_SERVICE_RESULT: PORT_SERVICE_RESULT;
export declare const VALID_SERVICE_PORTS: ("service.done" | "service.error" | "service.result")[];
export declare const VALID_PORTS: VALID_PORTS[];
export declare const NODE_TYPE_GROUP: NODE_TYPE_GROUP;
export declare const NODE_TYPE_CONSTANT: NODE_TYPE_CONSTANT;
export declare const NODE_TYPE_DATA_TO_TOKEN: NODE_TYPE_DATA_TO_TOKEN;
export declare const NODE_TYPE_START: NODE_TYPE_START;
export declare const NODE_TYPE_FLOW_OPERATION: NODE_TYPE_FLOW_OPERATION;
export declare const NODE_TYPE_PLACE: NODE_TYPE_PLACE;
export declare const NODE_TYPE_TOKEN_TO_DATA: NODE_TYPE_TOKEN_TO_DATA;
export declare const NODE_TYPE_TRANSITION: NODE_TYPE_TRANSITION;
export declare const NODE_TYPE_VAR: NODE_TYPE_VAR;
export declare const NODE_TYPE_MODULE: NODE_TYPE_MODULE;
export declare const NODE_TYPE_DATA_IF: NODE_TYPE_DATA_IF;
export declare const NODE_TYPE_BOOL_NOT: NODE_TYPE_BOOL_NOT;
export declare const NODE_TYPE_BOOL_OR: NODE_TYPE_BOOL_OR;
export declare const NODE_TYPE_BOOL_AND: NODE_TYPE_BOOL_AND;
export declare const NODE_TYPE_BOOL_XOR: NODE_TYPE_BOOL_XOR;
export declare const NODE_TYPE_FLOW_SYNC: NODE_TYPE_FLOW_SYNC;
export declare const NODE_TYPE_FLOW_IF: NODE_TYPE_FLOW_IF;
export declare const NODE_TYPE_WAIT_FOR: NODE_TYPE_WAIT_FOR;
export declare const NODE_TYPE_DATA_TO_ON_CHANGE: NODE_TYPE_DATA_TO_ON_CHANGE;
export declare const NODE_TYPE_DATA_TO_ON_TRUE: NODE_TYPE_DATA_TO_ON_TRUE;
export declare const NODE_TYPE_EVENT_TO_DATA: NODE_TYPE_EVENT_TO_DATA;
export declare const VALID_NODES: Array<VALID_NODES>;
/**
* Information of a base node in a graph.
*/
export interface IBaseNode {
key: string | number;
location: {
x: number;
y: number;
};
category?: VALID_NODES;
size?: {
width: number;
height: number;
};
group?: number | string;
isGroup?: boolean;
color?: string;
}
export interface IPort {
label: string;
portId: string;
type: VALID_PORTS;
allowMultipleInputs?: true;
portColor?: string;
}
export interface PN extends Partial<IBaseNode> {
}