// Type definitions for SystemJS 0.19.29
// Project: https://github.com/systemjs/systemjs
// Definitions by: Ludovic HENIN , Nathan Walker , Giedrius Grabauskas
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace SystemJSLoader {
type ModulesList = { [bundleName: string]: Array };
type PackageList = { [packageName: string]: T };
/**
* The following module formats are supported:
*
* - esm: ECMAScript Module (previously referred to as es6)
* - cjs: CommonJS
* - amd: Asynchronous Module Definition
* - global: Global shim module format
* - register: System.register or System.registerDynamic compatibility module format
*
*/
type ModuleFormat = "esm" | "cjs" | "amd" | "global" | "register";
/**
* Sets the module name of the transpiler to be used for loading ES6 modules.
* Represents a module name for System.import that must resolve to either Traceur, Babel or TypeScript.
* When set to traceur, babel or typescript, loading will be automatically configured as far as possible.
*/
type Transpiler = "plugin-traceur" | "plugin-babel" | "plugin-typescript" | "traceur" | "babel" | "typescript" | boolean;
type ConfigMap = PackageList;
type ConfigMeta = PackageList;
interface MetaConfig {
/**
* Sets in what format the module is loaded.
*/
format?: ModuleFormat;
/**
* For the global format, when automatic detection of exports is not enough, a custom exports meta value can be set.
* This tells the loader what global name to use as the module's export value.
*/
exports?: string;
/**
* Dependencies to load before this module. Goes through regular paths and map normalization.
* Only supported for the cjs, amd and global formats.
*/
deps?: Array;
/**
* A map of global names to module names that should be defined only for the execution of this module.
* Enables use of legacy code that expects certain globals to be present.
* Referenced modules automatically becomes dependencies. Only supported for the cjs and global formats.
*/
globals?: string;
/**
* Set a loader for this meta path.
*/
loader?: string;
/**
* For plugin transpilers to set the source map of their transpilation.
*/
sourceMap?: any;
/**
* Load the module using