npm.io
0.9.1 • Published 2d ago

@t15i/webspecs

Licence
MIT
Version
0.9.1
Deps
0
Size
279 kB
Vulns
0
Weekly
0

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/webspecs

Usage

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.

DOM (spec)
  • §1 Infrastructure
    • §1.4 Namespaces
      • validAttributeLocalName
    • ...
  • ...
ECMAScript (spec)
  • §5 Notational Conventions
    • §5.2.6 Mathematical Operations
      • sign
      • modulo
      • ...
    • ...
  • §6 ECMAScript Data Types and Values
    • §6.1 ECMAScript Language Types
      • §6.1.4 The String Type
        • isString
      • §6.1.7 The Object Type
        • PropertyKey
        • PropertyName
      • ...
    • §6.2 ECMAScript Specification Types
      • §6.2.6 The Property Descriptor Specification Type
        • §6.2.6.1 IsAccessorDescriptor
          • isAccessorDescriptor
        • §6.2.6.2 IsDataDescriptor
          • isDataDescriptor
        • ...
      • ...
  • §7 Abstract Operations
    • §7.1 Type Conversion
      • §7.1.4 ToNumber
        • toNumber
      • §7.1.5 ToIntegerOrInfinity
        • toIntegerOrInfinity
      • §7.1.6 ToFixedSizeInteger
        • toFixedSizeInteger
      • §7.1.8 ToUint32
        • toUint32
      • §7.1.18 ToString
        • toString
      • §7.1.22 CanonicalNumericIndexString
        • canonicalNumericIndexString
      • ...
    • §7.3 Operations on Objects
      • §7.3.5 CreateDataProperty
        • createDataProperty
      • ...
  • §10 Ordinary and Exotic Objects Behaviours
    • §10.1 Ordinary Object Internal Methods and Internal Slots
      • §10.1.5.1 OrdinaryGetOwnProperty
        • ordinaryGetOwnProperty
      • §10.1.6.1 OrdinaryDefineOwnProperty
        • ordinaryDefineOwnProperty
      • §10.1.9.2 OrdinarySetWithOwnDescriptor
        • ordinarySetWithOwnDescriptor
      • ...
    • ...
  • ...
HTML (spec)
  • §2 Infrastructure
    • §2.3 Common microsyntaxes
      • §2.3.3 Keywords and enumerated attributes
        • EnumeratedAttributeState
        • EnumeratedAttributeStates
      • §2.3.4 Numbers
        • §2.3.4.1 Signed integers
          • integerParsing
          • shortestPossibleStringRepresentingAsValidInteger
        • §2.3.4.2 Non-negative integers
          • nonNegativeIntegerParsing
          • shortestPossibleRepresentingAsValidNonNegativeInteger
        • §2.3.4.3 Floating-point numbers
          • bestRepresentationAsFloatingPointNumber
          • floatingPointNumberParsing
        • ...
      • ...
    • §2.4 URLs and fetching
      • §2.4.2 Resolving URLs
        • encodingParseURL
        • encodingParseAndSerializeURL
      • ...
    • §2.6 Common DOM interfaces
      • §2.6.1 Reflecting content attributes in IDL attributes
        • ReflectedBoolean
        • ReflectedDOMString
        • ReflectedDouble
        • ReflectedLong
        • ReflectedNullableDOMString
        • ReflectedNullableElement
        • ReflectedNullableFrozenArrayOfElements
        • ReflectedUnsignedLong
        • ReflectedUSVString
        • ReflectedContentAttribute / ReflectedIDLAttribute / ReflectedTarget
      • ...
    • ...
  • ...
Infra (spec)
  • §4 Primitive data types
    • §4.6 Code points
      • surrogate / surrogates
      • leadingSurrogate / leadingSurrogates
      • trailingSurrogate / trailingSurrogates
    • §4.7 Strings
      • convertStringIntoScalarValueString
      • ...
    • ...
  • §8 Namespaces
    • HTMLNamespace
    • MathMLNamespace
    • SVGNamespace
    • XLinkNamespace
    • XMLNamespace
    • XMLNSNamespace
  • ...
URL (spec)
  • §4 URLs
    • §4.4 URL parsing
      • urlParser
    • §4.5 URL serializing
      • urlSerializer
    • ...
  • ...
