electron/docs/api
Samuel Attard 81795744cf
fix: ensure the typescript definitions only export correct value types (#28712)
* fix: ensure the typescript definitions only export correct value types

In typescript there are two main types of "types" you can export, value types (class, const) and definition types (type, interface).  The typescript compiler will let anything declared via const or class be used as a value.  Unfortunately we were exporting a bunch of things (see the diff) as class/const when they weren't actually exported values. This lead to typescript being happy but the runtime throwing errors (not something we want).

This change passes "exported-in" context through our docs, to the parser and then to the definitions generator to ensure we only mark things as exported in the ts defs that we actually export.

Fixes #22167

* chore: update typescript-defs

* chore: update typescript-defs

* chore: fix bad typescript in IPC test

* docs: test rendering of new syntax

* chore: update per feedback, use same syntax but with 'this is not exportedd' line
2021-06-15 13:50:31 -07:00
..
structures chore: update ts parser for description comment fixes and generic types (#28709) 2021-04-19 11:44:58 -07:00
accelerator.md Update accelerator.md (#29193) 2021-05-19 09:52:06 +09:00
app.md docs: use relative links within docs (#29651) 2021-06-14 14:02:23 -05:00
auto-updater.md docs: auto update downloading multiple times (#27888) 2021-03-08 10:03:34 +09:00
browser-view.md docs: uniformize module API doc format (#28920) 2021-04-29 09:56:31 +02:00
browser-window-proxy.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
browser-window.md feat: add new imageAnimationPolicy webpref and webContents setter (#29095) 2021-06-08 11:00:22 +09:00
client-request.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
clipboard.md
command-line-switches.md docs: --force-fieldtrials was h2 rather than h3 (#29161) 2021-05-14 18:32:21 -07:00
command-line.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
content-tracing.md docs: fix contentTracing code sample (#26737) 2020-12-01 15:45:45 -08:00
context-bridge.md feat: add support for Blob's going over the ctx bridge (#29247) 2021-05-26 10:34:29 -07:00
cookies.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
crash-reporter.md feat: allow omitting submitURL when uploadToServer is false (#28105) 2021-03-18 14:15:19 -07:00
debugger.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
desktop-capturer.md docs: improve relative link linting and fix broken (#26020) 2020-10-20 10:46:27 +09:00
dialog.md docs: option title for showSaveDialog is not supported for some platforms (#28747) 2021-05-19 09:44:17 +02:00
dock.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
download-item.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
environment-variables.md docs: add debugging vars to env var doc (#26743) 2020-12-01 15:04:07 -08:00
extensions.md feat: implement allowFileAccess loadExtension option (#25198) 2021-02-01 14:41:08 -08:00
file-object.md
frameless-window.md fix: enable system maximization for frameless windows except if transparent (#28207) 2021-04-06 08:53:59 +09:00
global-shortcut.md fix: throw when using globalShortcut before ready (#27002) 2020-12-15 11:13:56 -08:00
in-app-purchase.md
incoming-message.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
ipc-main.md docs: Update ipcMain.handle() docs in ipc-main.md for error-handling details (#27461) 2021-02-02 21:22:20 +09:00
ipc-renderer.md docs: update verb tenses for structured clone notes (#27483) 2021-01-26 14:14:44 -08:00
menu-item.md feat: add APIs to enable/disable spell checker (#26276) 2020-11-11 10:29:18 -05:00
menu.md docs: use relative links within docs (#29651) 2021-06-14 14:02:23 -05:00
message-channel-main.md docs: uniformize module API doc format (#28920) 2021-04-29 09:56:31 +02:00
message-port-main.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
native-image.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
native-theme.md chore: cleanup whitespace in docs (#26356) 2020-11-05 14:12:43 -08:00
net-log.md
net.md feat: add net.online / net.isOnline() (#21004) 2020-10-20 19:55:06 -07:00
notification.md feat: custom toast xml and failure reporting for notifications (#25401) 2020-09-29 12:20:10 -07:00
power-monitor.md docs: suspend and resume are available on Linux (#27958) 2021-03-05 10:11:36 +09:00
power-save-blocker.md
process.md docs: update Node global symbols example to use contextBridge (#28245) 2021-03-22 11:01:12 +09:00
protocol.md docs: link ProtocolRequest doc (#25761) 2020-10-05 11:18:18 -04:00
screen.md docs: coordinate system of badly named method getCursorScreenPoint (#27156) 2021-01-11 12:19:48 +09:00
service-workers.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
session.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
share-menu.md docs: uniformize module API doc format (#28920) 2021-04-29 09:56:31 +02:00
shell.md chore: remove deprecated shell.moveItemToTrash() (#26723) 2020-11-30 23:25:03 +03:00
synopsis.md docs: rework introduction docs (#29062) 2021-05-24 11:32:36 +09:00
system-preferences.md chore: update ts parser for description comment fixes and generic types (#28709) 2021-04-19 11:44:58 -07:00
touch-bar-button.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
touch-bar-color-picker.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
touch-bar-group.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
touch-bar-label.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
touch-bar-other-items-proxy.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
touch-bar-popover.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
touch-bar-scrubber.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
touch-bar-segmented-control.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
touch-bar-slider.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
touch-bar-spacer.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
touch-bar.md docs: uniformize module API doc format (#28920) 2021-04-29 09:56:31 +02:00
tray.md docs: uniformize module API doc format (#28920) 2021-04-29 09:56:31 +02:00
web-contents.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
web-frame-main.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
web-frame.md docs: Add clarification for Visual Zoom behavior (#28860) 2021-04-28 17:20:47 -04:00
web-request.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
webview-tag.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
window-open.md feat: remove BrowserWindow option inheritance (#28550) 2021-04-21 10:55:17 -07:00