This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 之前下载是get类型的接口,前端直接location.href过去就下载了 | |
// 但是接口是post类型的话,这种方式就不行了,我试了ajax和fetch也都不能下载 | |
// 网上有用h5下载的,鉴于兼容性,暂不考虑 | |
// 下面的方式就是用form表单的方式来实现post类型的下载 | |
<form action="/download" method="post"> | |
<button type="submit">下载</button> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface IState {} | |
interface IContext { | |
//... | |
abc: 1 | |
} | |
const app = new Koa<IState, IContext>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs-extra'); | |
const path = require('path'); | |
const chalk = require('chalk'); | |
const { Extractor, ExtractorConfig } = require('@microsoft/api-extractor'); | |
/** | |
* run it after rollup build | |
*/ | |
async function createApiExtractor(pkgDir) { | |
const extractorConfigPath = path.resolve(pkgDir, `api-extractor.json`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"extends": "../../api-extractor.json", | |
"mainEntryPointFilePath": "./dist/packages/xxx/src/index.d.ts", | |
"dtsRollup": { | |
"untrimmedFilePath": "./dist/index.d.ts" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", | |
"dtsRollup": { | |
"enabled": true | |
}, | |
"docModel": { | |
"enabled": false | |
}, |