@@ -13,6 +13,7 @@ export * from "./core/scope/scope.js";
1313export * from "./services/cookie/cookie.js" ;
1414export * from "./services/cookie/interface.ts" ;
1515export * from "./services/exception/interface.ts" ;
16+ export * from "./core/parse/interface.ts" ;
1617import { Attributes } from "./core/compile/attributes.js" ;
1718import { Scope } from "./core/scope/scope.js" ;
1819/**
@@ -67,7 +68,7 @@ export type InjectableClass<TInstance = any> = new (...args: any) => TInstance;
6768 *
6869 * Parentheses are required around constructor types when used in unions.
6970 */
70- type FactoryFunction < T > = T extends abstract new ( ...args : any [ ] ) => any
71+ export type FactoryFunction < T > = T extends abstract new ( ...args : any [ ] ) => any
7172 ? ( ...args : ConstructorParameters < T > ) => InstanceType < T >
7273 : T ;
7374export type Injectable <
@@ -78,6 +79,12 @@ export type Injectable<
7879 ? InjectableClass < InstanceType < T > >
7980 : never )
8081 | T ;
82+ export interface ServiceProviderClass {
83+ new ( ...args : any [ ] ) : ServiceProvider ;
84+ }
85+ export interface ServiceProviderFactory {
86+ ( ...args : any [ ] ) : ServiceProvider ;
87+ }
8188/**
8289 * An object that defines how a service is constructed.
8390 *
@@ -166,6 +173,57 @@ export interface ChangesObject<T = any> {
166173 * Mapping of binding property names to their change metadata.
167174 */
168175export type OnChangesObject = Record < string , ChangesObject > ;
176+ /**
177+ * Interface for the $onInit lifecycle hook
178+ * https://docs.angularjs.org/api/ng/service/$compile#life-cycle-hooks
179+ */
180+ export interface OnInit {
181+ /**
182+ * Called on each controller after all the controllers on an element have been constructed and had their bindings
183+ * initialized (and before the pre & post linking functions for the directives on this element). This is a good
184+ * place to put initialization code for your controller.
185+ */
186+ $onInit ( ) : void ;
187+ }
188+ /**
189+ * Interface for the $onChanges lifecycle hook
190+ * https://docs.angularjs.org/api/ng/service/$compile#life-cycle-hooks
191+ */
192+ export interface OnChanges {
193+ /**
194+ * Called whenever one-way bindings are updated. The onChangesObj is a hash whose keys are the names of the bound
195+ * properties that have changed, and the values are an {@link IChangesObject} object of the form
196+ * { currentValue, previousValue, isFirstChange() }. Use this hook to trigger updates within a component such as
197+ * cloning the bound value to prevent accidental mutation of the outer value.
198+ */
199+ $onChanges ( onChangesObj : OnChangesObject ) : void ;
200+ }
201+ /**
202+ * Interface for the $onDestroy lifecycle hook
203+ * https://docs.angularjs.org/api/ng/service/$compile#life-cycle-hooks
204+ */
205+ export interface OnDestroy {
206+ /**
207+ * Called on a controller when its containing scope is destroyed. Use this hook for releasing external resources,
208+ * watches and event handlers.
209+ */
210+ $onDestroy ( ) : void ;
211+ }
212+ /**
213+ * Interface for the $postLink lifecycle hook
214+ * https://docs.angularjs.org/api/ng/service/$compile#life-cycle-hooks
215+ */
216+ export interface PostLink {
217+ /**
218+ * Called after this controller's element and its children have been linked. Similar to the post-link function this
219+ * hook can be used to set up DOM event handlers and do direct DOM manipulation. Note that child elements that contain
220+ * templateUrl directives will not have been compiled and linked since they are waiting for their template to load
221+ * asynchronously and their own compilation and linking has been suspended until that occurs. This hook can be considered
222+ * analogous to the ngAfterViewInit and ngAfterContentInit hooks in Angular 2. Since the compilation process is rather
223+ * different in Angular 1 there is no direct mapping and care should be taken when upgrading.
224+ */
225+ $postLink ( ) : void ;
226+ }
169227/**
170228 * AngularTS component lifecycle interface.
171229 * Directive controllers have a well-defined lifecycle. Each controller can implement "lifecycle hooks". These are methods that
0 commit comments