-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInterpretation.d.ts
39 lines (39 loc) · 1.42 KB
/
Interpretation.d.ts
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
import Scope from './Scope';
import Environment from './Environment';
import Type from './Type';
import Expression from './Expression';
interface Interpretation<T> {
pre(global: Environment<Type>): void;
post(T): T;
expression: {
literal($value): T;
name: {
table($identifier: string): T;
constant($identifier: string): T;
name(this: Environment<Type>, $identifier: string, resolution: [Type, [number, Scope.Key]]): T;
},
object($property: { name: string, value: T }[]): T;
array($element: T[]): T;
tuple($element: T[]): T;
find($table: string, $property: string, $id: string): T;
field($expression: T, $property: string): T;
element($expression: T, $index: T): T;
call(this: Environment<Type>, $expression: T, $argument: T): T;
operation($operator: string, $left?: T, $right?: T): T;
conditional($condition: T, $true: T, $false: T): T;
filter($expression: T, $filter: T): T;
which($expression: T, $filter: T): T;
map($expression: T, $mapper: T): T;
limit($expression: T, $limiter: [T, T]): T;
order($expression: T, $orderer: T, $direction?: boolean): T;
group($expression: T, $grouper: T): T;
distinct($expression: T): T;
compile(this: Environment<Type>, expression: Expression): T;
bind($value: T, scope: Scope<T>, environment: number = 0): T;
scope($expression: Scope<T>, expression: Expression): { [key: string]: any };
};
constant: {
[name: string]: Type;
};
};
export = Interpretation;