twa-dev/types

Proposal: support tsconfig "compilerOptions.types"

Closed this issue ยท 2 comments

@ArthurStam thanks for great twa libraries, good job ๐Ÿ‘

Just a small proposal - what do you think about switching from index.ts to index.d.ts and providing global namespace augmentation out of the box?

With that changes it would be possible to add twa types with just tsconfig setting compilerOptions.types:

CleanShot 2022-08-15 at 22 04 00@2x

@ewgenius I think that maybe it's not a good idea to pollute global namespace in this package. We have publish another package: https://github.com/twa-dev/sdk, check it out:

import WebApp from '@twa-dev/sdk';

WebApp.showAlert('Hey there!');

It allows you to work with SDK and don't think about window at all.

That makes sense, thanks!