TypeScript docs on authoring and publishing definition files: https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html