I recently came across TypeScript, but am struggling a bit with the documentation. This seems to be quite a bit of a cold approach to things. Case and point.
Defining definitions for the JS library.
First of all, if you get the js file from NuGet, some of these nuget packages should be a d.ts file.
Secondly, I could not find any specific documentation on how to create the definition file.
I want to include the MarkerWithLabel library, which is an extension of the goi.maps api library.
Does anyone have a .d.ts file that they want to provide, or where I can get documentation on how to create / generate a file from the JS library.
edit: The library I'm looking for for this file is d.ts, MarkerWithLabel .
Here is the .d.ts file that I started creating based on the doc specification, but this does not seem to work at all.
/// <reference path="google.maps.d.ts"/> declare class MarkerWithLabelOptions { crossImage: string; handCursor: string; labelAnchor: google.maps.Point; labelClass: string; labelContent: any; labelInBackground: boolean; labelStyle: any; labelVisible: boolean; optimized: boolean; raiseOnDrag: boolean; } declare class MarkerWithLabel extends google.maps.Marker{ constructor(opt?: MarkerWithLabelOptions); }
The implementation is as follows:
var _mwlo =new MarkerWithLabelOptions({ position: this.CenterPoint.toLatLng() , draggable: true , map: this._map , labelAnchor: new google.maps.Point(22, 0) , labelStyle: {opacity: 1.0} }); var _mwl = new MarkerWithLabel(_mwlo);
I get an error message stating that it cannot find a method that matches the given parameters.