我是打字稿的新手(实际上也是Javascript),我需要将下面两行javascript语法转换为打字稿
const gcs = require('@google-cloud/storage')();
const spawn = require('child-process-promise').spawn
我试图这样写,但是不起作用:
import * as gcs() from '@google-cloud/storage'
import * as spawn.spawn from 'child-process-promise'
答案 0 :(得分:2)
您无法在es6中做到这一点。您必须写:
import * as gcs from '@google-cloud/storage'
const something = gcs();