From 070fb39a3c3dcc5a56907ef3ad0b53fcd29d6e19 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 7 Jun 2022 11:45:48 -0700 Subject: [PATCH] Document DataTransferItem (#151442) This adds missing documentation to the `DataTransferItem` api type --- src/vscode-dts/vscode.d.ts | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/vscode-dts/vscode.d.ts b/src/vscode-dts/vscode.d.ts index 485dff49374..88f7fdf67eb 100644 --- a/src/vscode-dts/vscode.d.ts +++ b/src/vscode-dts/vscode.d.ts @@ -10058,14 +10058,27 @@ declare module 'vscode' { } /** - * A class for encapsulating data transferred during a drag and drop event. - * - * You can use the `value` of the `DataTransferItem` to get back the object you put into it - * so long as the extension that created the `DataTransferItem` runs in the same extension host. + * Encapsulates data transferred during drag and drop operations. */ export class DataTransferItem { + /** + * Get a string representation of this item. + * + * If {@linkcode DataTransferItem.value} is an object, this returns the result of json stringifying {@linkcode DataTransferItem.value} value. + */ asString(): Thenable; + + /** + * Custom data stored on this item. + * + * You can use `value` to share data across operations. The original object can be retrieved so long as the extension that + * created the `DataTransferItem` runs in the same extension host. + */ readonly value: any; + + /** + * @param value Custom data stored on this item. Can be retrieved using {@linkcode DataTransferItem.value}. + */ constructor(value: any); }