Tools

Class containing a set of static utilities functions

Hierarchy

  • Tools

Index

Properties

Static AllLogLevel

Find examples in Playground
AllLogLevel: number

All logs

Static BaseUrl

Find examples in Playground
BaseUrl: string

Gets or sets the base URL to use to load assets

Static CorsBehavior

Find examples in Playground
CorsBehavior: string | function

Default behaviour for cors in the application. It can be a string if the expected behavior is identical in the entire app. Or a callback to be able to set it per url or on a group of them (in case of Video source for instance)

Static CustomRequestHeaders

Find examples in Playground
CustomRequestHeaders: object

Custom HTTP Request Headers to be sent with XMLHttpRequests i.e. when loading files, where the server/service expects an Authorization header.

see

InjectCustomRequestHeaders injects them to an XMLHttpRequest

Type declaration

  • [key: string]: string

Static DefaultRetryStrategy

Find examples in Playground
DefaultRetryStrategy: function

Gets or sets the retry strategy to apply when an error happens while loading an asset

Type declaration

    • (url: string, request: XMLHttpRequest, retryIndex: number): number
    • Parameters

      • url: string
      • request: XMLHttpRequest
      • retryIndex: number

      Returns number

Static EndPerformanceCounter

Find examples in Playground
EndPerformanceCounter: function

Ends a specific performance coutner

Type declaration

    • (counterName: string, condition?: boolean): void
    • Parameters

      • counterName: string
      • Optional condition: boolean

      Returns void

Static Error

Find examples in Playground
Error: function

Write an error message to the console

Type declaration

    • (message: string): void
    • Parameters

      • message: string

      Returns void

Static ErrorLogLevel

Find examples in Playground
ErrorLogLevel: number

Only error logs

Static Log

Find examples in Playground
Log: function

Log a message to the console

Type declaration

    • (message: string): void
    • Parameters

      • message: string

      Returns void

Static LogCache

Find examples in Playground
LogCache: string

Gets current log cache (list of logs)

Static LogLevels

Find examples in Playground
LogLevels: number

Sets the current log level (MessageLogLevel / WarningLogLevel / ErrorLogLevel)

Static MessageLogLevel

Find examples in Playground
MessageLogLevel: number

Only message logs

Static NoneLogLevel

Find examples in Playground
NoneLogLevel: number

No log

Static Now

Find examples in Playground
Now: number

Gets either window.performance.now() if supported or Date.now() else

Static OnNewCacheEntry

Find examples in Playground
OnNewCacheEntry: function

Callback called when a new log is added

Type declaration

    • (entry: string): void
    • Parameters

      • entry: string

      Returns void

Static PerformanceConsoleLogLevel

Find examples in Playground
PerformanceConsoleLogLevel: number

Log performance to the console

Static PerformanceLogLevel

Find examples in Playground
PerformanceLogLevel: number

Sets the current performance log level

Static PerformanceNoneLogLevel

Find examples in Playground
PerformanceNoneLogLevel: number

No performance log

Static PerformanceUserMarkLogLevel

Find examples in Playground
PerformanceUserMarkLogLevel: number

Use user marks to log performance

Static PreprocessUrl

Find examples in Playground
PreprocessUrl: function

Gets or sets a function used to pre-process url before using them to load assets

Type declaration

    • (url: string): string
    • Parameters

      • url: string

      Returns string

Static RegisteredExternalClasses

Find examples in Playground
RegisteredExternalClasses: object

Use this object to register external classes like custom textures or material to allow the laoders to instantiate them

Type declaration

  • [key: string]: Object

Static StartPerformanceCounter

Find examples in Playground
StartPerformanceCounter: function

Starts a performance counter

Type declaration

    • (counterName: string, condition?: boolean): void
    • Parameters

      • counterName: string
      • Optional condition: boolean

      Returns void

Static UseCustomRequestHeaders

Find examples in Playground
UseCustomRequestHeaders: boolean

Enable/Disable Custom HTTP Request Headers globally. default = false

see

CustomRequestHeaders

Static UseFallbackTexture

Find examples in Playground
UseFallbackTexture: boolean

Gets or sets a global variable indicating if fallback texture must be used when a texture cannot be loaded

ignorenaming

Static Warn

Find examples in Playground
Warn: function

Write a warning message to the console

Type declaration

    • (message: string): void
    • Parameters

      • message: string

      Returns void

Static WarningLogLevel

Find examples in Playground
WarningLogLevel: number

Only warning logs

Static errorsCount

Find examples in Playground
errorsCount: number

