@connectv/core
Version:
agent-based reactive programming library for typescript/javascript
49 lines (48 loc) • 1.6 kB
TypeScript
import { Control } from '../pin/control';
import { Agent } from './agent';
import { NodeLike } from './node-like';
/**
*
* Represents [gate](https://connective.dev/docs/gate) agents.
*
*/
export declare class Gate extends Agent implements NodeLike {
private _control;
constructor();
/**
*
* Shortcut for `.in('value')`, the input pin receiving values.
* [Read this](https://connective.dev/docs/gate#signature) for more details.
*
*/
get input(): import("..").PinLike;
/**
*
* Shortcut for `.out('value')`, the output emitting allowed values.
* [Read this](https://connective.dev/docs/gate#signature) for more details.
*
*/
get output(): import("..").PinLike;
/**
*
* Each pin connected to this pin should emit a boolean value for each
* value sent to `.input`, and if all are true, the value is emitted via `.output`.
* [Read this](https://connective.dev/docs/gate) for more details.
*
*/
get control(): Control;
protected createOutput(label: string): import("..").PinLike;
protected createEntries(): import("..").PinLike[];
protected createExits(): import("..").PinLike[];
clear(): this;
}
/**
*
* Creates a [gate](https://connective.dev/docs/gate) agent.
* Gate agents await a control signal for each incoming value and either pass it along
* or drop it based on the boolean value of the control signal.
* [Checkout the docs](https://connective.dev/docs/gate) for examples and further information.
*
*/
export declare function gate(): Gate;
export default gate;