UNPKG

3.75 kBTypeScriptView Raw
1// Generated by dts-bundle-generator v6.9.0
2
3import { Aurelia, FrameworkConfiguration } from 'aurelia-framework';
4import { IStaticResourceConfig, TargetInstruction } from 'aurelia-templating';
5
6/**
7 * Attribute to be placed on any element to have it emit the View Compiler's
8 * TargetInstruction into the debug console, giving you insight into all the
9 * parsed bindings, behaviors and event handers for the targeted element.
10 */
11export declare class CompileSpy {
12 /**
13 * Creates and instanse of CompileSpy.
14 * @param element target element on where attribute is placed on.
15 * @param instruction instructions for how the target element should be enhanced.
16 */
17 constructor(element: Element, instruction: TargetInstruction);
18}
19/**
20 * Attribute to be placed on any HTML element in a view to emit the View instance
21 * to the debug console, giving you insight into the live View instance, including
22 * all child views, live bindings, behaviors and more.
23 */
24export declare class ViewSpy {
25 static $resource: IStaticResourceConfig;
26 private logger;
27 private value;
28 private view;
29 /**
30 * Creates a new instance of ViewSpy.
31 */
32 constructor();
33 private _log;
34 /**
35 * Invoked when the target view is created.
36 * @param view The target view.
37 */
38 created(view: any): void;
39 /**
40 * Invoked when the target view is bound.
41 * @param bindingContext The target view's binding context.
42 */
43 bind(bindingContext: {}): void;
44 /**
45 * Invoked when the target element is attached to the DOM.
46 */
47 attached(): void;
48 /**
49 * Invoked when the target element is detached from the DOM.
50 */
51 detached(): void;
52 /**
53 * Invoked when the target element is unbound.
54 */
55 unbind(): void;
56}
57export declare class StageComponent {
58 static withResources<T = any>(resources?: string | string[]): ComponentTester<T>;
59}
60export declare class ComponentTester<T = any> {
61 bind: (bindingContext: {}) => Promise<void>;
62 attached: () => Promise<void>;
63 detached: () => Promise<void>;
64 unbind: () => Promise<void>;
65 element: Element;
66 viewModel: T;
67 private html;
68 private resources;
69 private bindingContext;
70 private rootView;
71 private host;
72 configure(aurelia: Aurelia): FrameworkConfiguration;
73 bootstrap(configure: (aurelia: Aurelia) => FrameworkConfiguration): void;
74 withResources(resources: string | string[]): this;
75 inView(html: string): this;
76 boundTo(bindingContext: {}): this;
77 manuallyHandleLifecycle(): this;
78 create(bootstrap: (configure: (aurelia: Aurelia) => Promise<void>) => Promise<void>): Promise<void>;
79 dispose(): Element;
80 private _prepareLifecycle;
81 waitForElement(selector: string, options?: {
82 present?: boolean;
83 interval?: number;
84 timeout?: number;
85 }): Promise<Element>;
86 waitForElements(selector: string, options?: {
87 present?: boolean;
88 interval?: number;
89 timeout?: number;
90 }): Promise<NodeListOf<Element>>;
91}
92/**
93 * Generic function to wait for something to happen. Uses polling
94 * @param getter: a getter function that returns anything else than `null` or an
95 * empty array or an empty jQuery object when the
96 * condition is met
97 * @param options: lookup options, defaults to
98 * `{present: true, interval: 50, timeout: 5000}`
99 */
100export declare function waitFor<T>(getter: () => T, options?: {
101 present?: boolean;
102 interval?: number;
103 timeout?: number;
104}): Promise<T>;
105export declare function waitForDocumentElement(selector: string, options?: {
106 present?: boolean;
107 interval?: number;
108 timeout?: number;
109}): Promise<Element>;
110export declare function waitForDocumentElements(selector: string, options?: {
111 present?: boolean;
112 interval?: number;
113 timeout?: number;
114}): Promise<NodeListOf<Element>>;
115export declare function configure(config: FrameworkConfiguration): void;
116
117export {};