Non empty namespce

This commit is contained in:
Anthony Dionise
2019-02-05 15:25:51 -05:00
parent dacd441485
commit 321969d161
+24 -23
View File
@@ -10,27 +10,28 @@ import { Url } from 'url';
import * as core from "express-serve-static-core";
declare function historyApiFallback(options?: Options): core.RequestHandler;
declare namespace historyApiFallback {}
declare function historyApiFallback(options?: historyApiFallback.Options): core.RequestHandler;
declare namespace historyApiFallback {
interface Options {
exclusions?: string[];
disableDotRule?: true;
htmlAcceptHeaders?: string[];
index?: string;
logger?: typeof console.log;
rewrites?: Rewrite[];
verbose?: boolean;
}
interface Context {
match: RegExpMatchArray;
parsedUrl: Url;
}
type RewriteTo = (context: Context) => string;
interface Rewrite {
from: RegExp;
to: string | RegExp | RewriteTo;
}
}
export = historyApiFallback;
interface Options {
exclusions?: string[];
disableDotRule?: true;
htmlAcceptHeaders?: string[];
index?: string;
logger?: typeof console.log;
rewrites?: Rewrite[];
verbose?: boolean;
}
interface Context {
match: RegExpMatchArray;
parsedUrl: Url;
}
type RewriteTo = (context: Context) => string;
interface Rewrite {
from: RegExp;
to: string | RegExp | RewriteTo;
}