Direct access to all functionality from Aurelia's core libraries through the framework package. The aurelia-framework package re-exports the complete public API from 8 core Aurelia libraries plus the LogManager namespace, providing unified access to dependency injection, binding, templating, loading, and platform abstraction functionality.
All exports from the following core Aurelia libraries are available directly through aurelia-framework:
// All exports from these libraries are available through aurelia-framework:
export * from "aurelia-dependency-injection";
export * from "aurelia-binding";
export * from "aurelia-metadata";
export * from "aurelia-templating";
export * from "aurelia-loader";
export * from "aurelia-task-queue";
export * from "aurelia-path";
export * from "aurelia-pal";
// Logging is exported as a namespace
export * as LogManager from "aurelia-logging";Usage Examples:
// Import directly from aurelia-framework instead of individual packages
import {
Container,
autoinject,
BindingEngine,
ViewResources,
Loader,
TaskQueue,
join as pathJoin,
DOM,
PLATFORM
} from "aurelia-framework";
// Use logging namespace
import { LogManager } from "aurelia-framework";
const logger = LogManager.getLogger('my-app');Complete dependency injection system including Container, decorators, and resolvers.
// Key exports available from aurelia-dependency-injection:
class Container {
registerInstance(key: any, instance: any): void;
registerSingleton(key: any, fn?: Function): void;
registerTransient(key: any, fn?: Function): void;
get(key: any): any;
// ... and many more DI methods
}
// Decorators for DI
function autoinject(target: any): any;
function inject(...dependencies: any[]): any;
function singleton(target: any): any;
function transient(target: any): any;Examples:
import { Container, autoinject, inject } from "aurelia-framework";
// Use DI container
const container = new Container();
container.registerSingleton(ApiService);
// Use decorators
@autoinject
class MyViewModel {
constructor(private apiService: ApiService) {}
}
// Or with explicit injection
@inject(ApiService, Logger)
class MyService {
constructor(apiService, logger) {}
}Powerful data binding engine with observables, computed properties, and binding expressions.
// Key exports from aurelia-binding:
class BindingEngine {
createBindingExpression(expression: string): BindingExpression;
propertyObserver(obj: any, propertyName: string): PropertyObserver;
// ... binding engine methods
}
class ObserverLocator {
getObserver(obj: any, propertyName: string): any;
// ... observer location methods
}
// Decorators
function observable(target: any, key: string): void;
function computedFrom(...dependencies: string[]): any;Examples:
import { BindingEngine, observable, computedFrom } from "aurelia-framework";
class ViewModel {
@observable name = '';
@computedFrom('name')
get greeting() {
return `Hello, ${this.name}!`;
}
}
// Manual binding
const bindingEngine = new BindingEngine();
const observer = bindingEngine.propertyObserver(viewModel, 'name');
observer.subscribe(() => console.log('Name changed'));View engine, component system, and custom element/attribute creation.
// Key exports from aurelia-templating:
class ViewResources {
registerElement(tagName: string, behavior: HtmlBehaviorResource): void;
// ... resource registration methods
}
class TemplatingEngine {
compose(instruction: CompositionContext): Promise<View>;
enhance(instruction: EnhanceInstruction): View;
// ... templating methods
}
// Decorators for custom elements/attributes
function customElement(name: string): any;
function customAttribute(name: string): any;
function bindable(target: any, key: string): void;Examples:
import { customElement, bindable, ViewResources } from "aurelia-framework";
@customElement('my-button')
export class MyButton {
@bindable text: string;
@bindable disabled: boolean;
}
// Manual resource registration
const resources = new ViewResources();
resources.registerElement('custom-tag', myBehavior);Module loading abstraction for different module systems.
// Key exports from aurelia-loader:
abstract class Loader {
loadModule(id: string): Promise<any>;
loadAllModules(ids: string[]): Promise<any[]>;
loadTemplate(url: string): Promise<Template>;
// ... loader methods
}Examples:
import { Loader, PLATFORM } from "aurelia-framework";
const loader = new PLATFORM.Loader();
const module = await loader.loadModule('./my-module');
const template = await loader.loadTemplate('./my-template.html');Microtask and macrotask queue management for batching operations.
// Key exports from aurelia-task-queue:
class TaskQueue {
queueMicroTask(task: Function): void;
queueTask(task: Function): void;
flushTaskQueue(): void;
// ... task queue methods
}Examples:
import { TaskQueue } from "aurelia-framework";
const taskQueue = new TaskQueue();
// Queue DOM updates
taskQueue.queueMicroTask(() => {
updateDOMElement();
});
// Queue lower priority tasks
taskQueue.queueTask(() => {
performExpensiveOperation();
});Path manipulation and URL utilities.
// Key exports from aurelia-path:
function join(path1: string, path2: string): string;
function buildQueryString(params: any): string;
function parseQueryString(queryString: string): any;
function relativeToFile(name: string, file: string): string;
// ... many more path utilitiesExamples:
import { join, buildQueryString, parseQueryString } from "aurelia-framework";
const fullPath = join('/api', 'users/123');
const query = buildQueryString({ page: 1, limit: 20 });
const params = parseQueryString('?page=1&limit=20');Platform abstraction layer for DOM and environment APIs.
// Key exports from aurelia-pal:
interface DOM {
createElement(tagName: string): Element;
querySelectorAll(selector: string): NodeList;
addEventListener(eventName: string, callback: Function, capture?: boolean): void;
// ... DOM methods
}
interface PLATFORM {
global: any;
location: Location;
history: History;
// ... platform APIs
}Examples:
import { DOM, PLATFORM } from "aurelia-framework";
// DOM operations
const element = DOM.createElement('div');
const elements = DOM.querySelectorAll('.my-class');
// Platform detection
if (PLATFORM.global.window) {
// Browser environment
console.log('Running in browser');
}Reflection and metadata annotation system.
// Key exports from aurelia-metadata:
class MetadataType {
define(metadataKey: string, metadataValue: any, target: any): void;
get(metadataKey: string, target: any): any;
// ... metadata methods
}
function metadata(key: string, value: any): Function;Examples:
import { metadata } from "aurelia-framework";
@metadata('custom-info', { version: '1.0' })
class MyClass {
// Class implementation
}Comprehensive logging system with appenders and log levels.
// LogManager namespace exports:
namespace LogManager {
function getLogger(id: string): Logger;
function addAppender(appender: Appender): void;
function setLevel(level: number): void;
enum logLevel {
none = 0,
error = 1,
warn = 2,
info = 3,
debug = 4
}
interface Logger {
debug(message: string, ...rest: any[]): void;
info(message: string, ...rest: any[]): void;
warn(message: string, ...rest: any[]): void;
error(message: string, ...rest: any[]): void;
}
}Examples:
import { LogManager } from "aurelia-framework";
// Create logger
const logger = LogManager.getLogger('my-component');
// Use logger
logger.info('Component initialized');
logger.warn('Deprecated method called');
logger.error('An error occurred', error);
// Configure logging
LogManager.setLevel(LogManager.logLevel.debug);
LogManager.addAppender(new ConsoleAppender());You can import any functionality from the core libraries directly through aurelia-framework:
// Instead of multiple imports:
// import { Container } from "aurelia-dependency-injection";
// import { BindingEngine } from "aurelia-binding";
// import { ViewResources } from "aurelia-templating";
// Use single import:
import {
Container,
BindingEngine,
ViewResources,
TaskQueue,
DOM,
PLATFORM,
LogManager
} from "aurelia-framework";
// Or import everything:
import * as Aurelia from "aurelia-framework";
const container = new Aurelia.Container();This unified import approach simplifies dependency management and ensures version compatibility across all core Aurelia functionality.