Skip to content

Commit

Permalink
manually cast <any> to interactjs options to fix typescript errors, m…
Browse files Browse the repository at this point in the history
…aybe look into how to properly type a library instead.
  • Loading branch information
EddyVinck committed Dec 3, 2018
1 parent 8fce353 commit 31aa510
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions js/File.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import getIconUrl from "./utils/getIconUrl";
import { el } from "redom";
import { FileState } from "./types";
import interact from "interactjs";

import { FileState } from "./types/app";

const wallpaperGrid: HTMLElement = document.querySelector(".wallpaper-grid");
const taskbar: HTMLElement = document.querySelector("ul.taskbar");
const taskbarHeight: string = `${taskbar.clientHeight}px`;
Expand Down Expand Up @@ -122,13 +123,13 @@ class File {
.addEventListener("click", () => this.toggleMinimize(true));

const topBar = this.windowElement.querySelector(".top-bar");
interact(topBar).draggable({
interact(topBar).draggable(<any>{
ignoreFrom: ".minimize, .maximize, .close",
onmove: this.handleDrag
});

interact(this.windowElement)
.resizable({
.resizable(<any>{
// resize from all edges and corners
edges: { left: true, right: true, bottom: true, top: true },

Expand Down
File renamed without changes.
Empty file added js/types/interactjs.ts
Empty file.
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"lib": ["es2017", "dom"],
"allowSyntheticDefaultImports": true
},
"typeRoots": ["./node_modules/@types", "./js/types"],
"include": ["js"],
"exclude": ["node_modules"]
}

0 comments on commit 31aa510

Please sign in to comment.