Clear Up
SharpKit Reference

SharpKit.JavaScript Namespace

Contains all SharpKit compiler attributes used to customize JavaScript output Contains .NET types for primitive JavaScript types such as JsNumber, JsObject, JsArray, etc... Contains all JavaScript global functions in a derivable context class - JsContext

Download SDK: SharpKit.JavaScript.zip

Interfaces

Name Description
IJsArrayEnumerable<T>

Delegates

Name Description
JsAction A delegate for native javascript
JsAction<T> A delegate for native javascript
JsAction<T1, T2> A delegate for native javascript
JsAction<T1, T2, T3> A delegate for native javascript
JsAction<T1, T2, T3, T4> A delegate for native javascript
JsAction<T1, T2, T3, T4, T5> A delegate for native javascript
JsAction<T1, T2, T3, T4, T5, T6> A delegate for native javascript
JsFunc<TResult> A delegate for native javascript
JsFunc<T, TResult> A delegate for native javascript
JsFunc<T1, T2, TResult> A delegate for native javascript
JsFunc<T1, T2, T3, TResult> A delegate for native javascript
JsFunc<T1, T2, T3, T4, TResult> A delegate for native javascript
JsFunc<T1, T2, T3, T4, T5, TResult> A delegate for native javascript
JsFunc<T1, T2, T3, T4, T5, T6, TResult> A delegate for native javascript
JsNativeAction
JsNativeAction<T>
JsNativeAction<T1, T2>
JsNativeAction<T1, T2, T3>
JsNativeAction<T1, T2, T3, T4>
JsNativeAction<T1, T2, T3, T4, T5>
JsNativeAction<T1, T2, T3, T4, T5, T6>
JsNativeFunc<TResult>
JsNativeFunc<T, TResult>
JsNativeFunc<T1, T2, TResult>
JsNativeFunc<T1, T2, T3, TResult>
JsNativeFunc<T1, T2, T3, T4, TResult>
JsNativeFunc<T1, T2, T3, T4, T5, TResult>
JsNativeFunc<T1, T2, T3, T4, T5, T6, TResult>

Classes

Name Description
JsArguments An object representing the arguments to the currently executing function, and the functions that called it.
JsArray The Array object provides support for creation of arrays of any data type.
JsArray<T> The Array object provides support for creation of arrays of any data type.
JsBoolean
JsCode A special class, when used as a method parameter, can be assigned as string, and generates the native js code inside the string
JsContext
JsContextBase
JsDate
JsDelegateAttribute Specifies custom instructions for SharpKit for a delegate, this information is used when exporting the member, and when using it.
JsEmbeddedResourceAttribute
JsEnumAttribute Controls the interoperability and conversion of a .NET enum type into JavaScript.
JsError
JsEventAttribute Specifies custom instructions for SharpKit for an event, this information is used when exporting the member, and when using it.
JsExportAttribute Provides information regarding how SharpKit will export JavaScript code
JsExtensions Provides extension methods for C# to JavaScript
JsFieldAttribute Specifies custom instructions for SharpKit for a property, this information is used when exporting the member, and when using it.
JsFunction
JsMath
JsMergedFileAttribute Instructs SharpKit Compiler to create a merged file from specified sources
JsMethodAttribute Specifies custom instructions for SharpKit for a single method, this information is used when exporting the member, and when using it.
JsNamespaceAttribute Allows mapping and replacement between C# and JavaScript namespace. Useful for creating shorter namespaces in JavaScript
JsNativeError
JsNumber An object representation of the number data type and placeholder for numeric constants.
JsObject
JsObject<T>
JsObject<K, T>
JsObjectBase
JsPropertyAttribute Specifies custom instructions for SharpKit for a property, this information is used when exporting the member, and when using it.
JsRegExp An object that contains a regular expression pattern along with flags that identify how to apply the pattern. re = /pattern/[flags] re = new RegExp("pattern"[,"flags"])
JsRegExpResult
JsString Allows manipulation and formatting of text strings and determination and location of substrings within strings.
JsTypeAttribute Sets the rules that SharpKit will use when converting this .NET type into JavaScript. This attribute can be used on any type, and as assembly attribute, when used as an assembly attribute, and TargetType is not supplied, it will affect ALL types in the assembly

Enums

Name Description
JsMode Specifies the export and interoperability mode of a C# type in JavaScript
JsTypes

Examples

This example uses the JsTypeAttribute to instruct SharpKit compiler to convert this class into JavaScript, it also uses the parseInt global JavaScript function, and the toString() function on the JsNumber type.
using SharpKit.JavaScript;
            
namespace MyApp.Client
{
    [JsType(JsMode.Global, Filename="MyScript.js")]
    class MyScript : JsContext
    {
        public static void Main()
        {
            var x = parseInt("677");
            var s = x.toString();
        }
    }
}
            
© Copyright 2005-2011 SharpKit. All rights reserved.