-
Notifications
You must be signed in to change notification settings - Fork 168
/
operatorsTypes.ts
126 lines (93 loc) · 2.6 KB
/
operatorsTypes.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
import type { FunctionParam } from './functionsTypes';
import type { DropOptions, Name, Type } from './generalTypes';
export interface CreateOperatorOptions {
procedure: Name;
left?: Name;
right?: Name;
commutator?: Name;
negator?: Name;
restrict?: Name;
join?: Name;
hashes?: boolean;
merges?: boolean;
}
export interface DropOperatorOptions extends DropOptions {
left?: Name;
right?: Name;
}
export interface CreateOperatorClassOptions {
default?: boolean;
family?: string;
}
export interface OperatorListDefinition {
type: 'function' | 'operator';
number: number;
name: Name;
params?: FunctionParam[];
}
type CreateOperatorFn = (
operatorName: Name,
options: CreateOperatorOptions & DropOperatorOptions
) => string | string[];
export type CreateOperator = CreateOperatorFn & { reverse: CreateOperatorFn };
export type DropOperator = (
operatorName: Name,
dropOptions?: DropOperatorOptions
) => string | string[];
type CreateOperatorClassFn = (
operatorClassName: Name,
type: Type,
indexMethod: Name,
operatorList: OperatorListDefinition[],
options: CreateOperatorClassOptions & DropOptions
) => string | string[];
export type CreateOperatorClass = CreateOperatorClassFn & {
reverse: CreateOperatorClassFn;
};
export type DropOperatorClass = (
operatorClassName: Name,
indexMethod: Name,
dropOptions?: DropOptions
) => string | string[];
type RenameOperatorClassFn = (
oldOperatorClassName: Name,
indexMethod: Name,
newOperatorClassName: Name
) => string | string[];
export type RenameOperatorClass = RenameOperatorClassFn & {
reverse: RenameOperatorClassFn;
};
type CreateOperatorFamilyFn = (
operatorFamilyName: Name,
indexMethod: Name,
options?: DropOptions
) => string | string[];
export type CreateOperatorFamily = CreateOperatorFamilyFn & {
reverse: CreateOperatorFamilyFn;
};
export type DropOperatorFamily = (
operatorFamilyName: Name,
newSchemaName: Name,
dropOptions?: DropOptions
) => string | string[];
type RenameOperatorFamilyFn = (
oldOperatorFamilyName: Name,
indexMethod: Name,
newOperatorFamilyName: Name
) => string | string[];
export type RenameOperatorFamily = RenameOperatorFamilyFn & {
reverse: RenameOperatorFamilyFn;
};
type AddToOperatorFamilyFn = (
operatorFamilyName: Name,
indexMethod: Name,
operatorList: OperatorListDefinition[]
) => string | string[];
export type AddToOperatorFamily = AddToOperatorFamilyFn & {
reverse: AddToOperatorFamilyFn;
};
export type RemoveFromOperatorFamily = (
operatorFamilyName: Name,
indexMethod: Name,
operatorList: OperatorListDefinition[]
) => string | string[];