Gets a value indicating the number of loading errors

ignorenaming

Static fallbackTexture

Find examples in Playground
fallbackTexture: string

Texture content used if a texture cannot loaded

ignorenaming

Methods

Static BuildArray

Find examples in Playground
  • BuildArray<T>(size: number, itemBuilder: function): Array<T>
  • Returns an array of the given size filled with element built from the given constructor and the paramters

    Type parameters

    • T

    Parameters

    • size: number

      the number of element to construct and put in the array

    • itemBuilder: function

      a callback responsible for creating new instance of item. Called once per array entry.

        • (): T
        • Returns T

    Returns Array<T>

    a new array filled with new objects

Static CeilingPOT

Find examples in Playground
  • CeilingPOT(x: number): number
  • Find the next highest power of two.

    Parameters

    • x: number

      Number to start search from.

    Returns number

    Next highest power of two.

Static CheckExtends

Find examples in Playground
  • Checks if a given vector is inside a specific range

    Parameters

    • v: Vector3

      defines the vector to test

    • min: Vector3

      defines the minimum range

    • max: Vector3

      defines the maximum range

    Returns void

Static CleanUrl

Find examples in Playground
  • CleanUrl(url: string): string
  • Removes unwanted characters from an url

    Parameters

    • url: string

      defines the url to clean

    Returns string

    the cleaned url

Static ClearLogCache

Find examples in Playground
  • ClearLogCache(): void
  • Clears the log cache

    Returns void

Static CreateScreenshot

Find examples in Playground
  • CreateScreenshot(engine: Engine, camera: Camera, size: any, successCallback?: function, mimeType?: string): void
  • Captures a screenshot of the current rendering

    see

    http://doc.babylonjs.com/how_to/render_scene_on_a_png

    Parameters

    • engine: Engine

      defines the rendering engine

    • camera: Camera

      defines the source camera

    • size: any

      This parameter can be set to a single number or to an object with the following (optional) properties: precision, width, height. If a single number is passed, it will be used for both width and height. If an object is passed, the screenshot size will be derived from the parameters. The precision property is a multiplier allowing rendering at a higher or lower resolution

    • Optional successCallback: function

      defines the callback receives a single parameter which contains the screenshot as a string of base64-encoded characters. This string can be assigned to the src parameter of an to display it

        • (data: string): void
        • Parameters

          • data: string

          Returns void

    • Optional mimeType: string

      defines the MIME type of the screenshot image (default: image/png). Check your browser for supported MIME types

    Returns void

Static CreateScreenshotUsingRenderTarget

Find examples in Playground
  • CreateScreenshotUsingRenderTarget(engine: Engine, camera: Camera, size: any, successCallback?: function, mimeType?: string, samples?: number, antialiasing?: boolean, fileName?: string): void
  • Generates an image screenshot from the specified camera.

    see

    http://doc.babylonjs.com/how_to/render_scene_on_a_png

    Parameters

    • engine: Engine

      The engine to use for rendering

    • camera: Camera

      The camera to use for rendering

    • size: any

      This parameter can be set to a single number or to an object with the following (optional) properties: precision, width, height. If a single number is passed, it will be used for both width and height. If an object is passed, the screenshot size will be derived from the parameters. The precision property is a multiplier allowing rendering at a higher or lower resolution

    • Optional successCallback: function

      The callback receives a single parameter which contains the screenshot as a string of base64-encoded characters. This string can be assigned to the src parameter of an to display it

        • (data: string): void
        • Parameters

          • data: string

          Returns void

    • Optional mimeType: string

      The MIME type of the screenshot image (default: image/png). Check your browser for supported MIME types

    • Optional samples: number

      Texture samples (default: 1)

    • Optional antialiasing: boolean

      Whether antialiasing should be turned on or not (default: false)

    • Optional fileName: string

      A name for for the downloaded file.

    Returns void

Static DecodeBase64

Find examples in Playground
  • DecodeBase64(uri: string): ArrayBuffer
  • Decode the given base64 uri.

    Parameters

    • uri: string

      The uri to decode

    Returns ArrayBuffer

    The decoded base64 data.

Static DeepCopy

Find examples in Playground
  • DeepCopy(source: any, destination: any, doNotCopyList?: string[], mustCopyList?: string[]): void
  • Tries to copy an object by duplicating every property

    Parameters

    • source: any

      defines the source object

    • destination: any

      defines the target object

    • Optional doNotCopyList: string[]

      defines a list of properties to avoid

    • Optional mustCopyList: string[]

      defines a list of properties to copy (even if they start with _)

    Returns void

