mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
60 lines
1.9 KiB
Plaintext
60 lines
1.9 KiB
Plaintext
component.ts(12,4): error TS1361: 'onInit' cannot be used as a value because it was imported using 'import type'.
|
|
component.ts(16,4): error TS1361: 'onInit' cannot be used as a value because it was imported using 'import type'.
|
|
component.ts(20,4): error TS1361: 'onInit' cannot be used as a value because it was imported using 'import type'.
|
|
component.ts(24,4): error TS1361: 'onInit' cannot be used as a value because it was imported using 'import type'.
|
|
|
|
|
|
==== framework-hooks.ts (0 errors) ====
|
|
export const onInit = Symbol("onInit");
|
|
|
|
==== component.ts (4 errors) ====
|
|
import type { onInit } from "./framework-hooks";
|
|
|
|
interface Component {
|
|
[onInit]?(): void;
|
|
}
|
|
|
|
type T = {
|
|
[onInit]: any;
|
|
}
|
|
|
|
const o = {
|
|
[onInit]: 0 // Error
|
|
~~~~~~
|
|
!!! error TS1361: 'onInit' cannot be used as a value because it was imported using 'import type'.
|
|
!!! related TS1376 component.ts:1:15: 'onInit' was imported here.
|
|
};
|
|
|
|
class C {
|
|
[onInit]: any; // Error (because class fields)
|
|
~~~~~~
|
|
!!! error TS1361: 'onInit' cannot be used as a value because it was imported using 'import type'.
|
|
!!! related TS1376 component.ts:1:15: 'onInit' was imported here.
|
|
}
|
|
|
|
class D {
|
|
[onInit] = 0; // Error
|
|
~~~~~~
|
|
!!! error TS1361: 'onInit' cannot be used as a value because it was imported using 'import type'.
|
|
!!! related TS1376 component.ts:1:15: 'onInit' was imported here.
|
|
}
|
|
|
|
class E {
|
|
[onInit]() {} // Error
|
|
~~~~~~
|
|
!!! error TS1361: 'onInit' cannot be used as a value because it was imported using 'import type'.
|
|
!!! related TS1376 component.ts:1:15: 'onInit' was imported here.
|
|
}
|
|
|
|
abstract class F {
|
|
abstract [onInit](): void;
|
|
}
|
|
|
|
class G {
|
|
declare [onInit]: any;
|
|
}
|
|
|
|
declare class H {
|
|
[onInit]: any;
|
|
}
|
|
|