1

I am using a library that is "smartly" exporting a namespace Math from their library

import { Tool, Math } from 'library';

The problem is, when I use the library's Math, I am also using some native Math function from the browser.

Is there a way to specify which namespace to use ?

Math.customLib()
Math.nativeMath()

how to tell ts which one to use ?

1 Answer 1

2

Use the as syntax to create the import item name.

import { Tool, Math as MathFromLibrary } from 'library';
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.