diff --git a/packages/modkit/shared/src/types/source/rule.ts b/packages/modkit/shared/src/types/source/rule.ts index cb390ef..689c575 100644 --- a/packages/modkit/shared/src/types/source/rule.ts +++ b/packages/modkit/shared/src/types/source/rule.ts @@ -1,17 +1,52 @@ -export interface RuleSetRule { - type: 'RULE-SET'; +export interface Rule { + type: + | 'DOMAIN' + | 'DOMAIN-SUFFIX' + | 'DOMAIN-KEYWORD' + | 'DOMAIN-SET' + | 'IP-CIDR' + | 'IP-CIDR6' + | 'GEOIP' + | 'IP-ASN' + | 'USER-AGENT' + | 'URL-REGEX' + | 'PROCESS-NAME' + | 'AND' + | 'OR' + | 'NOT' + | 'SUBNET' + | 'DEST-PORT' + | 'IN-PORT' + | 'SRC-PORT' + | 'SRC-IP' + | 'PROTOCOL' + | 'SCRIPT' + | 'CELLULAR-RADIO' + | 'DEVICE-NAME' + | 'RULE-SET' + | 'FINAL'; + content?: string; /** * 对应 `source.assets` 中的 key */ - assetKey: string; + assetKey?: string; /** * 策略名 */ - policyName?: string; + policyName?: + | 'DIRECT' + | 'REJECT' + | 'REJECT-NO-DROP' + | 'REJECT-TINYGIF' + | 'CELLULAR' + | 'CELLULAR-ONLY' + | 'HYBRID' + | 'NO-HYBRID' + | string; /** * 描述 */ description?: string; } -export type ModuleRule = string | RuleSetRule; +export type ModuleRule = string | Rule;