Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
Fixed most of TypeScript errors for TS 3.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
akyoto committed Oct 10, 2018
1 parent d1987e9 commit 1829c2c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 106 deletions.
2 changes: 1 addition & 1 deletion scripts/Actions/Search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export function searchBySpeech(arn: AnimeNotifier, element: HTMLElement) {
let searchInput = document.getElementById("search") as HTMLInputElement
let oldPlaceholder = searchInput.placeholder

let SpeechRecognition: SpeechRecognitionStatic = window["SpeechRecognition"] || window["webkitSpeechRecognition"]
let SpeechRecognition: any = window["SpeechRecognition"] || window["webkitSpeechRecognition"]
recognition = new SpeechRecognition()
recognition.continuous = false
recognition.interimResults = false
Expand Down
8 changes: 5 additions & 3 deletions scripts/Analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ export default class Analytics {
}

if("connection" in navigator) {
let connection = navigator["connection"] as any

analytics.connection = {
downLink: navigator["connection"].downlink,
roundTripTime: navigator["connection"].rtt,
effectiveType: navigator["connection"].effectiveType
downLink: connection.downlink,
roundTripTime: connection.rtt,
effectiveType: connection.effectiveType
}
}

Expand Down
3 changes: 2 additions & 1 deletion scripts/AnimeNotifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,8 @@ export default class AnimeNotifier {
// Disallow Enter key in contenteditables and make it blur the element instead
if(e.keyCode === 13) {
if("blur" in activeElement) {
activeElement["blur"]()
let blur = activeElement["blur"] as Function
blur()
}

return preventDefault()
Expand Down
8 changes: 4 additions & 4 deletions scripts/Application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export default class Application {
this.content.innerHTML = html
}

markActiveLinks(links?: NodeListOf<HTMLAnchorElement>) {
markActiveLinks(links?: HTMLCollectionOf<HTMLAnchorElement>) {
if(!links) {
links = document.getElementsByTagName("a")
}
Expand All @@ -211,7 +211,7 @@ export default class Application {
}
}

ajaxify(links?: NodeListOf<HTMLAnchorElement>) {
ajaxify(links?: HTMLCollectionOf<HTMLAnchorElement>) {
if(!links) {
links = document.getElementsByTagName("a")
}
Expand Down Expand Up @@ -241,10 +241,10 @@ export default class Application {
return
}

let url = this.getAttribute("href")

e.preventDefault()

let url = (this as HTMLAnchorElement).getAttribute("href")

if(!url || url === self.currentPath) {
return
}
Expand Down
96 changes: 0 additions & 96 deletions scripts/Types/WebSpeechAPI.d.ts

This file was deleted.

3 changes: 2 additions & 1 deletion scripts/Utils/requestIdleCallback.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export function requestIdleCallback(func: Function) {
if("requestIdleCallback" in window) {
window["requestIdleCallback"](func)
let requestIdleCallback = window["requestIdleCallback"] as Function
requestIdleCallback(func)
} else {
func()
}
Expand Down

0 comments on commit 1829c2c

Please sign in to comment.