Currently, I am utilizing the Leaflet Library (http://leafletjs.com) within a TypeScript project.
Within this project, I am showcasing markers on a map which are configured using options detailed here: http://leafletjs.com/reference-1.3.0.html#marker-l-marker
In an attempt to enhance this functionality, I am integrating this library into my project: https://github.com/bbecquet/Leaflet.RotatedMarker
However, when attempting to add additional options to the second argument of Marker, I am encountering TypeScript errors:
ERROR in src/app/app.component.ts(61,7): error TS2345: Argument of type '{ rotationAngle: number; }' is not assignable to parameter of type 'MarkerOptions'.
Object literal may only specify known properties, and 'rotationAngle' does not exist in type 'MarkerOptions'
To address this issue, I am in the process of creating a typings script or file to allow for this customization.
/// <reference types="leaflet" />
declare module L {
export interface MarkerOptions {
rotationAngle: number;
rotationOrigin: string;
}
}
Perhaps something akin to this example: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/leaflet/index.d.ts#L1470
What steps am I overlooking to successfully implement this solution?
How can I generate custom typings for JavaScript code or third-party libraries that do not include typings by default?
For a more concise representation, you can refer to the Minimum Complete Verifiable Example provided here: https://github.com/badis/typescript-stackoverflow-question