Fix issue with properties clashing with jqueryui

This commit is contained in:
Oscar Busk
2018-10-17 17:45:47 +02:00
parent fb1a9771d4
commit 33f3666a20

View File

@@ -2,12 +2,16 @@
// Project: https://github.com/angular-ui/ui-sortable
// Definitions by: Thodoris Greasidis <https://github.com/thgreasi>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
// TypeScript Version: 2.4
/// <reference types="angular" />
/// <reference types="jqueryui" />
import * as ng from 'angular';
// Diff / Omit taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766
type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>;
declare module 'angular' {
export namespace ui {
@@ -79,11 +83,11 @@ declare module 'angular' {
isCustomHelperUsed(): Boolean;
}
interface UISortableUIItem<T> extends ng.IAugmentedJQuery {
interface UISortableUIItem<T> extends Omit<ng.IAugmentedJQuery, 'sortable'> {
sortable: UISortableProperties<T>;
}
interface UISortableUIParams<T> extends SortableUIParams {
interface UISortableUIParams<T> extends Omit<SortableUIParams, 'item'> {
item: UISortableUIItem<T>;
}