UNPKG

@herbertgao/surgio

Version:

Generating rules for Surge, Clash, Quantumult like a PRO

12 lines (11 loc) 895 B
import { JsonObject } from 'type-fest'; type ExtendContext = Record<string, any>; type PremitiveValue = string | number | boolean; type ExtendValue = JsonObject[] | JsonObject | PremitiveValue[] | PremitiveValue | ((extendContext: ExtendContext) => JsonObject[] | JsonObject | PremitiveValue[] | PremitiveValue); type ExtendFunction = (extendValue: ExtendValue) => (jsonInput: JsonObject, extendContext?: ExtendContext) => JsonObject; export declare const createExtendFunction: (extendKey: string) => ExtendFunction; export declare const extendOutbounds: ExtendFunction; export declare const extendEndpoints: ExtendFunction; export declare const combineExtendFunctions: (...args: ReturnType<ExtendFunction>[]) => ReturnType<ExtendFunction>; export declare const render: (templateDir: string, fileName: string, extend: (...args: any[]) => any, extendContext: ExtendContext) => string; export {};