chore: upgrade ts generator for better type safety (#20975)

* chore: upgrade ts generator for better type safety

* spec: fix tests
This commit is contained in:
Samuel Attard 2019-11-05 13:34:04 -08:00 committed by GitHub
parent 6e5ac301ce
commit fcee7212ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 12 deletions

View file

@ -389,9 +389,7 @@ which sends a `Buffer` as a response.
* `url` String * `url` String
* `method` String (optional) * `method` String (optional)
* `session` Session | null (optional) * `session` Session | null (optional)
* `uploadData` Object (optional) * `uploadData` [ProtocolResponseUploadData](structures/protocol-response-upload-data.md) (optional)
* `contentType` String - MIME type of the content.
* `data` String - Content to be sent.
* `completion` Function (optional) * `completion` Function (optional)
* `error` Error * `error` Error

View file

@ -1,4 +1,4 @@
# ProtocolResponseUploadData Object # ProtocolResponseUploadData Object
* `contentType` String - MIME type of the content. * `contentType` String - MIME type of the content.
* `data` String - Content to be sent. * `data` String | Buffer - Content to be sent.

View file

@ -5,7 +5,7 @@
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
"devDependencies": { "devDependencies": {
"@electron/docs-parser": "^0.4.2", "@electron/docs-parser": "^0.4.2",
"@electron/typescript-definitions": "^8.6.1", "@electron/typescript-definitions": "^8.6.4",
"@octokit/rest": "^16.3.2", "@octokit/rest": "^16.3.2",
"@primer/octicons": "^9.1.1", "@primer/octicons": "^9.1.1",
"@types/basic-auth": "^1.1.2", "@types/basic-auth": "^1.1.2",
@ -138,4 +138,4 @@
"@types/multiparty": "^0.0.32", "@types/multiparty": "^0.0.32",
"@types/temp": "^0.8.34" "@types/temp": "^0.8.34"
} }
} }

View file

@ -529,12 +529,12 @@ describe('protocol module', () => {
const port = (server.address() as AddressInfo).port const port = (server.address() as AddressInfo).port
const url = `http://127.0.0.1:${port}` const url = `http://127.0.0.1:${port}`
await interceptHttpProtocol('http', (request, callback) => { await interceptHttpProtocol('http', (request, callback) => {
const data = { const data: Electron.RedirectRequest = {
url: url, url: url,
method: 'POST', method: 'POST',
uploadData: { uploadData: {
contentType: 'application/x-www-form-urlencoded', contentType: 'application/x-www-form-urlencoded',
bytes: request.uploadData[0].bytes data: request.uploadData[0].bytes
}, },
session: null session: null
} }

View file

@ -40,10 +40,10 @@
ora "^3.4.0" ora "^3.4.0"
pretty-ms "^5.0.0" pretty-ms "^5.0.0"
"@electron/typescript-definitions@^8.6.1": "@electron/typescript-definitions@^8.6.4":
version "8.6.3" version "8.6.4"
resolved "https://registry.yarnpkg.com/@electron/typescript-definitions/-/typescript-definitions-8.6.3.tgz#6868d71bd56b6219150123969d1a6634629ef566" resolved "https://registry.yarnpkg.com/@electron/typescript-definitions/-/typescript-definitions-8.6.4.tgz#d4727c825afcebf6ff00a7d18416878288cac632"
integrity sha512-/PLUskJu2+W8BKkQQBQq2C0WFUyAeBaGEutt2sJkzzhkTWoVcKG4M36Me45+D0CiRqgAxTO9qR68O96+8vtIfg== integrity sha512-Fb4o56fikSE3id61U0MbPVBPcweVw8YwzO+JtT9aOorJR4baJZGmpsGxuaHeLSGv+D0Zd5XiWk13cEM/nv9fFw==
dependencies: dependencies:
"@electron/docs-parser" "^0.4.1" "@electron/docs-parser" "^0.4.1"
"@types/node" "^11.13.7" "@types/node" "^11.13.7"