本文整理汇总了TypeScript中dnd-core.IDragDropManager类的典型用法代码示例。如果您正苦于以下问题:TypeScript IDragDropManager类的具体用法?TypeScript IDragDropManager怎么用?TypeScript IDragDropManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IDragDropManager类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: registerTarget
export default function registerTarget(
type: string,
target: IDropTarget,
manager: IDragDropManager<any>,
): { handlerId: string; unregister: Unsubscribe } {
const registry = manager.getRegistry()
const targetId = registry.addTarget(type, target)
function unregisterTarget() {
registry.removeTarget(targetId)
}
return {
handlerId: targetId,
unregister: unregisterTarget,
}
}
示例2: registerSource
export default function registerSource(
type: string,
source: IDragSource,
manager: IDragDropManager<any>,
): {
handlerId: string
unregister: Unsubscribe
} {
const registry = manager.getRegistry()
const sourceId = registry.addSource(type, source)
function unregisterSource() {
registry.removeSource(sourceId)
}
return {
handlerId: sourceId,
unregister: unregisterSource,
}
}
示例3: constructor
constructor(manager: IDragDropManager<any>) {
this.internalMonitor = manager.getMonitor()
}