I’m prototyping a React app in Typescript with Atlaskit components. However, it seems that there are no type declarations available. What is the recommended way of working with Atlaskit modules and Typescript?
For example, this gives an error: import Page, { Grid } from '@atlaskit/page';
Could not find a declaration file for module ‘@atlaskit/page’. ‘…/node_modules/@atlaskit/page/dist/cjs/index.js’ implicitly has an ‘any’ type.
I am also using Typescript and Atlaskit for my add-ons. It’s unfortunate that AtlasKit does not provide types out of the box (there used to be some Typescript components, but I think they are now standardising on Flow).
Regarding your question: I have a single file declarations.d.ts in my project root folder with the following content
I’ve been discussing this in an issue on the AtlasKit BB repo…
TL;DR - they are hoping to eventually generate Typescript declarations from Flow, there are allegedly some defs in DefinitelyTyped, but I can’t find them, and I’m still waiting on a response to that one.
I’ve taken the route of manually copying the Flow defs and hand editing into a .d.ts for just what I need - sorry they aren’t really fit for public consumption though, if the DefinitelyType stuff materialises I’ll probably contribute whatever I have to that if it fills any gaps.
@izymesdev not to my knowledge. I assume you are looking for updated AP typings. I have uploaded some updated typings here in case you are interested. However, they are not complete and I noticed recently that many of the callback oriented APIs now also support Promises which is not covered in these types. Secretly, I am still hoping that the AtlasKit JS to TS initiative will spread further across Atlassian.
I am sure there are other vendors who have written typings for AP as well. I think CollabSoft (@remie) writes in Typescript too. Maybe they are willing to share their typings?