Skip to content

Commit 2eccefe

Browse files
committed
Adds FixMeAny type to be used during conversion
1 parent a8bfa03 commit 2eccefe

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

src/Draggable/DragEvent/DragEvent.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import AbstractEvent from 'shared/AbstractEvent';
2+
import {FixMeAny} from 'shared/types';
23

34
/**
45
* DragEventData
@@ -9,7 +10,7 @@ interface DragEventData {
910
originalSource: HTMLElement;
1011
mirror: HTMLElement;
1112
sourceContainer: HTMLElement;
12-
sensorEvent: any;
13+
sensorEvent: FixMeAny;
1314
}
1415

1516
/**

src/Plugins/ResizeMirror/ResizeMirror.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import AbstractPlugin from 'shared/AbstractPlugin';
22
import {requestNextAnimationFrame} from 'shared/utils';
3+
import {FixMeAny} from 'shared/types';
34

45
import {
56
DragOverEvent,
@@ -29,7 +30,7 @@ export default class ResizeMirror extends AbstractPlugin {
2930
* @constructs ResizeMirror
3031
* @param {Draggable} draggable - Draggable instance
3132
*/
32-
constructor(draggable: any) {
33+
constructor(draggable: FixMeAny) {
3334
super(draggable);
3435

3536
/**
@@ -91,7 +92,7 @@ export default class ResizeMirror extends AbstractPlugin {
9192
* @param {MirrorCreatedEvent} mirrorEvent
9293
* @private
9394
*/
94-
private onMirrorCreated({mirror}: any) {
95+
private onMirrorCreated({mirror}: FixMeAny) {
9596
this.mirror = mirror;
9697
}
9798

src/Plugins/SwapAnimation/SwapAnimation.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import AbstractPlugin from 'shared/AbstractPlugin';
2+
import {FixMeAny} from 'shared/types';
23

34
interface Options {
45
duration: number;
@@ -34,7 +35,7 @@ export default class SwapAnimation extends AbstractPlugin {
3435
* @constructs SwapAnimation
3536
* @param {Draggable} draggable - Draggable instance
3637
*/
37-
constructor(draggable: any) {
38+
constructor(draggable: FixMeAny) {
3839
super(draggable);
3940

4041
/**
@@ -86,7 +87,7 @@ export default class SwapAnimation extends AbstractPlugin {
8687
* @param {SortableSortedEvent} sortableEvent
8788
* @private
8889
*/
89-
onSortableSorted({oldIndex, newIndex, dragEvent}: any) {
90+
onSortableSorted({oldIndex, newIndex, dragEvent}: FixMeAny) {
9091
const {source, over} = dragEvent;
9192

9293
if (this.lastAnimationFrame) {
@@ -117,7 +118,7 @@ export default class SwapAnimation extends AbstractPlugin {
117118
function animate(
118119
from: HTMLElement,
119120
to: HTMLElement,
120-
{duration, easingFunction, horizontal}: any,
121+
{duration, easingFunction, horizontal}: Options,
121122
) {
122123
for (const element of [from, to]) {
123124
element.style.pointerEvents = 'none';

src/shared/AbstractPlugin/AbstractPlugin.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import {FixMeAny} from 'shared/types';
2+
13
/**
24
* All draggable plugins inherit from this class.
35
* @abstract
@@ -10,7 +12,7 @@ export abstract class AbstractPlugin {
1012
* @constructs AbstractPlugin
1113
* @param {Draggable} draggable - Draggable instance
1214
*/
13-
constructor(protected draggable: any) {}
15+
constructor(protected draggable: FixMeAny) {}
1416

1517
/**
1618
* Override to add listeners

src/shared/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export type FixMeAny = any;
2+
export type FixMeUnknown = unknown;

0 commit comments

Comments
 (0)