Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ahejlsberg authored Sep 25, 2019
1 parent 05ce01b commit 805bb29
Show file tree
Hide file tree
Showing 17 changed files with 519 additions and 517 deletions.
16 changes: 8 additions & 8 deletions types/byte-range/byte-range-tests.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import byteRange = require('byte-range');

byteRange(1); // $ExpectType [number, number]
byteRange(1, { signed: false }); // $ExpectType [number, number]
byteRange.uint8; // $ExpectType [number, number]
byteRange.uint16; // $ExpectType [number, number]
byteRange.uint32; // $ExpectType [number, number]
byteRange.int8; // $ExpectType [number, number]
byteRange.int16; // $ExpectType [number, number]
byteRange.int32; // $ExpectType [number, number]
byteRange(1); // $ExpectType [number, number] || ByteRange
byteRange(1, { signed: false }); // $ExpectType [number, number] || ByteRange
byteRange.uint8; // $ExpectType [number, number] || ByteRange
byteRange.uint16; // $ExpectType [number, number] || ByteRange
byteRange.uint32; // $ExpectType [number, number] || ByteRange
byteRange.int8; // $ExpectType [number, number] || ByteRange
byteRange.int16; // $ExpectType [number, number] || ByteRange
byteRange.int32; // $ExpectType [number, number] || ByteRange
2 changes: 1 addition & 1 deletion types/frida-gum/frida-gum-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ result.errno;

Interceptor.attach(puts, {
onEnter(args) {
// $ExpectType NativePointer[]
// $ExpectType NativePointer[] || InvocationArguments
args;
},
onLeave(retval) {
Expand Down
2 changes: 1 addition & 1 deletion types/geojson/geojson-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const featureWithPolygon: Feature<Polygon> = {
featureWithPolygon.type; // $ExpectType "Feature"
featureWithPolygon.geometry; // $ExpectType Polygon
featureWithPolygon.geometry.type; // $ExpectType "Polygon"
featureWithPolygon.geometry.coordinates; // $ExpectType number[][][]
featureWithPolygon.geometry.coordinates; // $ExpectType number[][][] || Position[][]

const point: Point = {
type: "Point",
Expand Down
2 changes: 1 addition & 1 deletion types/hogan.js/hogan.js-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ compiled.render({ value: "test" });
// $ExpectType Token[]
const scanned = Hogan.scan("{{#if}}{{value}}{{/if}}");

// $ExpectType Leaf[]
// $ExpectType Leaf[] || Tree
Hogan.parse(scanned);
22 changes: 11 additions & 11 deletions types/idyll-ast/idyll-ast-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ const ast: AST = [
];
const prop: Property = ["className", ["value", "hello"]];

// $ExpectType Node[]
// $ExpectType Node[] || AST
appendNode(ast, "hello");

// $ExpectType Node[]
// $ExpectType Node[] || AST
appendNode(getNodesByName(ast, "div"), "test");

// $ExpectType Node[]
// $ExpectType Node[] || AST
appendNodes(ast, [["strong", [], ["div", ["pre", [], []]]], "test"]);

// $ExpectType Node[]
// $ExpectType Node[] || AST
prependNode(getNodesByName(ast, "div"), "test");

// $ExpectType Node[]
// $ExpectType Node[] || AST
prependNodes(ast, [["strong", [], ["div", ["pre", [], []]]], "test"]);

// $ExpectType TreeNode
Expand Down Expand Up @@ -71,22 +71,22 @@ getNodesByName(ast, "h1");
// $ExpectType Node
filterChildren(ast[1], n => n === "world");

// $ExpectType Node[]
// $ExpectType Node[] || AST
filterNodes(ast, n => (n instanceof Object ? n[0] === "h1" : false));

// $ExpectType Node[]
// $ExpectType Node[] || AST
modifyNodesByName(ast, "h2", n => {
typeof n === "object" ? (n[1] = []) : undefined;
});

// $ExpectType [PropType, PropData] | null
// $ExpectType [PropType, PropData] | null || PropValue | null
getProperty(ast[1], "someProp");
// $ExpectType [string, [PropType, PropData]]
// $ExpectType [string, [PropType, PropData]] || Property
getProperties(ast[1])[0];
// $ExpectType [string, [PropType, PropData]][]
// $ExpectType [string, [PropType, PropData]][] || Property[]
getPropertiesByType(["h1", [], []], "variable");

// $ExpectType Node[]
// $ExpectType Node[] || AST
removeNodesByName(ast, "h1");

// $ExpectType Node
Expand Down
6 changes: 3 additions & 3 deletions types/idyll-compiler/idyll-compiler-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import compile = require("idyll-compiler");
// Dummy log
const log = (msg: string) => {};

// $ExpectType Node[] | Promise<Node[]>
// $ExpectType Node[] | Promise<Node[]> || AST | Promise<AST>
compile("*italics*", { async: false }, () => log("window"));

// $ExpectType Node[] | Promise<Node[]>
// $ExpectType Node[] | Promise<Node[]> || AST | Promise<AST>
compile("Simple **idyll**", { async: false });

// $ExpectType Node[] | Promise<Node[]>
// $ExpectType Node[] | Promise<Node[]> || AST | Promise<AST>
compile(`# Test`);
Loading

0 comments on commit 805bb29

Please sign in to comment.