Refactor: adjust write strategy usage

This commit is contained in:
SukkaW
2025-01-29 21:24:00 +08:00
parent 956d98d7dc
commit f9163db26c
9 changed files with 365 additions and 209 deletions

View File

@@ -15,3 +15,32 @@ export class RulesetOutput extends FileOutput {
];
}
}
export class SurgeOnlyRulesetOutput extends FileOutput {
constructor(
span: Span,
id: string,
protected type: 'non_ip' | 'ip' | (string & {}),
overrideOutputDir?: string
) {
super(span, id);
this.strategies = [
new SurgeRuleSet(this.type, overrideOutputDir)
];
}
}
export class ClashOnlyRulesetOutput extends FileOutput {
constructor(
span: Span,
id: string,
protected type: 'non_ip' | 'ip' | (string & {})
) {
super(span, id);
this.strategies = [
new ClashClassicRuleSet(this.type)
];
}
}