Add bundles, skipDataMain and onNodeCreated

This commit is contained in:
Alvaro Dias
2015-09-13 04:49:18 -07:00
parent 7a3ca1f0b8
commit 6a02cedcf0

View File

@@ -1,4 +1,4 @@
// Type definitions for RequireJS 2.1.8
// Type definitions for RequireJS 2.1.20
// Project: http://requirejs.org/
// Definitions by: Josh Baldwin <https://github.com/jbaldwin/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -88,6 +88,10 @@ interface RequireConfig {
// baseUrl.
paths?: { [key: string]: any; };
// Allows configuring multiple module IDs to be found in
// another script.
bundles?: { [key: string]: any; };
// Dictionary of Shim's.
// does not cover case of key->string[]
shim?: { [key: string]: RequireShim; };
@@ -182,6 +186,20 @@ interface RequireConfig {
**/
scriptType?: string;
/**
* If set to true, skips the data-main attribute scanning done
* to start module loading. Useful if RequireJS is embedded in
* a utility library that may interact with other RequireJS
* library on the page, and the embedded version should not do
* data-main loading.
**/
skipDataMain?: boolean;
/**
* Allow extending requirejs to support Subresource Integrity
* (SRI).
**/
onNodeCreated?: (node: HTMLScriptElement, config: RequireConfig, moduleName: string, url: string) => void;
}
// todo: not sure what to do with this guy