forked from ehn-dcc-development/eu-dcc-business-rules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypings.ts
28 lines (25 loc) · 1.4 KB
/
typings.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
/**
* Type definition for CertLogic expressions.
*/
export type CertLogicExpression =
| CertLogicExpression[]
| { "var": string }
| { "and": CertLogicExpression[] }
| { "if": [ CertLogicExpression, CertLogicExpression, CertLogicExpression ] }
| { "===": [ CertLogicExpression, CertLogicExpression ] }
| { "<": [ CertLogicExpression, CertLogicExpression ] | [ CertLogicExpression, CertLogicExpression, CertLogicExpression ] }
| { ">": [ CertLogicExpression, CertLogicExpression ] | [ CertLogicExpression, CertLogicExpression, CertLogicExpression ] }
| { "<=": [ CertLogicExpression, CertLogicExpression ] | [ CertLogicExpression, CertLogicExpression, CertLogicExpression ] }
| { ">=": [ CertLogicExpression, CertLogicExpression ] | [ CertLogicExpression, CertLogicExpression, CertLogicExpression ] }
| { "in": [ CertLogicExpression, CertLogicExpression ] }
| { "+": [ CertLogicExpression, CertLogicExpression ] }
| { "!": [ CertLogicExpression ] }
| { "plusTime": [ CertLogicExpression, number, TimeUnit ] }
| { "reduce": [ CertLogicExpression, CertLogicExpression, CertLogicExpression ] }
| { "extractFromUVCI": [ CertLogicExpression, number ] }
// literals:
| boolean
| number // ...which should be an integer...
| string
export type TimeUnit = "year" | "month" | "day" | "hour"
export const timeUnits: TimeUnit[] = [ "year", "month", "day", "hour" ]