docs: type names changed from wrapper to primitive (#31752)

This commit is contained in:
Milan Burda 2021-11-16 05:13:18 +01:00 committed by GitHub
parent 246884c4fb
commit e6b1d95a1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
115 changed files with 1685 additions and 1685 deletions

View file

@ -24,24 +24,24 @@ The `Notification` class has the following static methods:
#### `Notification.isSupported()`
Returns `Boolean` - Whether or not desktop notifications are supported on the current system
Returns `boolean` - Whether or not desktop notifications are supported on the current system
### `new Notification([options])`
* `options` Object (optional)
* `title` String (optional) - A title for the notification, which will be shown at the top of the notification window when it is shown.
* `subtitle` String (optional) _macOS_ - A subtitle for the notification, which will be displayed below the title.
* `body` String (optional) - The body text of the notification, which will be displayed below the title or subtitle.
* `silent` Boolean (optional) - Whether or not to emit an OS notification noise when showing the notification.
* `icon` (String | [NativeImage](native-image.md)) (optional) - An icon to use in the notification.
* `hasReply` Boolean (optional) _macOS_ - Whether or not to add an inline reply option to the notification.
* `timeoutType` String (optional) _Linux_ _Windows_ - The timeout duration of the notification. Can be 'default' or 'never'.
* `replyPlaceholder` String (optional) _macOS_ - The placeholder to write in the inline reply input field.
* `sound` String (optional) _macOS_ - The name of the sound file to play when the notification is shown.
* `urgency` String (optional) _Linux_ - The urgency level of the notification. Can be 'normal', 'critical', or 'low'.
* `title` string (optional) - A title for the notification, which will be shown at the top of the notification window when it is shown.
* `subtitle` string (optional) _macOS_ - A subtitle for the notification, which will be displayed below the title.
* `body` string (optional) - The body text of the notification, which will be displayed below the title or subtitle.
* `silent` boolean (optional) - Whether or not to emit an OS notification noise when showing the notification.
* `icon` (string | [NativeImage](native-image.md)) (optional) - An icon to use in the notification.
* `hasReply` boolean (optional) _macOS_ - Whether or not to add an inline reply option to the notification.
* `timeoutType` string (optional) _Linux_ _Windows_ - The timeout duration of the notification. Can be 'default' or 'never'.
* `replyPlaceholder` string (optional) _macOS_ - The placeholder to write in the inline reply input field.
* `sound` string (optional) _macOS_ - The name of the sound file to play when the notification is shown.
* `urgency` string (optional) _Linux_ - The urgency level of the notification. Can be 'normal', 'critical', or 'low'.
* `actions` [NotificationAction[]](structures/notification-action.md) (optional) _macOS_ - Actions to add to the notification. Please read the available actions and limitations in the `NotificationAction` documentation.
* `closeButtonText` String (optional) _macOS_ - A custom title for the close button of an alert. An empty string will cause the default localized text to be used.
* `toastXml` String (optional) _Windows_ - A custom description of the Notification on Windows superseding all properties above. Provides full customization of design and behavior of the notification.
* `closeButtonText` string (optional) _macOS_ - A custom title for the close button of an alert. An empty string will cause the default localized text to be used.
* `toastXml` string (optional) _Windows_ - A custom description of the Notification on Windows superseding all properties above. Provides full customization of design and behavior of the notification.
### Instance Events
@ -84,7 +84,7 @@ is closed.
Returns:
* `event` Event
* `reply` String - The string the user entered into the inline reply field.
* `reply` string - The string the user entered into the inline reply field.
Emitted when the user clicks the "Reply" button on a notification with `hasReply: true`.
@ -93,14 +93,14 @@ Emitted when the user clicks the "Reply" button on a notification with `hasReply
Returns:
* `event` Event
* `index` Number - The index of the action that was activated.
* `index` number - The index of the action that was activated.
#### Event: 'failed' _Windows_
Returns:
* `event` Event
* `error` String - The error encountered during execution of the `show()` method.
* `error` string - The error encountered during execution of the `show()` method.
Emitted when an error is encountered while creating and showing the native notification.
@ -126,45 +126,45 @@ Dismisses the notification.
#### `notification.title`
A `String` property representing the title of the notification.
A `string` property representing the title of the notification.
#### `notification.subtitle`
A `String` property representing the subtitle of the notification.
A `string` property representing the subtitle of the notification.
#### `notification.body`
A `String` property representing the body of the notification.
A `string` property representing the body of the notification.
#### `notification.replyPlaceholder`
A `String` property representing the reply placeholder of the notification.
A `string` property representing the reply placeholder of the notification.
#### `notification.sound`
A `String` property representing the sound of the notification.
A `string` property representing the sound of the notification.
#### `notification.closeButtonText`
A `String` property representing the close button text of the notification.
A `string` property representing the close button text of the notification.
#### `notification.silent`
A `Boolean` property representing whether the notification is silent.
A `boolean` property representing whether the notification is silent.
#### `notification.hasReply`
A `Boolean` property representing whether the notification has a reply action.
A `boolean` property representing whether the notification has a reply action.
#### `notification.urgency` _Linux_
A `String` property representing the urgency level of the notification. Can be 'normal', 'critical', or 'low'.
A `string` property representing the urgency level of the notification. Can be 'normal', 'critical', or 'low'.
Default is 'low' - see [NotifyUrgency](https://developer.gnome.org/notification-spec/#urgency-levels) for more information.
#### `notification.timeoutType` _Linux_ _Windows_
A `String` property representing the type of timeout duration for the notification. Can be 'default' or 'never'.
A `string` property representing the type of timeout duration for the notification. Can be 'default' or 'never'.
If `timeoutType` is set to 'never', the notification never expires. It stays open until closed by the calling API or the user.
@ -174,7 +174,7 @@ A [`NotificationAction[]`](structures/notification-action.md) property represent
#### `notification.toastXml` _Windows_
A `String` property representing the custom Toast XML of the notification.
A `string` property representing the custom Toast XML of the notification.
### Playing Sounds