Giter Club home page Giter Club logo

html-externs's Introduction

js.html Extern Generator

This project generates Haxe externs based on WebIDL files. The WebIDL files and parser are owned by Mozilla.

Usage

You should have the Haxe repository in a directory named "haxe" next to this repo.

Run bin/generate to update the js.html externs on the Haxe repo. Run bin/validate to make sure the output compiles.

To update to Mozilla's latest APIs, run bin/update-mozilla and run generate again. You may also need to grab the latest WebIDL.py from https://dxr.mozilla.org/mozilla-central/source/dom/bindings/parser/WebIDL.py

To add a new API by hand, add it in a new .webidl file under the webidl/ directory.

Any hand-written Haxe files that should be merged with the final output should go in the haxe/ directory.

Haxe 3.2 API migration

Element was split into Element and DOMElement. Certain methods that return DOMElement may need to be coerced into an Element.

The following types from js.html have been removed, along with an explanation. Most of the changes are due to spec advances, and removal of Chrome-only APIs.

  • js.html.AbstractWorker
    • Merged into Worker.
  • js.html.AnimationList
    • ?
  • js.html.BarInfo
    • Renamed to BarProp.
  • js.html.BaseFontElement
    • Obsolete.
  • js.html.BeforeLoadEvent
    • ?
  • js.html.CSSFilterValue
    • ?
  • js.html.CSSKeyframeRule
    • ?
  • js.html.CSSKeyframesRule
    • ?
  • js.html.CSSMatrix
    • Renamed to DOMMatrix.
  • js.html.CSSTransformValue
    • ?
  • js.html.CanvasRenderingContext
    • Obsolete.
  • js.html.ClientRect
    • Renamed to DOMRect.
  • js.html.ClientRectList
    • Renamed to DOMRectList.
  • js.html.Clipboard
    • Renamed to DataTransfer.
  • js.html.Counter
    • ?
  • js.html.DOMApplicationCache
    • Renamed to ApplicationCache.
  • js.html.DOMCoreException
    • Renamed to DOMException.
  • js.html.DOMFormData
    • Renamed to FormData.
  • js.html.DOMMimeType
    • Renamed to MimeType.
  • js.html.DOMMimeTypeArray
    • Renamed to MimeTypeArray.
  • js.html.DOMPlugin
    • Renamed to Plugin.
  • js.html.DOMPluginArray
    • Renamed to PluginArray.
  • js.html.DOMSelection
    • Renamed to Selection.
  • js.html.DOMURL
    • Renamed to URL.
  • js.html.DOMWindow
    • Renamed to Window.
  • js.html.DataTransferItem
    • Obsolete.
  • js.html.DataTransferItemList
    • Obsolete.
  • js.html.DedicatedWorkerContext
    • Obsolete.
  • js.html.DetailsElement
    • ?
  • js.html.ElementTimeControl
    • ?
  • js.html.Entity
    • Obsolete.
  • js.html.EntityReference
    • Obsolete.
  • js.html.EventException
    • ?
  • js.html.GamepadList
    • Obsolete.
  • js.html.Geoposition
    • Renamed to Position.
  • js.html.JavaScriptCallFrame
    • ?
  • js.html.KeygenElement
    • ?
  • js.html.MarqueeElement
    • Obsolete.
  • js.html.MediaController
    • ?
  • js.html.MediaKeyEvent
    • ?
  • js.html.MediaQueryListListener
    • ?
  • js.html.MemoryInfo
    • Obsolete.
  • js.html.MessageChannel
    • ?
  • js.html.NamedFlow
    • ?
  • js.html.Notation
    • Obsolete.
  • js.html.NotificationCenter
    • Obsolete.
  • js.html.OverflowEvent
    • ?
  • js.html.PagePopupController
    • Obsolete.
  • js.html.Point
    • Renamed to DOMPoint.
  • js.html.RangeException
    • ?
  • js.html.ScriptProfile
    • Obsolete.
  • js.html.ScriptProfileNode
    • Obsolete.
  • js.html.SharedWorkerContext
    • Obsolete.
  • js.html.SpeechInputEvent
    • Renamed to SpeechRecognitionEvent.
  • js.html.SpeechInputResult
    • Renamed to SpeechRecognitionResult.
  • js.html.SpeechInputResultList
    • Renamed to SpeechRecognitionResultList.
  • js.html.StorageInfo
    • Obsolete.
  • js.html.StyleMedia
    • ?
  • js.html.TextEvent
    • ?
  • js.html.TextTrackCue
    • Renamed to VTTCue.
  • js.html.WorkerContext
    • Obsolete.
  • js.html.XMLHttpRequestException
    • ?
  • js.html.XMLHttpRequestProgressEvent
    • ?
  • js.html.XPathException
    • ?
  • js.html.audio.AudioGain
    • Obsolete.
  • js.html.audio.AudioSourceNode
    • Obsolete.
  • js.html.audio.WaveTable
    • Obsolete.
  • js.html.fs.DirectoryEntry
    • Obsolete.
  • js.html.fs.DirectoryEntrySync
    • Obsolete.
  • js.html.fs.DirectoryReader
    • Obsolete.
  • js.html.fs.DirectoryReaderSync
    • Obsolete.
  • js.html.fs.Entry
    • Obsolete.
  • js.html.fs.EntryArray
    • Obsolete.
  • js.html.fs.EntryArraySync
    • Obsolete.
  • js.html.fs.EntrySync
    • Obsolete.
  • js.html.fs.FileEntry
    • Obsolete.
  • js.html.fs.FileEntrySync
    • Obsolete.
  • js.html.fs.FileError
    • Obsolete.
  • js.html.fs.FileException
    • Obsolete.
  • js.html.fs.FileSystem
    • Obsolete.
  • js.html.fs.FileSystemSync
    • Obsolete.
  • js.html.fs.FileWriter
    • Obsolete.
  • js.html.fs.FileWriterSync
    • Obsolete.
  • js.html.fs.Metadata
    • Obsolete.
  • js.html.idb.Any
    • Obsolete.
  • js.html.idb.DatabaseException
    • Obsolete.
  • js.html.idb.Key
    • Obsolete.
  • js.html.idb.UpgradeNeededEvent
    • Obsolete.
  • js.html.idb.VersionChangeRequest
    • Obsolete.
  • js.html.rtc.DataChannelEvent
    • Obsolete.
  • js.html.rtc.IceCandidateEvent
    • Obsolete.
  • js.html.rtc.LocalMediaStream
    • Obsolete.
  • js.html.rtc.MediaStream
    • Obsolete.
  • js.html.rtc.MediaStreamEvent
    • Obsolete.
  • js.html.rtc.MediaStreamList
    • Obsolete.
  • js.html.rtc.MediaStreamTrack
    • Obsolete.
  • js.html.rtc.MediaStreamTrackEvent
    • Obsolete.
  • js.html.rtc.MediaStreamTrackList
    • Obsolete.
  • js.html.rtc.NavigatorUserMediaError
    • Obsolete.
  • js.html.rtc.StatsElement
    • Obsolete.
  • js.html.rtc.StatsResponse
    • Obsolete.
  • js.html.sql.Database
    • Obsolete.
  • js.html.sql.DatabaseSync
    • Obsolete.
  • js.html.sql.Error
    • Obsolete.
  • js.html.sql.Exception
    • Obsolete.
  • js.html.sql.ResultSet
    • Obsolete.
  • js.html.sql.ResultSetRowList
    • Obsolete.
  • js.html.sql.Transaction
    • Obsolete.
  • js.html.sql.TransactionSync
    • Obsolete.
  • js.html.svg.AltGlyphDefElement
    • ?
  • js.html.svg.AltGlyphItemElement
    • ?
  • js.html.svg.AnimateColorElement
    • ?
  • js.html.svg.Color
    • ?
  • js.html.svg.CursorElement
    • ?
  • js.html.svg.ElementInstance
    • ?
  • js.html.svg.ElementInstanceList
    • ?
  • js.html.svg.Exception
    • ?
  • js.html.svg.ExternalResourcesRequired
    • ?
  • js.html.svg.FilterPrimitiveStandardAttributes
    • ?
  • js.html.svg.FitToViewBox
    • ?
  • js.html.svg.FontElement
    • ?
  • js.html.svg.FontFaceElement
    • ?
  • js.html.svg.FontFaceFormatElement
    • ?
  • js.html.svg.FontFaceNameElement
    • ?
  • js.html.svg.FontFaceSrcElement
    • ?
  • js.html.svg.FontFaceUriElement
    • ?
  • js.html.svg.GlyphElement
    • ?
  • js.html.svg.GlyphRefElement
    • ?
  • js.html.svg.HKernElement
    • ?
  • js.html.svg.LangSpace
    • ?
  • js.html.svg.Locatable
    • ?
  • js.html.svg.MissingGlyphElement
    • ?
  • js.html.svg.Paint
    • ?
  • js.html.svg.RenderingIntent
    • ?
  • js.html.svg.Stylable
    • ?
  • js.html.svg.TRefElement
    • ?
  • js.html.svg.Tests
    • ?
  • js.html.svg.Transformable
    • ?
  • js.html.svg.URIReference
    • ?
  • js.html.svg.VKernElement
    • ?
  • js.html.svg.ViewSpec
    • ?
  • js.html.webgl.CompressedTextureS3TC
    • Renamed to ExtensionCompressedTextureS3TC.
  • js.html.webgl.DebugRendererInfo
    • Renamed to ExtensionDebugRendererInfo.
  • js.html.webgl.DebugShaders
    • Renamed to ExtensionDebugShaders.
  • js.html.webgl.DepthTexture
    • Renamed to ExtensionDepthTexture.
  • js.html.webgl.EXTTextureFilterAnisotropic
    • Renamed to ExtensionTextureFilterAnisotropic.
  • js.html.webgl.LoseContext
    • Renamed to ExtensionLoseContext.
  • js.html.webgl.OESElementIndexUint
    • Obsolete.
  • js.html.webgl.OESStandardDerivatives
    • Renamed to ExtensionStandardDerivatives.
  • js.html.webgl.OESTextureFloat
    • Renamed to ExtensionTextureFloat.
  • js.html.webgl.OESVertexArrayObject
    • Renamed to ExtensionVertexArrayObject.
  • js.html.webgl.VertexArrayObjectOES
    • Renamed to VertexArray.

