-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* use value formatter for calculating values * validate $user dialect * 2.6.75
- Loading branch information
1 parent
dbd71e2
commit 3fd67df
Showing
13 changed files
with
2,161 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { DataModelBase } from "@themost/common"; | ||
import { AsyncSeriesEventEmitter } from '@themost/events'; | ||
import { DataContext } from "./types"; | ||
import { DataModel } from './data-model'; | ||
|
||
export declare interface ResolvingVariable { | ||
name: string; | ||
model?: DataModelBase; | ||
context?: DataContext; | ||
target?: any; | ||
value?: any; | ||
} | ||
|
||
|
||
/** | ||
* Class responsible for formatting values within a given data context. | ||
*/ | ||
export declare class ValueFormatter { | ||
|
||
readonly resolvingVariable: AsyncSeriesEventEmitter<ResolvingVariable>; | ||
/** | ||
* Creates an instance of ValueFormatter. | ||
* @param context - The data context in which the formatter operates. | ||
*/ | ||
constructor(context: DataContext, model?: DataModel, target?: any); | ||
|
||
/** | ||
* Formats the given value according to the rules defined in the data context. | ||
* @param value - The value to be formatted. | ||
* @returns The formatted value. | ||
*/ | ||
format(value: unknown): any; | ||
|
||
static register(name: string, definition: { [k: string]: (...value: any[]) => Promise<any> }): void; | ||
} | ||
|
||
export declare class ValueDialect { | ||
/** | ||
* Creates an instance of ValueDialect. | ||
* @param context - The data context in which the dialect operates. | ||
*/ | ||
constructor(context: DataContext, model: DataModel, target: any); | ||
|
||
} |
Oops, something went wrong.