import { type GCMarker } from './host-defined/engine.mts'; import { type ValueEvaluator, type PlainCompletion } from './completion.mts'; import { PropertyKeyMap } from './utils/container.mts'; import type { PrivateElementRecord } from './runtime-semantics/MethodDefinitionEvaluation.mts'; import type { PlainEvaluator } from './evaluator.mts'; import { type FunctionObject, type BuiltinFunctionObject, type ECMAScriptFunctionObject, type DefaultConstructorBuiltinFunction, EnvironmentRecord } from '#self'; declare abstract class BaseValue { static readonly null: NullValue; static readonly undefined: UndefinedValue; static readonly true: BooleanValue; static readonly false: BooleanValue; abstract type: Value['type']; static [Symbol.hasInstance]: (value: unknown) => value is Value; } /** https://tc39.es/ecma262/#sec-ecmascript-language-types */ export type Value = UndefinedValue | NullValue | BooleanValue | JSStringValue | SymbolValue | NumberValue | BigIntValue | ObjectValue; /** https://tc39.es/ecma262/#sec-ecmascript-language-types */ export declare const Value: typeof BaseValue & { (value: T): T extends null ? NullValue : T extends undefined ? UndefinedValue : T extends boolean ? BooleanValue : T extends string ? JSStringValue : T extends number ? NumberValue : T extends bigint ? BigIntValue : never; }; /** https://tc39.es/ecma262/#sec-ecmascript-language-types */ export type PropertyKeyValue = JSStringValue | SymbolValue; /** https://tc39.es/ecma262/#sec-ecmascript-language-types */ export type PrimitiveValue = UndefinedValue | NullValue | BooleanValue | JSStringValue | SymbolValue | NumberValue | BigIntValue; /** https://tc39.es/ecma262/#sec-ecmascript-language-types */ export declare const PrimitiveValue: (abstract new () => { type: Value['type']; }) & { [Symbol.hasInstance]: (value: unknown) => value is PrimitiveValue; readonly null: NullValue; readonly undefined: UndefinedValue; readonly true: BooleanValue; readonly false: BooleanValue; }; /** https://tc39.es/ecma262/#sec-ecmascript-language-types-undefined-type */ export declare class UndefinedValue extends PrimitiveValue { readonly type: 'Undefined'; readonly value: undefined; private constructor(); static [Symbol.hasInstance]: (value: unknown) => value is UndefinedValue; } /** https://tc39.es/ecma262/#sec-ecmascript-language-types-null-type */ export declare class NullValue extends PrimitiveValue { readonly type: 'Null'; readonly value: null; private constructor(); static [Symbol.hasInstance]: (value: unknown) => value is NullValue; } /** https://tc39.es/ecma262/#sec-ecmascript-language-types-boolean-type */ export declare class BooleanValue extends PrimitiveValue { readonly type: 'Boolean'; readonly value: T; private constructor(); booleanValue(): T; static [Symbol.hasInstance]: (value: unknown) => value is BooleanValue; } /** https://tc39.es/ecma262/#sec-ecmascript-language-types-string-type */ export declare class JSStringValue extends PrimitiveValue { readonly type: 'String'; readonly value: string; private constructor(); stringValue(): string; static [Symbol.hasInstance]: (value: unknown) => value is JSStringValue; } /** https://tc39.es/ecma262/#sec-ecmascript-language-types-symbol-type */ export declare class SymbolValue extends PrimitiveValue { readonly type: 'Symbol'; readonly Description: JSStringValue | UndefinedValue; constructor(Description: JSStringValue | UndefinedValue); static [Symbol.hasInstance]: (value: unknown) => value is SymbolValue; } /** https://tc39.es/ecma262/#sec-ecmascript-language-types-symbol-type */ export declare const wellKnownSymbols: { readonly asyncIterator: SymbolValue; readonly hasInstance: SymbolValue; readonly isConcatSpreadable: SymbolValue; readonly iterator: SymbolValue; readonly match: SymbolValue; readonly matchAll: SymbolValue; readonly replace: SymbolValue; readonly search: SymbolValue; readonly species: SymbolValue; readonly split: SymbolValue; readonly toPrimitive: SymbolValue; readonly toStringTag: SymbolValue; readonly unscopables: SymbolValue; }; /** https://tc39.es/ecma262/#sec-ecmascript-language-types-number-type */ export declare class NumberValue extends PrimitiveValue { readonly type: 'Number'; readonly value: number; private constructor(); numberValue(): number; isNaN(): boolean; isInfinity(): boolean; isFinite(): boolean; isIntegralNumber(): boolean; /** https://tc39.es/ecma262/#sec-numeric-types-number-unaryMinus */ static unaryMinus(x: NumberValue): NumberValue; /** https://tc39.es/ecma262/#sec-numeric-types-number-bitwiseNOT */ static bitwiseNOT(x: NumberValue): NumberValue; /** https://tc39.es/ecma262/#sec-numeric-types-number-exponentiate */ static exponentiate(base: NumberValue, exponent: NumberValue): NumberValue; /** https://tc39.es/ecma262/#sec-numeric-types-number-multiply */ static multiply(x: NumberValue, y: NumberValue): NumberValue; /** https://tc39.es/ecma262/#sec-numeric-types-number-divide */ static divide(x: NumberValue, y: NumberValue): NumberValue; /** https://tc39.es/ecma262/#sec-numeric-types-number-remainder */ static remainder(n: NumberValue, d: NumberValue): NumberValue; /** https://tc39.es/ecma262/#sec-numeric-types-number-add */ static add(x: NumberValue, y: NumberValue): NumberValue; /** https://tc39.es/ecma262/#sec-numeric-types-number-subtract */ static subtract(x: NumberValue, y: NumberValue): NumberValue; /** https://tc39.es/ecma262/#sec-numeric-types-number-leftShift */ static leftShift(x: NumberValue, y: NumberValue): NumberValue; /** https://tc39.es/ecma262/#sec-numeric-types-number-signedRightShift */ static signedRightShift(x: NumberValue, y: NumberValue): NumberValue; /** https://tc39.es/ecma262/#sec-numeric-types-number-unsignedRightShift */ static unsignedRightShift(x: NumberValue, y: NumberValue): NumberValue; /** https://tc39.es/ecma262/#sec-numeric-types-number-lessThan */ static lessThan(x: NumberValue, y: NumberValue): BooleanValue | BooleanValue | UndefinedValue; /** https://tc39.es/ecma262/#sec-numeric-types-number-equal */ static equal(x: NumberValue, y: NumberValue): BooleanValue | BooleanValue; /** https://tc39.es/ecma262/#sec-numeric-types-number-sameValue */ static sameValue(x: NumberValue, y: NumberValue): BooleanValue | BooleanValue; /** https://tc39.es/ecma262/#sec-numeric-types-number-sameValueZero */ static sameValueZero(x: NumberValue, y: NumberValue): BooleanValue | BooleanValue; /** https://tc39.es/ecma262/#sec-numeric-types-number-bitwiseAND */ static bitwiseAND(x: NumberValue, y: NumberValue): NumberValue; /** https://tc39.es/ecma262/#sec-numeric-types-number-bitwiseXOR */ static bitwiseXOR(x: NumberValue, y: NumberValue): NumberValue; /** https://tc39.es/ecma262/#sec-numeric-types-number-bitwiseOR */ static bitwiseOR(x: NumberValue, y: NumberValue): NumberValue; /** https://tc39.es/ecma262/#sec-numeric-types-number-tostring */ static toString(x: NumberValue, radix: number): JSStringValue; static readonly unit: NumberValue; static [Symbol.hasInstance]: (value: unknown) => value is NumberValue; } /** https://tc39.es/ecma262/#sec-ecmascript-language-types-bigint-type */ export declare class BigIntValue extends PrimitiveValue { readonly type: 'BigInt'; readonly value: bigint; private constructor(); bigintValue(): bigint; isNaN(): boolean; isFinite(): boolean; /** https://tc39.es/ecma262/#sec-numeric-types-bigint-unaryMinus */ static unaryMinus(x: BigIntValue): BigIntValue; /** https://tc39.es/ecma262/#sec-numeric-types-bigint-bitwiseNOT */ static bitwiseNOT(x: BigIntValue): BigIntValue; /** https://tc39.es/ecma262/#sec-numeric-types-bigint-exponentiate */ static exponentiate(base: BigIntValue, exponent: BigIntValue): BigIntValue | import("#self").ThrowCompletion; /** https://tc39.es/ecma262/#sec-numeric-types-bigint-multiply */ static multiply(x: BigIntValue, y: BigIntValue): BigIntValue; /** https://tc39.es/ecma262/#sec-numeric-types-bigint-divide */ static divide(x: BigIntValue, y: BigIntValue): BigIntValue | import("#self").ThrowCompletion; /** https://tc39.es/ecma262/#sec-numeric-types-bigint-remainder */ static remainder(n: BigIntValue, d: BigIntValue): BigIntValue | import("#self").ThrowCompletion; /** https://tc39.es/ecma262/#sec-numeric-types-bigint-add */ static add(x: BigIntValue, y: BigIntValue): BigIntValue; /** https://tc39.es/ecma262/#sec-numeric-types-bigint-subtract */ static subtract(x: BigIntValue, y: BigIntValue): BigIntValue; /** https://tc39.es/ecma262/#sec-numeric-types-bigint-leftShift */ static leftShift(x: BigIntValue, y: BigIntValue): BigIntValue; /** https://tc39.es/ecma262/#sec-numeric-types-bigint-signedRightShift */ static signedRightShift(x: BigIntValue, y: BigIntValue): BigIntValue; /** https://tc39.es/ecma262/#sec-numeric-types-bigint-unsignedRightShift */ static unsignedRightShift(_x: BigIntValue, _y: BigIntValue): import("#self").ThrowCompletion; /** https://tc39.es/ecma262/#sec-numeric-types-bigint-lessThan */ static lessThan(x: BigIntValue, y: BigIntValue): BooleanValue | BooleanValue; /** https://tc39.es/ecma262/#sec-numeric-types-bigint-equal */ static equal(x: BigIntValue, y: BigIntValue): BooleanValue | BooleanValue; /** https://tc39.es/ecma262/#sec-numeric-types-bigint-sameValue */ static sameValue(x: BigIntValue, y: BigIntValue): BooleanValue | BooleanValue; /** https://tc39.es/ecma262/#sec-numeric-types-bigint-sameValueZero */ static sameValueZero(x: BigIntValue, y: BigIntValue): BooleanValue | BooleanValue; /** https://tc39.es/ecma262/#sec-numeric-types-bigint-bitwiseAND */ static bitwiseAND(x: BigIntValue, y: BigIntValue): BigIntValue; /** https://tc39.es/ecma262/#sec-numeric-types-bigint-bitwiseXOR */ static bitwiseXOR(x: BigIntValue, y: BigIntValue): BigIntValue; /** https://tc39.es/ecma262/#sec-numeric-types-bigint-bitwiseOR */ static bitwiseOR(x: BigIntValue, y: BigIntValue): BigIntValue; /** https://tc39.es/ecma262/#sec-numeric-types-bigint-tostring */ static toString(x: BigIntValue, radix: number): JSStringValue; static readonly unit: BigIntValue; static [Symbol.hasInstance]: (value: unknown) => value is BigIntValue; } export interface ObjectInternalMethods { GetPrototypeOf(this: Self): ValueEvaluator; SetPrototypeOf(this: Self, V: ObjectValue | NullValue): ValueEvaluator; IsExtensible(this: Self): ValueEvaluator; PreventExtensions(this: Self): ValueEvaluator; GetOwnProperty(this: Self, P: PropertyKeyValue): PlainEvaluator; DefineOwnProperty(this: Self, P: PropertyKeyValue, Desc: Descriptor): ValueEvaluator; HasProperty(this: Self, P: PropertyKeyValue): ValueEvaluator; Get(this: Self, P: PropertyKeyValue, Receiver: Value): ValueEvaluator; Set(this: Self, P: PropertyKeyValue, V: Value, Receiver: Value): ValueEvaluator; Delete(this: Self, P: PropertyKeyValue): ValueEvaluator; OwnPropertyKeys(this: Self): PlainEvaluator; Call?(this: Self, thisArg: Value, args: Arguments): ValueEvaluator; Construct?(this: Self, args: Arguments, newTarget: FunctionObject | UndefinedValue): ValueEvaluator; } type ObjectSlotReturn = { [key in keyof ObjectInternalMethods]: ReturnType[key]>>; }; /** https://tc39.es/ecma262/#sec-object-type */ export declare class ObjectValue extends Value implements ObjectInternalMethods { readonly type: 'Object'; readonly properties: PropertyKeyMap; readonly internalSlotsList: readonly string[]; readonly PrivateElements: PrivateElementRecord[]; readonly ConstructedBy: (ECMAScriptFunctionObject | DefaultConstructorBuiltinFunction)[]; constructor(internalSlotsList: readonly string[]); GetPrototypeOf(): ObjectSlotReturn['GetPrototypeOf']; SetPrototypeOf(V: ObjectValue | NullValue): ObjectSlotReturn['SetPrototypeOf']; IsExtensible(): ObjectSlotReturn['IsExtensible']; PreventExtensions(): ObjectSlotReturn['PreventExtensions']; GetOwnProperty(P: PropertyKeyValue): ObjectSlotReturn['GetOwnProperty']; DefineOwnProperty(P: PropertyKeyValue, Desc: Descriptor): ObjectSlotReturn['DefineOwnProperty']; HasProperty(P: PropertyKeyValue): ObjectSlotReturn['HasProperty']; Get(P: PropertyKeyValue, Receiver: Value): ObjectSlotReturn['Get']; Set(P: PropertyKeyValue, V: Value, Receiver: Value): ObjectSlotReturn['Set']; Delete(P: PropertyKeyValue): ObjectSlotReturn['Delete']; OwnPropertyKeys(): ObjectSlotReturn['OwnPropertyKeys']; mark(m: GCMarker): void; static [Symbol.hasInstance]: (value: unknown) => value is ObjectValue; } /** https://tc39.es/ecma262/#sec-private-names */ export declare class PrivateName { private _; readonly Description: JSStringValue; constructor(description: JSStringValue); } export declare class ReferenceRecord { readonly Base: 'unresolvable' | Value | EnvironmentRecord; ReferencedName: Value | PrivateName; readonly Strict: BooleanValue; readonly ThisValue: Value | undefined; constructor({ Base, ReferencedName, Strict, ThisValue }: Pick); mark(m: GCMarker): void; } export type DescriptorInit = Pick; export declare function Descriptor(O: DescriptorInit): Descriptor; export declare class Descriptor { readonly Value?: Value; readonly Get?: FunctionObject | UndefinedValue; readonly Set?: FunctionObject | UndefinedValue; readonly Writable?: BooleanValue; readonly Enumerable?: BooleanValue; readonly Configurable?: BooleanValue; constructor(O: Pick); everyFieldIsAbsent(): boolean; mark(m: GCMarker): void; } export declare class DataBlock extends Uint8Array { } /** https://tc39.es/ecma262/#sec-sametype */ export declare function SameType(x: Value, y: Value): boolean; type SafeAccessMethods = 'map' | 'values' | 'entries' | 'filter' | 'forEach' | 'find'; export type Arguments = Omit & Pick; export interface FunctionCallContext { readonly thisValue: Value; readonly NewTarget: FunctionObject | UndefinedValue; } export interface NativeSteps { (this: BuiltinFunctionObject, args: Arguments, context: FunctionCallContext): PlainEvaluator | PlainCompletion; section?: string; isConstructor?: boolean; } export interface CanBeNativeSteps { (...args: (Value | undefined)[]): PlainEvaluator | PlainCompletion; } export {}; //# sourceMappingURL=value.d.mts.map