-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathValueFormatter.d.ts
More file actions
43 lines (35 loc) · 1.25 KB
/
ValueFormatter.d.ts
File metadata and controls
43 lines (35 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { DataModelBase } from "@themost/common";
import { AsyncSeriesEventEmitter } from '@themost/events';
import { DataContext } from "types";
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?: DataModelBase, 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: DataModelBase, target: any);
}