Closed vladyslav2 closed 7 years ago
That error occurs when trying to compile with typescript 2.4 (due to a change with weak types, where all type properties are optional).
It's fixed on the current branch I'm working on, which hopefully will get merged in soon.
For now, you can try downgrading your typescript version to 2.3.x to get it to compile without errors.
(unrelated to the Typescript error, but it looks like you also have some go build errors, which you can fix by running make prepare-vendor
to pull in the vendored dependencies)
@octavore thanks for a response
@octavore i'm really really new in typescript, but base on what i google, mithril-query.d.ts should looks like this:
/**
* Provide definitions for https://github.com/StephanHoyer/mithril-query
*/
declare module 'mithril-query' {
import * as Mithril from "mithril";
export interface mq {
<A, S>(element: Mithril.Component<A, S>, attrs?: A): AssertionStatic<A, S>;
<A, S>(vnode: Mithril.Vnode<A, S>): AssertionStatic<A, S>;
}
type Vnode<A,S> = Mithril.Vnode<A, S> & { text: string }
export interface AssertionStatic<A, S> {
first(selector: string): Mithril.Vnode<A, S>;
find(selector: string): Vnode<A,S>[];
has(selector: string): boolean;
contains(str: string): boolean;
redraw(): void;
click(selector: string): void;
vnode: Mithril.Vnode<A, S>;
log(selector: string): void;
rootNode: any
}
}
declare module 'mithril-query' should be before imports.
but still, i cannot figure out an error on https://github.com/ketchuphq/ketchup/blob/tp/themes/admin/src/js/components/content.test.tsx#L11
ERROR in ketchup/admin/src/js/components/content.test.tsx
(13,15): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'typeof 'mithril-query'' has no compatible call signatures.
typescript: 2.4.2 node: v8.1.4 go: go version go1.8.3 darwin/amd64