(
layout: GoldenLayout,
element: HTMLElement | JQuery,
factory: DragSourceFactory<K>,
)
| 1220 | * definitions don't properly type the second parameter as accepting a function. |
| 1221 | */ |
| 1222 | export function createDragSource<K extends keyof ComponentStateMap>( |
| 1223 | layout: GoldenLayout, |
| 1224 | element: HTMLElement | JQuery, |
| 1225 | factory: DragSourceFactory<K>, |
| 1226 | ): GoldenLayout.EventEmitter { |
| 1227 | // TODO(#7808): Fix GoldenLayout TypeScript definitions to eliminate 'as any' cast |
| 1228 | // Both the factory parameter type and return type are incorrectly defined |
| 1229 | const result = layout.createDragSource(element, factory as any) as any; |
| 1230 | return result._dragListener; |
| 1231 | } |
| 1232 | |
| 1233 | /** |
| 1234 | * Validation function for component states. |
no outgoing calls
no test coverage detected