Skip to content

Commit f0121eb

Browse files
committed
lint: lib/note/noteAction.ts
- install @types/markdown-pdf - add typing annotate
1 parent d6657b2 commit f0121eb

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

lib/note/noteActions.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import {Request, Response} from "express";
12
import * as fs from "fs";
23
import * as path from "path";
34

@@ -14,16 +15,15 @@ import {logger} from "../logger";
1415
import {Note, Revision} from "../models";
1516
import {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))

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
"@types/express-flash": "0.0.2",
117117
"@types/express-session": "^1.17.3",
118118
"@types/lodash": "^4.14.170",
119+
"@types/markdown-pdf": "^9.0.0",
119120
"@types/mime-types": "^2.1.0",
120121
"@types/minio": "^7.0.7",
121122
"@types/node": "~12.20.15",

0 commit comments

Comments
 (0)