Interface Cordova

Index

Properties

Methods

Properties

public platformId: string

Gets the operating system name.

public version: string

Gets Cordova framework version

Methods

public define(moduleName: string, factory: (require: any, exports: any, module: any) => any)

Defines custom logic as a Cordova module. Other modules can later access it using module name provided.

Parameters

  • moduleName: string
  • factory: (require: any, exports: any, module: any) => any

public exec(success: () => any, fail: () => any, service: string, action: string, args?: Array<string>)

Invokes native functionality by specifying corresponding service name, action and optional parameters.

Parameters

  • success: () => any

    A success callback function.

  • fail: () => any

    An error callback function.

  • service: string

    The service name to call on the native side (corresponds to a native class).

  • action: string

    The action name to call on the native side (generally corresponds to the native class method).

  • args?: Array<string> optional

    An array of arguments to pass into the native environment.

public require(moduleName: string): any

Access a Cordova module by name.

Parameters

  • moduleName: string

Returns

any