TypeScript/tests/baselines/reference/optionalAccessorsInInterface1.types

58 lines
3.2 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/optionalAccessorsInInterface1.ts ===
interface MyPropertyDescriptor {
2015-04-13 23:01:57 +02:00
>MyPropertyDescriptor : MyPropertyDescriptor, Symbol(MyPropertyDescriptor, Decl(optionalAccessorsInInterface1.ts, 0, 0))
2014-08-15 23:33:16 +02:00
get? (): any;
2015-04-13 23:01:57 +02:00
>get : () => any, Symbol(get, Decl(optionalAccessorsInInterface1.ts, 0, 32))
2014-08-15 23:33:16 +02:00
set? (v: any): void;
2015-04-13 23:01:57 +02:00
>set : (v: any) => void, Symbol(set, Decl(optionalAccessorsInInterface1.ts, 1, 17))
>v : any, Symbol(v, Decl(optionalAccessorsInInterface1.ts, 2, 10))
2014-08-15 23:33:16 +02:00
}
declare function defineMyProperty(o: any, p: string, attributes: MyPropertyDescriptor): any;
2015-04-13 23:01:57 +02:00
>defineMyProperty : (o: any, p: string, attributes: MyPropertyDescriptor) => any, Symbol(defineMyProperty, Decl(optionalAccessorsInInterface1.ts, 3, 1))
>o : any, Symbol(o, Decl(optionalAccessorsInInterface1.ts, 5, 34))
>p : string, Symbol(p, Decl(optionalAccessorsInInterface1.ts, 5, 41))
>attributes : MyPropertyDescriptor, Symbol(attributes, Decl(optionalAccessorsInInterface1.ts, 5, 52))
>MyPropertyDescriptor : MyPropertyDescriptor, Symbol(MyPropertyDescriptor, Decl(optionalAccessorsInInterface1.ts, 0, 0))
2014-08-15 23:33:16 +02:00
defineMyProperty({}, "name", { get: function () { return 5; } });
>defineMyProperty({}, "name", { get: function () { return 5; } }) : any
2015-04-13 23:01:57 +02:00
>defineMyProperty : (o: any, p: string, attributes: MyPropertyDescriptor) => any, Symbol(defineMyProperty, Decl(optionalAccessorsInInterface1.ts, 3, 1))
2014-08-15 23:33:16 +02:00
>{} : {}
2015-04-13 21:36:11 +02:00
>"name" : string
2015-01-24 17:04:23 +01:00
>{ get: function () { return 5; } } : { get: () => number; }
2015-04-13 23:01:57 +02:00
>get : () => number, Symbol(get, Decl(optionalAccessorsInInterface1.ts, 6, 30))
2014-08-15 23:33:16 +02:00
>function () { return 5; } : () => number
2015-04-13 21:36:11 +02:00
>5 : number
2014-08-15 23:33:16 +02:00
interface MyPropertyDescriptor2 {
2015-04-13 23:01:57 +02:00
>MyPropertyDescriptor2 : MyPropertyDescriptor2, Symbol(MyPropertyDescriptor2, Decl(optionalAccessorsInInterface1.ts, 6, 65))
2014-08-15 23:33:16 +02:00
get?: () => any;
2015-04-13 23:01:57 +02:00
>get : () => any, Symbol(get, Decl(optionalAccessorsInInterface1.ts, 8, 33))
2014-08-15 23:33:16 +02:00
set?: (v: any) => void;
2015-04-13 23:01:57 +02:00
>set : (v: any) => void, Symbol(set, Decl(optionalAccessorsInInterface1.ts, 9, 20))
>v : any, Symbol(v, Decl(optionalAccessorsInInterface1.ts, 10, 11))
2014-08-15 23:33:16 +02:00
}
declare function defineMyProperty2(o: any, p: string, attributes: MyPropertyDescriptor2): any;
2015-04-13 23:01:57 +02:00
>defineMyProperty2 : (o: any, p: string, attributes: MyPropertyDescriptor2) => any, Symbol(defineMyProperty2, Decl(optionalAccessorsInInterface1.ts, 11, 1))
>o : any, Symbol(o, Decl(optionalAccessorsInInterface1.ts, 13, 35))
>p : string, Symbol(p, Decl(optionalAccessorsInInterface1.ts, 13, 42))
>attributes : MyPropertyDescriptor2, Symbol(attributes, Decl(optionalAccessorsInInterface1.ts, 13, 53))
>MyPropertyDescriptor2 : MyPropertyDescriptor2, Symbol(MyPropertyDescriptor2, Decl(optionalAccessorsInInterface1.ts, 6, 65))
2014-08-15 23:33:16 +02:00
defineMyProperty2({}, "name", { get: function () { return 5; } });
>defineMyProperty2({}, "name", { get: function () { return 5; } }) : any
2015-04-13 23:01:57 +02:00
>defineMyProperty2 : (o: any, p: string, attributes: MyPropertyDescriptor2) => any, Symbol(defineMyProperty2, Decl(optionalAccessorsInInterface1.ts, 11, 1))
2014-08-15 23:33:16 +02:00
>{} : {}
2015-04-13 21:36:11 +02:00
>"name" : string
2015-01-24 17:04:23 +01:00
>{ get: function () { return 5; } } : { get: () => number; }
2015-04-13 23:01:57 +02:00
>get : () => number, Symbol(get, Decl(optionalAccessorsInInterface1.ts, 14, 31))
2014-08-15 23:33:16 +02:00
>function () { return 5; } : () => number
2015-04-13 21:36:11 +02:00
>5 : number
2014-08-15 23:33:16 +02:00