Document DataTransferItem (#151442)

This adds missing documentation to the `DataTransferItem` api type
pull/148832/head^2
Matt Bierner 2022-06-07 11:45:48 -07:00 committed by GitHub
parent 89606c8297
commit 070fb39a3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 4 deletions

View File

@ -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<string>;
/**
* 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);
}