Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Add TypeScript support #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions mctext-react.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
declare module 'mctext-react' {
interface Props {
children: string | object
colormap?: {
black: string
dark_blue: string
dark_green: string
dark_aqua: string
dark_red: string
dark_purple: string
gold: string
gray: string
dark_gray: string
blue: string
green: string
aqua: string
red: string
light_purple: string
yellow: string
white: string
}
randomChars?: string
prefix?: string
style?: object
}

function McText (props: Props): JSX.Element;
export default McText
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.1.0",
"description": "A React component to display Minecraft-formatted text.",
"main": "lib/McText.js",
"typings": "./mctext-react",
"scripts": {
"test": "standard && jest",
"build": "babel src -d lib --ignore spec.js",
Expand Down