TypedValue
TypedValue = {
amount:number;currency:string;type:"currency"; } | {precision?:number;type:"number";unit?:string;value:number; } | {precision?:number;type:"percent";value:number; } | {seconds:number;type:"duration"; } | {type:"date";value:WireDate; } | {timeZone?:string;type:"clock"; } | {type:"text";value:string; } |number|string
A value handed over raw so each surface can format it for the viewer’s own locale.
Never pre-format a number into a string yourself (no "$1,247"): use one of the
typed cases, or the currency/number/percent/duration/
date helpers that build them. text is for values that are genuinely text
(a status word, a username), not a workaround for formatting.
A bare JSON number is shorthand for { type: "number", value }, and a bare JSON
string is shorthand for { type: "text", value }. Both decode fine in the app, but
prefer the explicit typed forms so the renderer knows what it’s showing.
Union Members
Section titled “Union Members”Type Literal
Section titled “Type Literal”{ amount: number; currency: string; type: "currency"; }
Type Literal
Section titled “Type Literal”{ precision?: number; type: "number"; unit?: string; value: number; }
Type Literal
Section titled “Type Literal”{ precision?: number; type: "percent"; value: number; }
Type Literal
Section titled “Type Literal”{ seconds: number; type: "duration"; }
Type Literal
Section titled “Type Literal”{ type: "date"; value: WireDate; }
Type Literal
Section titled “Type Literal”{ timeZone?: string; type: "clock"; }
The current time of day in an IANA zone (the viewer’s own when omitted); the renderer keeps it current.
Type Literal
Section titled “Type Literal”{ type: "text"; value: string; }
number
string