Type Parameters

  • Schemes extends ExpectedSchemes
  • K = BaseArea<Schemes>

Hierarchy

Constructors

Properties

__scope: {
    parents: [K | BaseArea<Schemes>];
    produces: Produces;
}
comments: Map<string, Comment>
factory: NodeFactory
lastPointerEvent?: PointerEvent
name: string
parent?: any
signal: Signal<any>

Methods

  • Adds a frame comment. Represents a rectangle with a text and nodes linked to it. When user translates a comment, all linked nodes will be translated as well. When user drops a node on a comment, the node will be linked to the comment.

    Parameters

    • Optionaltext: string

      Comment text

    • Optionallinks: string[]

      List of node IDs the comment is linked with

    • params: {
          editPrompt?: boolean;
          id?: string;
      } = {}
      • OptionaleditPrompt?: boolean
      • Optionalid?: string

    Returns void

  • Adds an inline comment which is represented by a block with text at certain position, which is attached to the node. When user translates a node, the comment will be translated as well. When user drops a comment on a node, the comment will be linked to the node.

    Parameters

    • text: string

      Comment text

    • position: [number, number]

      Comment position

    • Optionallink: string

      Node ID the comment is linked with

    Returns void

  • Parameters

    • middleware: Pipe<K | Produces | BaseArea<Schemes>>

    Returns void

  • Removes all comments

    Returns void

  • Removes a comment

    Parameters

    • id: string

      Comment id

    Returns void

  • Trigger edit form for a comment

    Parameters

    • id: string

      Comment id

    Returns Promise<void>

  • Type Parameters

    • C extends Produces

    Parameters

    • context: C

    Returns Promise<
        | undefined
        | Extract<{
            data: Comment;
            type: "commentcreated";
        }, C>
        | Extract<{
            data: Comment;
            type: "commentremoved";
        }, C>
        | Extract<{
            data: Comment;
            type: "editcomment";
        }, C>
        | Extract<{
            data: Comment;
            type: "commentselected";
        }, C>
        | Extract<{
            data: Comment;
            type: "commentunselected";
        }, C>
        | Extract<{
            data: {
                dx: number;
                dy: number;
                id: string;
                sources?: string[];
            };
            type: "commenttranslated";
        }, C>
        | Extract<{
            data: {
                id: string;
                link: string;
            };
            type: "commentlinktranslate";
        }, C>>

  • Returns boolean

  • Type Parameters

    • T
    • P extends []

    Returns Scope<T, P>

  • Type Parameters

    • T

    Parameters

    • type: Type<T>

    Returns T

  • Selects a comment

    Parameters

    • id: string

      Comment id

    Returns void

  • Translates a comment

    Parameters

    • id: string

      Comment id

    • dx: number

      Delta x

    • dy: number

      Delta y

    Returns void

  • Unselects a comment

    Parameters

    • id: string

      Comment id

    Returns void

  • Type Parameters

    • S extends Scope<any, any[]>

    Parameters

    • scope: NestedScope<S, [Produces, K | BaseArea<Schemes>]>

    Returns {
        debug<T>(_f: ((p: {
            [K in string | number | symbol]: K | Produces | BaseArea<Schemes>
        }) => T)): void;
    }

    • debug:function
      • Type Parameters

        • T extends [] | [KeepIfNonAssignable<unknown, K | Produces | BaseArea<Schemes>>]

        Parameters

        • _f: ((p: {
              [K in string | number | symbol]: K | Produces | BaseArea<Schemes>
          }) => T)
            • (p): T
            • Parameters

              • p: {
                    [K in string | number | symbol]: K | Produces | BaseArea<Schemes>
                }

              Returns T

        Returns void