Static DelayAsync

Find examples in Playground
  • DelayAsync(delay: number): Promise<void>
  • Returns a promise that resolves after the given amount of time.

    Parameters

    • delay: number

      Number of milliseconds to delay

    Returns Promise<void>

    Promise that resolves after the given amount of time

Static Download

Find examples in Playground
  • Download(blob: Blob, fileName: string): void
  • Downloads a blob in the browser

    Parameters

    • blob: Blob

      defines the blob to download

    • fileName: string

      defines the name of the downloaded file

    Returns void

Static DumpFramebuffer

Find examples in Playground
  • DumpFramebuffer(width: number, height: number, engine: Engine, successCallback?: function, mimeType?: string, fileName?: string): void
  • Dumps the current bound framebuffer

    Parameters

    • width: number

      defines the rendering width

    • height: number

      defines the rendering height

    • engine: Engine

      defines the hosting engine

    • Optional successCallback: function

      defines the callback triggered once the data are available

        • (data: string): void
        • Parameters

          • data: string

          Returns void

    • Optional mimeType: string

      defines the mime type of the result

    • Optional fileName: string

      defines the filename to download. If present, the result will automatically be downloaded

    Returns void

Static EncodeArrayBufferTobase64

Find examples in Playground
  • EncodeArrayBufferTobase64(buffer: ArrayBuffer): string
  • Encode a buffer to a base64 string

    Parameters

    • buffer: ArrayBuffer

      defines the buffer to encode

    Returns string

    the encoded string

Static EncodeScreenshotCanvasData

Find examples in Playground
  • EncodeScreenshotCanvasData(successCallback?: function, mimeType?: string, fileName?: string): void
  • Encodes the canvas data to base 64 or automatically download the result if filename is defined

    Parameters

    • Optional successCallback: function

      defines the callback triggered once the data are available

        • (data: string): void
        • Parameters

          • data: string

          Returns void

    • Optional mimeType: string

      defines the mime type of the result

    • Optional fileName: string

      defines he filename to download. If present, the result will automatically be downloaded

    Returns void

Static ExitFullscreen

Find examples in Playground
  • ExitFullscreen(): void
  • Asks the browser to exit fullscreen mode

    Returns void

Static ExtractMinAndMax

Find examples in Playground
  • Extracts minimum and maximum values from a list of positions

    Parameters

    • positions: FloatArray

      defines the positions to use

    • start: number

      defines the start index in the positions array

    • count: number

      defines the number of positions to handle

    • Optional bias: Nullable<Vector2>

      defines bias value to add to the result

    • Optional stride: number

      defines the stride size to use (distance between two positions in the positions array)

    Returns object

    minimum and maximum values

Static ExtractMinAndMaxIndexed

Find examples in Playground
  • Extracts minimum and maximum values from a list of indexed positions

    Parameters

    • positions: FloatArray

      defines the positions to use

    • indices: IndicesArray

      defines the indices to the positions

    • indexStart: number

      defines the start index

    • indexCount: number

      defines the end index

    • Optional bias: Nullable<Vector2>

      defines bias value to add to the result

    Returns object

    minimum and maximum values

Static FetchToRef

Find examples in Playground
  • FetchToRef(u: number, v: number, width: number, height: number, pixels: Uint8Array, color: Color4): void
  • Read the content of a byte array at a specified coordinates (taking in account wrapping)

    Parameters

    • u: number

      defines the coordinate on X axis

    • v: number

      defines the coordinate on Y axis

    • width: number

      defines the width of the source data

    • height: number

      defines the height of the source data

    • pixels: Uint8Array

      defines the source byte array

    • color: Color4

      defines the output color

    Returns void

Static FileAsURL

Find examples in Playground
  • FileAsURL(content: string): string
  • Creates a data url from a given string content

    Parameters

    • content: string

      defines the content to convert

    Returns string

    the new data url link

Static First

Find examples in Playground
  • First<T>(array: Array<T>, predicate: function): Nullable<T>
  • Gets the first element of an array satisfying a given predicate

    Type parameters

    • T

    Parameters

    • array: Array<T>

      defines the array to browse

    • predicate: function

      defines the predicate to use

        • (item: T): boolean
        • Parameters

          • item: T

          Returns boolean

    Returns Nullable<T>

    null if not found or the element

Static FloatRound

