Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FakeCanonical<T>

Canonical class used for faking canonical units. Here, the canonical resolver is registered with the global service, but no files are loaded from the filesystem.

Type parameters

  • T

Hierarchy

Index

Constructors

constructor

Properties

Protected appPath

appPath: string[] = []

The base path directory where the canonical definitions reside.

Protected Readonly canon

canon: Canon

Protected canonicalItem

canonicalItem: string = ''

The singular, programmatic name of one of these canonical items.

example

middleware

Protected loadedItems

loadedItems: {} = {}

Object mapping canonical names to loaded file references.

Type declaration

  • [key: string]: T

Protected loadedNamespaces

loadedNamespaces: {} = {}

Object mapping canonical namespaces to resolver functions.

Type declaration

Protected Readonly logging

logging: Logging

status

status: UnitStatus = ...

The current status of the unit.

Protected suffix

suffix: string = '.js'

The file suffix of files in the base path that should be loaded.

Accessors

Private appClassApplication

canonicalItems

  • get canonicalItems(): string

path

Methods

all

  • all(namespace?: string): string[]

Protected app

Protected buildCanonicalDefinition

Protected container

down

  • down(): void | Promise<void>
  • This method is called to stop the unit when the application is shutting down. Here, you should do any teardown required to stop the package cleanly.

    IN PARTICULAR take care to free blocking resources that could prevent the process from exiting without a kill.

    Returns void | Promise<void>

get

  • get(key: string): undefined | T

getBoundMethod

  • getBoundMethod(methodName: string): (...args: any[]) => any
  • Get the method with the given name from this class, bound to this class.

    Parameters

    • methodName: string

    Returns (...args: any[]) => any

    function

      • (...args: any[]): any
      • Parameters

        • Rest ...args: any[]

        Returns any

initCanonicalItem

Protected make

  • make<T>(target: any, ...parameters: any[]): T

namespaces

  • namespaces(): string[]

registerNamespace

  • Register a namespace resolver with the canonical unit.

    Namespaces are canonical names that start with a particular key, beginning with the @ character, which resolve their resources using a resolver function.

    example
    const items = {
        'foo:bar': 123,
        'bob': 456,
    }
    
    const resolver = (key: string) => items[key]
    
    canonical.registerNamespace('@mynamespace', resolver)
    

    Now, the items in the @mynamespace namespace can be accessed like so:

    canonical.get('@mynamespace:foo:bar')  // => 123
    canonical.get('@mynamespace:bob')  // => 456
    

    Parameters

    Returns void

up

  • up(): Promise<void>

Static resolve

Extollo Logo

extollo (v. latin) - to lift up, to elevate

Extollo is a free & libre application framework in TypeScript.