Package Exports
- @xmcl/text-component
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@xmcl/text-component) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Text-component Module
This is a sub-module belong to minecraft-launcher-core module. You can still use this individually.
Usage
TextComponent
Create TextComponent from string OR Minecraft's formatted string, like '§cThis is red'
import { TextComponent } from "@xmcl/text-component";
const fromString: TextComponent = TextComponent.str("from string");
const formattedString: string;
const fromFormatted: TextComponent = TextComponent.from(formattedString);Render the TextComponent to css
import { TextComponent } from "@xmcl/text-component";
const yourComponent: TextComponent;
const hint: Array<{ style: string; text: string }> = TextComponent.render(yourComponent);