Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Model<In, Out>

This model contains multiple Nodes, Services to sample DataFrames that are pushed or pulled from this model.

Usage

Creation

Please refer to ModelBuilder for creating a new model

Pushing and Pulling

Pushing or pulling on a model is possible, but only recommended for prototyping. Instead, developers should use a SourceNode that automatically pushes new DataFrames or pushes new frames when receiving a pull.

Type parameters

Hierarchy

Index

Properties

edges

edges: Edge<any>[]

graph

graph: any

Graph shape

name

name: string

Name of the node. Does not have to be unique.

nodes

nodes: GraphNode<any, any>[]

referenceSpace

referenceSpace: TransformationSpace

Model reference space

uid

uid: string = ...

Unique identifier of node.

Accessors

inlets

  • get inlets(): Inlet<In>[]

outlets

  • get outlets(): Outlet<Out>[]

Methods

addEdge

  • addEdge(edge: Edge<any>): void

addListener

  • addListener(event: string | symbol, listener: (...args: any[]) => void): Model<In, Out>
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Model<In, Out>

addNode

  • addNode(node: GraphNode<any, any>): void

deleteEdge

  • deleteEdge(edge: Edge<any>): void

deleteNode

  • deleteNode(node: GraphNode<any, any>): void

destroy

  • destroy(): Promise<boolean>
  • Destroy the model, added nodes and services Equivalent of model.emitAsync('destroy');

    Returns Promise<boolean>

emit

  • emit(name: string | symbol, ...args: any[]): boolean
  • emit(event: "available"): boolean
  • emit(name: "completed", e: PushCompletedEvent): boolean
  • emit(name: "error", e: PushError): boolean
  • emit(name: "ready"): boolean
  • emit(name: "destroy"): boolean

emitAsync

  • emitAsync(type: string | symbol, ...args: any[]): Promise<boolean>

eventNames

  • eventNames(): (string | symbol)[]
  • Returns (string | symbol)[]

findAllServices

  • findAllServices<S>(q?: new () => S): S[]
  • Find all services and data services

    Type parameters

    Parameters

    • Optional q: new () => S
        • new (): S
        • Returns S

    Returns S[]

    Array of all services

findDataService

  • findDataService<D, F>(name: string): F
  • findDataService<D, F>(dataType: new () => D): F
  • findDataService<D, F>(object: D): F

findNodeByName

  • findNodeByName(name: string): GraphNode<any, any>

findNodeByUID

  • findNodeByUID(uid: string): GraphNode<any, any>

findService

  • findService<F>(name: string): F
  • findService<F>(serviceClass: new () => F): F
  • Find service

    Type parameters

    Parameters

    • name: string

    Returns F

    Found service

  • Type parameters

    Parameters

    • serviceClass: new () => F
        • new (): F
        • Returns F

    Returns F

getMaxListeners

  • getMaxListeners(): number
  • Returns number

isAvailable

  • isAvailable(): boolean

isReady

  • isReady(): boolean

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

logger

  • logger(level: string, log: any): void

off

  • off(event: string | symbol, listener: (...args: any[]) => void): Model<In, Out>
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Model<In, Out>

on

  • on(name: string | symbol, listener: (...args: any[]) => void): Model<In, Out>
  • on(event: "available", listener: () => void | Promise<void>): Model<In, Out>
  • on(name: "completed", listener: (event: PushCompletedEvent) => void | Promise<void>): Model<In, Out>
  • on(name: "error", listener: (event: PushError) => void | Promise<void>): Model<In, Out>
  • on(name: "pull", listener: (options?: PullOptions) => void | Promise<void>): Model<In, Out>
  • on(name: "push", listener: (frame: In, options?: PushOptions) => void | Promise<void>): Model<In, Out>

once

  • once(name: string | symbol, listener: (...args: any[]) => void): Model<In, Out>
  • once(event: "available", listener: () => void | Promise<void>): Model<In, Out>
  • once(name: "completed", listener: (event: PushCompletedEvent) => void | Promise<void>): Model<In, Out>
  • once(name: "destroy", listener: () => void | Promise<void>): Model<In, Out>
  • once(name: "build", listener: (builder: any) => void | Promise<void>): Model<In, Out>
  • once(name: "ready", listener: () => void | Promise<void>): Model<In, Out>

onceAvailable

  • onceAvailable(): Promise<void>

onceCompleted

  • onceCompleted(frameUID: string): Promise<PushEvent>

prependListener

  • prependListener(event: string | symbol, listener: (...args: any[]) => void): Model<In, Out>
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Model<In, Out>

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): Model<In, Out>
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Model<In, Out>

pull

push

  • push(data: In | In[], options?: PushOptions): Promise<void>

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • removeAllListeners(event?: string | symbol): Model<In, Out>
  • Parameters

    • Optional event: string | symbol

    Returns Model<In, Out>

removeListener

  • removeListener(event: string | symbol, listener: (...args: any[]) => void): Model<In, Out>
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Model<In, Out>

setMaxListeners

  • setMaxListeners(n: number): Model<In, Out>
  • Parameters

    • n: number

    Returns Model<In, Out>