Find examples in Playground
  • FloatRound(value: number): number
  • Returns the nearest 32-bit single precision float representation of a Number

    Parameters

    • value: number

      A Number. If the parameter is of a different type, it will get converted to a number or to NaN if it cannot be converted

    Returns number

    number

Static FloorPOT

Find examples in Playground
  • FloorPOT(x: number): number
  • Find the next lowest power of two.

    Parameters

    • x: number

      Number to start search from.

    Returns number

    Next lowest power of two.

Static Format

Find examples in Playground
  • Format(value: number, decimals?: number): string
  • Format the given number to a specific decimal format

    Parameters

    • value: number

      defines the number to format

    • Optional decimals: number

      defines the number of decimals to use

    Returns string

    the formatted string

Static GetClassName

Find examples in Playground
  • GetClassName(object: any, isType?: boolean): string
  • This method will return the name of the class used to create the instance of the given object. It will works only on Javascript basic data types (number, string, ...) and instance of class declared with the @className decorator.

    Parameters

    • object: any

      the object to get the class name from

    • Optional isType: boolean

      defines if the object is actually a type

    Returns string

    the name of the class, will be "object" for a custom data type not using the @className decorator

Static GetCurrentGradient

Find examples in Playground
  • GetCurrentGradient(ratio: number, gradients: IValueGradient[], updateFunc: function): void
  • Gets the current gradient from an array of IValueGradient

    Parameters

    • ratio: number

      defines the current ratio to get

    • gradients: IValueGradient[]

      defines the array of IValueGradient

    • updateFunc: function

      defines the callback function used to get the final value from the selected gradients

    Returns void

Static GetDOMTextContent

Find examples in Playground
  • GetDOMTextContent(element: HTMLElement): string
  • Extracts text content from a DOM element hierarchy

    Parameters

    • element: HTMLElement

      defines the root element

    Returns string

    a string

Static GetExponentOfTwo

Find examples in Playground
  • GetExponentOfTwo(value: number, max: number, mode?: number): number
  • Get the closest exponent of two

    Parameters

    • value: number

      defines the value to approximate

    • max: number

      defines the maximum value to return

    • Optional mode: number

      defines how to define the closest value

    Returns number

    closest exponent of two of the given value

Static GetFilename

Find examples in Playground
  • GetFilename(path: string): string
  • Extracts the filename from a path

    Parameters

    • path: string

      defines the path to use

    Returns string

    the filename

Static GetFolderPath

Find examples in Playground
  • GetFolderPath(uri: string, returnUnchangedIfNoSlash?: boolean): string
  • Extracts the "folder" part of a path (everything before the filename).

    Parameters

    • uri: string

      The URI to extract the info from

    • Optional returnUnchangedIfNoSlash: boolean

      Do not touch the URI if no slashes are present

    Returns string

    The "folder" part of the path

Static GetPointerPrefix

Find examples in Playground
  • GetPointerPrefix(): string
  • Gets the pointer prefix to use

    Returns string

    "pointer" if touch is enabled. Else returns "mouse"

Static InjectCustomRequestHeaders

Find examples in Playground
  • InjectCustomRequestHeaders(request: XMLHttpRequest): void
  • Injects the @see CustomRequestHeaders into the given request

    Parameters

    • request: XMLHttpRequest

      the request that should be used for injection

    Returns void

Static Instantiate

Find examples in Playground
  • Instantiate(className: string): any
  • Tries to instantiate a new object from a given class name

    Parameters

    • className: string

      defines the class name to instantiate

    Returns any

    the new object or null if the system was not able to do the instantiation

Static IsBase64

Find examples in Playground
  • IsBase64(uri: string): boolean
  • Test if the given uri is a base64 string

    Parameters

    • uri: string

      The uri to test

    Returns boolean

    True if the uri is a base64 string or false otherwise

Static IsEmpty

Find examples in Playground
  • IsEmpty(obj: any): boolean
  • Gets a boolean indicating if the given object has no own property

    Parameters

    • obj: any

      defines the object to test

    Returns boolean

    true if object has no own property

Static IsExponentOfTwo

Find examples in Playground
  • IsExponentOfTwo(value: number): boolean
  • Function indicating if a number is an exponent of 2

    Parameters

    • value: number

      defines the value to test

    Returns boolean

    true if the value is an exponent of 2

Static IsFileURL

Find examples in Playground
  • IsFileURL(): boolean
  • Checks if the loaded document was accessed via file:-Protocol.

    Returns boolean

    boolean

Static IsWindowObjectExist

Find examples in Playground
  • IsWindowObjectExist(): boolean
  • Checks if the window object exists

    Returns boolean

    true if the window object exists

