Skip to content

Commit 078073e

Browse files
committed
support returning custom types
1 parent cde2d33 commit 078073e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/module-declaration.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,12 @@ const generateModuleDeclaration = (module, index, API) => {
117117
let returnType = returnsThis(moduleMethod) ? 'this' : 'void'
118118

119119
if (moduleMethod.returns) {
120-
returnType = moduleMethod.returns
120+
// Account for methods on the process module that return a custom type/structure
121+
if (module.name === 'process' && moduleMethod.returns.type !== 'Object') {
122+
returnType = `Electron.${moduleMethod.returns.type}`
123+
} else {
124+
returnType = moduleMethod.returns
125+
}
121126
}
122127

123128
if (returnType === 'Object' || returnType.type === 'Object') {

vendor/fetch-docs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const mkdirp = require('mkdirp').sync
77
const os = require('os')
88

99
const downloadPath = path.join(os.tmpdir(), 'electron-api-tmp')
10-
const ELECTRON_COMMIT = 'a6e11d3b63cb7ca3b3661b6a56a853358b1ab734'
10+
const ELECTRON_COMMIT = '116403ed03997d7252f2874a781a6b61600795b2'
1111

1212
rm(downloadPath)
1313

0 commit comments

Comments
 (0)