@t15i/webspecs
v0.8.0
Published
TypeScript implementations of web platform specifications
Downloads
1,302
Maintainers
Readme
webspecs - TypeScript implementations of web platform specifications
A reference implementation of selected algorithms and types from the WHATWG, W3C, and TC39 specifications. Each module's path mirrors the section ID of the spec it implements, so navigating the source feels like navigating the spec.
Coverage is intentionally narrow — this is a knowledge base, not a polyfill. Only the algorithms that have been ported so far are listed below; everything else is marked with
....
Install
npm install @t15i/webspecsUsage
Each spec is exposed as its own subpath export:
import { ... } from "@t15i/webspecs/dom";
import { ... } from "@t15i/webspecs/ecma";
import { ... } from "@t15i/webspecs/html";
import { ... } from "@t15i/webspecs/infra";
import { ... } from "@t15i/webspecs/url";
import { ... } from "@t15i/webspecs/webidl";What's implemented
Expand a spec to see what is currently ported. ... marks sections with un-ported content.
- §1 Infrastructure
- §1.4 Namespaces
- [x]
validAttributeLocalName
- [x]
- ...
- §1.4 Namespaces
- ...
- §5 Notational Conventions
- §5.2.6 Mathematical Operations
- [x]
sign - [x]
modulo - ...
- [x]
- ...
- §5.2.6 Mathematical Operations
- §6 ECMAScript Data Types and Values
- §6.1 ECMAScript Language Types
- §6.1.4 The String Type
- [x]
isString
- [x]
- §6.1.7 The Object Type
- [x]
PropertyKey - [x]
PropertyName
- [x]
- ...
- §6.1.4 The String Type
- §6.2 ECMAScript Specification Types
- §6.2.6 The Property Descriptor Specification Type
- §6.2.6.1 IsAccessorDescriptor
- [x]
isAccessorDescriptor
- [x]
- §6.2.6.2 IsDataDescriptor
- [x]
isDataDescriptor
- [x]
- ...
- §6.2.6.1 IsAccessorDescriptor
- ...
- §6.2.6 The Property Descriptor Specification Type
- §6.1 ECMAScript Language Types
- §7 Abstract Operations
- §7.1 Type Conversion
- §7.1.4 ToNumber
- [x]
toNumber
- [x]
- §7.1.5 ToIntegerOrInfinity
- [x]
toIntegerOrInfinity
- [x]
- §7.1.6 ToFixedSizeInteger
- [x]
toFixedSizeInteger
- [x]
- §7.1.8 ToUint32
- [x]
toUint32
- [x]
- §7.1.18 ToString
- [x]
toString
- [x]
- §7.1.22 CanonicalNumericIndexString
- [x]
canonicalNumericIndexString
- [x]
- ...
- §7.1.4 ToNumber
- §7.3 Operations on Objects
- §7.3.5 CreateDataProperty
- [x]
createDataProperty
- [x]
- ...
- §7.3.5 CreateDataProperty
- §7.1 Type Conversion
- §10 Ordinary and Exotic Objects Behaviours
- §10.1 Ordinary Object Internal Methods and Internal Slots
- §10.1.5.1 OrdinaryGetOwnProperty
- [x]
ordinaryGetOwnProperty
- [x]
- §10.1.6.1 OrdinaryDefineOwnProperty
- [x]
ordinaryDefineOwnProperty
- [x]
- §10.1.9.2 OrdinarySetWithOwnDescriptor
- [x]
ordinarySetWithOwnDescriptor
- [x]
- ...
- §10.1.5.1 OrdinaryGetOwnProperty
- ...
- §10.1 Ordinary Object Internal Methods and Internal Slots
- ...
- §2 Infrastructure
- §2.3 Common microsyntaxes
- §2.3.3 Keywords and enumerated attributes
- [x]
EnumeratedAttributeState - [x]
EnumeratedAttributeStates
- [x]
- §2.3.4 Numbers
- §2.3.4.1 Signed integers
- [x]
integerParsing - [x]
shortestPossibleStringRepresentingAsValidInteger
- [x]
- §2.3.4.2 Non-negative integers
- [x]
nonNegativeIntegerParsing - [x]
shortestPossibleRepresentingAsValidNonNegativeInteger
- [x]
- §2.3.4.3 Floating-point numbers
- [x]
bestRepresentationAsFloatingPointNumber - [x]
floatingPointNumberParsing
- [x]
- ...
- §2.3.4.1 Signed integers
- ...
- §2.3.3 Keywords and enumerated attributes
- §2.4 URLs and fetching
- §2.4.2 Resolving URLs
- [x]
encodingParseURL - [x]
encodingParseAndSerializeURL
- [x]
- ...
- §2.4.2 Resolving URLs
- §2.6 Common DOM interfaces
- §2.6.1 Reflecting content attributes in IDL attributes
- [x]
ReflectedBoolean - [x]
ReflectedDOMString - [x]
ReflectedDouble - [x]
ReflectedLong - [x]
ReflectedNullableDOMString - [x]
ReflectedNullableElement - [x]
ReflectedNullableFrozenArrayOfElements - [x]
ReflectedUnsignedLong - [x]
ReflectedUSVString - [x]
ReflectedContentAttribute/ReflectedIDLAttribute/ReflectedTarget
- [x]
- ...
- §2.6.1 Reflecting content attributes in IDL attributes
- ...
- §2.3 Common microsyntaxes
- ...
- §4 Primitive data types
- §4.6 Code points
- [x]
surrogate/surrogates - [x]
leadingSurrogate/leadingSurrogates - [x]
trailingSurrogate/trailingSurrogates
- [x]
- §4.7 Strings
- [x]
convertStringIntoScalarValueString - ...
- [x]
- ...
- §4.6 Code points
- §8 Namespaces
- [x]
HTMLNamespace - [x]
MathMLNamespace - [x]
SVGNamespace - [x]
XLinkNamespace - [x]
XMLNamespace - [x]
XMLNSNamespace
- [x]
- ...
- §4 URLs
- §4.4 URL parsing
- [x]
urlParser
- [x]
- §4.5 URL serializing
- [x]
urlSerializer
- [x]
- ...
- §4.4 URL parsing
- ...
- §2 Interface definition language
- §2.1 Names
- [x]
Identifier - [x]
isIdentifier
- [x]
- §2.2 Interfaces
- [x]
Interface/InterfaceMembers/InterfaceStaticMembers
- [x]
- §2.5 Members
- [x]
Member - §2.5.2 Attributes
- [x]
Attribute - [x]
isAttribute - [x]
isRegularAttribute/isStaticAttribute - [x]
isReadonlyAttribute - [x]
isDeclaredToInheritItsGetterAttribute
- [x]
- §2.5.3 Operations
- [x]
Operation - [x]
Argument/ArgumentList - [x]
isOperation
- [x]
- §2.5.6 Special operations
- [x]
IndexedPropertyGetter - [x]
IndexedPropertySetter - [x]
NamedPropertyGetter - [x]
NamedPropertySetter - [x]
NamedPropertyDeleter - §2.5.6.1 Indexed properties
- [x]
determineValueOfIndexedProperty/IndexedPropertyDeterminator - [x]
setValueOfNewIndexedProperty/NewIndexedPropertySetter - [x]
setValueOfExistingIndexedProperty/ExistingIndexedPropertySetter - [x]
supportsIndexedProperties/SupportIndexedProperties - [x]
isSupportedPropertyIndex/SupportedPropertyIndices
- [x]
- §2.5.6.2 Named properties
- [x]
determineValueOfNamedProperty/NamedPropertyDeterminator - [x]
deleteExistingNamedProperty/ExistingNamedPropertyDeleter - [x]
setValueOfNewNamedProperty/NewNamedPropertySetter - [x]
setValueOfExistingNamedProperty/ExistingNamedPropertySetter - [x]
supportsNamedProperties/SupportNamedProperties - [x]
isSupportedPropertyName/SupportedPropertyNames
- [x]
- ...
- [x]
- ...
- [x]
- §2.12 Objects implementing interfaces
- [x]
PlatformObject - [x]
LegacyPlatformObject/LegacyPlatformObjectInterfaceBase - [x]
isLegacyPlatformObject
- [x]
- §2.13 Types
- [x]
Type
- [x]
- ...
- §2.1 Names
- §3 ECMAScript binding
- §3.2 ECMAScript type mapping
- §3.2.2 undefined
- [x]
Undefined
- [x]
- §3.2.3 boolean
- [x]
Boolean
- [x]
- §3.2.4 Integer types
- §3.2.4.5 long
- [x]
Long/LongConstructor
- [x]
- §3.2.4.6 unsigned long
- [x]
UnsignedLong/UnsignedLongConstructor
- [x]
- §3.2.4.9 Abstract operations
- [x]
integerPart - [x]
convertToInt
- [x]
- ...
- §3.2.4.5 long
- §3.2.7 double
- [x]
Double
- [x]
- §3.2.10 DOMString
- [x]
DOMString
- [x]
- §3.2.12 USVString
- [x]
USVString
- [x]
- §3.2.20 Nullable types
- [x]
Nullable
- [x]
- §3.2.21 sequence
- [x]
Sequence - [x]
createSequenceFromIterable
- [x]
- §3.2.27 Frozen array types
- [x]
FrozenArray
- [x]
- ...
- §3.2.2 undefined
- §3.3 Extended attributes
- §3.3.8 [Global]
- [x]
Global
- [x]
- ...
- §3.3.8 [Global]
- §3.4 Legacy extended attributes
- §3.4.7 [LegacyOverrideBuiltIns]
- [x]
LegacyOverrideBuiltIns
- [x]
- §3.4.9 [LegacyUnenumerableNamedProperties]
- [x]
LegacyUnenumerableNamedProperties
- [x]
- §3.4.10 [LegacyUnforgeable]
- [x]
LegacyUnforgeable - [x]
isUnforgeableOnInterface
- [x]
- ...
- §3.4.7 [LegacyOverrideBuiltIns]
- §3.7 Interfaces
- §3.7.4 Named properties object
- [x]
isNamedPropertyObject
- [x]
- ...
- §3.7.4 Named properties object
- §3.8 Platform objects
- [x]
isPlatformObject - [x]
PrimaryInterface - [x]
ImplementsInterfaceWith/ImplementsInterfaceWithout/implementsInterfaceWith - [x]
ImplementsInterfaceWithExtAttribute/ImplementsInterfaceWithoutExtAttribute/implementsInterfaceWithExtAttribute
- [x]
- §3.9 Legacy platform objects
- [x]
LegacyPlatformObjectInternalMethods - [x]
isUnforgeablePropertyName - §3.9.1
[[GetOwnProperty]]- [x]
getOwnProperty
- [x]
- §3.9.2
[[Set]]- [x]
set
- [x]
- §3.9.3
[[DefineOwnProperty]]- [x]
defineOwnProperty
- [x]
- §3.9.4
[[Delete]]- [x]
del
- [x]
- §3.9.5
[[PreventExtensions]]- [x]
preventExtensions
- [x]
- §3.9.6
[[OwnPropertyKeys]]- [x]
ownPropertyKeys
- [x]
- §3.9.7 Abstract operations
- [x]
legacyPlatformObjectGetOwnProperty - [x]
isNamedPropertyVisible - [x]
invokeIndexedPropertySetter - [x]
invokeNamedPropertySetter - [x]
isArrayIndex
- [x]
- [x]
- ...
- §3.2 ECMAScript type mapping
- ...
