Skip to content

Instantly share code, notes, and snippets.

@qwe2
Created February 24, 2015 11:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qwe2/f0974f97bce364a59211 to your computer and use it in GitHub Desktop.
Save qwe2/f0974f97bce364a59211 to your computer and use it in GitHub Desktop.
ClipboardEvent partial extension
namespace ClipboardEventExtension
open IntelliFactory.WebSharper
open IntelliFactory.WebSharper.InterfaceGenerator
module Definition =
let ClipboardEventType =
Pattern.EnumStrings "ClipboardEventType" [ "copy"; "cut"; "paste" ]
let DataTransfer =
Class "DataTransfer"
|+> Instance [
"dropEffect" =@ T<string>
"effectAllowed" =@ T<string>
]
let ClipboardEventConfig =
Pattern.Config "ClipboardEventConfig"
{
Optional = []
Required =
[
"dataType", T<string>
"data", T<string>
]
}
let ClipboardEvent =
Class "ClipboardEvent"
|=> Inherits T<JavaScript.Dom.Event>
|+> Instance [
"clipboardData" =? DataTransfer
]
|+> Static [
Constructor (ClipboardEventType?``type`` * ClipboardEventConfig?config)
]
let Assembly =
Assembly [
Namespace "IntelliFactory.WebSharper.JavaScript" [
ClipboardEventType
DataTransfer
ClipboardEventConfig
ClipboardEvent
]
]
[<Sealed>]
type Extension() =
interface IExtension with
member ext.Assembly =
Definition.Assembly
[<assembly: Extension(typeof<Extension>)>]
do ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment