mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Make ExpectError locations same for TS 3.8 Error locations changed for some object literals in TS 3.8. This breaks tests that use ExpectError since the ExpectError needs to be closer to the actual error. To fix this, I merged a lot of multi-line object literals into one-line literals. * remove stray edit
31 lines
590 B
TypeScript
31 lines
590 B
TypeScript
declare const map: AMap.Map;
|
|
|
|
// $ExpectType MapType
|
|
new AMap.MapType();
|
|
// $ExpectType MapType
|
|
new AMap.MapType({});
|
|
// $ExpectType MapType
|
|
const mapType = new AMap.MapType({
|
|
defaultType: 1,
|
|
showTraffic: true,
|
|
showRoad: true
|
|
});
|
|
|
|
// $ExpectError
|
|
new AMap.MapType({ defaultType: 2 });
|
|
|
|
// $ExpectType void
|
|
mapType.show();
|
|
|
|
// $ExpectType void
|
|
mapType.hide();
|
|
|
|
mapType.on('show', (event: AMap.MapType.EventMap['show']) => {
|
|
// $ExpectType "show"
|
|
event.type;
|
|
});
|
|
mapType.on('hide', (event: AMap.MapType.EventMap['hide']) => {
|
|
// $ExpectType "hide"
|
|
event.type;
|
|
});
|