本文整理匯總了TypeScript中dnd-core.DragDropManager類的典型用法代碼示例。如果您正苦於以下問題:TypeScript DragDropManager類的具體用法?TypeScript DragDropManager怎麽用?TypeScript DragDropManager使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了DragDropManager類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
export default function registerTarget<Context>(
type: TargetType,
target: DropTarget,
manager: DragDropManager<Context>,
): [Identifier, Unsubscribe] {
const registry = manager.getRegistry()
const targetId = registry.addTarget(type, target)
return [targetId, () => registry.removeTarget(targetId)]
}
示例2:
export default function registerSource<Context>(
type: SourceType,
source: DragSource,
manager: DragDropManager<Context>,
): [Identifier, Unsubscribe] {
const registry = manager.getRegistry()
const sourceId = registry.addSource(type, source)
return [sourceId, () => registry.removeSource(sourceId)]
}
示例3: registerSource
export default function registerSource(type: any, source: DragSource, manager: DragDropManager<any>) {
const registry = manager.getRegistry();
const sourceId = registry.addSource(type, source);
function unregisterSource() {
registry.removeSource(sourceId);
}
return {
handlerId: sourceId,
unregister: unregisterSource,
};
}
示例4: registerTarget
export default function registerTarget(type: any, target: DropTarget, manager: DragDropManager<any>) {
const registry = manager.getRegistry();
const targetId = registry.addTarget(type, target);
function unregisterTarget() {
registry.removeTarget(targetId);
}
return {
handlerId: targetId,
unregister: unregisterTarget,
};
}
示例5: unregisterTarget
export default function registerTarget<Context>(
type: string,
target: DropTarget,
manager: DragDropManager<Context>,
): { handlerId: string; unregister: Unsubscribe } {
const registry = manager.getRegistry()
const targetId = registry.addTarget(type, target)
function unregisterTarget() {
registry.removeTarget(targetId)
}
return {
handlerId: targetId,
unregister: unregisterTarget,
}
}
示例6: unregisterSource
export default function registerSource<Context>(
type: string,
source: DragSource,
manager: DragDropManager<Context>,
): {
handlerId: string
unregister: Unsubscribe
} {
const registry = manager.getRegistry()
const sourceId = registry.addSource(type, source)
function unregisterSource() {
registry.removeSource(sourceId)
}
return {
handlerId: sourceId,
unregister: unregisterSource,
}
}
示例7: constructor
constructor(manager: DragDropManager<any>) {
this.internalMonitor = manager.getMonitor()
}