Saxonberg Server API
    Preparing search index...
    Index

    Methods

    • Class currently registered under the canonical export name for path, or null if the path is in state Empty (or the file doesn't export a class matching the last-path-segment convention).

      The canonical export is the export whose name equals the last path segment without extension — the same convention StuffApi.clone uses today.

      Parameters

      • path: string

      Returns ClassLike | null

    • Like getCurrent but for an explicit export name. Useful for mixin / hook files where filename ≠ canonical export.

      Parameters

      • path: string
      • exportName: string

      Returns ClassLike | null

    • Previous registered class for path, or null in states Empty and V1. Same canonical-export convention as getCurrent.

      Parameters

      • path: string

      Returns ClassLike | null

    • Whether path was explicitly unload'd and not yet repopulated by a subsequent reload. StuffApi.clone uses this to choose between throwing (frozen) and lazy-reloading (never-seen).

      Parameters

      • path: string

      Returns boolean

    • Load the module at path, swap the registry's current blueprint for the new one. Throws on compile error or top-level execution error; registry stays unchanged on failure.

      Concurrent reload(path) calls share one in-flight promise — the second caller waits for the first instead of starting a parallel import.

      Parameters

      • path: string

      Returns Promise<void>

    • Refresh the persistence-hook chain from hooks.yaml. Required after reloading a hook source file: hook instances live as cloned Stuff objects pinned to their old class. This call drops the chain and rebuilds it from the manifest, so the next save / delete fires the freshly-cloned hooks. Idempotent.

      Lazy import keeps PersistenceManager (and its mongo dependency tree) out of HotReloadApi's static graph for callers that only touch the registry surface.

      Returns Promise<void>

    • Clear both registry slots for path and freeze it. Subsequent clone(path) throws "no blueprint at path" until the next reload() repopulates. Idempotent: unload-from-Empty emits the event without changing state, so subscribers still see the intent.

      Parameters

      • path: string

      Returns void