Home Reference Source
import EnvContext from 'remote-context/lib/EnvContext.js'
public class | source

EnvContext

Extends:

ReferenceContext → EnvContext

Example:

import { EnvContext } from 'remote-context';

const envContext = new EnvContext(name, context);

Constructor Summary

Public Constructor
public

constructor(name: string, context: object)

Create a new environment context.

Member Summary

Public Members
public get

Get the known name of this environment

Inherited Summary

From class ReferenceContext
public static

isValidReference(reference: *): boolean

Check if the given reference is valid.

public get

The the number of values in this context including it's parents.

public get

The the number of values in this context (excluding the parents).

public get

The the number of keys in this context (excluding the parents).

public get

Get the parent context.

public get

The the number of keys in this context including it's parents.

public

assign(value: *): Reference

Assign a new reference for the given value or return it's current reference.

public

clear(): void

Clear and release all the values on this context.

public

Create a closure context for this context.

public

Copy from other context it's references and values

public

delete(reference: Reference): boolean

Remove the given reference from this context.

public

exists(value: *): boolean

Check if this context or one of it's parents has the given value.

public

forEach(callback: function, thisArg: *): ReferenceContext

Iterate over the context own values.

public

Generate a reference for the assign method.

public

get(reference: Reference): * | undefined

Get the reference value on this context or it's parents.

public

has(reference: Reference): boolean

Check if this context or it's parents has the given reference.

public

Check if this context only (and not the parents) has the given reference.

public

lookup(value: *): Reference | undefined

Get the reference of the given value in this context or one of it's parents. Return undefined if the value not exists.

public

own(value: *): boolean

Check if this context only (excluding the parents) has the given value.

public

release(value: *): boolean

Release a value from this context and remove any reference for this value.

public

set(reference: Reference, value: *): ReferenceContext

Set a reference for the given value.

public

Get the instance constructor name.

Public Constructors

public constructor(name: string, context: object) source

Create a new environment context.

Override:

ReferenceContext#constructor

Params:

NameTypeAttributeDescription
name string

The known name of the environment

context object

A key-value object with all the context values.

Public Members

public get name: string source

Get the known name of this environment