Path: blob/main/src/vs/editor/common/services/treeViewsDnd.ts
3296 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45export interface ITreeViewsDnDService<T> {6readonly _serviceBrand: undefined;78removeDragOperationTransfer(uuid: string | undefined): Promise<T | undefined> | undefined;9addDragOperationTransfer(uuid: string, transferPromise: Promise<T | undefined>): void;10}1112export class TreeViewsDnDService<T> implements ITreeViewsDnDService<T> {13_serviceBrand: undefined;14private _dragOperations: Map<string, Promise<T | undefined>> = new Map();1516removeDragOperationTransfer(uuid: string | undefined): Promise<T | undefined> | undefined {17if ((uuid && this._dragOperations.has(uuid))) {18const operation = this._dragOperations.get(uuid);19this._dragOperations.delete(uuid);20return operation;21}22return undefined;23}2425addDragOperationTransfer(uuid: string, transferPromise: Promise<T | undefined>): void {26this._dragOperations.set(uuid, transferPromise);27}28}293031export class DraggedTreeItemsIdentifier {3233constructor(readonly identifier: string) { }34}353637