1 import type { ConditionComparator, FilterStatement } from '@proton/components/containers/filters/interfaces';
3 export type SIEVE_VERSION = 1 | 2;
5 export interface ValueTypePair {
9 export interface ValueNamePair {
13 export interface ValueTextPair {
18 export interface PrepareType {
23 export interface Match {
27 export const LABEL_KEYS = {
32 recipient: 'Recipient',
33 attachments: 'Attachments',
35 '!contains': 'does not contain',
39 '!matches': 'does not match',
40 starts: 'begins with',
41 '!starts': 'does not begin with',
43 '!ends': 'does not end with',
46 export type LABEL_KEY_TYPE = keyof typeof LABEL_KEYS;
48 export const LABEL_KEY_MATCHING = [
69 { match: 'Ends', default: 'ends', negate: '!ends' },
72 export const MATCH_KEYS: Partial<Record<ConditionComparator | 'default', string>> = {
81 export const OPERATOR_KEYS: Record<FilterStatement, string> = {
86 export interface BuildFileIntoType {
88 Name: string | ValueTypePair;
91 export interface IfTest {
110 export interface ItType {
125 export interface SieveTests {
131 export interface SieveCondition {
133 comparators: string[];
134 dollarNeeded: boolean;
137 export type EscapeVariableType = string | ValueTypePair;
139 export interface MainNodeType {
153 export type SieveBranch =