57 lines
1.8 KiB
Text
57 lines
1.8 KiB
Text
=== tests/cases/compiler/optionalAccessorsInInterface1.ts ===
|
|
interface MyPropertyDescriptor {
|
|
>MyPropertyDescriptor : MyPropertyDescriptor
|
|
|
|
get? (): any;
|
|
>get : () => any
|
|
|
|
set? (v: any): void;
|
|
>set : (v: any) => void
|
|
>v : any
|
|
}
|
|
|
|
declare function defineMyProperty(o: any, p: string, attributes: MyPropertyDescriptor): any;
|
|
>defineMyProperty : (o: any, p: string, attributes: MyPropertyDescriptor) => any
|
|
>o : any
|
|
>p : string
|
|
>attributes : MyPropertyDescriptor
|
|
>MyPropertyDescriptor : MyPropertyDescriptor
|
|
|
|
defineMyProperty({}, "name", { get: function () { return 5; } });
|
|
>defineMyProperty({}, "name", { get: function () { return 5; } }) : any
|
|
>defineMyProperty : (o: any, p: string, attributes: MyPropertyDescriptor) => any
|
|
>{} : {}
|
|
>"name" : string
|
|
>{ get: function () { return 5; } } : { get: () => number; }
|
|
>get : () => number
|
|
>function () { return 5; } : () => number
|
|
>5 : number
|
|
|
|
interface MyPropertyDescriptor2 {
|
|
>MyPropertyDescriptor2 : MyPropertyDescriptor2
|
|
|
|
get?: () => any;
|
|
>get : () => any
|
|
|
|
set?: (v: any) => void;
|
|
>set : (v: any) => void
|
|
>v : any
|
|
}
|
|
|
|
declare function defineMyProperty2(o: any, p: string, attributes: MyPropertyDescriptor2): any;
|
|
>defineMyProperty2 : (o: any, p: string, attributes: MyPropertyDescriptor2) => any
|
|
>o : any
|
|
>p : string
|
|
>attributes : MyPropertyDescriptor2
|
|
>MyPropertyDescriptor2 : MyPropertyDescriptor2
|
|
|
|
defineMyProperty2({}, "name", { get: function () { return 5; } });
|
|
>defineMyProperty2({}, "name", { get: function () { return 5; } }) : any
|
|
>defineMyProperty2 : (o: any, p: string, attributes: MyPropertyDescriptor2) => any
|
|
>{} : {}
|
|
>"name" : string
|
|
>{ get: function () { return 5; } } : { get: () => number; }
|
|
>get : () => number
|
|
>function () { return 5; } : () => number
|
|
>5 : number
|
|
|