SukkaW c2cc6d72ac
Some checks failed
Build / Build (push) Has been cancelled
Build / Diff output (push) Has been cancelled
Build / Deploy to Cloudflare Pages (3.114.6) (push) Has been cancelled
Build / Deploy to GitHub and GitLab (push) Has been cancelled
Chore: minor changes
2025-04-29 22:19:05 +08:00

50 lines
1.2 KiB
TypeScript

import type { Span } from '../../trace';
import { ClashClassicRuleSet } from '../writing-strategy/clash';
import { LegacyClashPremiumClassicRuleSet } from '../writing-strategy/legacy-clash-premium';
import { SingboxSource } from '../writing-strategy/singbox';
import { SurgeRuleSet } from '../writing-strategy/surge';
import { FileOutput } from './base';
export class RulesetOutput extends FileOutput {
constructor(span: Span, id: string, type: 'non_ip' | 'ip') {
super(span, id);
this.strategies = [
new SurgeRuleSet(type),
new ClashClassicRuleSet(type),
new LegacyClashPremiumClassicRuleSet(type),
new SingboxSource(type)
];
}
}
export class SurgeOnlyRulesetOutput extends FileOutput {
constructor(
span: Span,
id: string,
type: 'non_ip' | 'ip' | (string & {}),
overrideOutputDir?: string
) {
super(span, id);
this.strategies = [
new SurgeRuleSet(type, overrideOutputDir)
];
}
}
export class ClashOnlyRulesetOutput extends FileOutput {
constructor(
span: Span,
id: string,
type: 'non_ip' | 'ip'
) {
super(span, id);
this.strategies = [
new ClashClassicRuleSet(type),
new LegacyClashPremiumClassicRuleSet(type)
];
}
}