Skip to content

Commit

Permalink
feat: rule type
Browse files Browse the repository at this point in the history
Update rule.ts
  • Loading branch information
VirgilClyne committed Oct 20, 2024
1 parent ae8a232 commit 19f79e3
Showing 1 changed file with 40 additions and 5 deletions.
45 changes: 40 additions & 5 deletions packages/modkit/shared/src/types/source/rule.ts
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 19f79e3

Please sign in to comment.