TypeScript/tests/baselines/reference/APISample_transform.types

45 lines
3.2 KiB
Plaintext
Raw Normal View History

2015-01-29 20:23:02 +01:00
=== tests/cases/compiler/APISample_transform.ts ===
/*
* Note: This test is a public API sample. The sample sources can be found
at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#a-simple-transform-function
* Please log a "breaking change" issue for any API breaking change affecting this issue
*/
declare var console: any;
2015-04-13 23:01:57 +02:00
>console : any, Symbol(console, Decl(APISample_transform.ts, 7, 11))
2015-01-29 20:23:02 +01:00
import * as ts from "typescript";
2015-04-13 23:01:57 +02:00
>ts : typeof ts, Symbol(ts, Decl(APISample_transform.ts, 9, 6))
2015-01-29 20:23:02 +01:00
const source = "let x: string = 'string'";
2015-04-13 23:01:57 +02:00
>source : string, Symbol(source, Decl(APISample_transform.ts, 11, 5))
2015-04-13 21:36:11 +02:00
>"let x: string = 'string'" : string
2015-01-29 20:23:02 +01:00
let result = ts.transpile(source, { module: ts.ModuleKind.CommonJS });
2015-04-13 23:01:57 +02:00
>result : string, Symbol(result, Decl(APISample_transform.ts, 13, 3))
>ts.transpile(source, { module: ts.ModuleKind.CommonJS }) : string
>ts.transpile : (input: string, compilerOptions?: ts.CompilerOptions, fileName?: string, diagnostics?: ts.Diagnostic[]) => string, Symbol(ts.transpile, Decl(typescript.d.ts, 1756, 5))
2015-04-13 23:01:57 +02:00
>ts : typeof ts, Symbol(ts, Decl(APISample_transform.ts, 9, 6))
>transpile : (input: string, compilerOptions?: ts.CompilerOptions, fileName?: string, diagnostics?: ts.Diagnostic[]) => string, Symbol(ts.transpile, Decl(typescript.d.ts, 1756, 5))
2015-04-13 23:01:57 +02:00
>source : string, Symbol(source, Decl(APISample_transform.ts, 11, 5))
>{ module: ts.ModuleKind.CommonJS } : { [x: string]: ts.ModuleKind; module: ts.ModuleKind; }
2015-04-13 23:01:57 +02:00
>module : ts.ModuleKind, Symbol(module, Decl(APISample_transform.ts, 13, 35))
>ts.ModuleKind.CommonJS : ts.ModuleKind, Symbol(ts.ModuleKind.CommonJS, Decl(typescript.d.ts, 1108, 17))
>ts.ModuleKind : typeof ts.ModuleKind, Symbol(ts.ModuleKind, Decl(typescript.d.ts, 1106, 5))
>ts : typeof ts, Symbol(ts, Decl(APISample_transform.ts, 9, 6))
>ModuleKind : typeof ts.ModuleKind, Symbol(ts.ModuleKind, Decl(typescript.d.ts, 1106, 5))
>CommonJS : ts.ModuleKind, Symbol(ts.ModuleKind.CommonJS, Decl(typescript.d.ts, 1108, 17))
2015-01-29 20:23:02 +01:00
console.log(JSON.stringify(result));
>console.log(JSON.stringify(result)) : any
>console.log : any
2015-04-13 23:01:57 +02:00
>console : any, Symbol(console, Decl(APISample_transform.ts, 7, 11))
2015-01-29 20:23:02 +01:00
>log : any
>JSON.stringify(result) : string
2015-04-13 23:01:57 +02:00
>JSON.stringify : { (value: any): string; (value: any, replacer: (key: string, value: any) => any): string; (value: any, replacer: any[]): string; (value: any, replacer: (key: string, value: any) => any, space: any): string; (value: any, replacer: any[], space: any): string; }, Symbol(JSON.stringify, Decl(lib.d.ts, 964, 70), Decl(lib.d.ts, 969, 34), Decl(lib.d.ts, 975, 78), Decl(lib.d.ts, 981, 51), Decl(lib.d.ts, 988, 90))
>JSON : JSON, Symbol(JSON, Decl(lib.d.ts, 955, 42), Decl(lib.d.ts, 1000, 11))
>stringify : { (value: any): string; (value: any, replacer: (key: string, value: any) => any): string; (value: any, replacer: any[]): string; (value: any, replacer: (key: string, value: any) => any, space: any): string; (value: any, replacer: any[], space: any): string; }, Symbol(JSON.stringify, Decl(lib.d.ts, 964, 70), Decl(lib.d.ts, 969, 34), Decl(lib.d.ts, 975, 78), Decl(lib.d.ts, 981, 51), Decl(lib.d.ts, 988, 90))
>result : string, Symbol(result, Decl(APISample_transform.ts, 13, 3))
2015-01-29 20:23:02 +01:00