nebrelbug / react-admonitions

An admonitions React component, ported from remarkable-admonitions. Perfect for Docusaurus v2 and other React-based doc generators
https://nebrelbug.github.io/react-admonitions/
11 stars 4 forks source link

Suggestion: Include Typescript Types #1

Open bforbis opened 5 years ago

bforbis commented 5 years ago

An included index.d.ts would provide code intellisense and greater support for react projects using typescript.

nebrelbug commented 5 years ago

I like the idea! Do you want to create a pull request, or should I?

bforbis commented 5 years ago

If you could do it, that would be great. I don't know much about how to use rollup. I've tested locally with this following index.d.ts file and it seems to be working:

import React from 'react'

interface AdmonitionProps {
  type: "warning" | "tip" | "caution" | "note" | "important";
  iconType?: "svg" | "emoji";
  title?: string;
}

export default class Admonition extends React.Component<AdmonitionProps> {}

export {AdmonitionProps}