[misc]: typescript-y changes for compat

This commit is contained in:
41666 2019-06-05 13:04:16 -05:00
parent af7fd76bb9
commit b90bb5c2ed
No known key found for this signature in database
GPG key ID: DE08FAA8925DC747
4 changed files with 26 additions and 3 deletions

5
packages/roleypoly-ui/connector.d.ts vendored Normal file
View file

@ -0,0 +1,5 @@
import Next, { DevServer } from 'next'
declare module '@roleypoly/ui/connector' {
export default function (opts: { dev: boolean }): DevServer
}

13
packages/roleypoly-ui/mappings.d.ts vendored Normal file
View file

@ -0,0 +1,13 @@
declare module '@roleypoly/ui/mappings' {
export type Mappings = {
[newPath: string]: {
path: string,
custom?: (router: { get: (ctx: any) => void }) => void,
noAutoFix?: boolean
}
}
const mappings: Mappings
export default mappings
}

View file

@ -1,10 +1,12 @@
module.exports = {
'/s/add': {
path: '/_internal/_server_add',
custom (router) {
router.get('/s/', ctx => ctx.redirect('/s/add'))
}
},
'/s/:id': {
path: '/_internal/_server',
noAutoFix: true,

View file

@ -1,12 +1,14 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"allowJs": true,
"allowJs": false,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"jsx": "preserve",
"lib": [
"dom",
"es2017"
"es2017",
],
"module": "esnext",
"moduleResolution": "node",
@ -15,9 +17,10 @@
"noUnusedParameters": true,
"preserveConstEnums": true,
"removeComments": false,
"skipLibCheck": true,
// "skipLibCheck": true,
"sourceMap": true,
"strict": true,
"target": "esnext"
// "outDir": "./tmp"
}
}