WebIDL (spec)
  • §2 Interface definition language
    • §2.1 Names
      • Identifier
      • isIdentifier
    • §2.2 Interfaces
      • Interface / InterfaceMembers / InterfaceStaticMembers
    • §2.5 Members
      • Member
      • §2.5.2 Attributes
        • Attribute
        • isAttribute
        • isRegularAttribute / isStaticAttribute
        • isReadonlyAttribute
        • isDeclaredToInheritItsGetterAttribute
      • §2.5.3 Operations
        • Operation
        • Argument / ArgumentList
        • isOperation
      • §2.5.6 Special operations
        • IndexedPropertyGetter
        • IndexedPropertySetter
        • NamedPropertyGetter
        • NamedPropertySetter
        • NamedPropertyDeleter
        • §2.5.6.1 Indexed properties
          • determineValueOfIndexedProperty / IndexedPropertyDeterminator
          • setValueOfNewIndexedProperty / NewIndexedPropertySetter
          • setValueOfExistingIndexedProperty / ExistingIndexedPropertySetter
          • supportsIndexedProperties / SupportIndexedProperties
          • isSupportedPropertyIndex / SupportedPropertyIndices
        • §2.5.6.2 Named properties
          • determineValueOfNamedProperty / NamedPropertyDeterminator
          • deleteExistingNamedProperty / ExistingNamedPropertyDeleter
          • setValueOfNewNamedProperty / NewNamedPropertySetter
          • setValueOfExistingNamedProperty / ExistingNamedPropertySetter
          • supportsNamedProperties / SupportNamedProperties
          • isSupportedPropertyName / SupportedPropertyNames
        • ...
      • ...
    • §2.12 Objects implementing interfaces
      • PlatformObject
      • LegacyPlatformObject / LegacyPlatformObjectInterfaceBase
      • isLegacyPlatformObject
    • §2.13 Types
      • Type
    • ...
  • §3 ECMAScript binding
    • §3.2 ECMAScript type mapping
      • §3.2.2 undefined
        • Undefined
      • §3.2.3 boolean
        • Boolean
      • §3.2.4 Integer types
        • §3.2.4.5 long
          • Long / LongConstructor
        • §3.2.4.6 unsigned long
          • UnsignedLong / UnsignedLongConstructor
        • §3.2.4.9 Abstract operations
          • integerPart
          • convertToInt
        • ...
      • §3.2.7 double
        • Double
      • §3.2.10 DOMString
        • DOMString
      • §3.2.12 USVString
        • USVString
      • §3.2.20 Nullable types
        • Nullable
      • §3.2.21 sequence
        • Sequence
        • createSequenceFromIterable
      • §3.2.27 Frozen array types
        • FrozenArray
      • ...
    • §3.3 Extended attributes
      • §3.3.8 [Global]
        • Global
      • ...
    • §3.4 Legacy extended attributes
      • §3.4.7 [LegacyOverrideBuiltIns]
        • LegacyOverrideBuiltIns
      • §3.4.9 [LegacyUnenumerableNamedProperties]
        • LegacyUnenumerableNamedProperties
      • §3.4.10 [LegacyUnforgeable]
        • LegacyUnforgeable
        • isUnforgeableOnInterface
      • ...
    • §3.7 Interfaces
      • §3.7.4 Named properties object
        • isNamedPropertyObject
      • ...
    • §3.8 Platform objects
      • isPlatformObject
      • PrimaryInterface
      • ImplementsInterfaceWith / ImplementsInterfaceWithout / implementsInterfaceWith
      • ImplementsInterfaceWithExtAttribute / ImplementsInterfaceWithoutExtAttribute / implementsInterfaceWithExtAttribute
    • §3.9 Legacy platform objects
      • LegacyPlatformObjectInternalMethods
      • isUnforgeablePropertyName
      • §3.9.1 [[GetOwnProperty]]
        • getOwnProperty
      • §3.9.2 [[Set]]
        • set
      • §3.9.3 [[DefineOwnProperty]]
        • defineOwnProperty
      • §3.9.4 [[Delete]]
        • del
      • §3.9.5 [[PreventExtensions]]
        • preventExtensions
      • §3.9.6 [[OwnPropertyKeys]]
        • ownPropertyKeys
      • §3.9.7 Abstract operations
        • legacyPlatformObjectGetOwnProperty
        • isNamedPropertyVisible
        • invokeIndexedPropertySetter
        • invokeNamedPropertySetter
        • isArrayIndex
    • ...
  • ...

License

MIT

Keywords