How should Vue filters be bound using TypeScript? It is fairly straightforward with pure js, but I'm running into issue converting it to TypeScript.
The code and compile error are as follows:
app.ts
import * as Vue from 'vue'
...
import * as filters from './util/filters'
// register global utility filters.
Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key]);
})
util/filters.ts
export function host (url: string) {
...
}
export function timeAgo (time: any) {
....
}
Compile Error
error TS7017: Element implicitly has an 'any' type because type 'typeof ...' has no index signature.