Module Class

Index

Functions

Functions

define(constructor: Function, instanceMembers?: any, staticMembers?: any): any

Defines a class using the given constructor and the specified instance members.

Parameters

  • constructor: Function

    A constructor function that is used to instantiate this type.

  • instanceMembers?: any optional

    The set of instance fields, properties, and methods made available on the type.

  • staticMembers?: any optional

    The set of static fields, properties, and methods made available on the type.

Returns

any

The newly-defined type.

derive(baseClass: any, constructor: Function, instanceMembers?: any, staticMembers?: any): any

Creates a sub-class based on the specified baseClass parameter, using prototype inheritance.

Parameters

  • baseClass: any

    The type to inherit from.

  • constructor: Function

    A constructor function that is used to instantiate this type.

  • instanceMembers?: any optional

    The set of instance fields, properties, and methods to be made available on the type.

  • staticMembers?: any optional

    The set of static fields, properties, and methods to be made available on the type.

Returns

any

The newly-defined type.

mix(constructor: Function, mixin?: Array<any>): any

Defines a class using the given constructor and the union of the set of instance members specified by all the mixin objects. The mixin parameter list is of variable length. For more information, see Adding functionality with WinJS mixins.

Parameters

  • constructor: Function

    A constructor function that will be used to instantiate this class.

  • mixin?: Array<any> optional

    An object declaring the set of instance members. The mixin parameter list is of variable length.

Returns

any

The newly defined class.