Files
Pumpkin/pumpkin-plugin-wit/v0.1/text.wit
2026-04-21 16:36:24 +02:00

42 lines
1.3 KiB
Plaintext

interface text {
use common.{named-color, rgb-color, argb-color};
resource text-component {
text: static func(plain: string) -> text-component;
translate: static func(key: string, %with: list<text-component>) -> text-component;
add-child: func(child: text-component);
add-text: func(text: string);
get-text: func() -> string;
encode: func() -> list<u8>;
// Style
color-named: func(color: named-color);
color-rgb: func(color: rgb-color);
bold: func(value: bool);
italic: func(value: bool);
underlined: func(value: bool);
strikethrough: func(value: bool);
obfuscated: func(value: bool);
/// Text inserted into chat when shift-clicked
insertion: func(text: string);
font: func(font: string);
shadow-color: func(color: argb-color);
// Click events
click-open-url: func(url: string);
click-run-command: func(command: string);
click-suggest-command: func(command: string);
click-copy-to-clipboard: func(text: string);
// Hover events
hover-show-text: func(text: text-component);
/// Item data as SNBT string
hover-show-item: func(item: string);
hover-show-entity: func(entity-type: string, id: string, name: option<text-component>);
}
}