File: ambientPropertyDeclarationInJs.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (27 lines) | stat: -rw-r--r-- 944 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/test.js(3,9): error TS2322: Type '{}' is not assignable to type 'string'.
/test.js(6,5): error TS8009: The 'declare' modifier can only be used in TypeScript files.
/test.js(6,19): error TS8010: Type annotations can only be used in TypeScript files.
/test.js(9,19): error TS2339: Property 'foo' does not exist on type 'string'.


==== /test.js (4 errors) ====
    class Foo {
        constructor() {
            this.prop = {};
            ~~~~~~~~~
!!! error TS2322: Type '{}' is not assignable to type 'string'.
        }
    
        declare prop: string;
        ~~~~~~~
!!! error TS8009: The 'declare' modifier can only be used in TypeScript files.
                      ~~~~~~
!!! error TS8010: Type annotations can only be used in TypeScript files.
    
        method() {
            this.prop.foo
                      ~~~
!!! error TS2339: Property 'foo' does not exist on type 'string'.
        }
    }