Files
vscode/src/vscode-dts/vscode.proposed.dataChannels.d.ts
Matt Bierner 245265d15e Mark most Event properties as readonly
We want to prevent mistaken changes that do something like this:

```ts
foo.onEvent = () => { ... };
```

When they almost always mean:

```ts
foo.onEvent(() => { ... })
```
2025-10-09 13:59:00 -07:00

20 lines
642 B
TypeScript

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'vscode' {
export namespace env {
export function getDataChannel<T>(channelId: string): DataChannel<T>;
}
export interface DataChannel<T = unknown> {
readonly onDidReceiveData: Event<DataChannelEvent<T>>;
}
export interface DataChannelEvent<T> {
data: T;
}
}