1+ import { Request , Response } from "express" ;
12import * as fs from "fs" ;
23import * as path from "path" ;
34
@@ -14,16 +15,15 @@ import {logger} from "../logger";
1415import { Note , Revision } from "../models" ;
1516import { errorInternalError , errorNotFound } from "../response" ;
1617
17-
18- export function actionPublish ( req , res , note ) {
18+ export function actionPublish ( req : Request , res : Response , note ) : void {
1919 res . redirect ( config . serverURL + '/s/' + ( note . alias || note . shortid ) )
2020}
2121
22- export function actionSlide ( req , res , note ) {
22+ export function actionSlide ( req : Request , res : Response , note ) : void {
2323 res . redirect ( config . serverURL + '/p/' + ( note . alias || note . shortid ) )
2424}
2525
26- export function actionDownload ( req , res , note ) {
26+ export function actionDownload ( req : Request , res : Response , note ) : void {
2727 const body = note . content
2828 const title = Note . decodeTitle ( note . title )
2929 const filename = encodeURIComponent ( title )
@@ -39,7 +39,7 @@ export function actionDownload(req, res, note) {
3939 res . send ( body )
4040}
4141
42- export function actionInfo ( req , res , note ) {
42+ export function actionInfo ( req : Request , res : Response , note ) : void {
4343 const body = note . content
4444 const extracted = Note . extractMeta ( body )
4545 const markdown = extracted . markdown
@@ -66,7 +66,7 @@ export function actionInfo(req, res, note) {
6666 res . send ( data )
6767}
6868
69- export function actionPDF ( req , res , note ) {
69+ export function actionPDF ( req : Request , res : Response , note ) : void {
7070 const url = config . serverURL || 'http://' + req . get ( 'host' )
7171 const body = note . content
7272 const extracted = Note . extractMeta ( body )
@@ -119,7 +119,7 @@ const outputFormats = {
119119 docx : 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
120120}
121121
122- export async function actionPandoc ( req , res , note ) {
122+ export async function actionPandoc ( req : Request , res : Response , note ) : Promise < void > {
123123// var url = config.serverURL || 'http://' + req.get('host')
124124// var body = note.content
125125// var extracted = Note.extractMeta(body)
@@ -162,7 +162,7 @@ export async function actionPandoc(req, res, note) {
162162// }
163163}
164164
165- export function actionGist ( req , res , note ) {
165+ export function actionGist ( req : Request , res : Response , note ) : void {
166166 const data = {
167167 client_id : config . github . clientID ,
168168 redirect_uri : config . serverURL + '/auth/github/callback/' + Note . encodeNoteId ( note . id ) + '/gist' ,
@@ -173,7 +173,7 @@ export function actionGist(req, res, note) {
173173 res . redirect ( 'https://github.com/login/oauth/authorize?' + query )
174174}
175175
176- export function actionRevision ( req , res , note ) {
176+ export function actionRevision ( req : Request , res : Response , note ) : void {
177177 const actionId = req . params . actionId
178178 if ( actionId ) {
179179 const time = moment ( parseInt ( actionId ) )
0 commit comments