types: Upstream winchan types to DefinitelyTyped.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2025-05-23 18:20:35 -07:00
committed by Anders Kaseorg
parent c5f126c6ff
commit d33d52f3af
4 changed files with 10 additions and 65 deletions

View File

@@ -120,6 +120,7 @@
"@types/throttle-debounce": "^5.0.2", "@types/throttle-debounce": "^5.0.2",
"@types/tinycolor2": "^1.4.5", "@types/tinycolor2": "^1.4.5",
"@types/turndown": "^5.0.1", "@types/turndown": "^5.0.1",
"@types/winchan": "^0.2.0",
"@typescript-eslint/eslint-plugin": "^8.2.0", "@typescript-eslint/eslint-plugin": "^8.2.0",
"@typescript-eslint/parser": "^8.2.0", "@typescript-eslint/parser": "^8.2.0",
"babel-plugin-istanbul": "^7.0.0", "babel-plugin-istanbul": "^7.0.0",

8
pnpm-lock.yaml generated
View File

@@ -377,6 +377,9 @@ importers:
'@types/turndown': '@types/turndown':
specifier: ^5.0.1 specifier: ^5.0.1
version: 5.0.5 version: 5.0.5
'@types/winchan':
specifier: ^0.2.0
version: 0.2.0
'@typescript-eslint/eslint-plugin': '@typescript-eslint/eslint-plugin':
specifier: ^8.2.0 specifier: ^8.2.0
version: 8.32.0(@typescript-eslint/parser@8.32.0(eslint@9.26.0(jiti@1.21.7))(typescript@5.8.3))(eslint@9.26.0(jiti@1.21.7))(typescript@5.8.3) version: 8.32.0(@typescript-eslint/parser@8.32.0(eslint@9.26.0(jiti@1.21.7))(typescript@5.8.3))(eslint@9.26.0(jiti@1.21.7))(typescript@5.8.3)
@@ -2810,6 +2813,9 @@ packages:
'@types/unist@3.0.3': '@types/unist@3.0.3':
resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==}
'@types/winchan@0.2.0':
resolution: {integrity: sha512-1NyyjFkmpFf9T5hpyB1KgS4kljPwy45nxaq/I6CndEU2kw6BpxzFIAa0SXs620EtnEsvkFljquX+yRdlLxqDkA==}
'@types/ws@8.18.1': '@types/ws@8.18.1':
resolution: {integrity: sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==} resolution: {integrity: sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==}
@@ -12190,6 +12196,8 @@ snapshots:
'@types/unist@3.0.3': {} '@types/unist@3.0.3': {}
'@types/winchan@0.2.0': {}
'@types/ws@8.18.1': '@types/ws@8.18.1':
dependencies: dependencies:
'@types/node': 22.15.6 '@types/node': 22.15.6

View File

@@ -49,4 +49,4 @@ API_FEATURE_LEVEL = 390
# historical commits sharing the same major version, in which case a # historical commits sharing the same major version, in which case a
# minor version bump suffices. # minor version bump suffices.
PROVISION_VERSION = (326, 6) # bumped 2025-05-20 to add pydantic-partials PROVISION_VERSION = (326, 7) # bumped 2025-05-23 to add @types/winchan

View File

@@ -1,64 +0,0 @@
// Types for https://www.npmjs.com/package/winchan
/**
* Opens a window and initiates a cross-domain request. Call this from the
* "untrusted" or "client" site.
*
* @param options - Options for `open`
* @param responseCallback - Called when the request completes with a response
* or an error
*/
export function open(
options: {
/**
* URL of the "trusted" window
*/
url: string;
/**
* URL of the `relay.html` iframe (used for Internet Explorer support)
*/
relay_url: string;
/**
* Target name passed to `window.open`
*/
window_name?: string | undefined;
/**
* Comma-separated features passed to `window.open`
*/
window_features?: string | undefined;
/**
* Application-defined parameters for the request
*/
params?: unknown;
},
responseCallback: (err: string | null, response?: unknown) => void,
): {
/**
* Closes the window.
*/
close: () => void;
/**
* Tries to move the focus to the window.
*/
focus: () => void;
};
/**
* Listens for a request. Call this from the "trusted" site providing the
* window.
*
* @param requestCallback - Called to initiate the request
*/
export function onOpen(
requestCallback: (
origin: string,
params: unknown,
sendResponse: (response: unknown) => void,
) => void,
): {
/**
* Detaches the channel without sending a response yet. Call this before
* navigating to another page in a multi-page dialog.
*/
detach: () => void;
};