Learn how to evaluate and integrate the VNC SDK

We're here if you need help.

Set

vncsdk.Set

This is a JavaScript Set implementation that can be used to represent an argument comprising of a bitmask of enums. For example values in the enumeration vncsdk.Viewer.MouseButton may be added to the same set. For browsers that support JavaScript Sets, vncsdk.Set will return directly the browser’s implementation. For older browsers that lack support, a basic polyfill is created for use with VNC SDK functions.

Constructor Summary

Modifier and Type Method and Description

Set()

Creates and returns an empty vncsdk.Set.

Method Summary

Modifier and Type Method and Description

add(value)

Appends a new element with the given value to the vncsdk.Set object.

clear()

Removes all elements from the vncsdk.Set object.

delete(value)

Removes the element associated to the value.

boolean

has(value)

Returns a boolean asserting whether an element is present with the given value in the vncsdk.Set object or not.

forEach(callbackFn, thisArg)

Calls callbackFn once for each value present in the vncsdk.Set object, in insertion order.

Constructor

class vncsdk.Set()

Creates and returns an empty vncsdk.Set. For browsers with ES6 Set support this method will return the browser’s Set implementation. The following section describes the methods of the basic polyfill while methods for ES6 Set standard can be found here.

Methods

Set.add(value)

Appends a new element with the given value to the vncsdk.Set object.

Arguments:
  • value (enum value) –
Set.clear()

Removes all elements from the vncsdk.Set object.

Set.delete(value)

Removes the element associated to the value.

Arguments:
  • value (enum value) –
Set.has(value)

Returns a boolean asserting whether an element is present with the given value in the vncsdk.Set object or not.

Arguments:
  • value (enum value) –
Return type:

boolean

Set.forEach(callbackFn, thisArg)

Calls callbackFn once for each value present in the vncsdk.Set object, in insertion order. If a thisArg parameter is provided to forEach, it will be used as the this value for each callback.

×