what is the syntax to import function and object property in typescript?

Viewed 948

I am new in typescript (in Javascript also actually), I need to convert two lines of javascript syntax below into typescript

   const gcs = require('@google-cloud/storage')();
    const spawn = require('child-process-promise').spawn

I have tried to write like this, but it doesn't work:

import * as gcs() from '@google-cloud/storage'
import * as spawn.spawn from 'child-process-promise'
1 Answers

You can't do that in es6. You have to write:

import * as gcs from '@google-cloud/storage'
const something = gcs();
Related