我刚开始使用Flow类型和Nodejs。
我已经安装了类型定义,但是当我进行流检查时,它会抱怨Socket类:
Property Socket is missing in module net [1].
src/modules/DemoClass.js
1│ // @flow
2│ const { Socket } = require('net');
3│
4│ class DemoClass {
5│ getThing(x: string) {
/private/tmp/flow/flowlib_3fd2f1c3/node.js
[1] 1266│ declare module "net" {
1267│
1268│ declare class Server extends net$Server {}
1269│ declare class Socket extends net$Socket {}
从定义的顶部可以看到,已经定义了Socket。
我应该以其他方式要求Socket来使Flow开心吗?