Skip to content

Commit

Permalink
doc(all): lock down api and finalize api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Oct 24, 2015
1 parent 37f5fbf commit c59cf24
Show file tree
Hide file tree
Showing 14 changed files with 436 additions and 135 deletions.
58 changes: 47 additions & 11 deletions dist/amd/aurelia-framework.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,23 @@ declare module 'aurelia-framework' {

/**
* Manages configuring the aurelia framework instance.
* @param {Aurelia} aurelia An instance of Aurelia.
*/
export class FrameworkConfiguration {

/**
* The root DI container used by the application.
*/
container: Container;

/**
* The aurelia instance.
*/
aurelia: Aurelia;

/**
* Creates an instance of FrameworkConfiguration.
* @param aurelia An instance of Aurelia.
*/
constructor(aurelia: Aurelia);

/**
Expand Down Expand Up @@ -136,38 +148,58 @@ declare module 'aurelia-framework' {

/**
* The framework core that provides the main Aurelia object.
* @param loader The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use a defaultLoader.
* @param container The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty container.
* @param resources The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry.
*/
export class Aurelia {

/**
* The loader used by the application.
*/
loader: Loader;

/**
* The root DI container used by the application.
*/
container: Container;

/**
* The global view resources used by the application.
*/
resources: ViewResources;

/**
* The configuration used during application startup.
*/
use: FrameworkConfiguration;

/**
* Creates an instance of Aurelia.
* @param loader The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use the loader type specified by PLATFORM.Loader.
* @param container The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty, global container.
* @param resources The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry.
*/
constructor(loader?: Loader, container?: Container, resources?: ViewResources);

/**
* Loads plugins, then resources, and then starts the Aurelia instance.
* @return Returns the started Aurelia instance.
* @return Returns a Promise with the started Aurelia instance.
*/
start(): Promise<Aurelia>;

/**
* Enhances the host's existing elements with behaviors and bindings.
* @param bindingContext A binding context for the enhanced elements.
* @param applicationHost The DOM object that Aurelia will enhance.
* @return Returns the current Aurelia instance.
* @return Returns a Promise for the current Aurelia instance.
*/
enhance(bindingContext?: Object, applicationHost?: any): Promise<Aurelia>;
enhance(bindingContext?: Object, applicationHost?: string | Element): Promise<Aurelia>;

/**
* Instantiates the root view-model and view and add them to the DOM.
* @param root The root view-model to load upon bootstrap.
* Instantiates the root component and adds it to the DOM.
* @param root The root component to load upon bootstrap.
* @param applicationHost The DOM object that Aurelia will attach to.
* @return Returns the current Aurelia instance.
* @return Returns a Promise of the current Aurelia instance.
*/
setRoot(root?: string, applicationHost?: any): Promise<Aurelia>;
setRoot(root?: string, applicationHost?: string | Element): Promise<Aurelia>;
}
export * from 'aurelia-dependency-injection';
export * from 'aurelia-binding';
Expand All @@ -177,5 +209,9 @@ declare module 'aurelia-framework' {
export * from 'aurelia-task-queue';
export * from 'aurelia-path';
export * from 'aurelia-pal';

/**
* The log manager.
*/
export const LogManager: any;
}
3 changes: 1 addition & 2 deletions dist/amd/aurelia-framework.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ define(['exports', 'core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia-
_classCallCheck(this, Aurelia);

this.loader = loader || new _aureliaPal.PLATFORM.Loader();
this.container = container || new _aureliaDependencyInjection.Container();
this.container = container || new _aureliaDependencyInjection.Container().makeGlobal();
this.resources = resources || new _aureliaTemplating.ViewResources();
this.use = new FrameworkConfiguration(this);
this.logger = _aureliaLogging.getLogger('aurelia');
Expand All @@ -265,7 +265,6 @@ define(['exports', 'core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia-
this.use.instance(Aurelia, this);
this.use.instance(_aureliaLoader.Loader, this.loader);
this.use.instance(_aureliaTemplating.ViewResources, this.resources);
this.container.makeGlobal();
}

Aurelia.prototype.start = function start() {
Expand Down
58 changes: 47 additions & 11 deletions dist/aurelia-framework.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,23 @@ declare module 'aurelia-framework' {

/**
* Manages configuring the aurelia framework instance.
* @param {Aurelia} aurelia An instance of Aurelia.
*/
export class FrameworkConfiguration {

/**
* The root DI container used by the application.
*/
container: Container;

/**
* The aurelia instance.
*/
aurelia: Aurelia;

/**
* Creates an instance of FrameworkConfiguration.
* @param aurelia An instance of Aurelia.
*/
constructor(aurelia: Aurelia);

/**
Expand Down Expand Up @@ -136,38 +148,58 @@ declare module 'aurelia-framework' {

/**
* The framework core that provides the main Aurelia object.
* @param loader The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use a defaultLoader.
* @param container The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty container.
* @param resources The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry.
*/
export class Aurelia {

/**
* The loader used by the application.
*/
loader: Loader;

/**
* The root DI container used by the application.
*/
container: Container;

/**
* The global view resources used by the application.
*/
resources: ViewResources;

/**
* The configuration used during application startup.
*/
use: FrameworkConfiguration;

/**
* Creates an instance of Aurelia.
* @param loader The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use the loader type specified by PLATFORM.Loader.
* @param container The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty, global container.
* @param resources The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry.
*/
constructor(loader?: Loader, container?: Container, resources?: ViewResources);

/**
* Loads plugins, then resources, and then starts the Aurelia instance.
* @return Returns the started Aurelia instance.
* @return Returns a Promise with the started Aurelia instance.
*/
start(): Promise<Aurelia>;

/**
* Enhances the host's existing elements with behaviors and bindings.
* @param bindingContext A binding context for the enhanced elements.
* @param applicationHost The DOM object that Aurelia will enhance.
* @return Returns the current Aurelia instance.
* @return Returns a Promise for the current Aurelia instance.
*/
enhance(bindingContext?: Object, applicationHost?: any): Promise<Aurelia>;
enhance(bindingContext?: Object, applicationHost?: string | Element): Promise<Aurelia>;

/**
* Instantiates the root view-model and view and add them to the DOM.
* @param root The root view-model to load upon bootstrap.
* Instantiates the root component and adds it to the DOM.
* @param root The root component to load upon bootstrap.
* @param applicationHost The DOM object that Aurelia will attach to.
* @return Returns the current Aurelia instance.
* @return Returns a Promise of the current Aurelia instance.
*/
setRoot(root?: string, applicationHost?: any): Promise<Aurelia>;
setRoot(root?: string, applicationHost?: string | Element): Promise<Aurelia>;
}
export * from 'aurelia-dependency-injection';
export * from 'aurelia-binding';
Expand All @@ -177,5 +209,9 @@ declare module 'aurelia-framework' {
export * from 'aurelia-task-queue';
export * from 'aurelia-path';
export * from 'aurelia-pal';

/**
* The log manager.
*/
export const LogManager: any;
}
54 changes: 41 additions & 13 deletions dist/aurelia-framework.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,22 @@ function assertProcessed(plugins) {

/**
* Manages configuring the aurelia framework instance.
* @param {Aurelia} aurelia An instance of Aurelia.
*/
export class FrameworkConfiguration {
/**
* The root DI container used by the application.
*/
container: Container;

/**
* The aurelia instance.
*/
aurelia: Aurelia;

/**
* Creates an instance of FrameworkConfiguration.
* @param aurelia An instance of Aurelia.
*/
constructor(aurelia: Aurelia) {
this.aurelia = aurelia;
this.container = aurelia.container;
Expand Down Expand Up @@ -322,19 +332,35 @@ function preventActionlessFormSubmit() {

/**
* The framework core that provides the main Aurelia object.
* @param loader The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use a defaultLoader.
* @param container The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty container.
* @param resources The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry.
*/
export class Aurelia {
/**
* The loader used by the application.
*/
loader: Loader;
/**
* The root DI container used by the application.
*/
container: Container;
/**
* The global view resources used by the application.
*/
resources: ViewResources;

/**
* The configuration used during application startup.
*/
use: FrameworkConfiguration;

/**
* Creates an instance of Aurelia.
* @param loader The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use the loader type specified by PLATFORM.Loader.
* @param container The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty, global container.
* @param resources The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry.
*/
constructor(loader?: Loader, container?: Container, resources?: ViewResources) {
this.loader = loader || new PLATFORM.Loader();
this.container = container || new Container();
this.container = container || (new Container()).makeGlobal();
this.resources = resources || new ViewResources();
this.use = new FrameworkConfiguration(this);
this.logger = TheLogManager.getLogger('aurelia');
Expand All @@ -344,12 +370,11 @@ export class Aurelia {
this.use.instance(Aurelia, this);
this.use.instance(Loader, this.loader);
this.use.instance(ViewResources, this.resources);
this.container.makeGlobal();
}

/**
* Loads plugins, then resources, and then starts the Aurelia instance.
* @return Returns the started Aurelia instance.
* @return Returns a Promise with the started Aurelia instance.
*/
start(): Promise<Aurelia> {
if (this.started) {
Expand Down Expand Up @@ -385,9 +410,9 @@ export class Aurelia {
* Enhances the host's existing elements with behaviors and bindings.
* @param bindingContext A binding context for the enhanced elements.
* @param applicationHost The DOM object that Aurelia will enhance.
* @return Returns the current Aurelia instance.
* @return Returns a Promise for the current Aurelia instance.
*/
enhance(bindingContext: Object = {}, applicationHost = null): Promise<Aurelia> {
enhance(bindingContext: Object = {}, applicationHost: string | Element = null): Promise<Aurelia> {
this._configureHost(applicationHost);

return new Promise(resolve => {
Expand All @@ -400,12 +425,12 @@ export class Aurelia {
}

/**
* Instantiates the root view-model and view and add them to the DOM.
* @param root The root view-model to load upon bootstrap.
* Instantiates the root component and adds it to the DOM.
* @param root The root component to load upon bootstrap.
* @param applicationHost The DOM object that Aurelia will attach to.
* @return Returns the current Aurelia instance.
* @return Returns a Promise of the current Aurelia instance.
*/
setRoot(root: string = 'app', applicationHost = null): Promise<Aurelia> {
setRoot(root: string = 'app', applicationHost: string | Element = null): Promise<Aurelia> {
let compositionEngine;
let instruction = {};

Expand Down Expand Up @@ -464,4 +489,7 @@ export * from 'aurelia-task-queue';
export * from 'aurelia-path';
export * from 'aurelia-pal';

/**
* The log manager.
*/
export const LogManager = TheLogManager;
Loading

0 comments on commit c59cf24

Please sign in to comment.