Skip to content

Commit 29dd33f

Browse files
committed
Unify inject tokens
1 parent 70bd1c9 commit 29dd33f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+369
-348
lines changed

@types/animations/animate-cache.d.ts

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,51 @@ export function animateCache(): {
4444
*/
4545
put(key: string, value: any, isValid: boolean): void;
4646
};
47-
export function AnimateCacheProvider(): void;
4847
export class AnimateCacheProvider {
49-
$get: (typeof animateCache)[];
48+
$get(): {
49+
/**
50+
* Generates a unique cache key based on the node's parent and other parameters.
51+
* @param {HTMLElement} node - The DOM node to generate the cache key for.
52+
* @param {string} method - The animation method being applied.
53+
* @param {string} [addClass] - Class to add during the animation.
54+
* @param {string} [removeClass] - Class to remove during the animation.
55+
* @returns {string} - The generated cache key.
56+
*/
57+
cacheKey(
58+
node: HTMLElement,
59+
method: string,
60+
addClass?: string,
61+
removeClass?: string,
62+
): string;
63+
/**
64+
* Checks if a cached animation without a duration exists.
65+
* @param {string} key - The cache key to check.
66+
* @returns {boolean} - True if an invalid animation is cached, false otherwise.
67+
*/
68+
containsCachedAnimationWithoutDuration(key: string): boolean;
69+
/**
70+
* Clears the cache.
71+
* @returns {void}
72+
*/
73+
flush(): void;
74+
/**
75+
* Gets the count of a specific cache entry.
76+
* @param {string} key - The cache key to count.
77+
* @returns {number} - The count of the cache entry.
78+
*/
79+
count(key: string): number;
80+
/**
81+
* Retrieves a value associated with a specific cache key.
82+
* @param {string} key - The cache key to retrieve.
83+
* @returns {any} - The value associated with the cache key.
84+
*/
85+
get(key: string): any;
86+
/**
87+
* Adds or updates a cache entry.
88+
* @param {string} key - The cache key to add or update.
89+
* @param {any} value - The value to store.
90+
* @param {boolean} isValid - Whether the cache entry is valid.
91+
*/
92+
put(key: string, value: any, isValid: boolean): void;
93+
};
5094
}

@types/animations/animate.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,5 @@ export class AnimateProvider {
9696
$get: any[];
9797
}
9898
export namespace AnimateProvider {
99-
let $inject: string[];
99+
let $inject: any[];
100100
}

@types/animations/shared.d.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,10 @@ export const ACTIVE_CLASS_SUFFIX: "-active";
8383
export const PREPARE_CLASS_SUFFIX: "-prepare";
8484
export const NG_ANIMATE_CLASSNAME: "ng-animate";
8585
export const NG_ANIMATE_CHILDREN_DATA: "$$ngAnimateChildren";
86-
export let CSS_PREFIX: string;
87-
export let TRANSITION_PROP: any;
88-
export let TRANSITIONEND_EVENT: any;
89-
export let ANIMATION_PROP: any;
90-
export let ANIMATIONEND_EVENT: any;
86+
export const TRANSITION_PROP: "transition";
87+
export const TRANSITIONEND_EVENT: "transitionend";
88+
export const ANIMATION_PROP: "animation";
89+
export const ANIMATIONEND_EVENT: "animationend";
9190
export const DURATION_KEY: "Duration";
9291
export const PROPERTY_KEY: number;
9392
export const DELAY_KEY: "Delay";

@types/core/parse/parse.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ export class ParseProvider {
2929
identifierStart?: (arg0: any) => boolean,
3030
identifierContinue?: (arg0: any) => boolean,
3131
) => ParseProvider;
32-
$get: (string | (($filter: (any: any) => any) => any))[];
32+
$get: any[];
3333
}

@types/core/scope/scope.d.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ export function createScope(target?: any, context?: Scope): Scope;
1616
* @returns {boolean}
1717
*/
1818
export function isNonScope(target: any): boolean;
19-
/**
20-
* Decorator for excluding objects from scope observability
21-
*/
22-
export const NONSCOPE: "$nonscope";
2319
export const $postUpdateQueue: any[];
2420
export let rootScope: any;
2521
export class RootScopeProvider {

@types/injection-tokens.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ export function provider(services: string[]): string[];
1111
* ```js
1212
*
1313
* myDirective.$inject = [
14-
* angular.$injectTokens.$animate,
15-
* angular.$injectTokens.$templateRequest,
14+
* angular.$t._animate,
15+
* angular.$t._templateRequest,
1616
* ];
1717
*
1818
* function myDirective($animate, $templateRequest) { ... }
1919
*
2020
* ```
21+
* @private
2122
* @type Readonly<Record<string, string>>
2223
*/
2324
export const $injectTokens: Readonly<Record<string, string>>;

@types/namespace.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ import {
8989
import { RestService as TRestService } from "./services/rest/rest.js";
9090
import { ServiceProvider as TServiceProvider } from "./interface.ts";
9191
import { NgModelController as TNgModelController } from "./directive/model/model.js";
92+
import { RouterProvider } from "./router/router.ts";
93+
import { TransitionProvider as TTransitionProvider } from "./router/transition/transition-service.js";
9294
declare global {
9395
interface Function {
9496
$inject?: readonly string[] | undefined;
@@ -120,6 +122,7 @@ declare global {
120122
type SceProvider = TSceProvider;
121123
type SceDelegateProvider = TSceDelegateProvider;
122124
type FilterProvider = TFilterProvider;
125+
type TransitionProvider = TTransitionProvider;
123126
type AnchorScrollService = TAnchorScrollService;
124127
type AnimateService = TAnimateService;
125128
type CompileService = TCompileFn;
@@ -140,6 +143,7 @@ declare global {
140143
type PubSubService = TPubSub;
141144
type RootElementService = Element;
142145
type RootScopeService = TScope & Record<string, any>;
146+
type RouterService = RouterProvider;
143147
type StateService = TStateProvider;
144148
type SseService = TSseService;
145149
type SseConfig = TSseConfig;

@types/router/directives/state-directives.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ export namespace $StateRefDynamicDirective {
2727
}
2828
/**
2929
* @param {*} $state
30-
* @param {import('../router.js').Router} $router
30+
* @param {import('../router.js').RouterProvider} $router
3131
* @param {*} $interpolate
3232
* @param {*} $stateRegistry
3333
* @param {*} $transitions
3434
* @returns {import("../../interface.ts").Directive}
3535
*/
3636
export function $StateRefActiveDirective(
3737
$state: any,
38-
$router: import("../router.js").Router,
38+
$router: import("../router.js").RouterProvider,
3939
$interpolate: any,
4040
$stateRegistry: any,
4141
$transitions: any,

@types/router/router.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* This is where we hold the global mutable state such as current state, current
66
* params, current transition, etc.
77
*/
8-
export class Router {
8+
export class RouterProvider {
99
/**
1010
* Current parameter values
1111
*

@types/router/state/state-registry.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ export class StateRegistryProvider {
1010
/**
1111
* @param urlService
1212
* @param stateService
13-
* @param {import('../router.js').Router} globals
13+
* @param {import('../router.js').RouterProvider} globals
1414
* @param viewService
1515
*/
1616
constructor(
1717
urlService: any,
1818
stateService: any,
19-
globals: import("../router.js").Router,
19+
globals: import("../router.js").RouterProvider,
2020
viewService: any,
2121
);
2222
states: {};

0 commit comments

Comments
 (0)