Class ProjectAbstract

Static class handling the resources used with the current FUDGE-instance.
Keeps a list of the resources and generates ids to retrieve them.
Resources are objects referenced multiple times but supposed to be stored only once

Hierarchy (view full)

Properties

baseURL: URL = ...
graphInstancesToResync: GraphInstancesToResync = {}
mode: MODE = MODE.RUNTIME
resources: Resources = {}
scriptNamespaces: ScriptNamespaces = {}
serialization: SerializationOfResources = {}

Methods

  • Loads a script from the given URL and integrates it into a HTMLScriptElement in the document.head

    Parameters

    • _url: RequestInfo

    Returns Promise<void>

  • Registers the resource and generates an id for it by default.
    If the resource already has an id, thus having been registered, its deleted from the list and registered anew. It's possible to pass an id, but should not be done except by the Serializer.

    Parameters

    Returns void

  • Creates and registers a resource from a Node, copying the complete graph starting with it

    Parameters

    • _node: Node

      A node to create the resource from

    • _replaceWithInstance: boolean = true

      if true (default), the node used as origin is replaced by a GraphInstance of the Graph created

    Returns Promise<Graph>