'what is the difference about import import {} import * as in typescript [duplicate]

when I write code using typescript, sometimes import module using type 1:

import foo from bar;

sometimes import using type 2:

import {foo} from bar;

sometimes import using type 3:

import * as foo from bar;

what is the difference? when should using type 1,2,3?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source