2627e6f3fc
* 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
106 lines
3.4 KiB
Plaintext
106 lines
3.4 KiB
Plaintext
=== tests/cases/conformance/externalModules/b.ts ===
|
|
/// <reference path="math2d-augment.d.ts" />
|
|
import * as m from 'math2d';
|
|
>m : Symbol(m, Decl(b.ts, 1, 6))
|
|
|
|
let v = new m.Vector(3, 2);
|
|
>v : Symbol(v, Decl(b.ts, 2, 3))
|
|
>m.Vector : Symbol(m.Vector, Decl(index.d.ts, 9, 2), Decl(math2d-augment.d.ts, 2, 25))
|
|
>m : Symbol(m, Decl(b.ts, 1, 6))
|
|
>Vector : Symbol(m.Vector, Decl(index.d.ts, 9, 2), Decl(math2d-augment.d.ts, 2, 25))
|
|
|
|
let magnitude = m.getLength(v);
|
|
>magnitude : Symbol(magnitude, Decl(b.ts, 3, 3))
|
|
>m.getLength : Symbol(m.getLength, Decl(index.d.ts, 17, 2))
|
|
>m : Symbol(m, Decl(b.ts, 1, 6))
|
|
>getLength : Symbol(m.getLength, Decl(index.d.ts, 17, 2))
|
|
>v : Symbol(v, Decl(b.ts, 2, 3))
|
|
|
|
let p: m.Point = v.translate(5, 5);
|
|
>p : Symbol(p, Decl(b.ts, 4, 3))
|
|
>m : Symbol(m, Decl(b.ts, 1, 6))
|
|
>Point : Symbol(m.Point, Decl(index.d.ts, 5, 23))
|
|
>v.translate : Symbol(m.Vector.translate, Decl(index.d.ts, 14, 36))
|
|
>v : Symbol(v, Decl(b.ts, 2, 3))
|
|
>translate : Symbol(m.Vector.translate, Decl(index.d.ts, 14, 36))
|
|
|
|
p = v.reverse();
|
|
>p : Symbol(p, Decl(b.ts, 4, 3))
|
|
>v.reverse : Symbol(m.Vector.reverse, Decl(math2d-augment.d.ts, 4, 19))
|
|
>v : Symbol(v, Decl(b.ts, 2, 3))
|
|
>reverse : Symbol(m.Vector.reverse, Decl(math2d-augment.d.ts, 4, 19))
|
|
|
|
var t = p.x;
|
|
>t : Symbol(t, Decl(b.ts, 6, 3))
|
|
>p.x : Symbol(m.Point.x, Decl(index.d.ts, 6, 18))
|
|
>p : Symbol(p, Decl(b.ts, 4, 3))
|
|
>x : Symbol(m.Point.x, Decl(index.d.ts, 6, 18))
|
|
|
|
=== tests/cases/conformance/externalModules/node_modules/math2d/index.d.ts ===
|
|
|
|
export as namespace Math2d;
|
|
>Math2d : Symbol(Math2d, Decl(index.d.ts, 0, 0))
|
|
|
|
export = M2D;
|
|
>M2D : Symbol(M2D, Decl(index.d.ts, 3, 13))
|
|
|
|
declare namespace M2D {
|
|
>M2D : Symbol(Math2d, Decl(index.d.ts, 3, 13), Decl(math2d-augment.d.ts, 0, 33))
|
|
|
|
interface Point {
|
|
>Point : Symbol(Point, Decl(index.d.ts, 5, 23))
|
|
|
|
x: number;
|
|
>x : Symbol(Point.x, Decl(index.d.ts, 6, 18))
|
|
|
|
y: number;
|
|
>y : Symbol(Point.y, Decl(index.d.ts, 7, 12))
|
|
}
|
|
|
|
class Vector implements Point {
|
|
>Vector : Symbol(Vector, Decl(index.d.ts, 9, 2), Decl(math2d-augment.d.ts, 2, 25))
|
|
>Point : Symbol(Point, Decl(index.d.ts, 5, 23))
|
|
|
|
x: number;
|
|
>x : Symbol(Vector.x, Decl(index.d.ts, 11, 32))
|
|
|
|
y: number;
|
|
>y : Symbol(Vector.y, Decl(index.d.ts, 12, 12))
|
|
|
|
constructor(x: number, y: number);
|
|
>x : Symbol(x, Decl(index.d.ts, 14, 14))
|
|
>y : Symbol(y, Decl(index.d.ts, 14, 24))
|
|
|
|
translate(dx: number, dy: number): Vector;
|
|
>translate : Symbol(Vector.translate, Decl(index.d.ts, 14, 36))
|
|
>dx : Symbol(dx, Decl(index.d.ts, 16, 12))
|
|
>dy : Symbol(dy, Decl(index.d.ts, 16, 23))
|
|
>Vector : Symbol(Vector, Decl(index.d.ts, 9, 2), Decl(math2d-augment.d.ts, 2, 25))
|
|
}
|
|
|
|
function getLength(p: Vector): number;
|
|
>getLength : Symbol(getLength, Decl(index.d.ts, 17, 2))
|
|
>p : Symbol(p, Decl(index.d.ts, 19, 20))
|
|
>Vector : Symbol(Vector, Decl(index.d.ts, 9, 2), 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, 9, 2), 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, 5, 23))
|
|
}
|
|
}
|
|
|