Produce JS-visible string results as UTF-16 at their source, including numeric formatting, BigInt and BigFraction formatting, URI encoding, console formatting, parser errors, regular expression errors, Intl and Temporal records, LibUnicode locale boundaries, and LibWeb bindings. Handle fractional radix formatting through the UTF-16 builder view.
37 lines
861 B
C++
37 lines
861 B
C++
/*
|
|
* Copyright (c) 2025, Tim Flynn <trflynn89@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Span.h>
|
|
#include <AK/StringView.h>
|
|
#include <AK/Utf16View.h>
|
|
#include <LibJS/Runtime/AbstractOperations.h>
|
|
#include <LibJS/Runtime/Object.h>
|
|
#include <LibJS/Runtime/PropertyKey.h>
|
|
|
|
namespace JS::Intl {
|
|
|
|
// https://tc39.es/ecma402/#resolution-option-descriptor
|
|
struct ResolutionOptionDescriptor {
|
|
Utf16View key;
|
|
PropertyKey property;
|
|
OptionType type { OptionType::String };
|
|
ReadonlySpan<StringView> values {};
|
|
};
|
|
|
|
class IntlObject : public Object {
|
|
JS_OBJECT(IntlObject, Object);
|
|
|
|
public:
|
|
virtual ReadonlySpan<Utf16View> relevant_extension_keys() const = 0;
|
|
virtual ReadonlySpan<ResolutionOptionDescriptor> resolution_option_descriptors(VM&) const = 0;
|
|
|
|
protected:
|
|
using Object::Object;
|
|
};
|
|
|
|
}
|