All files / src index.ts

54.17% Statements 13/24
0% Branches 0/4
0% Functions 0/2
54.17% Lines 13/24
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42          1x 1x 1x   1x   1x 1x   1x 1x 1x 1x   1x 1x       1x                                  
import { BindingBehaviorResource, FrameworkConfiguration } from 'aurelia-framework';
 
import { AureliaUX } from './aurelia-ux';
import { BooleanBB } from './components/boolean-attr-binding-behavior';
 
export { swatches } from './colors/swatches';
export { shadows } from './colors/shadows';
export { processDesignAttributes } from './designs/design-attributes';
 
export { PaperRipple } from './effects/paper-ripple';
 
export { normalizeBooleanAttribute } from './components/html-attributes';
export { UxComponent } from './components/ux-component';
 
export { UxTheme } from './styles/ux-theme';
export { StyleEngine } from './styles/style-engine';
export { GlobalStyle } from './styles/global-style';
export { GlobalStyleEngine } from './styles/global-style-engine';
 
export { AureliaUX } from './aurelia-ux';
export { UXConfiguration } from './ux-configuration';
 
let uxCorePromise: Promise<AureliaUX>;
 
export function configure(config: FrameworkConfiguration, callback?: (config: AureliaUX) => Promise<any>) {
  if (uxCorePromise) {
    return uxCorePromise;
  }
  const ux: AureliaUX = config.container.get(AureliaUX);
  const boolAttr = new BindingBehaviorResource('');
  boolAttr.initialize(config.container, BooleanBB);
  boolAttr.register(config.aurelia.resources, 'booleanAttr');
 
  if (typeof callback === 'function') {
    return uxCorePromise = Promise.resolve(callback(ux))
      .then(() => ux.start(config));
  } else {
    ux.use.defaultConfiguration();
    return uxCorePromise = ux.start(config);
  }
}