Static LoadFile

Find examples in Playground
  • LoadFile(url: string, onSuccess: function, onProgress?: function, offlineProvider?: IOfflineProvider, useArrayBuffer?: boolean, onError?: function): IFileRequest
  • Loads a file

    Parameters

    • url: string

      url string, ArrayBuffer, or Blob to load

    • onSuccess: function

      callback called when the file successfully loads

        • (data: string | ArrayBuffer, responseURL?: string): void
        • Parameters

          • data: string | ArrayBuffer
          • Optional responseURL: string

          Returns void

    • Optional onProgress: function

      callback called while file is loading (if the server supports this mode)

        • (data: any): void
        • Parameters

          • data: any

          Returns void

    • Optional offlineProvider: IOfflineProvider

      defines the offline provider for caching

    • Optional useArrayBuffer: boolean

      defines a boolean indicating that date must be returned as ArrayBuffer

    • Optional onError: function

      callback called when the file fails to load

        • (request?: XMLHttpRequest, exception?: any): void
        • Parameters

          • Optional request: XMLHttpRequest
          • Optional exception: any

          Returns void

    Returns IFileRequest

    a file request object

Static LoadImage

Find examples in Playground
  • LoadImage(input: string | ArrayBuffer | Blob, onLoad: function, onError: function, offlineProvider: Nullable<IOfflineProvider>): HTMLImageElement
  • Loads an image as an HTMLImageElement.

    Parameters

    • input: string | ArrayBuffer | Blob

      url string, ArrayBuffer, or Blob to load

    • onLoad: function

      callback called when the image successfully loads

        • (img: HTMLImageElement): void
        • Parameters

          • img: HTMLImageElement

          Returns void

    • onError: function

      callback called when the image fails to load

        • (message?: string, exception?: any): void
        • Parameters

          • Optional message: string
          • Optional exception: any

          Returns void

    • offlineProvider: Nullable<IOfflineProvider>

      offline provider for caching

    Returns HTMLImageElement

    the HTMLImageElement of the loaded image

Static LoadScript

Find examples in Playground
  • LoadScript(scriptUrl: string, onSuccess: function, onError?: function): void
  • Load a script (identified by an url). When the url returns, the content of this file is added into a new script element, attached to the DOM (body element)

    Parameters

    • scriptUrl: string

      defines the url of the script to laod

    • onSuccess: function

      defines the callback called when the script is loaded

        • (): void
        • Returns void

    • Optional onError: function

      defines the callback to call if an error occurs

        • (message?: string, exception?: any): void
        • Parameters

          • Optional message: string
          • Optional exception: any

          Returns void

    Returns void

Static MakeArray

Find examples in Playground
  • MakeArray(obj: any, allowsNullUndefined?: boolean): Nullable<Array<any>>
  • Returns an array if obj is not an array

    Parameters

    • obj: any

      defines the object to evaluate as an array

    • Optional allowsNullUndefined: boolean

      defines a boolean indicating if obj is allowed to be null or undefined

    Returns Nullable<Array<any>>

    either obj directly if obj is an array or a new array containing obj

Static Mix

Find examples in Playground
  • Mix(a: number, b: number, alpha: number): number
  • Interpolates between a and b via alpha

    Parameters

    • a: number

      The lower value (returned when alpha = 0)

    • b: number

      The upper value (returned when alpha = 1)

    • alpha: number

      The interpolation-factor

    Returns number

    The mixed value

Static NearestPOT

Find examples in Playground
  • NearestPOT(x: number): number
  • Find the nearest power of two.

    Parameters

    • x: number

      Number to start search from.

    Returns number

    Next nearest power of two.

Static QueueNewFrame

Find examples in Playground
  • QueueNewFrame(func: function, requester?: any): number
  • Queue a new function into the requested animation frame pool (ie. this function will be executed byt the browser for the next frame)

    Parameters

    • func: function

      the function to be called

        • (): void
        • Returns void

    • Optional requester: any

      the object that will request the next frame. Falls back to window.

    Returns number

    frame number

Static RandomId

Find examples in Playground
  • RandomId(): string

Static ReadFile

Find examples in Playground
  • ReadFile(fileToLoad: File, callback: function, progressCallBack?: function, useArrayBuffer?: boolean): IFileRequest
  • Loads a file

    Parameters

    • fileToLoad: File

      defines the file to load

    • callback: function

      defines the callback to call when data is loaded

        • (data: any): void
        • Parameters

          • data: any

          Returns void

    • Optional progressCallBack: function

      defines the callback to call during loading process

        • (ev: ProgressEvent): any
        • Parameters

          • ev: ProgressEvent

          Returns any

    • Optional useArrayBuffer: boolean

      defines a boolean indicating that data must be returned as an ArrayBuffer

    Returns IFileRequest

    a file request object

