UNPKG

4.01 kBTypeScriptView Raw
1// Generated by dts-bundle-generator v6.7.0
2
3import { OverrideContext } from 'aurelia-binding';
4import { Container } from 'aurelia-dependency-injection';
5import { NavigationInstruction, RouteConfig, RouteLoader, Router } from 'aurelia-router';
6import { CompositionEngine, CompositionTransaction, View, ViewLocator, ViewSlot } from 'aurelia-templating';
7
8/**
9 * Default implementation of `RouteLoader` used for loading component based on a route config
10 */
11export declare class TemplatingRouteLoader extends RouteLoader {
12 constructor(compositionEngine: CompositionEngine);
13 /**
14 * Load corresponding component of a route config of a navigation instruction
15 */
16 loadRoute(router: Router, config: RouteConfig, navInstruction: NavigationInstruction): Promise<any>;
17}
18/**
19 * Implementation of Aurelia Router ViewPort. Responsible for loading route, composing and swapping routes views
20 */
21export declare class RouterView {
22 /**
23 * Swapping order when going to a new route. By default, supports 3 value: before, after, with
24 * - before = new in -> old out
25 * - after = old out -> new in
26 * - with = new in + old out
27 *
28 * These values are defined by swapStrategies export in aurelia-templating/ aurelia-framework
29 * Can be extended there and used here
30 */
31 swapOrder?: "before" | "after" | "with";
32 /**
33 * Layout view used for this router-view layout, if no layout-viewmodel specified
34 */
35 layoutView?: any;
36 /**
37 * Layout view model used as binding context for this router-view layout
38 * Actual type would be {string | Constructable | object}
39 */
40 layoutViewModel?: any;
41 /**
42 * Layout model used to activate layout view model, if specified with `layoutViewModel`
43 */
44 layoutModel?: any;
45 /**
46 * Element associated with this <router-view/> custom element
47 */
48 readonly element: Element;
49 /**
50 * Current router associated with this <router-view/>
51 */
52 readonly router: Router;
53 /**
54 * Container at this <router-view/> level
55 */
56 container: Container;
57 constructor(element: Element, container: Container, viewSlot: ViewSlot, router: Router, viewLocator: ViewLocator, compositionTransaction: CompositionTransaction, compositionEngine: CompositionEngine);
58 created(owningView: View): void;
59 bind(bindingContext: any, overrideContext: OverrideContext): void;
60 /**
61 * Implementation of `aurelia-router` ViewPort interface, responsible for templating related part in routing Pipeline
62 */
63 process($viewPortInstruction: any, waitToSwap?: boolean): Promise<void>;
64 swap($viewPortInstruction: any): void | Promise<void>;
65}
66/**
67* Locator which finds the nearest RouterView, relative to the current dependency injection container.
68*/
69export declare class RouterViewLocator {
70 /**
71 * Creates an instance of the RouterViewLocator class.
72 */
73 constructor();
74 /**
75 * Finds the nearest RouterView instance.
76 * @returns A promise that will be resolved with the located RouterView instance.
77 */
78 findNearest(): Promise<RouterView>;
79}
80/**
81 * Helper custom attribute to help associate an element with a route by name
82 */
83export declare class RouteHref {
84 /**
85 * Current router of this attribute
86 */
87 readonly router: Router;
88 /**
89 * Element this attribute is associated with
90 */
91 readonly element: Element;
92 /**
93 * Name of the route this attribute refers to. This name should exist in the current router hierarchy
94 */
95 route: string;
96 /**
97 * Parameters of this attribute to generate URL.
98 */
99 params: Record<string, any>;
100 /**
101 * Target property on a custom element if this attribute is put on a custom element
102 * OR an attribute if this attribute is put on a normal element
103 */
104 attribute: string;
105 constructor(router: Router, element: Element);
106 bind(): void;
107 unbind(): void;
108 attributeChanged(value: any, previous: any): Promise<void>;
109 processChange(): Promise<void>;
110}
111export interface IFrameworkConfiguration {
112 container: Container;
113 singleton(...args: any[]): this;
114 globalResources(...args: any[]): this;
115}
116export declare function configure(config: IFrameworkConfiguration): void;
117
118export {};