Options
All
  • Public
  • Public/Protected
  • All
Menu

Canonical unit that loads configuration files from app/configs.

Hierarchy

Index

Constructors

constructor

Properties

Protected accessedKeys

accessedKeys: string[] = []

Array of all unique accessed config keys, if recordConfigAccesses is true.

Protected appPath

appPath: string[] = ...

The base path directory where the canonical definitions reside.

Protected Readonly canon

canon: Canon

Protected canonicalItem

canonicalItem: string = 'config'

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

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

Protected recordConfigAccesses

recordConfigAccesses: boolean = false

If true, all the unique configuration keys will be stored for debugging.

status

status: UnitStatus = ...

The current status of the unit.

Protected suffix

suffix: string = '.config.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(): Promise<void>

get

  • get(key: string, fallback?: unknown): any

getBoundMethod

  • getBoundMethod(methodName: string): (...args: any[]) => 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.