Skip to content

Commit

Permalink
Pass generic type of result
Browse files Browse the repository at this point in the history
  • Loading branch information
Rokt33r committed Feb 25, 2019
1 parent 5d4cd9d commit 35aa079
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/BaseController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,24 @@ export class BaseController {
return this.injector(key)
}

end(data: any, encoding?: string, status?: number) {
end<D>(data: D, encoding?: string, status?: number): EndResult<D> {
return new EndResult(data, encoding, status)
}

json(data: any, status?: number) {
json<D>(data: D, status?: number): JSONResult<D> {
return new JSONResult(data, status)
}

redirect(location: string, status?: number) {
return new RedirectResult(location, status)
}

render(
render<D>(
view: string,
locals?: any,
locals?: D,
callback?: RenderResultCallback,
status?: number
) {
): RenderResult<D> {
return new RenderResult(view, locals, callback, status)
}

Expand All @@ -99,7 +99,7 @@ export class BaseController {
return new SendFileResult(filePath, options, callback, status)
}

send(data: any, status?: number) {
send<D>(data: D, status?: number): SendResult<D> {
return new SendResult(data, status)
}

Expand Down

0 comments on commit 35aa079

Please sign in to comment.