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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212
|
tests/cases/conformance/jsdoc/declarations/index.js(4,18): error TS8006: 'interface' declarations can only be used in TypeScript files.
tests/cases/conformance/jsdoc/declarations/index.js(6,18): error TS8006: 'interface' declarations can only be used in TypeScript files.
tests/cases/conformance/jsdoc/declarations/index.js(10,18): error TS8006: 'interface' declarations can only be used in TypeScript files.
tests/cases/conformance/jsdoc/declarations/index.js(31,11): error TS8006: 'interface' declarations can only be used in TypeScript files.
tests/cases/conformance/jsdoc/declarations/index.js(33,10): error TS18043: Types cannot appear in export declarations in JavaScript files.
tests/cases/conformance/jsdoc/declarations/index.js(35,11): error TS8006: 'interface' declarations can only be used in TypeScript files.
tests/cases/conformance/jsdoc/declarations/index.js(37,10): error TS18043: Types cannot appear in export declarations in JavaScript files.
tests/cases/conformance/jsdoc/declarations/index.js(39,18): error TS8006: 'interface' declarations can only be used in TypeScript files.
tests/cases/conformance/jsdoc/declarations/index.js(40,10): error TS18043: Types cannot appear in export declarations in JavaScript files.
tests/cases/conformance/jsdoc/declarations/index.js(42,10): error TS18043: Types cannot appear in export declarations in JavaScript files.
tests/cases/conformance/jsdoc/declarations/index.js(43,18): error TS8006: 'interface' declarations can only be used in TypeScript files.
tests/cases/conformance/jsdoc/declarations/index.js(45,18): error TS8006: 'interface' declarations can only be used in TypeScript files.
tests/cases/conformance/jsdoc/declarations/index.js(49,18): error TS8006: 'interface' declarations can only be used in TypeScript files.
tests/cases/conformance/jsdoc/declarations/index.js(53,18): error TS8006: 'interface' declarations can only be used in TypeScript files.
tests/cases/conformance/jsdoc/declarations/index.js(57,18): error TS8006: 'interface' declarations can only be used in TypeScript files.
tests/cases/conformance/jsdoc/declarations/index.js(61,18): error TS8006: 'interface' declarations can only be used in TypeScript files.
tests/cases/conformance/jsdoc/declarations/index.js(65,18): error TS8006: 'interface' declarations can only be used in TypeScript files.
tests/cases/conformance/jsdoc/declarations/index.js(67,18): error TS8006: 'interface' declarations can only be used in TypeScript files.
tests/cases/conformance/jsdoc/declarations/index.js(71,18): error TS8006: 'interface' declarations can only be used in TypeScript files.
tests/cases/conformance/jsdoc/declarations/index.js(75,18): error TS8006: 'interface' declarations can only be used in TypeScript files.
tests/cases/conformance/jsdoc/declarations/index.js(80,18): error TS8006: 'interface' declarations can only be used in TypeScript files.
tests/cases/conformance/jsdoc/declarations/index.js(84,18): error TS8006: 'interface' declarations can only be used in TypeScript files.
tests/cases/conformance/jsdoc/declarations/index.js(87,18): error TS8006: 'interface' declarations can only be used in TypeScript files.
tests/cases/conformance/jsdoc/declarations/index.js(91,18): error TS8006: 'interface' declarations can only be used in TypeScript files.
tests/cases/conformance/jsdoc/declarations/index.js(95,18): error TS8006: 'interface' declarations can only be used in TypeScript files.
tests/cases/conformance/jsdoc/declarations/index.js(100,18): error TS8006: 'interface' declarations can only be used in TypeScript files.
tests/cases/conformance/jsdoc/declarations/index.js(105,18): error TS8006: 'interface' declarations can only be used in TypeScript files.
tests/cases/conformance/jsdoc/declarations/index.js(107,18): error TS8006: 'interface' declarations can only be used in TypeScript files.
tests/cases/conformance/jsdoc/declarations/index.js(111,18): error TS8006: 'interface' declarations can only be used in TypeScript files.
tests/cases/conformance/jsdoc/declarations/index.js(115,18): error TS8006: 'interface' declarations can only be used in TypeScript files.
==== tests/cases/conformance/jsdoc/declarations/index.js (30 errors) ====
// Pretty much all of this should be an error, (since interfaces are forbidden in js),
// but we should be able to synthesize declarations from the symbols regardless
export interface A {}
~
!!! error TS8006: 'interface' declarations can only be used in TypeScript files.
export interface B {
~
!!! error TS8006: 'interface' declarations can only be used in TypeScript files.
cat: string;
}
export interface C<T, U> {
~
!!! error TS8006: 'interface' declarations can only be used in TypeScript files.
field: T & U;
optionalField?: T;
readonly readonlyField: T & U;
readonly readonlyOptionalField?: U;
(): number;
(x: T): U;
<Q>(x: Q): T & Q;
new (): string;
new (x: T): U;
new <Q>(x: Q): T & Q;
method<Q = number>(): number;
method<Q>(a: T & Q): Q & number;
method(a?: number): number;
method(...args: any[]): number;
optMethod?(): number;
}
interface G {}
~
!!! error TS8006: 'interface' declarations can only be used in TypeScript files.
export { G };
~
!!! error TS18043: Types cannot appear in export declarations in JavaScript files.
interface HH {}
~~
!!! error TS8006: 'interface' declarations can only be used in TypeScript files.
export { HH as H };
~~
!!! error TS18043: Types cannot appear in export declarations in JavaScript files.
export interface I {}
~
!!! error TS8006: 'interface' declarations can only be used in TypeScript files.
export { I as II };
~
!!! error TS18043: Types cannot appear in export declarations in JavaScript files.
export { J as JJ };
~
!!! error TS18043: Types cannot appear in export declarations in JavaScript files.
export interface J {}
~
!!! error TS8006: 'interface' declarations can only be used in TypeScript files.
export interface K extends I,J {
~
!!! error TS8006: 'interface' declarations can only be used in TypeScript files.
x: string;
}
export interface L extends K {
~
!!! error TS8006: 'interface' declarations can only be used in TypeScript files.
y: string;
}
export interface M<T> {
~
!!! error TS8006: 'interface' declarations can only be used in TypeScript files.
field: T;
}
export interface N<U> extends M<U> {
~
!!! error TS8006: 'interface' declarations can only be used in TypeScript files.
other: U;
}
export interface O {
~
!!! error TS8006: 'interface' declarations can only be used in TypeScript files.
[idx: string]: string;
}
export interface P extends O {}
~
!!! error TS8006: 'interface' declarations can only be used in TypeScript files.
export interface Q extends O {
~
!!! error TS8006: 'interface' declarations can only be used in TypeScript files.
[idx: string]: "ok";
}
export interface R extends O {
~
!!! error TS8006: 'interface' declarations can only be used in TypeScript files.
[idx: number]: "ok";
}
export interface S extends O {
~
!!! error TS8006: 'interface' declarations can only be used in TypeScript files.
[idx: string]: "ok";
[idx: number]: never;
}
export interface T {
~
!!! error TS8006: 'interface' declarations can only be used in TypeScript files.
[idx: number]: string;
}
export interface U extends T {}
~
!!! error TS8006: 'interface' declarations can only be used in TypeScript files.
export interface V extends T {
~
!!! error TS8006: 'interface' declarations can only be used in TypeScript files.
[idx: string]: string;
}
export interface W extends T {
~
!!! error TS8006: 'interface' declarations can only be used in TypeScript files.
[idx: number]: "ok";
}
export interface X extends T {
~
!!! error TS8006: 'interface' declarations can only be used in TypeScript files.
[idx: string]: string;
[idx: number]: "ok";
}
export interface Y {
~
!!! error TS8006: 'interface' declarations can only be used in TypeScript files.
[idx: string]: {x: number};
[idx: number]: {x: number, y: number};
}
export interface Z extends Y {}
~
!!! error TS8006: 'interface' declarations can only be used in TypeScript files.
export interface AA extends Y {
~~
!!! error TS8006: 'interface' declarations can only be used in TypeScript files.
[idx: string]: {x: number, y: number};
}
export interface BB extends Y {
~~
!!! error TS8006: 'interface' declarations can only be used in TypeScript files.
[idx: number]: {x: 0, y: 0};
}
export interface CC extends Y {
~~
!!! error TS8006: 'interface' declarations can only be used in TypeScript files.
[idx: string]: {x: number, y: number};
[idx: number]: {x: 0, y: 0};
}
|