Interface Require

Index

Call signatures

Methods

Call signatures

(module: string): any

CommonJS require call

Parameters

  • module: string

    Module to load

Returns

any

The loaded module

(modules: Array<string>)

Start the main app logic. Callback is optional. Can alternatively use deps and callback.

Parameters

  • modules: Array<string>

    Required modules to load.

(modules: Array<string>, ready: Function)

see

Require()

Parameters

  • modules: Array<string>
  • ready: Function

    Called when required modules are ready.

(modules: Array<string>, ready: Function, errback: Function)

see

http://requirejs.org/docs/api.html#errbacks

Parameters

  • modules: Array<string>
  • ready: Function

    Called when required modules are ready.

  • errback: Function

Methods

public config(config: RequireConfig): Require

Configure require.js

Parameters

Returns

Require

public defined(module: string): boolean

Returns true if the module has already been loaded and defined.

Parameters

  • module: string

    Module to check

Returns

boolean

public onError(err: RequireError, errback?: (err: RequireError) => void)

On Error override

Parameters

  • err: RequireError
  • errback?: (err: RequireError) => void optional

public onResourceLoad(context: Object, map: RequireMap, depArray: RequireMap[])

Semi-private function, overload in special instance of undef()

Parameters

public specified(module: string): boolean

Returns true if the module has already been requested or is in the process of loading and should be available at some point.

Parameters

  • module: string

    Module to check

Returns

boolean

public toUrl(module: string): string

Generate URLs from require module

Parameters

  • module: string

    Module to URL

Returns

string

URL string

public undef(module: string)

Undefine a module

Parameters

  • module: string

    Module to undefine.