Class: LanguageManager
Defined in: packages/core/src/lang-manager.ts:81
Manages the registration and retrieval of language-specific features.
Constructors
Constructor
new LanguageManager(
db):LanguageManager
Defined in: packages/core/src/lang-manager.ts:90
Parameters
| Parameter | Type |
|---|---|
db | DortDBAsFriend |
Returns
LanguageManager
Methods
getAggr()
getAggr(
lang,name,schema?):AggregateFn
Defined in: packages/core/src/lang-manager.ts:190
Retrieves an aggregate function by name and schema for a specific language. If no such aggregate function is registered specifically for the language, also checks for global aggregate functions.
Parameters
| Parameter | Type | Description |
|---|---|---|
lang | string | The language to search in. |
name | string | The name of the aggregate function to retrieve. |
schema? | string | symbol | The schema of the aggregate function to retrieve. |
Returns
The requested aggregate function, or throws an error if not found.
getCast()
getCast(
lang,name,schema?):Castable
Defined in: packages/core/src/lang-manager.ts:205
Retrieves a castable by name and schema for a specific language. If no such castable is registered specifically for the language, also checks for global castables.
Parameters
| Parameter | Type | Description |
|---|---|---|
lang | string | The language to search in. |
name | string | The name of the castable to retrieve. |
schema? | string | symbol | The schema of the castable to retrieve. |
Returns
The requested castable, or throws an error if not found.
getFn()
getFn(
lang,name,schema?):Fn
Defined in: packages/core/src/lang-manager.ts:179
Retrieves a function by name and schema for a specific language. If no such function is registered specifically for the language, also checks for global functions.
Parameters
| Parameter | Type | Description |
|---|---|---|
lang | string | The language to search in. |
name | string | The name of the function to retrieve. |
schema? | string | symbol | The schema of the function to retrieve. |
Returns
The requested function, or throws an error if not found.
getFnOrAggr()
getFnOrAggr(
lang,name,schema?):AggregateFn|Fn
Defined in: packages/core/src/lang-manager.ts:220
Retrieves a function or aggregate function by name and schema for a specific language. First checks for functions, then for global functions, then for aggregate functions, then for global aggregate functions.
Parameters
| Parameter | Type | Description |
|---|---|---|
lang | string | The language to search in. |
name | string | The name of the function or aggregate function to retrieve. |
schema? | string | symbol | The schema of the function or aggregate function to retrieve. |
Returns
The requested function or aggregate function, or throws an error if not found.
getLang()
getLang<
Name,Lang>(name):Lang
Defined in: packages/core/src/lang-manager.ts:134
Retrieves a registered language by name.
Type Parameters
| Type Parameter |
|---|
Name extends string |
Lang extends Language<Name> |
Parameters
| Parameter | Type | Description |
|---|---|---|
name | Name | The name of the language to retrieve. |
Returns
Lang
getOp()
getOp(
lang,name,schema?):Operator
Defined in: packages/core/src/lang-manager.ts:168
Retrieves an operator by name and schema for a specific language. If no such operator is registered specifically for the language, also checks for global operators.
Parameters
| Parameter | Type | Description |
|---|---|---|
lang | string | The language to search in. |
name | string | The name of the operator to retrieve. |
schema? | string | symbol | The schema of the operator to retrieve. |
Returns
The requested operator, or throws an error if not found.
getVisitorMap()
getVisitorMap<
T>(visitor):Record<string,InstanceType<PlanVisitors[T]>>
Defined in: packages/core/src/lang-manager.ts:145
Creates a map of visitor instances for a specific visitor type.
Type Parameters
| Type Parameter |
|---|
T extends keyof PlanVisitors |
Parameters
| Parameter | Type | Description |
|---|---|---|
visitor | T | The visitor type to retrieve. |
Returns
Record<string, InstanceType<PlanVisitors[T]>>
A map of language names to visitor instances.
registerExtension()
registerExtension(
ext):void
Defined in: packages/core/src/lang-manager.ts:96
Registers a new language extension.
Parameters
| Parameter | Type | Description |
|---|---|---|
ext | Extension | The extension to register. |
Returns
void
registerLang()
registerLang(
lang):void
Defined in: packages/core/src/lang-manager.ts:125
Registers a new language.
Parameters
| Parameter | Type | Description |
|---|---|---|
lang | Language | The language to register. |
Returns
void