Skip to content

Commit 8eede38

Browse files
broadwaylambSpace Team
authored andcommitted
[JS] Export top-level properties to TypeScript via Analysis API
^KT-82263 Fixed
1 parent c70e554 commit 8eede38

File tree

29 files changed

+210
-186
lines changed

29 files changed

+210
-186
lines changed

js/js.translator/testData/typescript-export/js/deprecated-in-exported-file/deprecated.aa.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ declare namespace JS_TESTS {
33
function KtSingleton<T>(): T & (abstract new() => any);
44

55
namespace foo {
6-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
6+
const bar: string;
77
function foo(): void;
88
/* ErrorDeclaration: Class declarations are not implemented yet */
99
/* ErrorDeclaration: Class declarations are not implemented yet */

js/js.translator/testData/typescript-export/js/deprecated/deprecated.aa.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ declare namespace JS_TESTS {
33
function KtSingleton<T>(): T & (abstract new() => any);
44

55
namespace foo {
6-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
6+
const bar: string;
77
function foo(): void;
88
/* ErrorDeclaration: Class declarations are not implemented yet */
99
/* ErrorDeclaration: Class declarations are not implemented yet */

js/js.translator/testData/typescript-export/js/escaped-declarations-in-exported-file/escaped-declarations.aa.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ declare namespace JS_TESTS {
33
function KtSingleton<T>(): T & (abstract new() => any);
44

55
namespace foo {
6-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
7-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
6+
7+
88

99
function invalid_args_name_sum(first_value: number, second_value: number): number;
1010
/* ErrorDeclaration: Class declarations are not implemented yet */

js/js.translator/testData/typescript-export/js/escaped-declarations/escaped-declarations.aa.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ declare namespace JS_TESTS {
33
function KtSingleton<T>(): T & (abstract new() => any);
44

55
namespace foo {
6-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
7-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
6+
7+
88

99
function invalid_args_name_sum(first_value: number, second_value: number): number;
1010
/* ErrorDeclaration: Class declarations are not implemented yet */

js/js.translator/testData/typescript-export/js/excluded-exported-declarations-in-exported-file/excluded-exported-declarations.aa.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ declare namespace JS_TESTS {
77
}
88

99
namespace foo {
10-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
10+
const foo: string;
1111
function bar(): string;
1212
}
1313
}

js/js.translator/testData/typescript-export/js/excluded-exported-declarations/excluded-exported-declarations.aa.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ declare namespace JS_TESTS {
77
}
88

99
namespace foo {
10-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
10+
const foo: string;
1111
function bar(): string;
1212
}
1313
}

js/js.translator/testData/typescript-export/js/implicit-export/implicit-export.aa.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ declare namespace JS_TESTS {
77
}
88

99
namespace foo {
10-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
11-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
10+
const console: Console;
11+
const error: CompileError;
1212
function producer(value: number): any/* foo.NonExportedType */;
1313
function consumer(value: any/* foo.NonExportedType */): number;
1414
function baz(a: number): Promise<number>;

js/js.translator/testData/typescript-export/js/inheritance/inheritance.aa.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ declare namespace JS_TESTS {
33
function KtSingleton<T>(): T & (abstract new() => any);
44

55
namespace foo {
6-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
6+
const fifth: any/* foo.Fifth<boolean> */;
77
function getI3(): foo.I3;
88
function getA(): foo.I3;
99
function getB(): foo.I3;

js/js.translator/testData/typescript-export/js/long-type-in-exported-file/long-type.aa.d.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ declare namespace JS_TESTS {
77
}
88

99
namespace foo {
10-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
11-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
12-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
13-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
14-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
15-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
16-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
17-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
18-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
19-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
10+
const _long: bigint;
11+
const _ulong: bigint;
12+
const _long_array: BigInt64Array;
13+
const _ulong_array: Array<bigint>;
14+
const _array_long: BigInt64Array;
15+
const _array_ulong: Array<bigint>;
16+
let myVar: bigint;
17+
const _n_long: Nullable<bigint>;
18+
const funInterfaceInheritor1: foo.funInterface;
19+
const funInterfaceInheritor2: foo.funInterface;
2020
function funWithLongParameters(a: bigint, b: bigint): bigint;
2121
function funWithLongDefaultParameters(a?: bigint, b?: bigint): bigint;
2222
function varargLong(x: BigInt64Array): number;

js/js.translator/testData/typescript-export/js/long-type/long-type.aa.d.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ declare namespace JS_TESTS {
77
}
88

99
namespace foo {
10-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
11-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
12-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
13-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
14-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
15-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
16-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
17-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
18-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
19-
/* ErrorDeclaration: Top level property declarations are not implemented yet */
10+
const _long: bigint;
11+
const _ulong: bigint;
12+
const _long_array: BigInt64Array;
13+
const _ulong_array: Array<bigint>;
14+
const _array_long: BigInt64Array;
15+
const _array_ulong: Array<bigint>;
16+
let myVar: bigint;
17+
const _n_long: Nullable<bigint>;
18+
const funInterfaceInheritor1: foo.funInterface;
19+
const funInterfaceInheritor2: foo.funInterface;
2020
function funWithLongParameters(a: bigint, b: bigint): bigint;
2121
function funWithLongDefaultParameters(a?: bigint, b?: bigint): bigint;
2222
function varargLong(x: BigInt64Array): number;

0 commit comments

Comments
 (0)