Built-ins are the globals in scope in every program without an import. They
are a subset of the ECMA-262 globals, TextEncoder and TextDecoder, and
PermissionDeniedError and QuotaExceededError. This page lists them, what is
absent and what to use instead, and each built-in’s members. The language
itself is on Language. The importable submilli:
modules are on Standard library.
Catalog
Section titled “Catalog”submilli builtins prints the catalog:
Types: Array, BigInt, Boolean, Capitalize, Error, ErrorOptions, Exclude, Extract, Lowercase, Map, MissingValueError, NoInfer, NonNullable, Number, Object, Omit, Parameters, Partial, PermissionDeniedError, Pick, QuotaExceededError, RangeError, Readonly, ReadonlyMap, ReadonlySet, Record, ReferenceError, RegExp, Required, ReturnType, Set, String, SyntaxError, TextDecoder, TextEncoder, TimeoutError, TypeError, URIError, Uint8Array, Uncapitalize, UppercaseNamespaces: JSON, Math, Temporal| Built-in | Kind | Describes |
|---|---|---|
Array<T> |
Type | A homogeneous array |
Map<K, V> |
Type | A key-value collection whose keys are compared by structural equality |
Set<T> |
Type | A unique-value collection whose elements are compared by structural equality |
String |
Type | UTF-16 strings |
Number |
Type | IEEE 754 doubles |
BigInt |
Type | Arbitrary-precision integers. Literals use the n suffix |
Boolean |
Type | true and false |
Object |
Type | The base of every object type, with Object.keys, values, entries, hasOwn, is |
Record<K, V> |
Type | String-keyed objects (Language) |
Partial, Required, Readonly, Pick, Omit, Exclude, Extract, NonNullable, Parameters, ReturnType, NoInfer |
Type | TypeScript’s utility types, over concrete types and type parameters |
Uppercase, Lowercase, Capitalize, Uncapitalize |
Type | String literal case mappings |
RegExp |
Type | Regular expressions, without lookaround or backreferences |
Uint8Array |
Type | Byte arrays, with hex and base64 conversion |
TextEncoder, TextDecoder |
Type | UTF-8 encoding and decoding |
Error |
Error class | The base error class. throw takes Error and its subclasses |
TypeError |
Error class | Failed runtime type checks: a failed as cast, x! on null or undefined, invalid UTF-8, an invalid URL |
RangeError |
Error class | Out-of-range values: an array index written past the end, bigint division by zero, invalid Temporal values, and argument-size caps |
MissingValueError |
Error class | A read that finds no value and no check: an array or string index out of range, a key a record doesn’t have, or a regex group that didn’t take part (Language). JSON.stringify of a value with no JSON text throws it too (Language) |
SyntaxError |
Error class | Text that fails to parse: JSON.parse, BigInt(), Uint8Array.fromHex, new RegExp() |
URIError |
Error class | A malformed % escape in decodeURI, or a lone surrogate in encodeURI |
ReferenceError |
Error class | Reading or writing a module variable, static field, or parameter before its declaration or initialization has run |
PermissionDeniedError |
Error class | A denied capability, with fields caller, capability, reason (Permissions) |
QuotaExceededError |
Error class | A budget refusal: filesystem space, model tokens, or session state (Errors and limits) |
TimeoutError |
Error class | A wait outside the program ran out of time: an application tool the harness did not answer within the blueprint’s tool_call_timeout |
JSON |
Namespace | JSON.parse, returning unknown, and JSON.stringify |
Math |
Namespace | Constants and functions, including Math.random() |
Temporal |
Namespace | Dates, times, time zones, and durations |
Every error class extends Error and can be named in a typed catch
(catch (e: PermissionDeniedError)).
Temporal types
Section titled “Temporal types”| Type | Represents |
|---|---|
Temporal.Instant |
An exact moment, with no time zone |
Temporal.ZonedDateTime |
A moment in an IANA time zone |
Temporal.PlainDate |
A calendar date, with no time or time zone |
Temporal.PlainTime |
A wall-clock time, with no date or time zone |
Temporal.PlainDateTime |
A calendar date and wall-clock time, with no time zone |
Temporal.PlainYearMonth |
A year and month, such as 2026-06 |
Temporal.PlainMonthDay |
A month and day, such as 06-07 |
Temporal.Duration |
A span of time |
Temporal.Now |
The clock: instant(), plainDateISO(), plainTimeISO(), plainDateTimeISO(), zonedDateTimeISO(), timeZoneId() |
Temporal values are immutable. Arithmetic returns a new value. The calendar is
ISO 8601. Temporal.Now functions take an optional IANA time-zone id and
default to the system zone. A Temporal value in a template literal is written
with an explicit .toString().
function main(): string { const opened = Temporal.Instant.from("2026-09-15T08:30:00Z"); const closed = Temporal.Instant.from("2026-09-18T10:00:00Z"); const hoursOpen = closed.since(opened).total("hours");
const local = closed.toZonedDateTimeISO("Asia/Jerusalem"); const followUp = local.toPlainDate().add({ days: 3 });
return `open ${hoursOpen} hours, closed ${local.toPlainTime().toString()} local, follow up ${followUp.toString()}`;}open 73.5 hours, closed 13:00:00 local, follow up 2026-09-21Global functions and values
Section titled “Global functions and values”These globals are in scope and are not in the submilli builtins catalog.
| Global | Behavior |
|---|---|
console.log(first, ...rest) |
Writes the values, separated by spaces, to the log stream |
assert(condition, message?) |
Throws Error(message) when condition is false |
parseInt(string, radix = 10) |
Parses an integer prefix, or returns NaN when there are no digits |
parseFloat(string) |
Parses a decimal number, or returns NaN when the text is not one |
isNaN(value), isFinite(value) |
Number tests |
encodeURIComponent(uri), encodeURI(uri) |
Percent-encoding. encodeURIComponent also takes a number or boolean, converted as String(value) does. Throws URIError on a lone surrogate |
decodeURIComponent(uri), decodeURI(uri) |
Percent-decoding. Throws URIError ("URI malformed") on an invalid escape |
NaN, Infinity |
Number constants |
fn.length |
A function’s parameters before the first optional, defaulted or rest one. A function keeps its length when assigned to a wider function type |
Not available
Section titled “Not available”| Global | Use instead |
|---|---|
Date |
Temporal, with Temporal.Now.instant() for the current time |
Symbol |
None |
Proxy, Reflect |
None |
Prototype reflection: Object.getPrototypeOf, Object.defineProperty, obj.hasOwnProperty, .prototype |
Object.hasOwn(obj, key) or key in obj for presence |
Object.freeze |
readonly types |
WeakMap, WeakSet |
Map, Set |
Promise, queueMicrotask, setTimeout, setInterval |
None. Calls are synchronous |
Typed arrays other than Uint8Array, ArrayBuffer, DataView |
Uint8Array |
Intl |
None. localeCompare uses the Unicode root collation on every machine |
globalThis, window |
None |
fetch |
submilli:http |
URL, URLSearchParams |
submilli:url |
crypto |
submilli:crypto, submilli:uuid |
atob, btoa, Buffer |
Uint8Array.fromBase64, toBase64, TextEncoder, TextDecoder |
process, require, and other Node.js globals |
The standard library and Submilli Packages |
An absent global is a compile error. Date has its own message:
function main(): string { const now = new Date(); return now.toISOString();}error: `Date` is not supported --> now.ts:2:19 |1 | function main(): string {2 | const now = new Date(); | ^^^^3 | return now.toISOString(); |help: use `Temporal.Now.instant()` for wall-clock time, or `Temporal.ZonedDateTime` / `Temporal.Instant` for time values. `Date` is intentionally out of scope — see Temporal for a correct, immutable, timezone-aware time API.Other absent globals are unresolved identifiers, such as
error: unresolved identifier `Symbol` , and absent members are missing
methods, such as error: no method `getPrototypeOf` on `ObjectConstructor`
followed by the type’s declaration.
Looking a built-in up
Section titled “Looking a built-in up”The live declarations, with doc comments, come from the CLI, which reads
the same source as the compiler. submilli builtins lists the catalog.
submilli builtins <name>… prints declarations, such as
submilli builtins Map Temporal.
A dotted path prints one member, such as submilli builtins Temporal.Instant
or submilli builtins Map.get. A name that is not a built-in fails with a
suggestion:
$ submilli builtins Dateunknown built-in: Date. Did you mean `Temporal`?
Run `submilli builtins` to list available built-ins.A module name is redirected to submilli docs:
$ submilli builtins submilli:fs`submilli:fs` is a package, not a language built-in. Run `submilli docs submilli:fs` for its declarations, and write `import ... from "submilli:fs"` to use it.
Run `submilli builtins` to list available built-ins.submilli docs Temporal prints a built-in’s declarations too, after a line
saying it is always in scope and takes no import.
A homogeneous array of T.
| Member | Description |
|---|---|
length: number |
The number of elements in the array. |
at(index: number): T | undefined |
Returns the element at index, or undefined if out of range. |
concat(...items: (readonly T[] | T)[]): T[] |
Returns a new array containing this array’s elements followed by each of items, in order. |
copyWithin(target: number, start?: number, end?: number): T[] |
Copies the slots [start, end) to target, in place (overlap-safe), and returns the array. |
entries(): Iterator<[number, T]> |
Returns a live Iterator<[number, T]> of index/element pairs. |
every(predicate: (arg0: T, arg1: number, arg2: T[]) => unknown): boolean |
Returns true if predicate returned a truthy value for every element. |
fill(value: T, start?: number, end?: number): T[] |
Sets every slot in [start, end) to value, in place, and returns the array. |
filter(predicate: (arg0: T, arg1: number, arg2: T[]) => unknown): T[] |
Returns a new array of the elements for which predicate returned a truthy value. |
find(callback: (arg0: T, arg1: number, arg2: T[]) => unknown): T | undefined |
Returns the first element for which callback returns a truthy value, or undefined if none match. |
findIndex(callback: (arg0: T, arg1: number, arg2: T[]) => unknown): number |
Returns the index of the first element for which callback returns a truthy value, or -1 if none match. |
findLast(callback: (arg0: T, arg1: number, arg2: T[]) => unknown): T | undefined |
Returns the last element for which callback returns a truthy value, or undefined if none match. |
findLastIndex(callback: (arg0: T, arg1: number, arg2: T[]) => unknown): number |
Returns the index of the last element for which callback returns a truthy value, or -1 if none match. |
flat<A, D extends number = 1>(this: A, depth?: D): FlatArray<A, D>[] |
Flattens nested arrays up to depth levels into a new array (default 1). |
flatMap<U>(callback: (arg0: T, arg1: number, arg2: T[]) => U[]): U[] |
Maps each element to an array via callback, then flattens the results one level. |
forEach(callback: (arg0: T, arg1: number, arg2: T[]) => void): void |
Calls callback(value, index, array) once for each element in order. |
includes(elem: T, fromIndex?: number): boolean |
Returns true if some element at or after fromIndex equals elem. |
indexOf(elem: T, fromIndex?: number): number |
Returns the index of the first element equal to elem at or after fromIndex, or -1 if not present. |
join(separator?: string): string |
Joins the elements using separator. |
keys(): Iterator<number> |
Returns a live Iterator<number> of the indices — length is re-read on every step. |
lastIndexOf(elem: T, fromIndex?: number): number |
Returns the index of the last element equal to elem, or -1. |
map<U>(callback: (arg0: T, arg1: number, arg2: T[]) => U): U[] |
Returns a new array produced by applying callback to each element. |
pop(): T | undefined |
Removes the last element and returns it, or undefined if the array is empty. |
push(...items: T[]): number |
Appends items to the end of the array, in argument order. |
reduce<U>(callback: (arg0: U, arg1: T, arg2: number, arg3: T[]) => U, initial: U): U |
Reduces the array to a single value. |
reduceRight<U>(callback: (arg0: U, arg1: T, arg2: number, arg3: T[]) => U, initial: U): U |
Reduces the array right-to-left. |
reverse(): T[] |
Reverses the array in place and returns it. |
shift(): T | undefined |
Removes and returns the first element, shifting the rest forward. |
slice(start?: number, end?: number): T[] |
Returns a new array of the elements from start (inclusive) to end (exclusive). |
some(predicate: (arg0: T, arg1: number, arg2: T[]) => unknown): boolean |
Returns true if predicate returned a truthy value for at least one element. |
sort(compareFn?: (arg0: T, arg1: T) => number): T[] |
Sorts the array in place and returns it. |
splice(start: number, deleteCount?: number, ...items: T[]): T[] |
Removes deleteCount elements at start, inserts items there (in place), and returns the removed elements. |
toJson(): string |
Returns the JSON representation of this array — "[" + elements’ toJson() joined with "," + "]". |
toReversed(): T[] |
Returns a new array with the elements in reverse order; the receiver is not modified. |
toSorted(compareFn?: (arg0: T, arg1: T) => number): T[] |
Returns a new sorted array; the receiver is not modified. |
toSpliced(start: number, deleteCount?: number, ...items: T[]): T[] |
Returns a new array with deleteCount elements removed at start and items inserted there; the receiver is not modified. |
toString(): string |
Returns the elements joined with commas. |
unshift(...items: T[]): number |
Prepends items (keeping their argument order) and returns the new length. |
values(): Iterator<T> |
Returns a live Iterator<T> over the elements — unlike Map/Set cursors it sees pushes made during iteration. |
with(index: number, value: T): T[] |
Returns a copy of the array with the slot at index replaced by value; the receiver is not modified. |
| Constant | Description |
|---|---|
Array: ArrayConstructor |
ArrayConstructor
Section titled “ArrayConstructor”Constructor object for Array.
| Member | Description |
|---|---|
from<T, U>(src: { readonly length: number } | readonly T[] | Iterable<T> | Iterator<T>, mapFn?: (arg0: T, arg1: number) => U): U[] |
Materializes any iterable — an array, string (code points), Iterator<T>, or Iterable<T> — into a fresh array. |
isArray<T>(value: T): boolean |
Returns true when value is an array. |
of<T>(...items: T[]): T[] |
Builds an array from its arguments — Array.of(1, 2, 3) is [1, 2, 3]. |
BigInt
Section titled “BigInt”Arbitrary-precision integer.
| Member | Description |
|---|---|
toJson(): string |
Returns the canonical decimal representation — JSON has no native bigint literal, so this matches toString. |
toString(radix?: number): string |
Returns this bigint formatted in the given base. |
valueOf(): bigint |
Returns this primitive value unchanged. |
| Constant | Description |
|---|---|
BigInt: BigIntConstructor |
BigIntConstructor
Section titled “BigIntConstructor”Constructor object for bigint.
| Member | Description |
|---|---|
(value: string | number): bigint |
Convert a string or number to a bigint. |
fromString(value: string): bigint |
Parse a decimal string as a bigint. |
Boolean
Section titled “Boolean”The boolean type — true or false.
| Member | Description |
|---|---|
toJson(): string |
Returns "true" or "false" — same as toString (booleans are JSON-native). |
toString(): string |
Returns "true" or "false". |
valueOf(): boolean |
Returns this primitive value unchanged. |
| Constant | Description |
|---|---|
Boolean: BooleanConstructor |
BooleanConstructor
Section titled “BooleanConstructor”Constructor object for boolean.
| Member | Description |
|---|---|
(value?: unknown): boolean |
Convert any value to a boolean by its truthiness: false, 0, NaN, "", 0n, null and undefined are false; everything else is true. |
Capitalize
Section titled “Capitalize”Capitalize
Section titled “Capitalize”Convert first character of string literal type to uppercase.
type Capitalize<S extends string> = intrinsic;The built-in error class.
| Member | Description |
|---|---|
static isError(value?: unknown): boolean |
Returns true when value is an Error instance (including subclasses). |
cause?: unknown |
The error that led to this one, passed as new Error(message, { cause }); undefined when none was. |
message: string |
The human-readable message passed to new Error(message). |
name: string |
The error class name. |
constructor(message?: string, options?: ErrorOptions) |
ErrorOptions
Section titled “ErrorOptions”Options for an error constructor, as in new Error(message, { cause }).
| Member | Description |
|---|---|
cause?: unknown |
The error that led to the new one, stored as its cause. |
Exclude
Section titled “Exclude”Exclude
Section titled “Exclude”Exclude from T those types that are assignable to U.
type Exclude<T, U> = T extends U ? never : T;Extract
Section titled “Extract”Extract
Section titled “Extract”Extract from T those types that are assignable to U.
type Extract<T, U> = T extends U ? T : never;FlatArray
Section titled “FlatArray”FlatArray
Section titled “FlatArray”The element type after flattening an array through Depth levels.
type FlatArray<Arr, Depth extends number> = { done: Arr; recur: Arr extends ReadonlyArray<infer InnerArr> ? FlatArray<InnerArr, [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]> : Arr; }[Depth extends -1 ? "done" : "recur"];Lowercase
Section titled “Lowercase”Lowercase
Section titled “Lowercase”Convert string literal type to lowercase.
type Lowercase<S extends string> = intrinsic;A hash-backed key-value collection.
| Member | Description |
|---|---|
readonly size: number |
The number of entries currently in the map. |
clear(): void |
Removes every entry. |
delete(key: K): boolean |
Removes key from the map. |
entries(): Iterator<[K, V]> |
Returns a lazy Iterator<[K, V]> over the entries — the same cursor for-of uses. |
forEach(callback: (arg0: V, arg1: K, arg2: Map<K, V>) => void): void |
Calls callback(value, key, map) once for each entry in insertion order, including entries the callback adds. |
get(key: K): V | undefined |
Returns the value associated with key, or undefined if the key is not present. |
has(key: K): boolean |
Returns true when key is present. |
iterator(): Iterator<[K, V]> |
Returns a fresh Iterator<[K, V]> over the entries in insertion order. |
keys(): Iterator<K> |
Returns a lazy Iterator<K> over the keys in insertion order. |
set(key: K, value: V): Map<K, V> |
Associates value with key, overwriting any prior value. |
values(): Iterator<V> |
Returns a lazy Iterator<V> over the values in insertion order. |
| Constant | Description |
|---|---|
Map: MapConstructor |
MapConstructor
Section titled “MapConstructor”Constructor object for Map.
| Member | Description |
|---|---|
new <K, V>(entries?: readonly (readonly [K, V])[] | Iterable<[K, V]> | Iterator<[K, V]> | null): Map<K, V> |
Construct a Map<K, V>, optionally from an iterable of [K, V] entries: new Map([["a", 1]]). |
groupBy<K, T>(items: readonly T[] | Iterable<T> | Iterator<T>, keySelector: (arg0: T, arg1: number) => K): Map<K, T[]> |
Groups iterable elements by the callback’s result: a Map from each key to the elements it was returned for, in first-seen order. |
MissingValueError
Section titled “MissingValueError”A read found no value (extends Error): an array or string index out of range, a key a record does not have, or a regex group that did not take part in the match.
| Member | Description |
|---|---|
constructor(message?: string, options?: ErrorOptions) |
NoInfer
Section titled “NoInfer”NoInfer
Section titled “NoInfer”Marker for non-inference type position: T is not inferred from it.
type NoInfer<T> = intrinsic;NonNullable
Section titled “NonNullable”NonNullable
Section titled “NonNullable”Exclude null and undefined from T.
type NonNullable<T> = T & {};Number
Section titled “Number”The IEEE-754 double-precision number type.
| Member | Description |
|---|---|
toExponential(fractionDigits?: number): string |
Exponential notation — (1234.5).toExponential(2) is "1.23e+3". |
toFixed(digits?: number): string |
Fixed-point notation with exactly digits fraction digits — (3.14159).toFixed(2) is "3.14". |
toJson(): string |
Returns the JSON representation of this number. |
toPrecision(precision?: number): string |
Formats to precision significant digits, switching to exponential form for very large or small values. |
toString(radix?: number): string |
Returns this number formatted in the given base. |
valueOf(): number |
Returns this primitive value unchanged. |
| Constant | Description |
|---|---|
Number: NumberConstructor |
NumberConstructor
Section titled “NumberConstructor”Constructor object for number.
| Member | Description |
|---|---|
readonly EPSILON: number |
The gap between 1 and the next representable double (2^-52). |
readonly MAX_SAFE_INTEGER: number |
2^53 − 1 — the largest exactly-representable integer. |
readonly MAX_VALUE: number |
The largest finite double (≈1.7976931348623157e308). |
readonly MIN_SAFE_INTEGER: number |
−(2^53 − 1). |
readonly MIN_VALUE: number |
The smallest positive double (5e-324, subnormal). |
readonly NEGATIVE_INFINITY: number |
Same value as -Infinity. |
readonly NaN: number |
Same value as the global NaN. |
readonly POSITIVE_INFINITY: number |
Same value as the global Infinity. |
(value?: number | bigint | string | boolean): number |
Convert a number, boolean, string, bigint, or undefined to a number. |
isFinite(value: unknown): boolean |
Returns true when value is neither NaN nor ±Infinity. |
isInteger(value: unknown): boolean |
Returns true when value is a finite whole number. |
isNaN(value: unknown): boolean |
Returns true when value is NaN. |
isSafeInteger(value: unknown): boolean |
Returns true when value is an integer that f64 represents exactly (|value| ≤ 2^53 − 1). |
parseFloat(s: string): number |
Same as the global parseFloat — parses the longest leading decimal, ignoring trailing junk. |
parseInt(s: string, radix?: number): number |
Same as the global parseInt — parses the longest leading integer, ignoring trailing junk. |
Object
Section titled “Object”Universal base type for every object shape.
| Member | Description |
|---|---|
toJson(): string |
Returns the JSON representation of this object — "{" + "key":value-json pairs joined with "," + "}". |
toString(): string |
Returns "[object Object]". |
| Constant | Description |
|---|---|
Object: ObjectConstructor |
ObjectConstructor
Section titled “ObjectConstructor”Constructor object for Object — the enumeration statics (keys/values/entries/hasOwn), assign, fromEntries, groupBy and is.
| Member | Description |
|---|---|
assign<T>(target: T, ...sources: unknown[]): T |
Copies own enumerable values from sources to the original target, in source order. |
entries(obj: unknown): [string, unknown][] |
Returns [name, value] pairs in canonical sorted key order. |
fromEntries<T>(entries: readonly (readonly [number | string, T])[] | Iterable<readonly [number | string, T]> | Iterator<readonly [number | string, T]>): { [key: string]: T } |
Creates a string-keyed object from entry pairs. |
groupBy<K, T>(items: readonly T[] | Iterable<T> | Iterator<T>, keySelector: (arg0: T, arg1: number) => K): { [key: string]: T[] } |
Groups iterable elements by the callback’s property key. |
hasOwn(obj: unknown, key: string): boolean |
Returns true when obj has a field named key: an omitted optional field answers false, one holding undefined answers true. |
is(a: unknown, b: unknown): boolean |
SameValue comparison: like === but Object.is(NaN, NaN) is true and Object.is(0, -0) is false. |
keys(obj: unknown): string[] |
Returns the object’s field names in canonical sorted order (the same order JSON output uses). |
values(obj: unknown): unknown[] |
Returns the object’s field values, aligned with Object.keys order. |
Construct a type with the properties of T except for those in type K.
type Omit<T, K extends string | number> = Pick<T, Exclude<keyof T, K>>;Parameters
Section titled “Parameters”Parameters
Section titled “Parameters”Obtain the parameters of a function type in a tuple.
type Parameters<T extends (...args: never[]) => unknown> = T extends (...args: infer P) => unknown ? P : never;Partial
Section titled “Partial”Partial
Section titled “Partial”Make all properties in T optional.
type Partial<T> = { [P in keyof T]?: T[P] };PermissionDeniedError
Section titled “PermissionDeniedError”The built-in permission-denial class (extends Error, name = "PermissionDeniedError").
| Member | Description |
|---|---|
caller: string |
The Package the denied call was attributed to (e.g. "main"). |
capability: string |
The denied capability name (e.g. "fs.read", "http.get"). |
reason: string |
The policy-supplied denial reason. |
constructor(message: string, caller: string, capability: string, reason: string) |
From T, pick a set of properties whose keys are in the union K.
type Pick<T, K extends keyof T> = { [P in K]: T[P] };QuotaExceededError
Section titled “QuotaExceededError”A budget refusal (extends Error): filesystem space, model tokens, or session state.
| Member | Description |
|---|---|
constructor(message?: string, options?: ErrorOptions) |
RangeError
Section titled “RangeError”The built-in range-error class (extends Error, name = "RangeError").
| Member | Description |
|---|---|
constructor(message?: string, options?: ErrorOptions) |
Readonly
Section titled “Readonly”Readonly
Section titled “Readonly”Make all properties in T readonly.
type Readonly<T> = { readonly [P in keyof T]: T[P] };ReadonlyMap
Section titled “ReadonlyMap”ReadonlyMap
Section titled “ReadonlyMap”A Map that can only be read: get, has, size, forEach and iteration, but not set, delete or clear.
type ReadonlyMap<K, V> = Omit<Map<K, V>, "set" | "delete" | "clear" | "forEach"> & { forEach(callback: (value: V, key: K, map: ReadonlyMap<K, V>) => void): void };ReadonlySet
Section titled “ReadonlySet”ReadonlySet
Section titled “ReadonlySet”A Set that can only be read: has, size, forEach, iteration and the set algebra, but not add, delete or clear.
type ReadonlySet<T> = Omit<Set<T>, "add" | "delete" | "clear" | "forEach"> & { forEach(callback: (value: T, value2: T, set: ReadonlySet<T>) => void): void };Record
Section titled “Record”Record
Section titled “Record”Record<K, V> accepts string, number, enum, literal-union, and template-pattern keys.
type Record<K extends string | number, V> = { [P in K]: V };ReferenceError
Section titled “ReferenceError”The built-in reference-error class (extends Error, name = "ReferenceError").
| Member | Description |
|---|---|
constructor(message?: string, options?: ErrorOptions) |
RegExp
Section titled “RegExp”Compiled regular expression.
| Member | Description |
|---|---|
readonly dotAll: boolean |
true if the regex was constructed with the s flag (. matches newlines). |
readonly flags: string |
The flag string in source order — any subset of gimsuy. |
readonly global: boolean |
true if the regex was constructed with the g flag. |
readonly ignoreCase: boolean |
true if the regex was constructed with the i flag (case-insensitive matching). |
lastIndex: number |
Where the next g or y match starts; matching advances it, and a failed match resets it to 0. |
readonly multiline: boolean |
true if the regex was constructed with the m flag (^ / $ match line boundaries). |
readonly source: string |
The original JS-source pattern (without the leading/trailing /). |
readonly sticky: boolean |
true if the regex was constructed with the y flag (sticky / anchored at lastIndex). |
readonly unicode: boolean |
true if the regex was constructed with the u flag. |
exec(s: string): RegExpExecArray | null |
Find the next match in s. |
test(s: string): boolean |
Returns true if the pattern matches anywhere in s. |
| Constant | Description |
|---|---|
RegExp: RegExpConstructor |
RegExpConstructor
Section titled “RegExpConstructor”Constructor object for RegExp.
| Member | Description |
|---|---|
(source: string | RegExp, flags?: string): RegExp |
Compile a pattern as new RegExp does. |
new (source: string | RegExp, flags?: string): RegExp |
Construct a fresh RegExp from a pattern string or an existing regex. |
escape(string: string): string |
Returns string with every character that has a meaning in a pattern escaped, so new RegExp(RegExp.escape(s)) matches s literally. |
Required
Section titled “Required”Required
Section titled “Required”Make all properties in T required.
type Required<T> = { [P in keyof T]-?: T[P] };ReturnType
Section titled “ReturnType”ReturnType
Section titled “ReturnType”Obtain the return type of a function type.
type ReturnType<T extends (...args: never[]) => unknown> = T extends (...args: never[]) => infer R ? R : never;A hash-backed unique-value collection.
| Member | Description |
|---|---|
readonly size: number |
The number of elements currently in the set. |
add(value: T): Set<T> |
Adds value to the set. |
clear(): void |
Removes every element. |
delete(value: T): boolean |
Removes value from the set. |
difference<U>(other: ReadonlySet<U>): Set<T> |
Returns a new set with this set’s elements that are not in other. |
entries(): Iterator<[T, T]> |
Returns a lazy Iterator<[T, T]> of [value, value] pairs (the element repeats, mirroring Map#entries). |
forEach(callback: (arg0: T, arg1: T, arg2: Set<T>) => void): void |
Calls callback(value, value, set) once for each element in insertion order, including elements the callback adds. |
has(value: T): boolean |
Returns true when value is present. |
intersection<U>(other: ReadonlySet<U>): Set<T> |
Returns a new set with the elements present in both this set and other. |
isDisjointFrom<U>(other: ReadonlySet<U>): boolean |
Returns true when this set and other share no elements. |
isSubsetOf<U>(other: ReadonlySet<U>): boolean |
Returns true when every element of this set is in other. |
isSupersetOf<U>(other: ReadonlySet<U>): boolean |
Returns true when every element of other is in this set. |
iterator(): Iterator<T> |
Returns a fresh Iterator<T> over the elements in insertion order. |
keys(): Iterator<T> |
Alias of values() — sets have no separate keys. |
symmetricDifference<U>(other: ReadonlySet<U>): Set<T | U> |
Returns a new set with the elements in exactly one of this set and other (the overlap is dropped). |
union<U>(other: ReadonlySet<U>): Set<T | U> |
Returns a new set with every element of this set and other. |
values(): Iterator<T> |
Returns a fresh array of every element in insertion order. |
| Constant | Description |
|---|---|
Set: SetConstructor |
SetConstructor
Section titled “SetConstructor”Constructor object for Set.
| Member | Description |
|---|---|
new <T>(values?: readonly T[] | Iterable<T> | Iterator<T> | null): Set<T> |
Construct a Set<T>, optionally from an iterable of values: new Set([1, 2, 2]) dedups to size 2. |
String
Section titled “String”The UTF-16 string type.
| Member | Description |
|---|---|
readonly length: number |
The number of UTF-16 code units in the string. |
at(index: number): string | undefined |
Returns the code unit at index as a single-character string. |
charAt(index: number): string |
Returns the UTF-16 code unit at index as a single-character string. |
charCodeAt(index: number): number |
Returns the UTF-16 code unit at index as an integer (0..65535), or NaN if out of range. |
codePointAt(index: number): number | undefined |
Returns the Unicode code point starting at index, decoding surrogate pairs into values up to 0x10FFFF. |
concat(...strings: string[]): string |
Returns a new string with each of strings appended, in order. |
endsWith(search: string, endPosition?: number): boolean |
Returns true if the substring ending at endPosition ends with search. |
equals(other: string): boolean |
Returns true when both strings have identical code units. |
includes(search: string, fromIndex?: number): boolean |
Returns true if search occurs at or after fromIndex. |
indexOf(search: string, fromIndex?: number): number |
Returns the index of the first occurrence of search at or after fromIndex, or -1 if none. |
isWellFormed(): boolean |
Returns true when the string contains no lone surrogates (it round-trips losslessly through UTF-8). |
iterator(): Iterator<string> |
Returns an Iterator<string> of CODE POINTS — surrogate pairs arrive as one two-unit string. |
lastIndexOf(search: string, fromIndex?: number): number |
Returns the index of the last occurrence of search at or before fromIndex, or -1 if none. |
localeCompare(other: string): number |
Compares this string with other by the Unicode root collation, the order Intl.Collator gives for the root or an English locale: lower case before upper case, accented letters beside their base letter. |
match(re: string | RegExp): RegExpMatchArray | null |
Find the next match of re in this string. |
matchAll(re: string | RegExp): Iterator<RegExpExecArray> |
Find every non-overlapping match of re in this string. |
normalize(form?: string): string |
Returns a new string in the specified Unicode normalization form. |
padEnd(targetLength: number, padString?: string): string |
Pads this string with padString on the right until the result reaches targetLength code units. |
padStart(targetLength: number, padString?: string): string |
Pads this string with padString on the left until the result reaches targetLength code units. |
repeat(count: number): string |
Returns a new string containing count copies of this string concatenated. |
replace(search: string | RegExp, replacement: string | ((arg0: string, arg1?: unknown, arg2?: unknown, arg3?: unknown, arg4?: unknown, arg5?: unknown, arg6?: unknown, arg7?: unknown) => string)): string |
Replace the first match of search with replacement. |
replaceAll(search: string | RegExp, replacement: string | ((arg0: string, arg1?: unknown, arg2?: unknown, arg3?: unknown, arg4?: unknown, arg5?: unknown, arg6?: unknown, arg7?: unknown) => string)): string |
Replace every non-overlapping match of search with replacement. |
search(re: string | RegExp): number |
Index of the first match of re in this string, or -1 if no match. |
slice(start?: number, end?: number): string |
Returns a new string containing the code units from start (inclusive) to end (exclusive). |
split(separator: string | RegExp, limit?: number): string[] |
Split this string into pieces by matches of separator. |
startsWith(search: string, position?: number): boolean |
Returns true if the substring starting at position begins with search. |
substr(start: number, length?: number): string |
Returns length code units starting at start; a negative start counts from the end. |
substring(start?: number, end?: number): string |
Like slice, but negative values clamp to 0, and start and end are swapped when start > end. |
toJson(): string |
Returns this string wrapped in "…" with JSON escapes applied (\", \\, \b, \f, \n, \r, \t, and \u00XX for control codepoints). |
toLowerCase(): string |
Returns a new string with every character converted to its Unicode lowercase form. |
toString(): string |
Returns this string unchanged (identity). |
toUpperCase(): string |
Returns a new string with every character converted to its Unicode uppercase form. |
toWellFormed(): string |
Returns a copy with every lone surrogate replaced by U+FFFD (�); well-formed strings come back unchanged. |
trim(): string |
Returns a new string with Unicode whitespace removed from both ends. |
trimEnd(): string |
Returns a new string with Unicode whitespace removed from the end. |
trimLeft(): string |
The older name of trimStart: returns a new string with Unicode whitespace removed from the start. |
trimRight(): string |
The older name of trimEnd: returns a new string with Unicode whitespace removed from the end. |
trimStart(): string |
Returns a new string with Unicode whitespace removed from the start. |
valueOf(): string |
Returns this primitive value unchanged. |
| Constant | Description |
|---|---|
String: StringConstructor |
StringConstructor
Section titled “StringConstructor”Constructor object for string.
| Member | Description |
|---|---|
(value?: unknown): string |
Convert any value to its string representation: "null" and "undefined" for those values, otherwise the value’s toString() method. |
fromCharCode(...codes: number[]): string |
Builds a string from UTF-16 code units — one unit per argument. |
fromCodePoint(...codePoints: number[]): string |
Builds a string from Unicode code points; astral code points (> U+FFFF) encode as surrogate pairs. |
SyntaxError
Section titled “SyntaxError”The built-in syntax-error class (extends Error, name = "SyntaxError").
| Member | Description |
|---|---|
constructor(message?: string, options?: ErrorOptions) |
TextDecoder
Section titled “TextDecoder”Decodes UTF-8 byte arrays into UTF-16 strings.
| Member | Description |
|---|---|
decode(bytes: Uint8Array): string |
Decode bytes as UTF-8 into a UTF-16 string. |
| Constant | Description |
|---|---|
TextDecoder: TextDecoderConstructor |
TextDecoderConstructor
Section titled “TextDecoderConstructor”Constructor object for TextDecoder.
| Member | Description |
|---|---|
new (): TextDecoder |
Construct a new TextDecoder instance. |
TextEncoder
Section titled “TextEncoder”Encodes UTF-16 strings to UTF-8 byte arrays.
| Member | Description |
|---|---|
encode(s: string): Uint8Array |
UTF-8 encode s into a Uint8Array. |
| Constant | Description |
|---|---|
TextEncoder: TextEncoderConstructor |
TextEncoderConstructor
Section titled “TextEncoderConstructor”Constructor object for TextEncoder.
| Member | Description |
|---|---|
new (): TextEncoder |
Construct a new TextEncoder instance. |
TimeoutError
Section titled “TimeoutError”A wait outside the program ran out of time (extends Error): an application tool the harness did not answer within the blueprint’s tool_call_timeout.
| Member | Description |
|---|---|
constructor(message?: string, options?: ErrorOptions) |
TypeError
Section titled “TypeError”The built-in type-error class (extends Error, name = "TypeError").
| Member | Description |
|---|---|
constructor(message?: string, options?: ErrorOptions) |
URIError
Section titled “URIError”The built-in URI-error class (extends Error, name = "URIError").
| Member | Description |
|---|---|
constructor(message?: string, options?: ErrorOptions) |
Uint8Array
Section titled “Uint8Array”Packed byte array.
| Member | Description |
|---|---|
readonly BYTES_PER_ELEMENT: number |
The size in bytes of each element: always 1. |
readonly byteLength: number |
Equivalent to length. |
readonly length: number |
The number of bytes in this array. |
at(index: number): number | undefined |
Returns the byte at index, or undefined if out of range. |
copyWithin(target: number, start?: number, end?: number): Uint8Array |
Copies bytes[start..end) to bytes[target..] in place. |
entries(): Iterator<[number, number]> |
Returns a live Iterator<[number, number]> of index/byte pairs. |
equals(other: Uint8Array): boolean |
Byte-by-byte equality with other. |
every(predicate: (arg0: number, arg1: number, arg2: Uint8Array) => unknown): boolean |
Returns true iff predicate(byte, index, array) returns a truthy value for every byte. |
fill(value: number, start?: number, end?: number): Uint8Array |
Converts value to a byte and writes it to every position in [start, end). |
filter(predicate: (arg0: number, arg1: number, arg2: Uint8Array) => unknown): Uint8Array |
Returns a new Uint8Array containing every byte for which predicate(byte, index, array) returns a truthy value. |
find(predicate: (arg0: number, arg1: number, arg2: Uint8Array) => boolean): number | undefined |
Returns the first byte for which predicate(byte, index, array) returns true, or undefined. |
findIndex(predicate: (arg0: number, arg1: number, arg2: Uint8Array) => boolean): number |
Returns the index of the first matching byte, or -1. |
findLast(predicate: (arg0: number, arg1: number, arg2: Uint8Array) => unknown): number | undefined |
Returns the last byte for which predicate(byte, index, array) returns a truthy value, or undefined. |
findLastIndex(predicate: (arg0: number, arg1: number, arg2: Uint8Array) => unknown): number |
Returns the index of the last matching byte, or -1. |
forEach(callback: (arg0: number, arg1: number, arg2: Uint8Array) => void): void |
Invokes callback(byte, index, array) for every byte in order. |
includes(target: number, fromIndex?: number): boolean |
Returns true if target appears at or after fromIndex. |
indexOf(target: number, fromIndex?: number): number |
Returns the first index of target, or -1. |
iterator(): Iterator<number> |
Returns a live Iterator<number> of the bytes, which for-of and spread use. |
join(separator?: string): string |
Returns this array’s bytes formatted in decimal and concatenated with separator between adjacent pairs. |
keys(): Iterator<number> |
Returns a live Iterator<number> of the indices. |
lastIndexOf(target: number, fromIndex?: number): number |
Returns the last index of target, or -1. |
map(callback: (arg0: number, arg1: number, arg2: Uint8Array) => number): Uint8Array |
Returns a new Uint8Array with each callback(this[i], i, this) result converted to a byte. |
reduce<U>(callback: (arg0: U, arg1: number, arg2: number, arg3: Uint8Array) => U, initial: U): U |
Folds bytes left-to-right with callback(acc, byte, index, array). |
reduceRight<U>(callback: (arg0: U, arg1: number, arg2: number, arg3: Uint8Array) => U, initial: U): U |
Folds bytes right-to-left with callback(acc, byte, index, array). |
reverse(): Uint8Array |
Reverses this array’s bytes in place and returns this. |
set(values: Uint8Array, offset?: number): void |
Copies values into this array starting at offset. |
slice(start?: number, end?: number): Uint8Array |
Returns a fresh copy of the bytes in [start, end). |
some(predicate: (arg0: number, arg1: number, arg2: Uint8Array) => unknown): boolean |
Returns true if predicate returns a truthy value for any byte. |
sort(compareFn?: (arg0: number, arg1: number) => number): Uint8Array |
Sorts bytes in place via compareFn(a, b). |
subarray(start?: number, end?: number): Uint8Array |
Deep-copy alias for slice under v1 (no ArrayBuffer view sharing). |
toBase64(options?: Base64Options): string |
Returns the bytes as a base64 string. |
toHex(): string |
Returns the bytes as a lowercase hex string. |
toJson(): string |
Returns this array’s bytes as a standard (padded) base64 string wrapped in "…" (the JSON string form). |
toReversed(): Uint8Array |
Returns a fresh copy with bytes reversed. |
toSorted(compareFn?: (arg0: number, arg1: number) => number): Uint8Array |
Returns a fresh copy sorted via compareFn. |
toString(): string |
Returns this array’s bytes joined as a comma-separated decimal string — e.g. new Uint8Array([1, 2, 3]).toString() === "1,2,3". |
values(): Iterator<number> |
Returns a live Iterator<number> of the bytes; writes during iteration are seen. |
with(index: number, value: number): Uint8Array |
Returns a clone of this array with value converted to a byte and written at index. |
| Constant | Description |
|---|---|
Uint8Array: Uint8ArrayConstructor |
Uint8ArrayConstructor
Section titled “Uint8ArrayConstructor”Constructor object for Uint8Array.
| Member | Description |
|---|---|
readonly BYTES_PER_ELEMENT: number |
The size in bytes of each element: always 1. |
new (values?: number | number[]): Uint8Array |
Build a new Uint8Array. |
alloc(n: number): Uint8Array |
Allocate a zero-filled Uint8Array of length n. |
fromArray(values: number[]): Uint8Array |
Build a new Uint8Array from values — canonical name for new Uint8Array(values). |
fromBase64(s: string, options?: Base64Options): Uint8Array |
Decode s as base64; options.alphabet picks standard vs URL-safe. |
fromBytes(other: Uint8Array): Uint8Array |
Returns a deep copy of other. |
fromHex(s: string): Uint8Array |
Decode s as a hex string. |
of(...values: number[]): Uint8Array |
Build a Uint8Array from the supplied byte values — Uint8Array.of(1, 2, 3). |
Uncapitalize
Section titled “Uncapitalize”Uncapitalize
Section titled “Uncapitalize”Convert first character of string literal type to lowercase.
type Uncapitalize<S extends string> = intrinsic;Uppercase
Section titled “Uppercase”Uppercase
Section titled “Uppercase”Convert string literal type to uppercase.
type Uppercase<S extends string> = intrinsic;The JSON value.
| Member | Description |
|---|---|
parse(text: string): unknown |
Parse a JSON string as unknown; use JSON.parse(s) as T to validate a target type. |
stringify(value: unknown, replacer?: null, space?: number | string | null): string |
Serialize a value to a JSON string. |
| Function | Capability | Description |
|---|---|---|
abs(x: number): number |
||
acos(x: number): number |
||
acosh(x: number): number |
||
asin(x: number): number |
||
asinh(x: number): number |
||
atan(x: number): number |
||
atan2(y: number, x: number): number |
||
atanh(x: number): number |
||
cbrt(x: number): number |
||
ceil(x: number): number |
||
clz32(x: number): number |
||
cos(x: number): number |
||
cosh(x: number): number |
||
exp(x: number): number |
||
expm1(x: number): number |
||
floor(x: number): number |
||
fround(x: number): number |
||
hypot(...values: number[]): number |
||
imul(a: number, b: number): number |
||
log(x: number): number |
||
log10(x: number): number |
||
log1p(x: number): number |
||
log2(x: number): number |
||
max(...values: number[]): number |
||
min(...values: number[]): number |
||
pow(base: number, exponent: number): number |
||
random(): number |
Pseudo-random number in [0, 1). |
|
round(x: number): number |
||
sign(x: number): number |
||
sin(x: number): number |
||
sinh(x: number): number |
||
sqrt(x: number): number |
||
tan(x: number): number |
||
tanh(x: number): number |
||
trunc(x: number): number |
| Constant | Description |
|---|---|
E: number |
|
LN10: number |
|
LN2: number |
|
LOG10E: number |
|
LOG2E: number |
|
PI: number |
|
SQRT1_2: number |
|
SQRT2: number |
Temporal
Section titled “Temporal”| Constant | Description |
|---|---|
Duration: Temporal.DurationConstructor |
The Temporal.Duration constructor. |
Instant: Temporal.InstantConstructor |
The Temporal.Instant constructor. |
PlainDate: Temporal.PlainDateConstructor |
A calendar date (year, month, day) with no time or time zone. |
PlainDateTime: Temporal.PlainDateTimeConstructor |
A calendar date and wall-clock time with no time zone. |
PlainMonthDay: Temporal.PlainMonthDayConstructor |
A calendar month and day with no year or time zone (e.g. 06-07). |
PlainTime: Temporal.PlainTimeConstructor |
A wall-clock time (hour, minute, second, nanosecond) with no date or time zone. |
PlainYearMonth: Temporal.PlainYearMonthConstructor |
A calendar year and month with no day or time zone (e.g. 2026-06). |
ZonedDateTime: Temporal.ZonedDateTimeConstructor |
The Temporal.ZonedDateTime constructor. |
Temporal.Duration
Section titled “Temporal.Duration”A span of time, expressed as separate calendar (years/months/weeks/days) and time (hours/…/nanoseconds) unit slots.
| Member | Description |
|---|---|
readonly blank: boolean |
true when every slot is 0 (the Duration is empty / sign === 0). |
readonly days: number |
Calendar-days slot. |
readonly hours: number |
Hours slot. |
readonly microseconds: number |
Microseconds slot. |
readonly milliseconds: number |
Milliseconds slot. |
readonly minutes: number |
Minutes slot. |
readonly months: number |
Calendar-months slot. |
readonly nanoseconds: number |
Nanoseconds slot. |
readonly seconds: number |
Seconds slot. |
readonly sign: number |
-1, 0, or 1: the Duration’s overall direction (every slot shares this sign). |
readonly weeks: number |
Calendar-weeks slot. |
readonly years: number |
Calendar-years slot. |
abs(): Temporal.Duration |
Returns a Duration with every slot’s absolute value (a non-negative Duration). |
add(d: string | Temporal.Duration | Temporal.DurationFields): Temporal.Duration |
Returns this + d as a new Duration. |
negated(): Temporal.Duration |
Returns a Duration with every field’s sign flipped. |
round(roundTo: string | Temporal.DurationRoundOptions): Temporal.Duration |
Rounds this Duration — round("hour") (smallestUnit shorthand) or round({ smallestUnit, largestUnit, roundingMode, roundingIncrement, relativeTo }). |
subtract(d: string | Temporal.Duration | Temporal.DurationFields): Temporal.Duration |
Returns this - d as a new Duration. |
toJSON(): string |
Returns the ISO string form used by JSON.stringify. |
toString(options?: Temporal.DurationToStringOptions): string |
Returns the ISO 8601 duration form (e.g. "PT1H30M"), optionally rounded/formatted. |
total(totalOf: string | Temporal.DurationTotalOptions): number |
Total length of this Duration in a unit — total("hours") or total({ unit, relativeTo }). |
with(fields: Temporal.Duration | Temporal.DurationFields): Temporal.Duration |
Returns a copy of this Duration with the given slots replaced (e.g. d.with({ hours: 5 })); unlisted slots are kept. |
Temporal.DurationCompareOptions
Section titled “Temporal.DurationCompareOptions”Options for Temporal.Duration.compare(...).
| Member | Description |
|---|---|
readonly relativeTo?: string | { calendar?: string; day: number; era?: string; eraYear?: number; hour?: number; microsecond?: number; millisecond?: number; minute?: number; month?: number; monthCode?: string; nanosecond?: number; offset?: string; second?: number; timeZone: string | Temporal.ZonedDateTime; year?: number } | { calendar?: string; day: number; era?: string; eraYear?: number; month?: number; monthCode?: string; year?: number } | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime |
Anchor (PlainDate or ZonedDateTime) — required to compare calendar durations. |
Temporal.DurationConstructor
Section titled “Temporal.DurationConstructor”Constructor object for Temporal.Duration.
| Member | Description |
|---|---|
new (fields: Temporal.DurationFields): Temporal.Duration |
Construct a Duration from a fields bag (e.g. { hours: 1, minutes: 30 }). |
compare(a: string | Temporal.Duration | Temporal.DurationFields, b: string | Temporal.Duration | Temporal.DurationFields, options?: Temporal.DurationCompareOptions): number |
Compares two Durations: -1, 0, or 1. |
from(item: string | Temporal.Duration | Temporal.DurationFields): Temporal.Duration |
Build a Duration from an ISO 8601 string (e.g. "PT1H30M"), an existing Duration, or a fields bag ({ hours: 1 }). |
fromJson(value: unknown): Temporal.Duration |
Construct from an already parsed JSON value, using the same conversion as from. |
Temporal.DurationFields
Section titled “Temporal.DurationFields”Options bag for new Temporal.Duration({...}).
| Member | Description |
|---|---|
readonly days?: number |
Calendar days. |
readonly hours?: number |
Hours. |
readonly microseconds?: number |
Microseconds. |
readonly milliseconds?: number |
Milliseconds. |
readonly minutes?: number |
Minutes. |
readonly months?: number |
Calendar months. |
readonly nanoseconds?: number |
Nanoseconds. |
readonly seconds?: number |
Seconds. |
readonly weeks?: number |
Calendar weeks (7 days each). |
readonly years?: number |
Calendar years. |
Temporal.DurationRoundOptions
Section titled “Temporal.DurationRoundOptions”Options for Temporal.Duration.round(...).
| Member | Description |
|---|---|
readonly largestUnit?: string |
Largest unit to balance into (e.g. "hour"). |
readonly relativeTo?: string | { calendar?: string; day: number; era?: string; eraYear?: number; hour?: number; microsecond?: number; millisecond?: number; minute?: number; month?: number; monthCode?: string; nanosecond?: number; offset?: string; second?: number; timeZone: string | Temporal.ZonedDateTime; year?: number } | { calendar?: string; day: number; era?: string; eraYear?: number; month?: number; monthCode?: string; year?: number } | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime |
Anchor (PlainDate or ZonedDateTime) — required to round calendar units. |
readonly roundingIncrement?: number |
Round to a multiple of this increment (default 1). |
readonly roundingMode?: string |
"halfExpand" (default), "ceil", "floor", "trunc", "halfEven", … |
readonly smallestUnit?: string |
Smallest unit to keep (e.g. "second"). |
Temporal.DurationToStringOptions
Section titled “Temporal.DurationToStringOptions”Options for Temporal.Duration.prototype.toString(...).
| Member | Description |
|---|---|
readonly fractionalSecondDigits?: number |
Exact fractional second digits to print, from 0 through 9. |
readonly roundingMode?: string |
"trunc" (default), "ceil", "floor", "halfExpand", … |
readonly smallestUnit?: string |
Smallest unit to keep while formatting. |
Temporal.DurationTotalOptions
Section titled “Temporal.DurationTotalOptions”Options for Temporal.Duration.prototype.total(...).
| Member | Description |
|---|---|
readonly relativeTo?: string | { calendar?: string; day: number; era?: string; eraYear?: number; hour?: number; microsecond?: number; millisecond?: number; minute?: number; month?: number; monthCode?: string; nanosecond?: number; offset?: string; second?: number; timeZone: string | Temporal.ZonedDateTime; year?: number } | { calendar?: string; day: number; era?: string; eraYear?: number; month?: number; monthCode?: string; year?: number } | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime |
Anchor (PlainDate or ZonedDateTime) — required for calendar units. |
readonly unit: string |
The unit to total into (e.g. "hours", "days"). |
Temporal.Instant
Section titled “Temporal.Instant”A point in time, to nanosecond precision.
| Member | Description |
|---|---|
readonly epochMilliseconds: number |
Milliseconds since the Unix epoch (1970-01-01T00:00:00Z). |
readonly epochNanoseconds: bigint |
Nanoseconds since the Unix epoch as a bigint (full precision). |
add(d: string | Temporal.Duration | Temporal.DurationFields): Temporal.Instant |
Returns a new Instant d later. |
equals(other: string | Temporal.Instant | Temporal.ZonedDateTime): boolean |
true if this and other refer to the same instant. |
round(roundTo: string | Temporal.InstantRoundOptions): Temporal.Instant |
Rounds this Instant to the requested time unit and increment. |
since(other: string | Temporal.Instant | Temporal.ZonedDateTime, options?: Temporal.SinceUntilOptions): Temporal.Duration |
Returns the Duration from other to this (positive if this is later). |
subtract(d: string | Temporal.Duration | Temporal.DurationFields): Temporal.Instant |
Returns a new Instant d earlier. |
toJSON(): string |
Returns the ISO string form used by JSON.stringify. |
toString(): string |
Returns the ISO 8601 representation (e.g. "2024-03-09T15:30:45.123Z"). |
toZonedDateTimeISO(tz: string | Temporal.ZonedDateTime): Temporal.ZonedDateTime |
Project this Instant onto the IANA time zone tz. |
until(other: string | Temporal.Instant | Temporal.ZonedDateTime, options?: Temporal.SinceUntilOptions): Temporal.Duration |
Returns the Duration from this to other (positive if other is later). |
Temporal.InstantConstructor
Section titled “Temporal.InstantConstructor”Constructor object for Temporal.Instant.
| Member | Description |
|---|---|
compare(a: string | Temporal.Instant | Temporal.ZonedDateTime, b: string | Temporal.Instant | Temporal.ZonedDateTime): number |
Orders two Instants: -1, 0, or 1. |
from(item: string | Temporal.Instant | Temporal.ZonedDateTime): Temporal.Instant |
Parse an ISO 8601 instant string (e.g. "2024-03-09T15:30:45.123Z"). |
fromEpochMilliseconds(ms: number): Temporal.Instant |
Construct an Instant from milliseconds since the Unix epoch. |
fromEpochNanoseconds(ns: bigint): Temporal.Instant |
Construct an Instant from nanoseconds since the Unix epoch (full precision). |
fromJson(value: unknown): Temporal.Instant |
Construct from an already parsed JSON value, using the same conversion as from. |
Temporal.InstantRoundOptions
Section titled “Temporal.InstantRoundOptions”Options for Temporal.Instant.round(...).
| Member | Description |
|---|---|
readonly roundingIncrement?: number |
Positive increment of smallestUnit; defaults to 1. |
readonly roundingMode?: string |
Rounding mode; defaults to "halfExpand". |
readonly smallestUnit: string |
Smallest time unit to retain, from hour through nanosecond. |
Temporal.PlainDate
Section titled “Temporal.PlainDate”A calendar date (year, month, day) with no time or time zone.
| Member | Description |
|---|---|
readonly day: number |
Day of the month (1–31). |
readonly dayOfWeek: number |
Day of the week, 1 (Monday) through 7 (Sunday). |
readonly dayOfYear: number |
Day of the year (1–365 or 366). |
readonly daysInMonth: number |
Days in this month. |
readonly daysInWeek: number |
Days in this ISO week. |
readonly daysInYear: number |
Days in this year. |
readonly inLeapYear: boolean |
True when the ISO calendar year is a leap year. |
readonly month: number |
Calendar month (1–12). |
readonly monthCode: string |
ISO month code, e.g. "M06". |
readonly monthsInYear: number |
Months in this year. |
readonly weekOfYear: number |
ISO week number. |
readonly year: number |
Calendar year. |
readonly yearOfWeek: number |
ISO week-numbering year. |
add(duration: string | Temporal.Duration | Temporal.DurationFields): Temporal.PlainDate |
Returns a new value with duration added. |
equals(other: string | { calendar?: string; day: number; era?: string; eraYear?: number; month?: number; monthCode?: string; year?: number } | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime): boolean |
true if this and other denote the same value. |
since(other: string | { calendar?: string; day: number; era?: string; eraYear?: number; month?: number; monthCode?: string; year?: number } | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime, options?: Temporal.SinceUntilOptions): Temporal.Duration |
The Duration from other since which this occurs. |
subtract(duration: string | Temporal.Duration | Temporal.DurationFields): Temporal.PlainDate |
Returns a new value with duration subtracted. |
toJSON(): string |
Returns the ISO string form used by JSON.stringify. |
toPlainDateTime(time?: string | { hour?: number; microsecond?: number; millisecond?: number; minute?: number; nanosecond?: number; second?: number } | Temporal.PlainDateTime | Temporal.PlainTime | Temporal.ZonedDateTime): Temporal.PlainDateTime |
Combines this date with time (default midnight) into a PlainDateTime. |
toPlainMonthDay(): Temporal.PlainMonthDay |
The month-and-day part as a PlainMonthDay. |
toPlainYearMonth(): Temporal.PlainYearMonth |
The year-and-month part as a PlainYearMonth. |
toString(): string |
The ISO 8601 string form. |
toZonedDateTime(timeZoneOrOptions: string | Temporal.ZonedDateTime | Temporal.PlainDateToZonedOptions): Temporal.ZonedDateTime |
Interprets this date in a time zone — pass a zone id (midnight) or `{ timeZone, plainTime? |
until(other: string | { calendar?: string; day: number; era?: string; eraYear?: number; month?: number; monthCode?: string; year?: number } | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime, options?: Temporal.SinceUntilOptions): Temporal.Duration |
The Duration from this until other. |
with(fields: Temporal.PlainDateFields): Temporal.PlainDate |
Returns a copy with the listed fields replaced; unlisted fields are kept. |
Temporal.PlainDateConstructor
Section titled “Temporal.PlainDateConstructor”Constructor object, accessed via the Temporal binding.
| Member | Description |
|---|---|
compare(a: string | { calendar?: string; day: number; era?: string; eraYear?: number; month?: number; monthCode?: string; year?: number } | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime, b: string | { calendar?: string; day: number; era?: string; eraYear?: number; month?: number; monthCode?: string; year?: number } | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime): number |
Orders two values: -1, 0, or 1. |
from(item: string | { calendar?: string; day: number; era?: string; eraYear?: number; month?: number; monthCode?: string; year?: number } | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime, options?: { overflow?: "constrain" | "reject" }): Temporal.PlainDate |
Convert a Temporal value, ISO string, or ISO fields bag. |
fromJson(value: unknown): Temporal.PlainDate |
Construct from an already parsed JSON value, using the same conversion as from. |
Temporal.PlainDateFields
Section titled “Temporal.PlainDateFields”Partial fields bag for with(...).
| Member | Description |
|---|---|
readonly day?: number |
Optional field; omitted fields keep the receiver’s value. |
readonly month?: number |
Optional field; omitted fields keep the receiver’s value. |
readonly year?: number |
Optional field; omitted fields keep the receiver’s value. |
Temporal.PlainDateTime
Section titled “Temporal.PlainDateTime”A calendar date and wall-clock time with no time zone.
| Member | Description |
|---|---|
readonly day: number |
Day of the month (1–31). |
readonly dayOfWeek: number |
Day of the week, 1 (Monday) through 7 (Sunday). |
readonly dayOfYear: number |
Day of the year (1–365 or 366). |
readonly daysInMonth: number |
Days in this month. |
readonly daysInWeek: number |
Days in this ISO week. |
readonly daysInYear: number |
Days in this year. |
readonly hour: number |
Hour of the day (0–23). |
readonly inLeapYear: boolean |
True when the ISO calendar year is a leap year. |
readonly microsecond: number |
Microsecond within the millisecond (0–999). |
readonly millisecond: number |
Millisecond within the second (0–999). |
readonly minute: number |
Minute of the hour (0–59). |
readonly month: number |
Calendar month (1–12). |
readonly monthCode: string |
ISO month code, e.g. "M06". |
readonly monthsInYear: number |
Months in this year. |
readonly nanosecond: number |
Nanoseconds within the second (0–999_999_999). |
readonly second: number |
Second of the minute (0–59). |
readonly weekOfYear: number |
ISO week number. |
readonly year: number |
Calendar year. |
readonly yearOfWeek: number |
ISO week-numbering year. |
add(duration: string | Temporal.Duration | Temporal.DurationFields): Temporal.PlainDateTime |
Returns a new value with duration added. |
equals(other: string | { calendar?: string; day: number; era?: string; eraYear?: number; hour?: number; microsecond?: number; millisecond?: number; minute?: number; month?: number; monthCode?: string; nanosecond?: number; second?: number; year?: number } | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime): boolean |
true if this and other denote the same value. |
since(other: string | { calendar?: string; day: number; era?: string; eraYear?: number; hour?: number; microsecond?: number; millisecond?: number; minute?: number; month?: number; monthCode?: string; nanosecond?: number; second?: number; year?: number } | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime, options?: Temporal.SinceUntilOptions): Temporal.Duration |
The Duration from other since which this occurs. |
subtract(duration: string | Temporal.Duration | Temporal.DurationFields): Temporal.PlainDateTime |
Returns a new value with duration subtracted. |
toJSON(): string |
Returns the ISO string form used by JSON.stringify. |
toPlainDate(): Temporal.PlainDate |
The calendar-date part as a PlainDate. |
toPlainMonthDay(): Temporal.PlainMonthDay |
The month-and-day part as a PlainMonthDay. |
toPlainTime(): Temporal.PlainTime |
The wall-clock-time part as a PlainTime. |
toPlainYearMonth(): Temporal.PlainYearMonth |
The year-and-month part as a PlainYearMonth. |
toString(): string |
The ISO 8601 string form. |
toZonedDateTime(timeZone: string | Temporal.ZonedDateTime): Temporal.ZonedDateTime |
Interprets this wall clock in timeZone, resolving DST gaps with compatible disambiguation. |
until(other: string | { calendar?: string; day: number; era?: string; eraYear?: number; hour?: number; microsecond?: number; millisecond?: number; minute?: number; month?: number; monthCode?: string; nanosecond?: number; second?: number; year?: number } | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime, options?: Temporal.SinceUntilOptions): Temporal.Duration |
The Duration from this until other. |
with(fields: Temporal.PlainDateTimeFields): Temporal.PlainDateTime |
Returns a copy with the listed fields replaced; unlisted fields are kept. |
Temporal.PlainDateTimeConstructor
Section titled “Temporal.PlainDateTimeConstructor”Constructor object, accessed via the Temporal binding.
| Member | Description |
|---|---|
compare(a: string | { calendar?: string; day: number; era?: string; eraYear?: number; hour?: number; microsecond?: number; millisecond?: number; minute?: number; month?: number; monthCode?: string; nanosecond?: number; second?: number; year?: number } | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime, b: string | { calendar?: string; day: number; era?: string; eraYear?: number; hour?: number; microsecond?: number; millisecond?: number; minute?: number; month?: number; monthCode?: string; nanosecond?: number; second?: number; year?: number } | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime): number |
Orders two values: -1, 0, or 1. |
from(item: string | { calendar?: string; day: number; era?: string; eraYear?: number; hour?: number; microsecond?: number; millisecond?: number; minute?: number; month?: number; monthCode?: string; nanosecond?: number; second?: number; year?: number } | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime, options?: { overflow?: "constrain" | "reject" }): Temporal.PlainDateTime |
Convert a Temporal value, ISO string, or ISO fields bag. |
fromJson(value: unknown): Temporal.PlainDateTime |
Construct from an already parsed JSON value, using the same conversion as from. |
Temporal.PlainDateTimeFields
Section titled “Temporal.PlainDateTimeFields”Partial fields bag for with(...).
| Member | Description |
|---|---|
readonly day?: number |
Optional field; omitted fields keep the receiver’s value. |
readonly hour?: number |
Optional field; omitted fields keep the receiver’s value. |
readonly microsecond?: number |
Optional field; omitted fields keep the receiver’s value. |
readonly millisecond?: number |
Optional field; omitted fields keep the receiver’s value. |
readonly minute?: number |
Optional field; omitted fields keep the receiver’s value. |
readonly month?: number |
Optional field; omitted fields keep the receiver’s value. |
readonly nanosecond?: number |
Optional field; omitted fields keep the receiver’s value. |
readonly second?: number |
Optional field; omitted fields keep the receiver’s value. |
readonly year?: number |
Optional field; omitted fields keep the receiver’s value. |
Temporal.PlainDateToZonedOptions
Section titled “Temporal.PlainDateToZonedOptions”Options for PlainDate.toZonedDateTime.
| Member | Description |
|---|---|
readonly plainTime?: string | { hour?: number; microsecond?: number; millisecond?: number; minute?: number; nanosecond?: number; second?: number } | Temporal.PlainDateTime | Temporal.PlainTime | Temporal.ZonedDateTime |
Wall-clock time; defaults to midnight when omitted. |
readonly timeZone: string | Temporal.ZonedDateTime |
IANA time-zone id (e.g. "America/New_York"). |
Temporal.PlainMonthDay
Section titled “Temporal.PlainMonthDay”A calendar month and day with no year or time zone (e.g. 06-07).
| Member | Description |
|---|---|
readonly day: number |
Day of the month (1–31). |
readonly month: number |
Calendar month (1–12). |
readonly monthCode: string |
ISO month code, e.g. "M06". |
equals(other: string | { calendar?: string; day: number; era?: string; eraYear?: number; month?: number; monthCode?: string; year?: number } | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.PlainMonthDay | Temporal.ZonedDateTime): boolean |
true if this and other denote the same value. |
toJSON(): string |
Returns the ISO string form used by JSON.stringify. |
toPlainDate(fields: Temporal.PlainMonthDayToDateFields): Temporal.PlainDate |
Adds a year to make a PlainDate; a Feb-29 month-day constrains to Feb-28 in a non-leap year. |
toString(): string |
The ISO 8601 string form. |
with(fields: Temporal.PlainMonthDayFields): Temporal.PlainMonthDay |
Returns a copy with the listed fields replaced; unlisted fields are kept. |
Temporal.PlainMonthDayConstructor
Section titled “Temporal.PlainMonthDayConstructor”Constructor object, accessed via the Temporal binding.
| Member | Description |
|---|---|
from(item: string | { calendar?: string; day: number; era?: string; eraYear?: number; month?: number; monthCode?: string; year?: number } | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.PlainMonthDay | Temporal.ZonedDateTime, options?: { overflow?: "constrain" | "reject" }): Temporal.PlainMonthDay |
Convert a Temporal value, ISO string, or ISO fields bag. |
fromJson(value: unknown): Temporal.PlainMonthDay |
Construct from an already parsed JSON value, using the same conversion as from. |
Temporal.PlainMonthDayFields
Section titled “Temporal.PlainMonthDayFields”Partial fields bag for with(...).
| Member | Description |
|---|---|
readonly day?: number |
Optional field; omitted fields keep the receiver’s value. |
readonly month?: number |
Optional field; omitted fields keep the receiver’s value. |
Temporal.PlainMonthDayToDateFields
Section titled “Temporal.PlainMonthDayToDateFields”The field that completes this value into a PlainDate.
| Member | Description |
|---|---|
readonly year: number |
Calendar year; a Feb-29 month-day constrains to Feb-28 in a non-leap year. |
Temporal.PlainTime
Section titled “Temporal.PlainTime”A wall-clock time (hour, minute, second, nanosecond) with no date or time zone.
| Member | Description |
|---|---|
readonly hour: number |
Hour of the day (0–23). |
readonly microsecond: number |
Microsecond within the millisecond (0–999). |
readonly millisecond: number |
Millisecond within the second (0–999). |
readonly minute: number |
Minute of the hour (0–59). |
readonly nanosecond: number |
Nanoseconds within the second (0–999_999_999). |
readonly second: number |
Second of the minute (0–59). |
add(duration: string | Temporal.Duration | Temporal.DurationFields): Temporal.PlainTime |
Returns a new value with duration added. |
equals(other: string | { hour?: number; microsecond?: number; millisecond?: number; minute?: number; nanosecond?: number; second?: number } | Temporal.PlainDateTime | Temporal.PlainTime | Temporal.ZonedDateTime): boolean |
true if this and other denote the same value. |
since(other: string | { hour?: number; microsecond?: number; millisecond?: number; minute?: number; nanosecond?: number; second?: number } | Temporal.PlainDateTime | Temporal.PlainTime | Temporal.ZonedDateTime, options?: Temporal.SinceUntilOptions): Temporal.Duration |
The Duration from other since which this occurs. |
subtract(duration: string | Temporal.Duration | Temporal.DurationFields): Temporal.PlainTime |
Returns a new value with duration subtracted. |
toJSON(): string |
Returns the ISO string form used by JSON.stringify. |
toString(): string |
The ISO 8601 string form. |
until(other: string | { hour?: number; microsecond?: number; millisecond?: number; minute?: number; nanosecond?: number; second?: number } | Temporal.PlainDateTime | Temporal.PlainTime | Temporal.ZonedDateTime, options?: Temporal.SinceUntilOptions): Temporal.Duration |
The Duration from this until other. |
with(fields: Temporal.PlainTimeFields): Temporal.PlainTime |
Returns a copy with the listed fields replaced; unlisted fields are kept. |
Temporal.PlainTimeConstructor
Section titled “Temporal.PlainTimeConstructor”Constructor object, accessed via the Temporal binding.
| Member | Description |
|---|---|
compare(a: string | { hour?: number; microsecond?: number; millisecond?: number; minute?: number; nanosecond?: number; second?: number } | Temporal.PlainDateTime | Temporal.PlainTime | Temporal.ZonedDateTime, b: string | { hour?: number; microsecond?: number; millisecond?: number; minute?: number; nanosecond?: number; second?: number } | Temporal.PlainDateTime | Temporal.PlainTime | Temporal.ZonedDateTime): number |
Orders two values: -1, 0, or 1. |
from(item: string | { hour?: number; microsecond?: number; millisecond?: number; minute?: number; nanosecond?: number; second?: number } | Temporal.PlainDateTime | Temporal.PlainTime | Temporal.ZonedDateTime, options?: { overflow?: "constrain" | "reject" }): Temporal.PlainTime |
Convert a Temporal value, ISO string, or ISO fields bag. |
fromJson(value: unknown): Temporal.PlainTime |
Construct from an already parsed JSON value, using the same conversion as from. |
Temporal.PlainTimeFields
Section titled “Temporal.PlainTimeFields”Partial fields bag for with(...).
| Member | Description |
|---|---|
readonly hour?: number |
Optional field; omitted fields keep the receiver’s value. |
readonly microsecond?: number |
Optional field; omitted fields keep the receiver’s value. |
readonly millisecond?: number |
Optional field; omitted fields keep the receiver’s value. |
readonly minute?: number |
Optional field; omitted fields keep the receiver’s value. |
readonly nanosecond?: number |
Optional field; omitted fields keep the receiver’s value. |
readonly second?: number |
Optional field; omitted fields keep the receiver’s value. |
Temporal.PlainYearMonth
Section titled “Temporal.PlainYearMonth”A calendar year and month with no day or time zone (e.g. 2026-06).
| Member | Description |
|---|---|
readonly daysInMonth: number |
Days in this month. |
readonly daysInYear: number |
Days in this year. |
readonly inLeapYear: boolean |
True when the ISO calendar year is a leap year. |
readonly month: number |
Calendar month (1–12). |
readonly monthCode: string |
ISO month code, e.g. "M06". |
readonly monthsInYear: number |
Months in this year. |
readonly year: number |
Calendar year. |
add(duration: string | Temporal.Duration | Temporal.DurationFields): Temporal.PlainYearMonth |
Returns a new value with duration added. |
equals(other: string | { calendar?: string; era?: string; eraYear?: number; month?: number; monthCode?: string; year?: number } | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.PlainYearMonth | Temporal.ZonedDateTime): boolean |
true if this and other denote the same value. |
since(other: string | { calendar?: string; era?: string; eraYear?: number; month?: number; monthCode?: string; year?: number } | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.PlainYearMonth | Temporal.ZonedDateTime, options?: Temporal.SinceUntilOptions): Temporal.Duration |
The Duration from other since which this occurs. |
subtract(duration: string | Temporal.Duration | Temporal.DurationFields): Temporal.PlainYearMonth |
Returns a new value with duration subtracted. |
toJSON(): string |
Returns the ISO string form used by JSON.stringify. |
toPlainDate(fields: Temporal.PlainYearMonthToDateFields): Temporal.PlainDate |
Adds a day to make a PlainDate; the day constrains to the month length. |
toString(): string |
The ISO 8601 string form. |
until(other: string | { calendar?: string; era?: string; eraYear?: number; month?: number; monthCode?: string; year?: number } | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.PlainYearMonth | Temporal.ZonedDateTime, options?: Temporal.SinceUntilOptions): Temporal.Duration |
The Duration from this until other. |
with(fields: Temporal.PlainYearMonthFields): Temporal.PlainYearMonth |
Returns a copy with the listed fields replaced; unlisted fields are kept. |
Temporal.PlainYearMonthConstructor
Section titled “Temporal.PlainYearMonthConstructor”Constructor object, accessed via the Temporal binding.
| Member | Description |
|---|---|
compare(a: string | { calendar?: string; era?: string; eraYear?: number; month?: number; monthCode?: string; year?: number } | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.PlainYearMonth | Temporal.ZonedDateTime, b: string | { calendar?: string; era?: string; eraYear?: number; month?: number; monthCode?: string; year?: number } | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.PlainYearMonth | Temporal.ZonedDateTime): number |
Orders two values: -1, 0, or 1. |
from(item: string | { calendar?: string; era?: string; eraYear?: number; month?: number; monthCode?: string; year?: number } | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.PlainYearMonth | Temporal.ZonedDateTime, options?: { overflow?: "constrain" | "reject" }): Temporal.PlainYearMonth |
Convert a Temporal value, ISO string, or ISO fields bag. |
fromJson(value: unknown): Temporal.PlainYearMonth |
Construct from an already parsed JSON value, using the same conversion as from. |
Temporal.PlainYearMonthFields
Section titled “Temporal.PlainYearMonthFields”Partial fields bag for with(...).
| Member | Description |
|---|---|
readonly month?: number |
Optional field; omitted fields keep the receiver’s value. |
readonly year?: number |
Optional field; omitted fields keep the receiver’s value. |
Temporal.PlainYearMonthToDateFields
Section titled “Temporal.PlainYearMonthToDateFields”The field that completes this value into a PlainDate.
| Member | Description |
|---|---|
readonly day: number |
Day of the month (1–31); constrained to the month length. |
Temporal.SinceUntilOptions
Section titled “Temporal.SinceUntilOptions”Options for until/since on every Temporal type.
| Member | Description |
|---|---|
readonly largestUnit?: string |
Largest unit to balance into (e.g. "hours", "months"). |
readonly roundingIncrement?: number |
Round to a multiple of this increment of smallestUnit (default 1). |
readonly roundingMode?: string |
"halfExpand" (default), "ceil", "floor", "trunc", "halfEven", … |
readonly smallestUnit?: string |
Smallest unit to keep; the result is rounded to it. |
Temporal.ZonedDateTime
Section titled “Temporal.ZonedDateTime”An Instant paired with an IANA time zone.
| Member | Description |
|---|---|
readonly day: number |
Day of the month (1–31). |
readonly dayOfWeek: number |
Day of the week, 1 (Monday) through 7 (Sunday). |
readonly dayOfYear: number |
Day of the year (1–365 or 366). |
readonly daysInMonth: number |
Days in this month. |
readonly daysInWeek: number |
Days in this ISO week. |
readonly daysInYear: number |
Days in this year. |
readonly epochMilliseconds: number |
Milliseconds since the Unix epoch (timezone-independent). |
readonly epochNanoseconds: bigint |
Nanoseconds since the Unix epoch. |
readonly hour: number |
Hour of the day (0–23). |
readonly hoursInDay: number |
Elapsed hours in this local day, accounting for time-zone transitions. |
readonly inLeapYear: boolean |
True when the ISO calendar year is a leap year. |
readonly microsecond: number |
Microsecond within the millisecond (0–999). |
readonly millisecond: number |
Millisecond within the second (0–999). |
readonly minute: number |
Minute of the hour (0–59). |
readonly month: number |
Calendar month (1–12). |
readonly monthCode: string |
ISO month code, e.g. "M06". |
readonly monthsInYear: number |
Months in this year. |
readonly nanosecond: number |
Nanosecond within the microsecond (0–999). |
readonly offset: string |
UTC offset at this instant, such as "-05:00". |
readonly offsetNanoseconds: number |
UTC offset at this instant in nanoseconds. |
readonly second: number |
Second of the minute (0–59 or 60 on a leap-second). |
readonly timeZoneId: string |
The IANA time-zone id (e.g. "America/New_York"). |
readonly weekOfYear: number |
ISO week number. |
readonly year: number |
Calendar year in this time zone. |
readonly yearOfWeek: number |
ISO week-numbering year. |
add(d: string | Temporal.Duration | Temporal.DurationFields): Temporal.ZonedDateTime |
Returns a new ZonedDateTime d later. |
equals(other: string | { calendar?: string; day: number; era?: string; eraYear?: number; hour?: number; microsecond?: number; millisecond?: number; minute?: number; month?: number; monthCode?: string; nanosecond?: number; offset?: string; second?: number; timeZone: string | Temporal.ZonedDateTime; year?: number } | Temporal.ZonedDateTime): boolean |
true if this and other have the same instant and the same time-zone id. |
round(roundTo: string | Temporal.ZonedDateTimeRoundOptions): Temporal.ZonedDateTime |
Rounds this ZonedDateTime in its time zone, from day through nanosecond precision. |
since(other: string | { calendar?: string; day: number; era?: string; eraYear?: number; hour?: number; microsecond?: number; millisecond?: number; minute?: number; month?: number; monthCode?: string; nanosecond?: number; offset?: string; second?: number; timeZone: string | Temporal.ZonedDateTime; year?: number } | Temporal.ZonedDateTime, options?: Temporal.SinceUntilOptions): Temporal.Duration |
Returns the calendar-aware Duration from other to this. |
startOfDay(): Temporal.ZonedDateTime |
Returns the first valid instant on this date in the current time zone. |
subtract(d: string | Temporal.Duration | Temporal.DurationFields): Temporal.ZonedDateTime |
Returns a new ZonedDateTime d earlier. |
toInstant(): Temporal.Instant |
Drops the time-zone, returns the underlying Instant. |
toJSON(): string |
Returns the ISO string form used by JSON.stringify. |
toPlainDate(): Temporal.PlainDate |
The wall-clock calendar date in this time zone, as a tz-free PlainDate. |
toPlainDateTime(): Temporal.PlainDateTime |
The wall-clock date and time in this time zone, as a tz-free PlainDateTime. |
toPlainTime(): Temporal.PlainTime |
The wall-clock time in this time zone, as a tz-free PlainTime (with nanosecond precision). |
toString(): string |
Returns the ISO 8601 form with bracketed tz (e.g. "2024-03-09T12:00:00+00:00[UTC]"). |
until(other: string | { calendar?: string; day: number; era?: string; eraYear?: number; hour?: number; microsecond?: number; millisecond?: number; minute?: number; month?: number; monthCode?: string; nanosecond?: number; offset?: string; second?: number; timeZone: string | Temporal.ZonedDateTime; year?: number } | Temporal.ZonedDateTime, options?: Temporal.SinceUntilOptions): Temporal.Duration |
Returns the calendar-aware Duration from this to other. |
with(fields: Temporal.ZonedDateTimeFields): Temporal.ZonedDateTime |
Returns a copy with the listed wall-clock fields replaced (keeping the time zone); unlisted fields are kept. |
withTimeZone(tz: string | Temporal.ZonedDateTime): Temporal.ZonedDateTime |
Same instant, different IANA time zone. |
Temporal.ZonedDateTimeConstructor
Section titled “Temporal.ZonedDateTimeConstructor”Constructor object for Temporal.ZonedDateTime.
| Member | Description |
|---|---|
compare(a: string | { calendar?: string; day: number; era?: string; eraYear?: number; hour?: number; microsecond?: number; millisecond?: number; minute?: number; month?: number; monthCode?: string; nanosecond?: number; offset?: string; second?: number; timeZone: string | Temporal.ZonedDateTime; year?: number } | Temporal.ZonedDateTime, b: string | { calendar?: string; day: number; era?: string; eraYear?: number; hour?: number; microsecond?: number; millisecond?: number; minute?: number; month?: number; monthCode?: string; nanosecond?: number; offset?: string; second?: number; timeZone: string | Temporal.ZonedDateTime; year?: number } | Temporal.ZonedDateTime): number |
Orders two ZonedDateTimes by their exact instant: -1, 0, or 1. |
from(item: string | { calendar?: string; day: number; era?: string; eraYear?: number; hour?: number; microsecond?: number; millisecond?: number; minute?: number; month?: number; monthCode?: string; nanosecond?: number; offset?: string; second?: number; timeZone: string | Temporal.ZonedDateTime; year?: number } | Temporal.ZonedDateTime, options?: { overflow?: "constrain" | "reject" }): Temporal.ZonedDateTime |
Parse an ISO 8601 zoned datetime with bracketed tz (e.g. "2026-01-15T10:00:00-05:00[America/New_York]"). |
fromJson(value: unknown): Temporal.ZonedDateTime |
Construct from an already parsed JSON value, using the same conversion as from. |
Temporal.ZonedDateTimeFields
Section titled “Temporal.ZonedDateTimeFields”Partial fields bag for with(...).
| Member | Description |
|---|---|
readonly day?: number |
Optional field; omitted fields keep the receiver’s value. |
readonly hour?: number |
Optional field; omitted fields keep the receiver’s value. |
readonly microsecond?: number |
Optional field; omitted fields keep the receiver’s value. |
readonly millisecond?: number |
Optional field; omitted fields keep the receiver’s value. |
readonly minute?: number |
Optional field; omitted fields keep the receiver’s value. |
readonly month?: number |
Optional field; omitted fields keep the receiver’s value. |
readonly nanosecond?: number |
Optional field; omitted fields keep the receiver’s value. |
readonly second?: number |
Optional field; omitted fields keep the receiver’s value. |
readonly year?: number |
Optional field; omitted fields keep the receiver’s value. |
Temporal.ZonedDateTimeRoundOptions
Section titled “Temporal.ZonedDateTimeRoundOptions”Options for Temporal.ZonedDateTime.round(...).
| Member | Description |
|---|---|
readonly roundingIncrement?: number |
Positive increment of smallestUnit; defaults to 1. |
readonly roundingMode?: string |
Rounding mode; defaults to "halfExpand". |
readonly smallestUnit: string |
Smallest wall-clock unit to retain, from day through nanosecond. |
| Function | Capability | Description |
|---|---|---|
instant(): Temporal.Instant |
The current wall-clock instant. | |
plainDateISO(tz?: string | Temporal.ZonedDateTime): Temporal.PlainDate |
Today’s date in tz, or the system (local) zone if tz is omitted / undefined. |
|
plainDateTimeISO(tz?: string | Temporal.ZonedDateTime): Temporal.PlainDateTime |
The current date and wall-clock time in tz, or the system (local) zone if tz is omitted / undefined. |
|
plainTimeISO(tz?: string | Temporal.ZonedDateTime): Temporal.PlainTime |
The current wall-clock time in tz, or the system (local) zone if tz is omitted / undefined. |
|
timeZoneId(): string |
The system IANA time-zone id (or "UTC" if the system zone can’t be detected). |
|
zonedDateTime(tz?: string | Temporal.ZonedDateTime): Temporal.ZonedDateTime |
The current ZonedDateTime in tz, or the system zone if tz is undefined. |
|
zonedDateTimeISO(tz?: string | Temporal.ZonedDateTime): Temporal.ZonedDateTime |
The current ZonedDateTime in tz, or the system zone if tz is omitted / undefined. |