nxkit
Version:
This is a collection of tools, independent of any other libraries
39 lines (38 loc) • 793 B
TypeScript
export interface Rule {
match: string;
service?: string;
action?: string;
[prop: string]: any;
}
export interface RuleResult {
service: string;
action: string;
[prop: string]: any;
}
export declare class Router {
/**
* 路由规则
* @type {InlRule[]}
*/
private m_rules;
/**
* Service to handle static files
* @type {String}
*/
private m_staticService;
/**
* 设置路由器
* @param {Object} rules 路由配置
*/
config({ router, virtual, staticService }: {
router?: Rule[];
virtual?: string;
staticService?: string;
}): void;
/**
* find router info by url
* @param {String} url
* @return {Object}
*/
find(url: string): RuleResult;
}