Created
February 24, 2015 11:26
-
-
Save qwe2/f0974f97bce364a59211 to your computer and use it in GitHub Desktop.
ClipboardEvent partial extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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