How to define the type of a custom leaflet control : <p>When looking through the type definitions from <code>@types/leaflet</code> you can see custom controls defined similar to:</p>

<pre><code>export namespace Control {
    ...
    class Zoom extends Control {
        constructor(options?: ZoomOptions);
        options: ZoomOptions;
    }
    ...
}
</code></pre>

<p>However, when creating your custom control through:</p>

<pre><code>declare module 'leaflet' {
    namespace Control {
        class CustomControl extends Control {
            constructor(options: CustomOptions);
        }
    }
    namespace control {
        function customControl(options: CustomOptions): Control.CustomControl;
    }
}

L.Control.CustomControl = L.Control.extend({
    ...
});
</code></pre>

<p>throws a typescript error:
<code>
Type '(new (...args: any[]) =&gt; any) &amp; typeof Class' is missing the following properties from type 'typeof CustomControl': Zoom, Attribution, Layers, Scale, and 6 more.
</code></p>

<p>This seems to happen because the namespace and class <code>Control</code> go through Typescript's Declaration Merging. This causes <code>CustomControl</code> to require properties from the namespace rather than just the class.</p>

<p>Is there a way to fix this or circumvent it without forcing type <code>any</code>?</p>
