Skip to content

stellar/dts-xdr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

dts-xdr

Stellar

dts-xdr is a library for generating TypeScript declarations file (.d.ts) for js-xdr auto-generated files.

This library uses jscodeshift to generate the definitions, follow the steps below to generate definitions.

Setup

git clone https://github.com/stellar/dts-xdr.git
cd dts-xdr
yarn install

Usage

You can use this library in two mode:

Source replacement

The first one is using inline replacement which is the default mode when you call jscodeshift. The following will replace the given file with the generated code:

npx jscodeshift -t src/transform.js sample/stellar-xdr_generated.js

After you run the command above, sample/stellar-xdr_generated.js will have the type definitions.

Output mode

The second mode is specifying an output file, this mode won't change the source file. The following command will generate a new file called stellar-xdr_generated.d.ts with the TypeScript declarations:

OUT=stellar-xdr_generated.d.ts npx jscodeshift -t src/transform.js sample/stellar-xdr_generated.js

About

A library for generating TypeScript declarations (.d.ts) for js-xdr auto-generated files.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published