Skip to content

Commit 28fcaa6

Browse files
authored
Merge pull request #57 from electron/support-returning-custom-types
support returning custom types
2 parents cde2d33 + f14478b commit 28fcaa6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/module-declaration.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ const generateModuleDeclaration = (module, index, API) => {
118118

119119
if (moduleMethod.returns) {
120120
returnType = moduleMethod.returns
121+
// Account for methods on the process module that return a custom type/structure, we need to reference the Electron namespace to use these types
122+
if (module.name === 'process' && moduleMethod.returns.type !== 'Object') {
123+
returnType = `Electron.${moduleMethod.returns.type}`
124+
}
121125
}
122126

123127
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)