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 21, 2024
1 parent 537158f commit 92c8bf0
Showing 1 changed file with 40 additions and 36 deletions.
76 changes: 40 additions & 36 deletions packages/modkit/shared/src/types/source/rule.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,43 @@
export type RuleType =
| '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';

export type policyNameType =
| 'DIRECT'
| 'REJECT'
| 'REJECT-NO-DROP'
| 'REJECT-TINYGIF'
| 'CELLULAR'
| 'CELLULAR-ONLY'
| 'HYBRID'
| 'NO-HYBRID'
| string;

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';
type: RuleType;
content?: string;
/**
* 对应 `source.assets` 中的 key
Expand All @@ -33,16 +46,7 @@ export interface Rule {
/**
* 策略名
*/
policyName?:
| 'DIRECT'
| 'REJECT'
| 'REJECT-NO-DROP'
| 'REJECT-TINYGIF'
| 'CELLULAR'
| 'CELLULAR-ONLY'
| 'HYBRID'
| 'NO-HYBRID'
| string;
policyName?: policyNameType;
/**
* 描述
*/
Expand Down

0 comments on commit 92c8bf0

Please sign in to comment.