mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
21 lines
485 B
TypeScript
21 lines
485 B
TypeScript
//// [tests/cases/compiler/genericFunctions2.ts] ////
|
|
|
|
//// [genericFunctions2.ts]
|
|
declare function map <T, U > (items: T[], f: (x: T) => U): U[];
|
|
|
|
var myItems: string[];
|
|
var lengths = map(myItems, x => x.length);
|
|
|
|
|
|
|
|
//// [genericFunctions2.js]
|
|
"use strict";
|
|
var myItems;
|
|
var lengths = map(myItems, x => x.length);
|
|
|
|
|
|
//// [genericFunctions2.d.ts]
|
|
declare function map<T, U>(items: T[], f: (x: T) => U): U[];
|
|
declare var myItems: string[];
|
|
declare var lengths: number[];
|