raml-org / raml-js-parser-2

(deprecated)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`typings-new-format` are not being exported by index.d.ts

wes-goulet opened this issue · comments

commented

The type returned by loadSync is defined in raml-1-parser/dist/typings-new-format/raml.d.ts. So when I use loadSync I have the following import at the top of my file:

import { Api10 } from 'raml-1-parser/dist/typings-new-format/spec-1.0/api';

I would much rather just import directly from raml-1-parser... but this does not work:

import { Api10 } from 'raml-1-parser';

Please update index.d.ts to export the typings-new-format so I don't have to reach into the package to get those types.

commented

Digging into index.ts I found this line:

export import jsonTypings = require("./typings-new-format/raml");

So the types I need are there, just under that jsonTypings export, I've changed my code to this:

import { jsonTypings } from 'raml-1-parser';

const foo: jsonTypings.api10.Api10 = ...

Which works fine, closing this issue.