mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
1.4 KiB
1.4 KiB
index.ts:3:8 - error TS2345: Argument of type '{ default: () => void; }' is not assignable to parameter of type '() => void'.
Type '{ default: () => void; }' provides no match for the signature '(): void'.
3 invoke(foo);
~~~
index.ts:1:1 - Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead.
1 import * as foo from "./foo";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
==== foo.d.ts (0 errors) ====
declare function foo(): void;
declare namespace foo {}
export = foo;
==== index.ts (1 errors) ====
import * as foo from "./foo";
function invoke(f: () => void) { f(); }
invoke(foo);
~~~
!!! error TS2345: Argument of type '{ default: () => void; }' is not assignable to parameter of type '() => void'.
!!! error TS2345: Type '{ default: () => void; }' provides no match for the signature '(): void'.
!!! related TS7038 index.ts:1:1: Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead.
Found 1 error in index.ts:3
Type '{ default: () => void; }' provides no match for the signature '(): void'.
3 invoke(foo);
~~~
index.ts:1:1 - Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead.
1 import * as foo from "./foo";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
==== foo.d.ts (0 errors) ====
declare function foo(): void;
declare namespace foo {}
export = foo;
==== index.ts (1 errors) ====
import * as foo from "./foo";
function invoke(f: () => void) { f(); }
invoke(foo);
~~~
!!! error TS2345: Argument of type '{ default: () => void; }' is not assignable to parameter of type '() => void'.
!!! error TS2345: Type '{ default: () => void; }' provides no match for the signature '(): void'.
!!! related TS7038 index.ts:1:1: Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead.
Found 1 error in index.ts:3