File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 1+ declare module 'navaid' {
2+ type Promisable < T > = T | Promise < T > ;
3+
4+ export type Params = Record < string , string > ;
5+ export type UnknownHandler = ( uri : string ) => void ;
6+ export type RouteHandler < T = Params > = ( params ?: T ) => Promisable < any > ;
7+
8+ export interface Router {
9+ format ( uri : string ) : string | false ;
10+ route ( uri : string , replace ?: boolean ) : void ;
11+ on < T = Params > ( pattern : string , handler : RouteHandler < T > ) : Router ;
12+ run ( uri ?: string ) : Router ;
13+ listen ( uri ?: string ) : Router ;
14+ unlisten ?: VoidFunction ;
15+ }
16+
17+ export default function ( base ?: string , on404 ?: UnknownHandler ) : Router ;
18+ }
Original file line number Diff line number Diff line change 66 "unpkg" : " dist/navaid.min.js" ,
77 "module" : " dist/navaid.mjs" ,
88 "main" : " dist/navaid.js" ,
9+ "types" : " index.d.ts" ,
910 "license" : " MIT" ,
1011 "author" : {
1112 "name" : " Luke Edwards" ,
2122 "test" : " uvu -r esm test"
2223 },
2324 "files" : [
25+ " *.d.ts" ,
2426 " dist"
2527 ],
2628 "keywords" : [
You can’t perform that action at this time.
0 commit comments