Refactor: refine writing strategy
Some checks are pending
Build / Build (push) Waiting to run
Build / Diff output (push) Blocked by required conditions
Build / Deploy to Cloudflare Pages (push) Blocked by required conditions
Build / Deploy to GitHub and GitLab (push) Blocked by required conditions

This commit is contained in:
SukkaW
2025-02-01 00:04:09 +08:00
parent 3926fb3484
commit 2035f5ea96
8 changed files with 41 additions and 35 deletions

View File

@@ -42,7 +42,11 @@ export class SingboxSource extends BaseWriteStrategy {
});
}
constructor(public type: string, protected outputDir = OUTPUT_SINGBOX_DIR) {
constructor(
/** Since sing-box only have one format that does not reflect type, we need to specify it */
public type: 'domainset' | 'non_ip' | 'ip' /* | (string & {}) */,
public readonly outputDir = OUTPUT_SINGBOX_DIR
) {
super(outputDir);
}