@tur-ng/std 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.d.ts +23 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tur-ng/std",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "type": "module",
5
5
  "types": "src/index.d.ts",
6
6
  "files": [
package/src/index.d.ts CHANGED
@@ -69,7 +69,9 @@ declare module "tur:std" {
69
69
  * `SpanData` struct (the JS field is `content`; Rust maps it to `text`). */
70
70
  export interface SpanData {
71
71
  content: string;
72
- bold?: boolean;
72
+ /** CSS-style numeric font weight (100–1000). Omit for the default
73
+ * (400). Overrides the element's `fontWeight` for this run. */
74
+ weight?: number;
73
75
  italic?: boolean;
74
76
  underline?: boolean;
75
77
  fontSize?: number;
@@ -286,8 +288,12 @@ declare module "tur:std" {
286
288
  }
287
289
 
288
290
  export interface TextProps {
289
- text: Val<string>;
291
+ text?: Val<string>;
290
292
  fontSize?: Val<number>;
293
+ /** CSS-style numeric font weight (100–1000) applied to the whole
294
+ * element. Per-span `weight` overrides it for that range. Omit for
295
+ * the default (400). */
296
+ fontWeight?: Val<number>;
291
297
  color?: Val<Brush | null>;
292
298
  spans?: Val<SpanData[]>;
293
299
  /** When `true`, the text can be drag-selected with the pointer. */
@@ -438,6 +444,9 @@ declare module "tur:std" {
438
444
  cursorColor?: Val<Brush | null>;
439
445
  fontSize?: Val<number>;
440
446
  fontFamily?: Val<string>;
447
+ /** CSS-style numeric font weight (100–1000). Omit for the default
448
+ * (400). Per-span `weight` overrides it. */
449
+ fontWeight?: Val<number>;
441
450
  width?: Val<number>;
442
451
  height?: Val<number>;
443
452
  multiline?: Val<boolean>;
@@ -779,4 +788,16 @@ declare module "tur:std" {
779
788
  ): LinearGradient;
780
789
  export function colorLerp(a: Color, b: Color, t: number): Color;
781
790
  export function requestFocus(target: TextController | Element): void;
791
+
792
+ export interface EventBus {
793
+ on(callback: (payload: Uint8Array) => void): void;
794
+ send(payload: Uint8Array): void;
795
+ }
796
+ export const eventBus: EventBus;
797
+
798
+ /** Decode a Uint8Array (or ArrayBuffer) of UTF-8 bytes into a string. */
799
+ export function decodeUtf8(bytes: Uint8Array | ArrayBuffer): string;
800
+
801
+ /** Encode a string into a Uint8Array of UTF-8 bytes. */
802
+ export function encodeUtf8(text: string): Uint8Array;
782
803
  }