[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 = { module.exports = {
'/s/add': { '/s/add': {
path: '/_internal/_server_add', path: '/_internal/_server_add',
custom (router) { custom (router) {
router.get('/s/', ctx => ctx.redirect('/s/add')) router.get('/s/', ctx => ctx.redirect('/s/add'))
} }
}, },
'/s/:id': { '/s/:id': {
path: '/_internal/_server', path: '/_internal/_server',
noAutoFix: true, noAutoFix: true,

View file

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