* Fix #10083 - allowSyntheticDefaultImports alters getExternalModuleMember (#10096) * Add a helper function `getOrUpdateProperty` to prevent unprotected access to Maps. * Limit type guards as assertions to incomplete types in loops * Accept new baselines * Fix linting error * [Release-2.0] Fix 9662: Visual Studio 2015 with TS2.0 gives incorrect @types path resolution errors (#9867) * Change the shape of the shim layer to support getAutomaticTypeDirectives * Change the key for looking up automatic type-directives * Update baselines from change look-up name of type-directives * Add @currentDirectory into the test * Update baselines * Fix linting error * Address PR: fix spelling mistake * Instead of return path of the type directive names just return type directive names * Remove unused reference files: these tests produce erros so they will not produce these files (#9233) * Don't allow properties inherited from Object to be automatically included in TSX attributes * Port PR #10016 to Master (#10100) * Treat namespaceExportDeclaration as declaration * Update baselines * wip - add tests * Add tests * Show "export namespace" for quick-info * Update baselines from merging
95 lines
3.3 KiB
Plaintext
95 lines
3.3 KiB
Plaintext
=== tests/cases/conformance/externalModules/a.ts ===
|
|
/// <reference path="node_modules/math2d/index.d.ts" />
|
|
/// <reference path="math2d-augment.d.ts" />
|
|
let v = new Math2d.Vector(3, 2);
|
|
>v : Symbol(v, Decl(a.ts, 2, 3))
|
|
>Math2d.Vector : Symbol(Math2d.Vector, Decl(index.d.ts, 6, 1))
|
|
>Math2d : Symbol(Math2d, Decl(index.d.ts, 0, 0))
|
|
>Vector : Symbol(Math2d.Vector, Decl(index.d.ts, 6, 1))
|
|
|
|
let magnitude = Math2d.getLength(v);
|
|
>magnitude : Symbol(magnitude, Decl(a.ts, 3, 3))
|
|
>Math2d.getLength : Symbol(Math2d.getLength, Decl(index.d.ts, 14, 1))
|
|
>Math2d : Symbol(Math2d, Decl(index.d.ts, 0, 0))
|
|
>getLength : Symbol(Math2d.getLength, Decl(index.d.ts, 14, 1))
|
|
>v : Symbol(v, Decl(a.ts, 2, 3))
|
|
|
|
let p: Math2d.Point = v.translate(5, 5);
|
|
>p : Symbol(p, Decl(a.ts, 4, 3))
|
|
>Math2d : Symbol(Math2d, Decl(index.d.ts, 0, 0))
|
|
>Point : Symbol(Math2d.Point, Decl(index.d.ts, 1, 27))
|
|
>v.translate : Symbol(Vector.translate, Decl(index.d.ts, 11, 35))
|
|
>v : Symbol(v, Decl(a.ts, 2, 3))
|
|
>translate : Symbol(Vector.translate, Decl(index.d.ts, 11, 35))
|
|
|
|
p = v.reverse();
|
|
>p : Symbol(p, Decl(a.ts, 4, 3))
|
|
>v.reverse : Symbol(Vector.reverse, Decl(math2d-augment.d.ts, 4, 19))
|
|
>v : Symbol(v, Decl(a.ts, 2, 3))
|
|
>reverse : Symbol(Vector.reverse, Decl(math2d-augment.d.ts, 4, 19))
|
|
|
|
var t = p.x;
|
|
>t : Symbol(t, Decl(a.ts, 6, 3))
|
|
>p.x : Symbol(Math2d.Point.x, Decl(index.d.ts, 3, 24))
|
|
>p : Symbol(p, Decl(a.ts, 4, 3))
|
|
>x : Symbol(Math2d.Point.x, Decl(index.d.ts, 3, 24))
|
|
|
|
=== tests/cases/conformance/externalModules/node_modules/math2d/index.d.ts ===
|
|
|
|
export as namespace Math2d;
|
|
>Math2d : Symbol(Math2d, Decl(index.d.ts, 0, 0))
|
|
|
|
export interface Point {
|
|
>Point : Symbol(Point, Decl(index.d.ts, 1, 27))
|
|
|
|
x: number;
|
|
>x : Symbol(Point.x, Decl(index.d.ts, 3, 24))
|
|
|
|
y: number;
|
|
>y : Symbol(Point.y, Decl(index.d.ts, 4, 11))
|
|
}
|
|
|
|
export class Vector implements Point {
|
|
>Vector : Symbol(Vector, Decl(index.d.ts, 6, 1), Decl(math2d-augment.d.ts, 2, 25))
|
|
>Point : Symbol(Point, Decl(index.d.ts, 1, 27))
|
|
|
|
x: number;
|
|
>x : Symbol(Vector.x, Decl(index.d.ts, 8, 38))
|
|
|
|
y: number;
|
|
>y : Symbol(Vector.y, Decl(index.d.ts, 9, 11))
|
|
|
|
constructor(x: number, y: number);
|
|
>x : Symbol(x, Decl(index.d.ts, 11, 13))
|
|
>y : Symbol(y, Decl(index.d.ts, 11, 23))
|
|
|
|
translate(dx: number, dy: number): Vector;
|
|
>translate : Symbol(Vector.translate, Decl(index.d.ts, 11, 35))
|
|
>dx : Symbol(dx, Decl(index.d.ts, 13, 11))
|
|
>dy : Symbol(dy, Decl(index.d.ts, 13, 22))
|
|
>Vector : Symbol(Vector, Decl(index.d.ts, 6, 1), Decl(math2d-augment.d.ts, 2, 25))
|
|
}
|
|
|
|
export function getLength(p: Vector): number;
|
|
>getLength : Symbol(getLength, Decl(index.d.ts, 14, 1))
|
|
>p : Symbol(p, Decl(index.d.ts, 16, 26))
|
|
>Vector : Symbol(Vector, Decl(index.d.ts, 6, 1), Decl(math2d-augment.d.ts, 2, 25))
|
|
|
|
=== tests/cases/conformance/externalModules/math2d-augment.d.ts ===
|
|
import * as Math2d from 'math2d';
|
|
>Math2d : Symbol(Math2d, Decl(math2d-augment.d.ts, 0, 6))
|
|
|
|
// Augment the module
|
|
declare module 'math2d' {
|
|
// Add a method to the class
|
|
interface Vector {
|
|
>Vector : Symbol(Vector, Decl(index.d.ts, 6, 1), Decl(math2d-augment.d.ts, 2, 25))
|
|
|
|
reverse(): Math2d.Point;
|
|
>reverse : Symbol(Vector.reverse, Decl(math2d-augment.d.ts, 4, 19))
|
|
>Math2d : Symbol(Math2d, Decl(math2d-augment.d.ts, 0, 6))
|
|
>Point : Symbol(Point, Decl(index.d.ts, 1, 27))
|
|
}
|
|
}
|
|
|