1 |
|
2 |
|
3 | import { OverrideContext, bindingMode } from 'aurelia-binding';
|
4 | import { View, ViewFactory, ViewSlot } from 'aurelia-templating';
|
5 |
|
6 | declare enum ActivationStrategy {
|
7 | |
8 |
|
9 |
|
10 | InvokeLifecycle = "invoke-lifecycle",
|
11 | |
12 |
|
13 |
|
14 | Replace = "replace"
|
15 | }
|
16 |
|
17 |
|
18 |
|
19 | export declare class Compose {
|
20 | |
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | model: any;
|
27 | |
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | view: any;
|
34 | |
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 | viewModel: any;
|
41 | |
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 | activationStrategy: ActivationStrategy;
|
49 | |
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 | swapOrder: any;
|
56 | |
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 | constructor(element: any, container: any, compositionEngine: any, viewSlot: any, viewResources: any, taskQueue: any);
|
66 | /**
|
67 | * Invoked when the component has been created.
|
68 | *
|
69 | * @param owningView The view that this component was created inside of.
|
70 | */
|
71 | created(owningView: View): void;
|
72 | /**
|
73 | * Used to set the bindingContext.
|
74 | *
|
75 | * @param bindingContext The context in which the view model is executed in.
|
76 | * @param overrideContext The context in which the view model is executed in.
|
77 | */
|
78 | bind(bindingContext: any, overrideContext: any): void;
|
79 | /**
|
80 | * Unbinds the Compose.
|
81 | */
|
82 | unbind(): void;
|
83 | /**
|
84 | * Invoked everytime the bound model changes.
|
85 | * @param newValue The new value.
|
86 | * @param oldValue The old value.
|
87 | */
|
88 | modelChanged(newValue: any, oldValue: any): void;
|
89 | /**
|
90 | * Invoked everytime the bound view changes.
|
91 | * @param newValue The new value.
|
92 | * @param oldValue The old value.
|
93 | */
|
94 | viewChanged(newValue: any, oldValue: any): void;
|
95 | /**
|
96 | * Invoked everytime the bound view model changes.
|
97 | * @param newValue The new value.
|
98 | * @param oldValue The old value.
|
99 | */
|
100 | viewModelChanged(newValue: any, oldValue: any): void;
|
101 | }
|
102 | declare class IfCore {
|
103 | constructor(viewFactory: ViewFactory, viewSlot: ViewSlot);
|
104 | bind(bindingContext: any, overrideContext: any): void;
|
105 | unbind(): void;
|
106 | }
|
107 | /**
|
108 | * Binding to conditionally include or not include template logic depending on returned result
|
109 | * - value should be Boolean or will be treated as such (truthy / falsey)
|
110 | */
|
111 | export declare class If extends IfCore {
|
112 | condition: any;
|
113 | swapOrder: "before" | "with" | "after";
|
114 | cache: boolean | string;
|
115 | |
116 |
|
117 |
|
118 |
|
119 |
|
120 | bind(bindingContext: any, overrideContext: any): void;
|
121 | |
122 |
|
123 |
|
124 |
|
125 | conditionChanged(newValue: any): void;
|
126 | }
|
127 | export declare class Else extends IfCore {
|
128 | constructor(viewFactory: any, viewSlot: any);
|
129 | bind(bindingContext: any, overrideContext: any): void;
|
130 | }
|
131 | /**
|
132 | * Creates a binding context for decandant elements to bind to.
|
133 | */
|
134 | export declare class With {
|
135 | value: any;
|
136 | |
137 |
|
138 |
|
139 |
|
140 |
|
141 | constructor(viewFactory: ViewFactory, viewSlot: ViewSlot);
|
142 | /**
|
143 | * Binds the With with provided binding context and override context.
|
144 | * @param bindingContext The binding context.
|
145 | * @param overrideContext An override context for binding.
|
146 | */
|
147 | bind(bindingContext: any, overrideContext: any): void;
|
148 | /**
|
149 | * Invoked everytime the bound value changes.
|
150 | * @param newValue The new value.
|
151 | */
|
152 | valueChanged(newValue: any): void;
|
153 | /**
|
154 | * Unbinds With
|
155 | */
|
156 | unbind(): void;
|
157 | }
|
158 | /**
|
159 | * An abstract base class for elements and attributes that repeat
|
160 | * views.
|
161 | */
|
162 | export declare class AbstractRepeater {
|
163 | constructor(options: any);
|
164 | /**
|
165 | * Returns the number of views the repeater knows about.
|
166 | *
|
167 | * @return the number of views.
|
168 | */
|
169 | viewCount(): number;
|
170 | /**
|
171 | * Returns all of the repeaters views as an array.
|
172 | *
|
173 | * @return The repeater's array of views;
|
174 | */
|
175 | views(): any[];
|
176 | /**
|
177 | * Returns a single view from the repeater at the provided index.
|
178 | *
|
179 | * @param index The index of the requested view.
|
180 | * @return {View|ViewSlot} The requested view.
|
181 | */
|
182 | view(index: number): any;
|
183 | |
184 |
|
185 |
|
186 |
|
187 |
|
188 | matcher(): Function | null;
|
189 | |
190 |
|
191 |
|
192 |
|
193 |
|
194 |
|
195 |
|
196 | addView(bindingContext: any, overrideContext: any): any;
|
197 | |
198 |
|
199 |
|
200 |
|
201 |
|
202 |
|
203 |
|
204 |
|
205 | insertView(index: any, bindingContext: any, overrideContext: any): any;
|
206 | |
207 |
|
208 |
|
209 |
|
210 |
|
211 |
|
212 | moveView(sourceIndex: any, targetIndex: any): any;
|
213 | |
214 |
|
215 |
|
216 |
|
217 |
|
218 |
|
219 | removeAllViews(returnToCache?: boolean, skipAnimation?: boolean): any;
|
220 | |
221 |
|
222 |
|
223 |
|
224 |
|
225 |
|
226 |
|
227 | removeViews(viewsToRemove: Array<View>, returnToCache?: boolean, skipAnimation?: boolean): any;
|
228 | |
229 |
|
230 |
|
231 |
|
232 |
|
233 |
|
234 |
|
235 | removeView(index: number, returnToCache?: boolean, skipAnimation?: boolean): any;
|
236 | |
237 |
|
238 |
|
239 |
|
240 |
|
241 |
|
242 | updateBindings(view: View): void;
|
243 | }
|
244 |
|
245 |
|
246 |
|
247 | export declare class Repeat extends AbstractRepeater {
|
248 | |
249 |
|
250 |
|
251 |
|
252 |
|
253 |
|
254 |
|
255 | static useInnerMatcher: boolean;
|
256 | |
257 |
|
258 |
|
259 |
|
260 |
|
261 | items: any;
|
262 | |
263 |
|
264 |
|
265 |
|
266 |
|
267 | local: any;
|
268 | |
269 |
|
270 |
|
271 |
|
272 |
|
273 | key: any;
|
274 | |
275 |
|
276 |
|
277 |
|
278 |
|
279 | value: any;
|
280 | |
281 |
|
282 |
|
283 |
|
284 |
|
285 |
|
286 |
|
287 |
|
288 |
|
289 | constructor(viewFactory: any, instruction: any, viewSlot: any, viewResources: any, observerLocator: any, strategyLocator: any);
|
290 | call(context: any, changes: any): void;
|
291 | /**
|
292 | * Binds the repeat to the binding context and override context.
|
293 | * @param bindingContext The binding context.
|
294 | * @param overrideContext An override context for binding.
|
295 | */
|
296 | bind(bindingContext: any, overrideContext: any): void;
|
297 | /**
|
298 | * Unbinds the repeat
|
299 | */
|
300 | unbind(): void;
|
301 | /**
|
302 | * Invoked everytime the item property changes.
|
303 | */
|
304 | itemsChanged(): void;
|
305 | /**
|
306 | * Invoked when the underlying collection changes.
|
307 | */
|
308 | handleCollectionMutated(collection: any, changes: any): void;
|
309 | /**
|
310 | * Invoked when the underlying inner collection changes.
|
311 | */
|
312 | handleInnerCollectionMutated(collection: any, changes: any): void;
|
313 | viewCount(): any;
|
314 | views(): any;
|
315 | view(index: any): any;
|
316 | matcher(): any;
|
317 | addView(bindingContext: any, overrideContext: any): void;
|
318 | insertView(index: any, bindingContext: any, overrideContext: any): void;
|
319 | moveView(sourceIndex: any, targetIndex: any): void;
|
320 | removeAllViews(returnToCache: any, skipAnimation: any): any;
|
321 | removeViews(viewsToRemove: any, returnToCache: any, skipAnimation: any): any;
|
322 | removeView(index: any, returnToCache: any, skipAnimation: any): any;
|
323 | updateBindings(view: View): void;
|
324 | }
|
325 | /**
|
326 | * Binding to conditionally show markup in the DOM based on the value.
|
327 | * - different from "if" in that the markup is still added to the DOM, simply not shown.
|
328 | */
|
329 | export declare class Show {
|
330 | value: any;
|
331 | |
332 |
|
333 |
|
334 |
|
335 |
|
336 |
|
337 | constructor(element: any, animator: any, domBoundary: any);
|
338 | /**
|
339 | * Invoked when the behavior is created.
|
340 | */
|
341 | created(): void;
|
342 | /**
|
343 | * Invoked everytime the bound value changes.
|
344 | * @param newValue The new value.
|
345 | */
|
346 | valueChanged(newValue: any): void;
|
347 | /**
|
348 | * Binds the Show attribute.
|
349 | */
|
350 | bind(bindingContext: any): void;
|
351 | }
|
352 | /**
|
353 | * Binding to conditionally show markup in the DOM based on the value.
|
354 | * - different from "if" in that the markup is still added to the DOM, simply not shown.
|
355 | */
|
356 | export declare class Hide {
|
357 | |
358 |
|
359 |
|
360 |
|
361 |
|
362 |
|
363 | constructor(element: any, animator: any, domBoundary: any);
|
364 | /**
|
365 | * Invoked when the behavior is created.
|
366 | */
|
367 | created(): void;
|
368 | /**
|
369 | * Invoked everytime the bound value changes.
|
370 | * @param newValue The new value.
|
371 | */
|
372 | valueChanged(newValue: any): void;
|
373 | /**
|
374 | * Binds the Hide attribute.
|
375 | */
|
376 | bind(bindingContext: any): void;
|
377 | value(value: any): void;
|
378 | }
|
379 | /**
|
380 | * Default Html Sanitizer to prevent script injection.
|
381 | */
|
382 | export declare class HTMLSanitizer {
|
383 | |
384 |
|
385 |
|
386 |
|
387 | sanitize(input: any): any;
|
388 | }
|
389 |
|
390 |
|
391 |
|
392 | export declare class SanitizeHTMLValueConverter {
|
393 | |
394 |
|
395 |
|
396 |
|
397 | constructor(sanitizer: HTMLSanitizer);
|
398 | /**
|
399 | * Process the provided markup that flows to the view.
|
400 | * @param untrustedMarkup The untrusted markup to be sanitized.
|
401 | */
|
402 | toView(untrustedMarkup: any): any;
|
403 | }
|
404 | /**
|
405 | * Marks any part of a view to be replacable by the consumer.
|
406 | */
|
407 | export declare class Replaceable {
|
408 | |
409 |
|
410 |
|
411 |
|
412 | constructor(viewFactory: ViewFactory, viewSlot: ViewSlot);
|
413 | /**
|
414 | * Binds the replaceable to the binding context and override context.
|
415 | * @param bindingContext The binding context.
|
416 | * @param overrideContext An override context for binding.
|
417 | */
|
418 | bind(bindingContext: any, overrideContext: any): void;
|
419 | /**
|
420 | * Unbinds the replaceable.
|
421 | */
|
422 | unbind(): void;
|
423 | }
|
424 | /**
|
425 | * CustomAttribute that binds provided DOM element's focus attribute with a property on the viewmodel.
|
426 | */
|
427 | export declare class Focus {
|
428 | |
429 |
|
430 |
|
431 |
|
432 |
|
433 | constructor(element: any, taskQueue: any);
|
434 | /**
|
435 | * Invoked everytime the bound value changes.
|
436 | */
|
437 | valueChanged(): void;
|
438 | /**
|
439 | * Invoked when the attribute is attached to the DOM.
|
440 | */
|
441 | attached(): void;
|
442 | /**
|
443 | * Invoked when the attribute is detached from the DOM.
|
444 | */
|
445 | detached(): void;
|
446 | handleEvent(e: any): void;
|
447 | }
|
448 | export declare class AttrBindingBehavior {
|
449 | bind(binding: any, source: any): void;
|
450 | unbind(binding: any, source: any): void;
|
451 | }
|
452 | export declare class OneTimeBindingBehavior {
|
453 | mode: bindingMode;
|
454 | constructor();
|
455 | }
|
456 | export declare class OneWayBindingBehavior {
|
457 | mode: bindingMode;
|
458 | constructor();
|
459 | }
|
460 | export declare class ToViewBindingBehavior {
|
461 | mode: bindingMode;
|
462 | constructor();
|
463 | }
|
464 | export declare class FromViewBindingBehavior {
|
465 | mode: bindingMode;
|
466 | constructor();
|
467 | }
|
468 | export declare class TwoWayBindingBehavior {
|
469 | mode: bindingMode;
|
470 | constructor();
|
471 | }
|
472 | export declare class ThrottleBindingBehavior {
|
473 | bind(binding: any, source: any, delay?: number): void;
|
474 | unbind(binding: any, source: any): void;
|
475 | }
|
476 | export declare class DebounceBindingBehavior {
|
477 | bind(binding: any, source: any, delay?: number): void;
|
478 | unbind(binding: any, source: any): void;
|
479 | }
|
480 | export declare class SelfBindingBehavior {
|
481 | bind(binding: any, source: any): void;
|
482 | unbind(binding: any, source: any): void;
|
483 | }
|
484 | export declare class SignalBindingBehavior {
|
485 | signals: any;
|
486 | constructor(bindingSignaler: any);
|
487 | bind(binding: any, source: any, ...names: any[]): void;
|
488 | unbind(binding: any, source: any): void;
|
489 | }
|
490 | export declare class BindingSignaler {
|
491 | signals: {};
|
492 | signal(name: string): void;
|
493 | }
|
494 | export declare class UpdateTriggerBindingBehavior {
|
495 | bind(binding: any, source: any, ...events: any[]): void;
|
496 | unbind(binding: any, source: any): void;
|
497 | }
|
498 |
|
499 |
|
500 |
|
501 | export interface RepeatStrategy {
|
502 | instanceChanged(repeat: Repeat, items: any): void;
|
503 | instanceMutated(repeat: Repeat, items: any, changes: any): void;
|
504 | getCollectionObserver(observerLocator: any, items: any): any;
|
505 | }
|
506 |
|
507 |
|
508 |
|
509 |
|
510 | export declare class RepeatStrategyLocator {
|
511 | |
512 |
|
513 |
|
514 | constructor();
|
515 | /**
|
516 | * Adds a repeat strategy to be located when repeating a template over different collection types.
|
517 | * @param strategy A repeat strategy that can iterate a specific collection type.
|
518 | */
|
519 | addStrategy(matcher: (items: any) => boolean, strategy: RepeatStrategy): void;
|
520 | /**
|
521 | * Gets the best strategy to handle iteration.
|
522 | */
|
523 | getStrategy(items: any): RepeatStrategy;
|
524 | }
|
525 | /**
|
526 | * A strategy for repeating a template over null or undefined (does nothing)
|
527 | */
|
528 | export declare class NullRepeatStrategy {
|
529 | instanceChanged(repeat: any, items: any): void;
|
530 | getCollectionObserver(observerLocator: any, items: any): void;
|
531 | }
|
532 |
|
533 |
|
534 |
|
535 | export declare class ArrayRepeatStrategy {
|
536 | |
537 |
|
538 |
|
539 |
|
540 |
|
541 | getCollectionObserver(observerLocator: any, items: any): any;
|
542 | |
543 |
|
544 |
|
545 |
|
546 |
|
547 | instanceChanged(repeat: any, items: any): void;
|
548 | |
549 |
|
550 |
|
551 |
|
552 |
|
553 |
|
554 | instanceMutated(repeat: any, array: any, splices: any): void;
|
555 | }
|
556 |
|
557 |
|
558 |
|
559 | export declare class MapRepeatStrategy {
|
560 | |
561 |
|
562 |
|
563 |
|
564 | getCollectionObserver(observerLocator: any, items: any): any;
|
565 | |
566 |
|
567 |
|
568 |
|
569 | instanceChanged(repeat: any, items: any): void;
|
570 | |
571 |
|
572 |
|
573 |
|
574 |
|
575 | instanceMutated(repeat: any, map: any, records: any): void;
|
576 | }
|
577 |
|
578 |
|
579 |
|
580 | export declare class SetRepeatStrategy {
|
581 | |
582 |
|
583 |
|
584 |
|
585 | getCollectionObserver(observerLocator: any, items: any): any;
|
586 | |
587 |
|
588 |
|
589 |
|
590 | instanceChanged(repeat: any, items: any): void;
|
591 | |
592 |
|
593 |
|
594 |
|
595 |
|
596 |
|
597 | instanceMutated(repeat: any, set: any, records: any): void;
|
598 | }
|
599 |
|
600 |
|
601 |
|
602 | export declare class NumberRepeatStrategy {
|
603 | |
604 |
|
605 |
|
606 | getCollectionObserver(): any;
|
607 | |
608 |
|
609 |
|
610 |
|
611 | instanceChanged(repeat: any, value: any): void;
|
612 | }
|
613 |
|
614 |
|
615 |
|
616 |
|
617 |
|
618 |
|
619 |
|
620 | export declare function createFullOverrideContext(repeat: any, data: any, index: any, length: any, key?: string): OverrideContext;
|
621 |
|
622 |
|
623 |
|
624 |
|
625 |
|
626 |
|
627 | export declare function updateOverrideContext(overrideContext: any, index: any, length: any): void;
|
628 |
|
629 |
|
630 |
|
631 | export declare function getItemsSourceExpression(instruction: any, attrName: any): any;
|
632 |
|
633 |
|
634 |
|
635 | export declare function unwrapExpression(expression: any): any;
|
636 |
|
637 |
|
638 |
|
639 | export declare function isOneTime(expression: any): boolean;
|
640 |
|
641 |
|
642 |
|
643 | export declare function updateOneTimeBinding(binding: any): void;
|
644 | export declare function viewsRequireLifecycle(viewFactory: any): any;
|
645 | export declare function configure(config: any): void;
|
646 |
|
647 | export {};
|