0

Here's a function I need to use in typescript code:

ol.inherits(child, parent);

How to add a definition for that function in OpenLayers.d.ts file?

https://github.com/borisyankov/DefinitelyTyped/blob/master/openlayers/openlayers.d.ts

Thank you in advance for any help!

1

1 Answer 1

2

Untested sample but a likely candidate:

declare module OpenLayers {
    export function inherits(child:any,base:any);
}

A Pull Request + test would be welcome if you manage to use this function.

PS:

I recommend using the extends keyword and not bothering with the inherits function as it will give you better type safety. For example

class FooLayer extends OpenLayers.Layer{
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.