有没有办法在ES6 / Node4中创建接口? [英] Is there a way to create interfaces in ES6 / Node 4?

查看:101
本文介绍了有没有办法在ES6 / Node4中创建接口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ES6在Node4中完全可用。我想知道它是否包含界面定义方法的概念,如 MyClass实现MyInterface

ES6 is fully available in Node 4. I was wondering whether it includes a concept of interface to define method contracts as in MyClass implements MyInterface.

我的Google搜索找不到很多,但也许有一个很好的技巧或解决方法。

I can't find much with my Googling, but maybe there is a nice trick or workaround available.

推荐答案

接口不是ES6的一部分,但是类是。

Interfaces are not part of the ES6 but classes are.

如果你真的需要它们,你应该看看支持它们的TypeScript

If you really need them, you should look at TypeScript which support them.

这篇关于有没有办法在ES6 / Node4中创建接口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