Closed nlapshin closed 1 year ago
@nlapshin Could you provide a bit more background on the exact steps you take to reproduce this error along with at what point exactly does this error occur at? If you have any images you could provide seeing it visually might help as well.
Sorry for late answer.
For example, i installed docusign-esign and @types/docusign-esign package and tried to do something like code below:
import { EnvelopeDefinition } from 'docusign-esign';
const env = EnvelopeDefinition();
And I see error
'EnvelopeDefinition' only refers to a type, but is being used as a value here.ts
Because in @types/docusign-esign EnvelopeDefinition is inteface(not class)
@nlapshin It might be worthwhile to start by using the quick start guide to see working examples and building from the quick start.
The Quick start guide is found here: https://developers.docusign.com/docs/esign-rest-api/quickstart/overview/ We also have a tool you can use where you select a language and use a drag and drop approach to building out sample code here: https://apirequestbuilder.docusign.com/
Both give working examples of creating envelopes via the API that should avoid the types of errors you are running into.
@kollDocuSign Thanks for your answer. Unfortunately, there is no example typescript in the examples. I don't have problem usign pure Node.js, I have problems when I use Typescript(and declaration file from @types/docusign-esign).
I found similar problem in stackoverflow https://stackoverflow.com/questions/69429795/unable-to-find-docusign-models-in-typescript-code
@kollDocuSign Also, I created simple repo where you can see problems with import some parts of docusign library(Document for example).
https://github.com/nlapshin/docusign-typescript-example/blob/main/src/index.ts
@nlapshin After some internal outreach the input back was that the SDK doesn't define any types so typescript won’t be supported. A workaround might be to follow this article: https://medium.com/@steveruiz/using-a-javascript-library-without-type-declarations-in-a-typescript-project-3643490015f3
I try to implement integration using typescript.
I installed "docusign-esign": "5.18.0" and "@types/docusign-esign": "5.6.2". I tried to use some feature and I was seeing some errors in import. For example,
Property 'EnvelopeDefinition' does not exist on type 'typeof import("/home/nik/projects/my-project/node_modules/@types/docusign-esign/index")
Maybe, I do something in wrong way.