Static ReadFileAsDataURL

Find examples in Playground
  • ReadFileAsDataURL(fileToLoad: Blob, callback: function, progressCallback: function): IFileRequest
  • Loads a file from a blob

    Parameters

    • fileToLoad: Blob

      defines the blob to use

    • callback: function

      defines the callback to call when data is loaded

        • (data: any): void
        • Parameters

          • data: any

          Returns void

    • progressCallback: function

      defines the callback to call during loading process

        • (ev: ProgressEvent): any
        • Parameters

          • ev: ProgressEvent

          Returns any

    Returns IFileRequest

    a file request object

Static RegisterTopRootEvents

Find examples in Playground
  • RegisterTopRootEvents(events: object[]): void
  • Function used to register events at window level

    Parameters

    • events: object[]

      defines the events to register

    Returns void

Static RequestFullscreen

Find examples in Playground
  • RequestFullscreen(element: HTMLElement): void
  • Ask the browser to promote the current element to fullscreen rendering mode

    Parameters

    • element: HTMLElement

      defines the DOM element to promote

    Returns void

Static SetCorsBehavior

Find examples in Playground
  • SetCorsBehavior(url: string | string[], element: object): void
  • Sets the cors behavior on a dom element. This will add the required Tools.CorsBehavior to the element.

    Parameters

    • url: string | string[]

      define the url we are trying

    • element: object

      define the dom element where to configure the cors policy

      • crossOrigin: string | null

    Returns void

Static SetImmediate

Find examples in Playground
  • SetImmediate(action: function): void
  • Polyfill for setImmediate

    Parameters

    • action: function

      defines the action to execute after the current execution block

        • (): void
        • Returns void

    Returns void

Static Slice

Find examples in Playground
  • Slice<T>(data: T, start?: number, end?: number): T
  • Provides a slice function that will work even on IE

    Type parameters

    • T

    Parameters

    • data: T

      defines the array to slice

    • Optional start: number

      defines the start of the data (optional)

    • Optional end: number

      defines the end of the data (optional)

    Returns T

    the new sliced array

Static ToBlob

Find examples in Playground
  • ToBlob(canvas: HTMLCanvasElement, successCallback: function, mimeType?: string): void
  • Converts the canvas data to blob. This acts as a polyfill for browsers not supporting the to blob function.

    Parameters

    • canvas: HTMLCanvasElement

      Defines the canvas to extract the data from

    • successCallback: function

      Defines the callback triggered once the data are available

    • Optional mimeType: string

      Defines the mime type of the result

    Returns void

Static ToDegrees

Find examples in Playground
  • ToDegrees(angle: number): number
  • Convert an angle in radians to degrees

    Parameters

    • angle: number

      defines the angle to convert

    Returns number

    the angle in degrees

Static ToRadians

Find examples in Playground
  • ToRadians(angle: number): number
  • Convert an angle in degrees to radians

    Parameters

    • angle: number

      defines the angle to convert

    Returns number

    the angle in radians

Static UnregisterTopRootEvents

Find examples in Playground
  • UnregisterTopRootEvents(events: object[]): void
  • Function used to unregister events from window level

    Parameters

    • events: object[]

      defines the events to unregister

    Returns void

Static ValidateXHRData

Find examples in Playground
  • ValidateXHRData(xhr: XMLHttpRequest, dataType?: number): boolean
  • Validates if xhr data is correct

    Parameters

    • xhr: XMLHttpRequest

      defines the request to validate

    • Optional dataType: number

      defines the expected data type

    Returns boolean

    true if data is correct

Static getFullClassName

Find examples in Playground
  • getFullClassName(object: any, isType?: boolean): Nullable<string>
  • This method will return the name of the full name of the class, including its owning module (if any). It will works only on Javascript basic data types (number, string, ...) and instance of class declared with the @className decorator or implementing a method getClassName():string (in which case the module won't be specified).

    ignorenaming

    Parameters

    • object: any

      the object to get the class name from

    • Optional isType: boolean

      defines if the object is actually a type

    Returns Nullable<string>

    a string that can have two forms: "moduleName.className" if module was specified when the class' Name was registered or "className" if there was not module specified.

Generated using TypeDoc