Skip to content

Commit

Permalink
fix(build): use tsx for build scripts (#569)
Browse files Browse the repository at this point in the history
  • Loading branch information
erickzhao authored Jun 4, 2024
1 parent e837107 commit f08be77
Show file tree
Hide file tree
Showing 22 changed files with 235 additions and 63 deletions.
8 changes: 4 additions & 4 deletions docs/latest/api/app.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ In most cases, you should do everything in the `ready` event handler.
Returns:

* `event` Event
* `launchInfo` Record<string, any\> | [NotificationResponse](latest/api/structures/notification-response.md) _macOS_
* `launchInfo` Record\<string, any\> | [NotificationResponse](latest/api/structures/notification-response.md) _macOS_

Emitted once, when Electron has finished initializing. On macOS, `launchInfo`
holds the `userInfo` of the [`NSUserNotification`](https://developer.apple.com/documentation/foundation/nsusernotification)
Expand Down Expand Up @@ -848,7 +848,7 @@ This method returns the application name of the default handler for the protocol
Returns `Promise<Object>` - Resolve with an object containing the following:

* `icon` NativeImage - the display icon of the app handling the protocol.
* `path` string - installation path of the app handling the protocol.
* `path` string - installation path of the app handling the protocol.
* `name` string - display name of the app handling the protocol.

This method returns a promise that contains the application name, icon and path of the default handler for the protocol
Expand Down Expand Up @@ -981,7 +981,7 @@ app.setJumpList([

### `app.requestSingleInstanceLock([additionalData])`

* `additionalData` Record&#60;any, any\&#62; (optional) - A JSON object containing additional data to send to the first instance.
* `additionalData` Record\<any, any\> (optional) - A JSON object containing additional data to send to the first instance.

Returns `boolean`

Expand Down Expand Up @@ -1420,7 +1420,7 @@ systems Application folder. Use in combination with `app.moveToApplicationsFolde
### `app.moveToApplicationsFolder([options])` _macOS_

* `options` Object (optional)
* `conflictHandler` Function&#60;boolean&#62; (optional) - A handler for potential conflict in move failure.
* `conflictHandler` Function\<boolean> (optional) - A handler for potential conflict in move failure.
* `conflictType` string - The type of move conflict encountered by the handler; can be `exists` or `existsAndRunning`, where `exists` means that an app of the same name is present in the Applications directory and `existsAndRunning` means both that it exists and that it's presently running.

Returns `boolean` - Whether the move was successful. Please note that if
Expand Down
2 changes: 1 addition & 1 deletion docs/latest/api/auto-updater.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ The `autoUpdater` object has the following methods:

* `options` Object
* `url` string
* `headers` Record&#60;string, string\&#62; (optional) _macOS_ - HTTP request headers.
* `headers` Record\<string, string\> (optional) _macOS_ - HTTP request headers.
* `serverType` string (optional) _macOS_ - Can be `json` or `default`, see the [Squirrel.Mac][squirrel-mac]
README for more information.

Expand Down
2 changes: 1 addition & 1 deletion docs/latest/api/base-window.md
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ Closes the currently open [Quick Look][quick-look] panel.

#### `win.setBounds(bounds[, animate])`

* `bounds` Partial&#60;[Rectangle](latest/api/structures/rectangle.md)\&#62;
* `bounds` Partial\<[Rectangle](latest/api/structures/rectangle.md)\>
* `animate` boolean (optional) _macOS_

Resizes and moves the window to the supplied bounds. Any properties that are not supplied will default to their current values.
Expand Down
4 changes: 2 additions & 2 deletions docs/latest/api/browser-window.md
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ Closes the currently open [Quick Look][quick-look] panel.

#### `win.setBounds(bounds[, animate])`

* `bounds` Partial&#60;[Rectangle](latest/api/structures/rectangle.md)\&#62;
* `bounds` Partial\<[Rectangle](latest/api/structures/rectangle.md)\>
* `animate` boolean (optional) _macOS_

Resizes and moves the window to the supplied bounds. Any properties that are not supplied will default to their current values.
Expand Down Expand Up @@ -1372,7 +1372,7 @@ win.loadURL('http://localhost:8000/post', {

* `filePath` string
* `options` Object (optional)
* `query` Record&#60;string, string\&#62; (optional) - Passed to `url.format()`.
* `query` Record\<string, string\> (optional) - Passed to `url.format()`.
* `search` string (optional) - Passed to `url.format()`.
* `hash` string (optional) - Passed to `url.format()`.

Expand Down
4 changes: 2 additions & 2 deletions docs/latest/api/client-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ following properties:
method.
* `url` string (optional) - The request URL. Must be provided in the absolute
form with the protocol scheme specified as http or https.
* `headers` Record&#60;string, string | string[]\&#62; (optional) - Headers to be sent
* `headers` Record\<string, string | string[]\> (optional) - Headers to be sent
with the request.
* `session` Session (optional) - The [`Session`](latest/api/session.md) instance with
which the request is associated.
Expand Down Expand Up @@ -167,7 +167,7 @@ Returns:
* `statusCode` Integer
* `method` string
* `redirectUrl` string
* `responseHeaders` Record&#60;string, string[]\&#62;
* `responseHeaders` Record\<string, string[]\>

Emitted when the server returns a redirect response (e.g. 301 Moved
Permanently). Calling [`request.followRedirect`](#requestfollowredirect) will
Expand Down
4 changes: 2 additions & 2 deletions docs/latest/api/crash-reporter.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ The `crashReporter` module has the following methods:
number of crashes uploaded to 1/hour. Default is `false`.
* `compress` boolean (optional) - If true, crash reports will be compressed
and uploaded with `Content-Encoding: gzip`. Default is `true`.
* `extra` Record&#60;string, string\&#62; (optional) - Extra string key/value
* `extra` Record\<string, string\> (optional) - Extra string key/value
annotations that will be sent along with crash reports that are generated
in the main process. Only string values are supported. Crashes generated in
child processes will not contain these extra
parameters to crash reports generated from child processes, call
[`addExtraParameter`](#crashreporteraddextraparameterkey-value) from the
child process.
* `globalExtra` Record&#60;string, string\&#62; (optional) - Extra string key/value
* `globalExtra` Record\<string, string\> (optional) - Extra string key/value
annotations that will be sent along with any crash reports generated in any
process. These annotations cannot be changed once the crash reporter has
been started. If a key is present in both the global extra parameters and
Expand Down
4 changes: 2 additions & 2 deletions docs/latest/api/ipc-main.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Removes listeners of the specified `channel`.
### `ipcMain.handle(channel, listener)`

* `channel` string
* `listener` Function&#60;Promise&#60;any\&#62; | any\&#62;
* `listener` Function\<Promise\<any\> | any\>
* `event` [IpcMainInvokeEvent][ipc-main-invoke-event]
* `...args` any[]

Expand Down Expand Up @@ -109,7 +109,7 @@ provided to the renderer process. Please refer to
### `ipcMain.handleOnce(channel, listener)`

* `channel` string
* `listener` Function&#60;Promise&#60;any\&#62; | any\&#62;
* `listener` Function\<Promise\<any\> | any\>
* `event` [IpcMainInvokeEvent][ipc-main-invoke-event]
* `...args` any[]

Expand Down
2 changes: 1 addition & 1 deletion docs/latest/api/protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ expect streaming responses.

* `scheme` string - scheme to handle, for example `https` or `my-app`. This is
the bit before the `:` in a URL.
* `handler` Function&#60;[GlobalResponse](https://nodejs.org/api/globals.html#response) | Promise&#60;GlobalResponse\&#62;\&#62;
* `handler` Function\<[GlobalResponse](https://nodejs.org/api/globals.html#response) | Promise\<GlobalResponse\>\>
* `request` [GlobalRequest](https://nodejs.org/api/globals.html#request)

Register a protocol handler for `scheme`. Requests made to URLs with this
Expand Down
2 changes: 1 addition & 1 deletion docs/latest/api/push-notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The `pushNotification` module emits the following events:
Returns:

* `event` Event
* `userInfo` Record&#60;String, any\&#62;
* `userInfo` Record\<String, any\>

Emitted when the app receives a remote notification while running.
See: https://developer.apple.com/documentation/appkit/nsapplicationdelegate/1428430-application?language=objc
Expand Down
8 changes: 4 additions & 4 deletions docs/latest/api/session.md
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ session.fromPartition('some-partition').setPermissionRequestHandler((webContents
#### `ses.setPermissionCheckHandler(handler)`
* `handler` Function&#60;boolean&#62; | null
* `handler` Function\<boolean> | null
* `webContents` ([WebContents](latest/api/web-contents.md) | null) - WebContents checking the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin. All cross origin sub frames making permission checks will pass a `null` webContents to this handler, while certain other permission checks such as `notifications` checks will always pass `null`. You should use `embeddingOrigin` and `requestingOrigin` to determine what origin the owning frame and the requesting frame are on respectively.
* `permission` string - Type of permission check.
* `clipboard-read` - Request access to read from the clipboard.
Expand Down Expand Up @@ -955,7 +955,7 @@ Passing `null` instead of a function resets the handler to its default state.
#### `ses.setDevicePermissionHandler(handler)`
* `handler` Function&#60;boolean&#62; | null
* `handler` Function\<boolean> | null
* `details` Object
* `deviceType` string - The type of device that permission is being requested on, can be `hid`, `serial`, or `usb`.
* `origin` string - The origin URL of the device permission check.
Expand Down Expand Up @@ -1028,7 +1028,7 @@ app.whenReady().then(() => {
#### `ses.setUSBProtectedClassesHandler(handler)`
* `handler` Function&#60;string[]&#62; | null
* `handler` Function\<string[]> | null
* `details` Object
* `protectedClasses` string[] - The current list of protected USB classes. Possible class values include:
* `audio`
Expand Down Expand Up @@ -1221,7 +1221,7 @@ Returns `Promise<Buffer>` - resolves with blob data.
* `url` string
* `options` Object (optional)
* `headers` Record&#60;string, string\&#62; (optional) - HTTP request headers.
* `headers` Record\<string, string\> (optional) - HTTP request headers.
Initiates a download of the resource at `url`.
The API will generate a [DownloadItem](latest/api/download-item.md) that can be accessed
Expand Down
2 changes: 1 addition & 1 deletion docs/latest/api/structures/file-path-with-headers.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ hide_title: false
# FilePathWithHeaders Object

* `path` string - The path to the file to send.
* `headers` Record&#60;string, string\&#62; (optional) - Additional headers to be sent.
* `headers` Record\<string, string\> (optional) - Additional headers to be sent.
2 changes: 1 addition & 1 deletion docs/latest/api/structures/notification-response.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ hide_title: false
* `actionIdentifier` string - The identifier string of the action that the user selected.
* `date` number - The delivery date of the notification.
* `identifier` string - The unique identifier for this notification request.
* `userInfo` Record&#60;string, any\&#62; - A dictionary of custom information associated with the notification.
* `userInfo` Record\<string, any\> - A dictionary of custom information associated with the notification.
* `userText` string (optional) - The text entered or chosen by the user.
2 changes: 1 addition & 1 deletion docs/latest/api/structures/protocol-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ hide_title: false
* `referrer` string
* `method` string
* `uploadData` [UploadData[]](latest/api/structures/upload-data.md) (optional)
* `headers` Record&#60;string, string\&#62;
* `headers` Record\<string, string\>
2 changes: 1 addition & 1 deletion docs/latest/api/structures/protocol-response.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ hide_title: false
`"text/html"`. Setting `mimeType` would implicitly set the `content-type`
header in response, but if `content-type` is already set in `headers`, the
`mimeType` would be ignored.
* `headers` Record&#60;string, string | string[]\&#62; (optional) - An object containing the response headers. The
* `headers` Record\<string, string | string[]\> (optional) - An object containing the response headers. The
keys must be string, and values must be either string or Array of string.
* `data` (Buffer | string | ReadableStream) (optional) - The response body. When
returning stream as response, this is a Node.js readable stream representing
Expand Down
2 changes: 1 addition & 1 deletion docs/latest/api/structures/transaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ hide_title: false
* `errorMessage` string - The error message if an error occurred while processing the transaction.
* `payment` Object
* `productIdentifier` string - The identifier of the purchased product.
* `quantity` Integer - The quantity purchased.
* `quantity` Integer - The quantity purchased.
* `applicationUsername` string - An opaque identifier for the user’s account on your system.
* `paymentDiscount` [PaymentDiscount](latest/api/structures/payment-discount.md) (optional) - The details of the discount offer to apply to the payment.
4 changes: 2 additions & 2 deletions docs/latest/api/structures/user-default-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ hide_title: false
* `float` number
* `double` number
* `url` string
* `array` Array&#60;unknown&#62;
* `dictionary` Record&#60;string, unknown&#62;
* `array` Array\<unknown>
* `dictionary` Record\<string, unknown>

This type is a helper alias, no object will ever exist of this type.
14 changes: 7 additions & 7 deletions docs/latest/api/system-preferences.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Returns `boolean` - Whether the Swipe between pages setting is on.
### `systemPreferences.postNotification(event, userInfo[, deliverImmediately])` _macOS_

* `event` string
* `userInfo` Record&#60;string, any\&#62;
* `userInfo` Record\<string, any\>
* `deliverImmediately` boolean (optional) - `true` to post notifications immediately even when the subscribing app is inactive.

Posts `event` as native notifications of macOS. The `userInfo` is an Object
Expand All @@ -52,15 +52,15 @@ that contains the user information dictionary sent along with the notification.
### `systemPreferences.postLocalNotification(event, userInfo)` _macOS_

* `event` string
* `userInfo` Record&#60;string, any\&#62;
* `userInfo` Record\<string, any\>

Posts `event` as native notifications of macOS. The `userInfo` is an Object
that contains the user information dictionary sent along with the notification.

### `systemPreferences.postWorkspaceNotification(event, userInfo)` _macOS_

* `event` string
* `userInfo` Record&#60;string, any\&#62;
* `userInfo` Record\<string, any\>

Posts `event` as native notifications of macOS. The `userInfo` is an Object
that contains the user information dictionary sent along with the notification.
Expand All @@ -70,7 +70,7 @@ that contains the user information dictionary sent along with the notification.
* `event` string | null
* `callback` Function
* `event` string
* `userInfo` Record&#60;string, unknown\&#62;
* `userInfo` Record\<string, unknown\>
* `object` string

Returns `number` - The ID of this subscription
Expand Down Expand Up @@ -99,7 +99,7 @@ If `event` is null, the `NSDistributedNotificationCenter` doesn’t use it as cr
* `event` string | null
* `callback` Function
* `event` string
* `userInfo` Record&#60;string, unknown\&#62;
* `userInfo` Record\<string, unknown\>
* `object` string

Returns `number` - The ID of this subscription
Expand All @@ -114,7 +114,7 @@ If `event` is null, the `NSNotificationCenter` doesn’t use it as criteria for
* `event` string | null
* `callback` Function
* `event` string
* `userInfo` Record&#60;string, unknown\&#62;
* `userInfo` Record\<string, unknown\>
* `object` string

Returns `number` - The ID of this subscription
Expand Down Expand Up @@ -144,7 +144,7 @@ Same as `unsubscribeNotification`, but removes the subscriber from `NSWorkspace.

### `systemPreferences.registerDefaults(defaults)` _macOS_

* `defaults` Record&#60;string, string | boolean | number\&#62; - a dictionary of (`key: value`) user defaults
* `defaults` Record\<string, string | boolean | number\> - a dictionary of (`key: value`) user defaults

Add the specified defaults to your application's `NSUserDefaults`.

Expand Down
Loading

0 comments on commit f08be77

Please sign in to comment.