Crocsx
Crocsx

Reputation: 7640

how to use a specific namespace, or global namespace in typescript

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 ?

Upvotes: 1

Views: 48

Answers (1)

tcf01
tcf01

Reputation: 1789

Use the as syntax to create the import item name.

import { Tool, Math as MathFromLibrary } from 'library';

Upvotes: 2

Related Questions