ruleset.ts 571 B

1234567891011121314151617
  1. import type { Span } from '../../trace';
  2. import { ClashClassicRuleSet } from '../writing-strategy/clash';
  3. import { SingboxSource } from '../writing-strategy/singbox';
  4. import { SurgeRuleSet } from '../writing-strategy/surge';
  5. import { FileOutput } from './base';
  6. export class RulesetOutput extends FileOutput {
  7. constructor(span: Span, id: string, protected type: 'non_ip' | 'ip' | (string & {})) {
  8. super(span, id);
  9. this.strategies = [
  10. new SurgeRuleSet(this.type),
  11. new ClashClassicRuleSet(this.type),
  12. new SingboxSource(this.type)
  13. ];
  14. }
  15. }