Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libp2p interface bug #97

Open
sonygod opened this issue Aug 18, 2021 · 0 comments
Open

libp2p interface bug #97

sonygod opened this issue Aug 18, 2021 · 0 comments

Comments

@sonygod
Copy link

sonygod commented Aug 18, 2021

I use dts2hx for libp2p

node_modules\libp2p-interfaces\dist\src\transport\types.d.ts

export interface TransportFactory<DialOptions extends { signal?: AbortSignal }, ListenerOptions> {
  new(upgrader: Upgrader): Transport<DialOptions, ListenerOptions>;
}

will gen wrong code here

package libp2p.dist.src.transport_manager;

typedef TransportFactory = libp2p_interfaces.dist.src.transport.types.TransportFactory<Dynamic, Dynamic>;

npx dts2hx libp2p --tsconfig ./tsconfig.json --verbose

here is tsconfig.json

{
    "extends": "./node_modules/aegir/src/config/tsconfig.aegir.json",
    "compilerOptions": {
      "outDir": "dist",
      "lib": [
        "esnext.asynciterable",
        "ES2019",
        "es2018",
        "ES2019.Array",
        "ES2019.Object",
        "ES2019.String",
        "ES2019.Symbol",
        "ES2020"
      ],
      "types": ["node"]
    },
    "include": [
      "src"
    ],
    "exclude": [
      "src/circuit/protocol/index.js", // exclude generated file
      "src/identify/message.js", // exclude generated file
      "src/insecure/proto.js", // exclude generated file
      "src/peer-store/persistent/pb/address-book.js", // exclude generated file
      "src/peer-store/persistent/pb/proto-book.js", // exclude generated file
      "src/record/peer-record/peer-record.js", // exclude generated file
      "src/record/envelope/envelope.js" // exclude generated file
    ]
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant