1 | import { Container } from 'aurelia-dependency-injection';
|
2 | import { Router, RouteConfig, NavigationInstruction } from 'aurelia-router';
|
3 | import { Controller } from 'aurelia-templating';
|
4 |
|
5 | export type Constructable<T = any> = new (...args: any[]) => T;
|
6 |
|
7 | export interface IFrameworkConfiguration {
|
8 | container: Container;
|
9 | singleton(...args: any[]): this;
|
10 | globalResources(...args: any[]): this;
|
11 | }
|
12 |
|
13 |
|
14 | declare module 'aurelia-dependency-injection' {
|
15 |
|
16 | interface Container {
|
17 | viewModel?: any;
|
18 | getChildRouter(): Router;
|
19 | }
|
20 | }
|
21 |
|
22 |
|
23 | declare module 'aurelia-templating' {
|
24 | interface CompositionContext {
|
25 | router?: Router;
|
26 | }
|
27 |
|
28 | interface View {
|
29 |
|
30 | children: View[];
|
31 |
|
32 | slots: Record<string, any>;
|
33 | }
|
34 |
|
35 | interface CompositionTransaction {
|
36 | initialComposition?: boolean;
|
37 | }
|
38 |
|
39 | interface ResourceDescription {
|
40 | value: Function;
|
41 | metadata: HtmlBehaviorResource;
|
42 | }
|
43 |
|
44 | interface Controller {
|
45 | slots: Record<string, any>;
|
46 | }
|
47 |
|
48 | interface ViewStrategy {
|
49 | makeRelativeTo(moduleId: string): void;
|
50 | }
|
51 | }
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 | export interface ViewPortComponent {
|
58 | viewModel: any;
|
59 | childContainer?: Container;
|
60 | router: Router;
|
61 | config?: RouteConfig;
|
62 | childRouter?: Router;
|
63 | |
64 |
|
65 |
|
66 | [key: string]: any;
|
67 | }
|
68 |
|
69 |
|
70 | export interface ViewPortInstruction {
|
71 |
|
72 | name?: string;
|
73 |
|
74 | strategy: 'no-change' | 'invoke-lifecycle' | 'replace';
|
75 |
|
76 | childNavigationInstruction?: NavigationInstruction;
|
77 |
|
78 | moduleId: string;
|
79 |
|
80 | component: ViewPortComponent;
|
81 |
|
82 | childRouter?: Router;
|
83 |
|
84 | lifecycleArgs: [Record<string, string>, RouteConfig, NavigationInstruction];
|
85 |
|
86 | prevComponent?: ViewPortComponent;
|
87 | }
|
88 |
|
89 | export interface ViewPort {
|
90 |
|
91 | container: Container;
|
92 | swap(viewportInstruction: ViewPortInstruction): void;
|
93 | process(viewportInstruction: ViewPortInstruction, waitToSwap?: boolean): Promise<void>;
|
94 | }
|
95 |
|
96 | export interface IRouterViewViewPortInstruction extends ViewPortInstruction {
|
97 | controller?: Controller;
|
98 | layoutInstruction?: {
|
99 | viewModel: any;
|
100 | model: any;
|
101 | view: any;
|
102 | };
|
103 | }
|