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

@ -110,13 +110,13 @@ expect streaming responses.
### `protocol.registerFileProtocol(scheme, handler)`
* `scheme` String
* `scheme` string
* `handler` Function
* `request` [ProtocolRequest](structures/protocol-request.md)
* `callback` Function
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
* `response` (string | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully registered
Returns `boolean` - Whether the protocol was successfully registered
Registers a protocol of `scheme` that will send a file as the response. The
`handler` will be called with `request` and `callback` where `request` is
@ -131,13 +131,13 @@ from protocols that follow the "generic URI syntax" like `file:`.
### `protocol.registerBufferProtocol(scheme, handler)`
* `scheme` String
* `scheme` string
* `handler` Function
* `request` [ProtocolRequest](structures/protocol-request.md)
* `callback` Function
* `response` (Buffer | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully registered
Returns `boolean` - Whether the protocol was successfully registered
Registers a protocol of `scheme` that will send a `Buffer` as a response.
@ -155,29 +155,29 @@ protocol.registerBufferProtocol('atom', (request, callback) => {
### `protocol.registerStringProtocol(scheme, handler)`
* `scheme` String
* `scheme` string
* `handler` Function
* `request` [ProtocolRequest](structures/protocol-request.md)
* `callback` Function
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
* `response` (string | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully registered
Returns `boolean` - Whether the protocol was successfully registered
Registers a protocol of `scheme` that will send a `String` as a response.
Registers a protocol of `scheme` that will send a `string` as a response.
The usage is the same with `registerFileProtocol`, except that the `callback`
should be called with either a `String` or an object that has the `data`
should be called with either a `string` or an object that has the `data`
property.
### `protocol.registerHttpProtocol(scheme, handler)`
* `scheme` String
* `scheme` string
* `handler` Function
* `request` [ProtocolRequest](structures/protocol-request.md)
* `callback` Function
* `response` ProtocolResponse
Returns `Boolean` - Whether the protocol was successfully registered
Returns `boolean` - Whether the protocol was successfully registered
Registers a protocol of `scheme` that will send an HTTP request as a response.
@ -186,13 +186,13 @@ should be called with an object that has the `url` property.
### `protocol.registerStreamProtocol(scheme, handler)`
* `scheme` String
* `scheme` string
* `handler` Function
* `request` [ProtocolRequest](structures/protocol-request.md)
* `callback` Function
* `response` (ReadableStream | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully registered
Returns `boolean` - Whether the protocol was successfully registered
Registers a protocol of `scheme` that will send a stream as a response.
@ -235,95 +235,95 @@ protocol.registerStreamProtocol('atom', (request, callback) => {
### `protocol.unregisterProtocol(scheme)`
* `scheme` String
* `scheme` string
Returns `Boolean` - Whether the protocol was successfully unregistered
Returns `boolean` - Whether the protocol was successfully unregistered
Unregisters the custom protocol of `scheme`.
### `protocol.isProtocolRegistered(scheme)`
* `scheme` String
* `scheme` string
Returns `Boolean` - Whether `scheme` is already registered.
Returns `boolean` - Whether `scheme` is already registered.
### `protocol.interceptFileProtocol(scheme, handler)`
* `scheme` String
* `scheme` string
* `handler` Function
* `request` [ProtocolRequest](structures/protocol-request.md)
* `callback` Function
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
* `response` (string | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully intercepted
Returns `boolean` - Whether the protocol was successfully intercepted
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
which sends a file as a response.
### `protocol.interceptStringProtocol(scheme, handler)`
* `scheme` String
* `scheme` string
* `handler` Function
* `request` [ProtocolRequest](structures/protocol-request.md)
* `callback` Function
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
* `response` (string | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully intercepted
Returns `boolean` - Whether the protocol was successfully intercepted
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
which sends a `String` as a response.
which sends a `string` as a response.
### `protocol.interceptBufferProtocol(scheme, handler)`
* `scheme` String
* `scheme` string
* `handler` Function
* `request` [ProtocolRequest](structures/protocol-request.md)
* `callback` Function
* `response` (Buffer | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully intercepted
Returns `boolean` - Whether the protocol was successfully intercepted
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
which sends a `Buffer` as a response.
### `protocol.interceptHttpProtocol(scheme, handler)`
* `scheme` String
* `scheme` string
* `handler` Function
* `request` [ProtocolRequest](structures/protocol-request.md)
* `callback` Function
* `response` [ProtocolResponse](structures/protocol-response.md)
Returns `Boolean` - Whether the protocol was successfully intercepted
Returns `boolean` - Whether the protocol was successfully intercepted
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
which sends a new HTTP request as a response.
### `protocol.interceptStreamProtocol(scheme, handler)`
* `scheme` String
* `scheme` string
* `handler` Function
* `request` [ProtocolRequest](structures/protocol-request.md)
* `callback` Function
* `response` (ReadableStream | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully intercepted
Returns `boolean` - Whether the protocol was successfully intercepted
Same as `protocol.registerStreamProtocol`, except that it replaces an existing
protocol handler.
### `protocol.uninterceptProtocol(scheme)`
* `scheme` String
* `scheme` string
Returns `Boolean` - Whether the protocol was successfully unintercepted
Returns `boolean` - Whether the protocol was successfully unintercepted
Remove the interceptor installed for `scheme` and restore its original handler.
### `protocol.isProtocolIntercepted(scheme)`
* `scheme` String
* `scheme` string
Returns `Boolean` - Whether `scheme` is already intercepted.
Returns `boolean` - Whether `scheme` is already intercepted.
[file-system-api]: https://developer.mozilla.org/en-US/docs/Web/API/LocalFileSystem