2018-09-22 12:28:50 +00:00
|
|
|
'use strict'
|
|
|
|
|
2018-09-20 03:43:26 +00:00
|
|
|
const common = require('@electron/internal/common/api/exports/electron')
|
|
|
|
const moduleList = require('@electron/internal/renderer/api/module-list')
|
2016-01-12 02:40:23 +00:00
|
|
|
|
2016-01-14 18:35:29 +00:00
|
|
|
// Import common modules.
|
2016-03-25 19:57:17 +00:00
|
|
|
common.defineProperties(exports)
|
2016-01-12 02:40:23 +00:00
|
|
|
|
2018-06-13 16:15:34 +00:00
|
|
|
for (const {
|
2018-09-13 16:10:51 +00:00
|
|
|
name,
|
|
|
|
file,
|
|
|
|
enabled = true,
|
|
|
|
private: isPrivate = false
|
|
|
|
} of moduleList) {
|
2018-06-13 16:15:34 +00:00
|
|
|
if (!enabled) {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
|
|
|
Object.defineProperty(exports, name, {
|
|
|
|
enumerable: !isPrivate,
|
2019-02-14 22:29:20 +00:00
|
|
|
get: common.memoizedGetter(() => {
|
|
|
|
const value = require(`@electron/internal/renderer/api/${file}.js`)
|
|
|
|
// Handle Typescript modules with an "export default X" statement
|
|
|
|
if (value.__esModule) return value.default
|
|
|
|
return value
|
|
|
|
})
|
2017-03-06 14:58:10 +00:00
|
|
|
})
|
|
|
|
}
|