Hierarchy
- Context
Constructors
constructor
+ new Context(env: object, opts: NormalizedFullOptions, sync: boolean): Context
Defined in context/context.ts:26
Parameters:
| Name | Type | Default |
|---|---|---|
env |
object | {} |
opts |
NormalizedFullOptions | defaultOptions |
sync |
boolean | false |
Returns: Context
Properties
environments
• environments: Scope
Defined in context/context.ts:20
globals
• globals: Scope
Defined in context/context.ts:24
opts
• opts: NormalizedFullOptions
Defined in context/context.ts:26
Private registers
• registers: object
Defined in context/context.ts:14
Type declaration:
Private scopes
• scopes: Scope[] = [{}]
Defined in context/context.ts:13
sync
• sync: boolean
Defined in context/context.ts:25
Methods
bottom
▸ bottom(): PlainObject | Drop
Defined in context/context.ts:69
Returns: PlainObject | Drop
Private findScope
▸ findScope(key: string): PlainObject | Drop
Defined in context/context.ts:72
Parameters:
| Name | Type |
|---|---|
key |
string |
Returns: PlainObject | Drop
get
▸ get(paths: string[]): object
Defined in context/context.ts:49
Parameters:
| Name | Type |
|---|---|
paths |
string[] |
Returns: object
getAll
▸ getAll(): PlainObject | Drop
Defined in context/context.ts:45
Returns: PlainObject | Drop
getFromScope
▸ getFromScope(scope: object, paths: string[] | string): object
Defined in context/context.ts:53
Parameters:
| Name | Type |
|---|---|
scope |
object |
paths |
string[] | string |
Returns: object
getRegister
▸ getRegister(key: string): any
Defined in context/context.ts:33
Parameters:
| Name | Type |
|---|---|
key |
string |
Returns: any
pop
▸ pop(): undefined | PlainObject | Drop
Defined in context/context.ts:66
Returns: undefined | PlainObject | Drop
push
▸ push(ctx: object): number
Defined in context/context.ts:63
Parameters:
| Name | Type |
|---|---|
ctx |
object |
Returns: number
restoreRegister
▸ restoreRegister(keyValues: [string, any][]): void
Defined in context/context.ts:42
Parameters:
| Name | Type |
|---|---|
keyValues |
[string, any][] |
Returns: void
saveRegister
▸ saveRegister(…keys: string[]): [string, any][]
Defined in context/context.ts:39
Parameters:
| Name | Type |
|---|---|
...keys |
string[] |
Returns: [string, any][]
setRegister
▸ setRegister(key: string, value: any): any
Defined in context/context.ts:36
Parameters:
| Name | Type |
|---|---|
key |
string |
value |
any |
Returns: any