GoodNotes / ts-interface-generator

Export JSII Compatible Interface from public NPM packages
Apache License 2.0
1 stars 0 forks source link
cdk jsii projen-managed ts-morph

TS Interface Generator

Export JSII Compatible Interface from external packages

This repository is an exploration of generating JSII Compatible Interfaces for public packages on NPM.

It has only been tested with the DataDog Typescript API Client package and is not intended for production use.

Usage

# install pj dependencies
yarn
# run the export-datadog-interfaces task
npx projen@latest export-datadog-interfaces
# confirm JSII compile works
npx projen@latest compile

How it works

The export-datadog-interfaces task uses the ts-morph package to parse the DataDog Typescript API Client package and generate a JSII compatible interface for a specific class within the package. It resolves imports and combines all dependencies into a single Typescript source file.

Notes:

References