UNPKG

8.39 kBTypeScriptView Raw
1/**
2 * @license Angular v15.1.2
3 * (c) 2010-2022 Google LLC. https://angular.io/
4 * License: MIT
5 */
6
7
8import { ANIMATION_MODULE_TYPE } from '@angular/core';
9import { AnimationBuilder } from '@angular/animations';
10import { AnimationDriver } from '@angular/animations/browser';
11import { AnimationFactory } from '@angular/animations';
12import { AnimationMetadata } from '@angular/animations';
13import { AnimationOptions } from '@angular/animations';
14import { AnimationPlayer } from '@angular/animations';
15import { ApplicationRef } from '@angular/core';
16import * as i0 from '@angular/core';
17import * as i1 from '@angular/platform-browser';
18import { ModuleWithProviders } from '@angular/core';
19import { NgZone } from '@angular/core';
20import { OnDestroy } from '@angular/core';
21import { Provider } from '@angular/core';
22import { Renderer2 } from '@angular/core';
23import { RendererFactory2 } from '@angular/core';
24import { RendererStyleFlags2 } from '@angular/core';
25import { RendererType2 } from '@angular/core';
26import { ɵAnimationEngine } from '@angular/animations/browser';
27import { ɵAnimationStyleNormalizer } from '@angular/animations/browser';
28
29export { ANIMATION_MODULE_TYPE }
30
31declare class BaseAnimationRenderer implements Renderer2 {
32 protected namespaceId: string;
33 delegate: Renderer2;
34 engine: ɵAnimationEngine;
35 private _onDestroy?;
36 constructor(namespaceId: string, delegate: Renderer2, engine: ɵAnimationEngine, _onDestroy?: (() => void) | undefined);
37 get data(): {
38 [key: string]: any;
39 };
40 destroyNode: ((n: any) => void) | null;
41 destroy(): void;
42 createElement(name: string, namespace?: string | null | undefined): any;
43 createComment(value: string): any;
44 createText(value: string): any;
45 appendChild(parent: any, newChild: any): void;
46 insertBefore(parent: any, newChild: any, refChild: any, isMove?: boolean): void;
47 removeChild(parent: any, oldChild: any, isHostElement: boolean): void;
48 selectRootElement(selectorOrNode: any, preserveContent?: boolean): any;
49 parentNode(node: any): any;
50 nextSibling(node: any): any;
51 setAttribute(el: any, name: string, value: string, namespace?: string | null | undefined): void;
52 removeAttribute(el: any, name: string, namespace?: string | null | undefined): void;
53 addClass(el: any, name: string): void;
54 removeClass(el: any, name: string): void;
55 setStyle(el: any, style: string, value: any, flags?: RendererStyleFlags2 | undefined): void;
56 removeStyle(el: any, style: string, flags?: RendererStyleFlags2 | undefined): void;
57 setProperty(el: any, name: string, value: any): void;
58 setValue(node: any, value: string): void;
59 listen(target: any, eventName: string, callback: (event: any) => boolean | void): () => void;
60 protected disableAnimations(element: any, value: boolean): void;
61}
62
63/**
64 * Exports `BrowserModule` with additional [dependency-injection providers](guide/glossary#provider)
65 * for use with animations. See [Animations](guide/animations).
66 * @publicApi
67 */
68export declare class BrowserAnimationsModule {
69 /**
70 * Configures the module based on the specified object.
71 *
72 * @param config Object used to configure the behavior of the `BrowserAnimationsModule`.
73 * @see `BrowserAnimationsModuleConfig`
74 *
75 * @usageNotes
76 * When registering the `BrowserAnimationsModule`, you can use the `withConfig`
77 * function as follows:
78 * ```
79 * @NgModule({
80 * imports: [BrowserAnimationsModule.withConfig(config)]
81 * })
82 * class MyNgModule {}
83 * ```
84 */
85 static withConfig(config: BrowserAnimationsModuleConfig): ModuleWithProviders<BrowserAnimationsModule>;
86 static ɵfac: i0.ɵɵFactoryDeclaration<BrowserAnimationsModule, never>;
87 static ɵmod: i0.ɵɵNgModuleDeclaration<BrowserAnimationsModule, never, never, [typeof i1.BrowserModule]>;
88 static ɵinj: i0.ɵɵInjectorDeclaration<BrowserAnimationsModule>;
89}
90
91/**
92 * Object used to configure the behavior of {@link BrowserAnimationsModule}
93 * @publicApi
94 */
95export declare interface BrowserAnimationsModuleConfig {
96 /**
97 * Whether animations should be disabled. Passing this is identical to providing the
98 * `NoopAnimationsModule`, but it can be controlled based on a runtime value.
99 */
100 disableAnimations?: boolean;
101}
102
103/**
104 * A null player that must be imported to allow disabling of animations.
105 * @publicApi
106 */
107export declare class NoopAnimationsModule {
108 static ɵfac: i0.ɵɵFactoryDeclaration<NoopAnimationsModule, never>;
109 static ɵmod: i0.ɵɵNgModuleDeclaration<NoopAnimationsModule, never, never, [typeof i1.BrowserModule]>;
110 static ɵinj: i0.ɵɵInjectorDeclaration<NoopAnimationsModule>;
111}
112
113/**
114 * Returns the set of [dependency-injection providers](guide/glossary#provider)
115 * to enable animations in an application. See [animations guide](guide/animations)
116 * to learn more about animations in Angular.
117 *
118 * @usageNotes
119 *
120 * The function is useful when you want to enable animations in an application
121 * bootstrapped using the `bootstrapApplication` function. In this scenario there
122 * is no need to import the `BrowserAnimationsModule` NgModule at all, just add
123 * providers returned by this function to the `providers` list as show below.
124 *
125 * ```typescript
126 * bootstrapApplication(RootComponent, {
127 * providers: [
128 * provideAnimations()
129 * ]
130 * });
131 * ```
132 *
133 * @publicApi
134 */
135export declare function provideAnimations(): Provider[];
136
137/**
138 * Returns the set of [dependency-injection providers](guide/glossary#provider)
139 * to disable animations in an application. See [animations guide](guide/animations)
140 * to learn more about animations in Angular.
141 *
142 * @usageNotes
143 *
144 * The function is useful when you want to bootstrap an application using
145 * the `bootstrapApplication` function, but you need to disable animations
146 * (for example, when running tests).
147 *
148 * ```typescript
149 * bootstrapApplication(RootComponent, {
150 * providers: [
151 * provideNoopAnimations()
152 * ]
153 * });
154 * ```
155 *
156 * @publicApi
157 */
158export declare function provideNoopAnimations(): Provider[];
159
160export declare class ɵAnimationRenderer extends BaseAnimationRenderer implements Renderer2 {
161 factory: ɵAnimationRendererFactory;
162 constructor(factory: ɵAnimationRendererFactory, namespaceId: string, delegate: Renderer2, engine: ɵAnimationEngine, onDestroy?: () => void);
163 setProperty(el: any, name: string, value: any): void;
164 listen(target: 'window' | 'document' | 'body' | any, eventName: string, callback: (event: any) => any): () => void;
165}
166
167export declare class ɵAnimationRendererFactory implements RendererFactory2 {
168 private delegate;
169 private engine;
170 private _zone;
171 private _currentId;
172 private _microtaskId;
173 private _animationCallbacksBuffer;
174 private _rendererCache;
175 private _cdRecurDepth;
176 private promise;
177 constructor(delegate: RendererFactory2, engine: ɵAnimationEngine, _zone: NgZone);
178 createRenderer(hostElement: any, type: RendererType2): Renderer2;
179 begin(): void;
180 private _scheduleCountTask;
181 end(): void;
182 whenRenderingDone(): Promise<any>;
183 static ɵfac: i0.ɵɵFactoryDeclaration<ɵAnimationRendererFactory, never>;
184 static ɵprov: i0.ɵɵInjectableDeclaration<ɵAnimationRendererFactory>;
185}
186
187export declare class ɵBrowserAnimationBuilder extends AnimationBuilder {
188 private _nextAnimationId;
189 private _renderer;
190 constructor(rootRenderer: RendererFactory2, doc: any);
191 build(animation: AnimationMetadata | AnimationMetadata[]): AnimationFactory;
192 static ɵfac: i0.ɵɵFactoryDeclaration<ɵBrowserAnimationBuilder, never>;
193 static ɵprov: i0.ɵɵInjectableDeclaration<ɵBrowserAnimationBuilder>;
194}
195
196export declare class ɵBrowserAnimationFactory extends AnimationFactory {
197 private _id;
198 private _renderer;
199 constructor(_id: string, _renderer: ɵAnimationRenderer);
200 create(element: any, options?: AnimationOptions): AnimationPlayer;
201}
202
203export declare class ɵInjectableAnimationEngine extends ɵAnimationEngine implements OnDestroy {
204 constructor(doc: any, driver: AnimationDriver, normalizer: ɵAnimationStyleNormalizer, appRef: ApplicationRef);
205 ngOnDestroy(): void;
206 static ɵfac: i0.ɵɵFactoryDeclaration<ɵInjectableAnimationEngine, never>;
207 static ɵprov: i0.ɵɵInjectableDeclaration<ɵInjectableAnimationEngine>;
208}
209
210export { }