add typescript definition file

pull/51/head
arolson101 8 years ago
parent d2e9f585c6
commit 96bced7aa0

16
index.d.ts vendored

@ -0,0 +1,16 @@
declare module "docuri" {
interface Route<T, S> {
// parse DocURI string to object
(str: S): T | false;
// generate DocURI string from object
(obj: T): S;
// change DocURI string parts with values provided by object returning a string
(str: S, obj: T): S;
}
export function route<T, S>(route: string): Route<T, S>;
export function route<T>(route: string): Route<T, string>;
}
Loading…
Cancel
Save