TypeScript custom declaration files for untyped npm modules. The declaration declare module ‘shiitake’; should be in a global scope. i.e. a top level declaration in a non module (where a module is a file with at least one top level import or export).
A declaration of the form declare module ‘…’ { } in a module is an augmentation. For more details see Typescript Module Augmentation.
So you want this file to look like:
1 2 3 4 5 6 7 8 9 10 11 | declare module 'shiitake' { import * as React from 'react'; export interface ShiitakeProps { lines: number; } export default class Shiitake extends React.Component<ShiitakeProps, any> { } } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.