html-externs's People

Contributors

aduros avatar fponticelli avatar haxiomic avatar nadako avatar simn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

html-externs's Issues

Work Queue

Tracking the todolist:

  • typed arrays to js.lib
  • js.Promise references to js.lib HaxeFoundation/haxe#8282
  • Remap any other types that have moved to js.lib
  • Add @:pure to typedarray constructors
  • class constants on instances with trailing underscore
  • Re-order overloads for better type interference (this is a work around for an overload bug)
  • Split up either types into abstracts where possible. This one is a bit tricky but worth doing.
  • Add missing userVisibleOnly field, see HaxeFoundation/haxe#9027

Migration guide

The migration guide should be updated to reflect recent changes wrt Element-gate :)

Housekeeping

  • Update readme instructions to sync with recent changes
  • Tidy and reorganise scripts to make it easy to reproduce

Use new function type syntax

It would be great if we could support the new function type since this would provide richer completion/documentation for the working with JavaScript. I noticed this information is already available in the webidls.

For example; BaseAudioContext webidl:

callback DecodeSuccessCallback = void (AudioBuffer decodedData);
callback DecodeErrorCallback = void (DOMException error);

...

Promise<AudioBuffer> decodeAudioData(ArrayBuffer audioData,
                                         optional DecodeSuccessCallback successCallback,
                                         optional DecodeErrorCallback errorCallback);

Currently we generate:

function decodeAudioData(audioData:js.lib.ArrayBuffer, ?successCallback:AudioBuffer->Void, ?errorCallback:js.html.DOMException->Void):Promise<AudioBuffer>;

This could be improved like this:

function decodeAudioData(audioData:js.lib.ArrayBuffer, ?successCallback:(decodedData:AudioBuffer) -> Void,
		?errorCallback:(error:DOMException) -> Void):Promise<AudioBuffer>;

.. or with typedef

function decodeAudioData(audioData:js.lib.ArrayBuffer, ?successCallback:DecodeSuccessCallback, ?errorCallback:DecodeErrorCallback):Promise<AudioBuffer>;

typedef DecodeSuccessCallback = (decodedData:AudioBuffer) -> Void;
typedef DecodeErrorCallback = (error:DOMException) -> Void;

If the info is not available we can always fallback to the "old syntax".

HTML input valueAsDate

In haxe 3.2 version, InputElement has no longer valueAsDate field and so, the value can't be interpreted as a date

Could this field be add or maybe there is a reason to avoid using it ?

refers to HaxeFoundation/haxe#5034

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.