1
1
import type { RedirectCode , Route , RouteGroupOptions , StatusCode } from '@stacksjs/types'
2
2
import { projectPath } from '@stacksjs/path'
3
3
4
- export interface Router {
4
+ export interface RouterInterface {
5
5
get ( url : Route [ 'url' ] , callback : Route [ 'callback' ] ) : this
6
6
post ( url : Route [ 'url' ] , callback : Route [ 'callback' ] ) : this
7
7
view ( url : Route [ 'url' ] , callback : Route [ 'callback' ] ) : this
@@ -15,7 +15,7 @@ export interface Router {
15
15
getRoutes ( ) : Promise < Route [ ] >
16
16
}
17
17
18
- export class Router implements Router {
18
+ export class Router implements RouterInterface {
19
19
private routes : Route [ ] = [ ]
20
20
21
21
private addRoute ( method : Route [ 'method' ] , uri : string , callback : Route [ 'callback' ] | string | object , statusCode : StatusCode ) : void {
@@ -124,21 +124,21 @@ export class Router implements Router {
124
124
}
125
125
126
126
public name ( name : string ) : this {
127
- // @ts -expect-error
127
+ // @ts -expect-error - this is fine for now
128
128
this . routes [ this . routes . length - 1 ] . name = name
129
129
130
130
return this
131
131
}
132
132
133
133
public middleware ( middleware : Route [ 'middleware' ] ) : this {
134
- // @ts -expect-error
134
+ // @ts -expect-error - this is fine for now
135
135
this . routes [ this . routes . length - 1 ] . middleware = middleware
136
136
137
137
return this
138
138
}
139
139
140
140
public prefix ( prefix : string ) : this {
141
- // @ts -expect-error
141
+ // @ts -expect-error - this is fine for now
142
142
this . routes [ this . routes . length - 1 ] . prefix = prefix
143
143
144
144
return this
0 commit comments