cherry-pick(#33096): chore: various v1.48.0 roll fixes for .NET

This commit is contained in:
Max Schmitt 2024-10-14 16:32:11 +02:00
parent daff1a9025
commit e5bbd5effe
4 changed files with 22 additions and 12 deletions

View file

@ -256,19 +256,25 @@ By default, closing one side of the connection, either in the page or on the ser
### param: WebSocketRoute.onClose.handler ### param: WebSocketRoute.onClose.handler
* since: v1.48 * since: v1.48
* langs: js, python * langs: js, python
- `handler` <[function]\([number]|[undefined], [string]|[undefined]\): [Promise<any>|any]> - `handler` <[function]\([int]|[undefined], [string]|[undefined]\): [Promise<any>|any]>
Function that will handle WebSocket closure. Received an optional [close code](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#code) and an optional [close reason](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#reason). Function that will handle WebSocket closure. Received an optional [close code](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#code) and an optional [close reason](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#reason).
### param: WebSocketRoute.onClose.handler ### param: WebSocketRoute.onClose.handler
* since: v1.48 * since: v1.48
* langs: java, csharp * langs: java
- `handler` <[function]\([null]|[number], [null]|[string]\)> - `handler` <[function]\([null]|[int], [null]|[string]\)>
Function that will handle WebSocket closure. Received an optional [close code](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#code) and an optional [close reason](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#reason). Function that will handle WebSocket closure. Received an optional [close code](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#code) and an optional [close reason](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#reason).
### param: WebSocketRoute.onClose.handler
* since: v1.48
* langs: csharp
- `handler` <[function]\([int?], [string]\)>
## async method: WebSocketRoute.onMessage Function that will handle WebSocket closure. Received an optional [close code](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#code) and an optional [close reason](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#reason).
## method: WebSocketRoute.onMessage
* since: v1.48 * since: v1.48
This method allows to handle messages that are sent by the WebSocket, either from the page or from the server. This method allows to handle messages that are sent by the WebSocket, either from the page or from the server.

View file

@ -363,7 +363,7 @@ Target URL.
## js-fetch-option-params ## js-fetch-option-params
* langs: js * langs: js
- `params` <[Object]<[string], [string]|[number]|[boolean]>|[URLSearchParams]|[string]> - `params` <[Object]<[string], [string]|[float]|[boolean]>|[URLSearchParams]|[string]>
Query parameters to be sent with the URL. Query parameters to be sent with the URL.

View file

@ -16,7 +16,7 @@
// @ts-check // @ts-check
const Documentation = require('./documentation'); const Documentation = require('./documentation');
const { visitAll } = require('../markdown'); const { visitAll, render } = require('../markdown');
/** /**
* @param {Documentation.MarkdownNode[]} nodes * @param {Documentation.MarkdownNode[]} nodes
* @param {number} maxColumns * @param {number} maxColumns
@ -64,7 +64,10 @@ function _innerRenderNodes(nodes, maxColumns = 80, wrapParagraphs = true) {
} else if (node.type === 'li') { } else if (node.type === 'li') {
_wrapInNode('item><description', _wrapAndEscape(node, maxColumns), summary, '/description></item'); _wrapInNode('item><description', _wrapAndEscape(node, maxColumns), summary, '/description></item');
} else if (node.type === 'note') { } else if (node.type === 'note') {
_wrapInNode('para', _wrapAndEscape(node, maxColumns), remarks); _wrapInNode('para', _wrapAndEscape({
type: 'text',
text: render(node.children ?? []).replaceAll('\n', '↵'),
}, maxColumns), remarks);
} }
lastNode = node; lastNode = node;
}); });
@ -75,11 +78,11 @@ function _innerRenderNodes(nodes, maxColumns = 80, wrapParagraphs = true) {
function _wrapCode(lines) { function _wrapCode(lines) {
let i = 0; let i = 0;
let out = []; const out = [];
for (let line of lines) { for (let line of lines) {
line = line.replace(/[&]/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;'); line = line.replace(/[&]/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
if (i < lines.length - 1) if (i < lines.length - 1)
line = line + "<br/>"; line = line + '<br/>';
out.push(line); out.push(line);
i++; i++;
} }
@ -163,4 +166,4 @@ function renderTextOnly(nodes, maxColumns = 80) {
return result.summary; return result.summary;
} }
module.exports = { renderXmlDoc, renderTextOnly } module.exports = { renderXmlDoc, renderTextOnly };

View file

@ -520,7 +520,8 @@ function renderMethod(member, parent, name, options, out) {
&& !name.startsWith('Get') && !name.startsWith('Get')
&& name !== 'CreateFormData' && name !== 'CreateFormData'
&& !name.startsWith('PostDataJSON') && !name.startsWith('PostDataJSON')
&& !name.startsWith('As')) { && !name.startsWith('As')
&& name !== 'ConnectToServer') {
if (!member.async) { if (!member.async) {
if (member.spec && !options.nodocs) if (member.spec && !options.nodocs)
out.push(...XmlDoc.renderXmlDoc(member.spec, maxDocumentationColumnWidth)); out.push(...XmlDoc.renderXmlDoc(member.spec, maxDocumentationColumnWidth));
@ -718,7 +719,7 @@ function translateType(type, parent, generateNameCallback = t => t.name, optiona
if (type.expression === '[null]|[Error]') if (type.expression === '[null]|[Error]')
return 'void'; return 'void';
if (type.name == 'Promise' && type.templates?.[0].name === 'any') if (type.name === 'Promise' && type.templates?.[0].name === 'any')
return 'Task'; return 'Task';
if (type.union) { if (type.union) {