diff --git a/@types/animations/animate.d.ts b/@types/animations/animate.d.ts
index d67a2d3b2..c49f6f1e3 100644
--- a/@types/animations/animate.d.ts
+++ b/@types/animations/animate.d.ts
@@ -212,74 +212,12 @@ export class AnimateProvider {
*/
enabled: any;
/**
- * Cancels the provided animation and applies the end state of the animation.
- * Note that this does not cancel the underlying operation, e.g. the setting of classes or
- * adding the element to the DOM.
- *
- * @param {import('./runner/animate-runner.js').AnimateRunner} runner An animation runner returned by an $animate function.
- *
- * @example
-
-
- angular.module('animationExample', []).component('cancelExample', {
- templateUrl: 'template.html',
- controller: function($element, $animate) {
- this.runner = null;
-
- this.addClass = function() {
- this.runner = $animate.addClass($element.querySelectorAll('div'), 'red');
- let ctrl = this;
- this.runner.finally(function() {
- ctrl.runner = null;
- });
- };
-
- this.removeClass = function() {
- this.runner = $animate.removeClass($element.querySelectorAll('div'), 'red');
- let ctrl = this;
- this.runner.finally(function() {
- ctrl.runner = null;
- });
- };
-
- this.cancel = function() {
- $animate.cancel(this.runner);
- };
- }
- });
-
-
-
-
-
-
-
-
-
CSS-Animated Text
-
-
-
-
-
-
- .red-add, .red-remove {
- transition: all 4s cubic-bezier(0.250, 0.460, 0.450, 0.940);
- }
-
- .red,
- .red-add.red-add-active {
- color: #FF0000;
- font-size: 40px;
- }
-
- .red-remove.red-remove-active {
- font-size: 10px;
- color: black;
- }
-
-
-
- */
+ * Cancels the provided animation and applies the end state of the animation.
+ * Note that this does not cancel the underlying operation, e.g. the setting of classes or
+ * adding the element to the DOM.
+ *
+ * @param {import('./runner/animate-runner.js').AnimateRunner} runner An animation runner returned by an $animate function.
+ */
cancel(
runner: import("./runner/animate-runner.js").AnimateRunner,
): void;
diff --git a/@types/core/compile/attributes.d.ts b/@types/core/compile/attributes.d.ts
index 899b7cb00..390584f87 100644
--- a/@types/core/compile/attributes.d.ts
+++ b/@types/core/compile/attributes.d.ts
@@ -1,7 +1,7 @@
export class Attributes {
static $nonscope: boolean;
/**
- * @param {ng.Scope} $rootScope
+ * @param {ng.RootScopeService} $rootScope
* @param {*} $animate
* @param {ng.ExceptionHandlerService} $exceptionHandler
* @param {*} $sce
@@ -9,7 +9,7 @@ export class Attributes {
* @param {Object} [attributesToCopy]
*/
constructor(
- $rootScope: ng.Scope,
+ $rootScope: ng.RootScopeService,
$animate: any,
$exceptionHandler: ng.ExceptionHandlerService,
$sce: any,
diff --git a/@types/core/di/ng-module.d.ts b/@types/core/di/ng-module.d.ts
index 087cb7a25..09647b445 100644
--- a/@types/core/di/ng-module.d.ts
+++ b/@types/core/di/ng-module.d.ts
@@ -49,6 +49,7 @@ export class NgModule {
/** @type {!Array.>} */
runBlocks: Array>;
services: any[];
+ wasmModules: any[];
/**
* @param {string} name
* @param {any} object
@@ -153,4 +154,10 @@ export class NgModule {
name: string,
ctlFn: import("../../interface.ts").Injectable,
): NgModule;
+ /**
+ * @param {string} name
+ * @param {string} src
+ * @returns {NgModule}
+ */
+ wasm(name: string, src: string): NgModule;
}
diff --git a/@types/core/sanitize/interface.d.ts b/@types/core/sanitize/interface.d.ts
new file mode 100644
index 000000000..0046947df
--- /dev/null
+++ b/@types/core/sanitize/interface.d.ts
@@ -0,0 +1,8 @@
+/**
+ * Sanitizer function that processes a URI string and optionally
+ * treats it as a media URL.
+ */
+export type SanitizerFn = (
+ uri: string | null | undefined,
+ isMediaUrl?: boolean,
+) => string | null | undefined;
diff --git a/@types/core/sanitize/sanitize-uri.d.ts b/@types/core/sanitize/sanitize-uri.d.ts
index 17d3229e3..1ca5acb40 100644
--- a/@types/core/sanitize/sanitize-uri.d.ts
+++ b/@types/core/sanitize/sanitize-uri.d.ts
@@ -33,8 +33,11 @@ export class SanitizeUriProvider implements ServiceProvider {
regexp?: RegExp | undefined,
): RegExp | SanitizeUriProvider;
/**
- * @returns {import("./interface").SanitizerFn}
+ * @returns {import("./interface.ts").SanitizerFn}
*/
- $get(): any;
+ $get: (
+ | string
+ | (($window: ng.WindowService) => import("./interface.ts").SanitizerFn)
+ )[];
}
export type ServiceProvider = import("../../interface.ts").ServiceProvider;
diff --git a/@types/core/scope/interface.d.ts b/@types/core/scope/interface.d.ts
index b46815bf4..56f7e6695 100644
--- a/@types/core/scope/interface.d.ts
+++ b/@types/core/scope/interface.d.ts
@@ -5,10 +5,10 @@ export interface AsyncQueueTask {
fn: (...args: any[]) => any;
locals: Record;
}
-export type ListenerFunction = (newValue: any, originalTarget: object) => void;
+export type ListenerFn = (newValue?: any, originalTarget?: object) => void;
export interface Listener {
originalTarget: object;
- listenerFn: ListenerFunction;
+ listenerFn: ListenerFn;
watchFn: CompiledExpression;
id: number;
scopeId: number;
diff --git a/@types/core/scope/scope.d.ts b/@types/core/scope/scope.d.ts
index 47d3feb5a..1f80bd38d 100644
--- a/@types/core/scope/scope.d.ts
+++ b/@types/core/scope/scope.d.ts
@@ -128,12 +128,12 @@ export class Scope {
* function is invoked when changes to that property are detected.
*
* @param {string} watchProp - An expression to be watched in the context of this model.
- * @param {import('./interface.ts').ListenerFunction} [listenerFn] - A function to execute when changes are detected on watched context.
+ * @param {ng.ListenerFn} [listenerFn] - A function to execute when changes are detected on watched context.
* @param {boolean} [lazy] - A flag to indicate if the listener should be invoked immediately. Defaults to false.
*/
$watch(
watchProp: string,
- listenerFn?: import("./interface.ts").ListenerFunction,
+ listenerFn?: ng.ListenerFn,
lazy?: boolean,
): () => void;
$new(childInstance: any): any;
diff --git a/@types/directive/wasm/wasm.d.ts b/@types/directive/wasm/wasm.d.ts
new file mode 100644
index 000000000..5b323a182
--- /dev/null
+++ b/@types/directive/wasm/wasm.d.ts
@@ -0,0 +1,3 @@
+export function ngWasmDirective(): {
+ link: ($scope: any, _: any, $attrs: any) => Promise;
+};
diff --git a/@types/namespace.d.ts b/@types/namespace.d.ts
index a4d0e21e4..1c26c3434 100644
--- a/@types/namespace.d.ts
+++ b/@types/namespace.d.ts
@@ -2,6 +2,10 @@ export { angular } from "./index.js";
import { Angular as TAngular } from "./angular.js";
import { Attributes as TAttributes } from "./core/compile/attributes.js";
import { Scope as TScope } from "./core/scope/scope.js";
+import {
+ ListenerFn as TListenerFn,
+ Listener as TListener,
+} from "./core/scope/interface.ts";
import { NgModule as TNgModule } from "./core/di/ng-module.js";
import { InjectorService as TInjectorService } from "./core/di/internal-injector.js";
import {
@@ -107,8 +111,10 @@ declare global {
type TemplateCacheService = Map;
type TemplateRequestService = TTemplateRequestService;
type ErrorHandlingConfig = TErrorHandlingConfig;
- type WindowService = Window;
+ type ListenerFn = TListenerFn;
+ type Listener = TListener;
type DocumentService = Document;
+ type WindowService = Window;
type WorkerConfig = TWorkerConfig;
type WorkerConnection = TWorkerConnection;
}
diff --git a/@types/services/sce/sce.d.ts b/@types/services/sce/sce.d.ts
index 4c3a225ce..9fb472893 100644
--- a/@types/services/sce/sce.d.ts
+++ b/@types/services/sce/sce.d.ts
@@ -24,85 +24,7 @@ export namespace SCE_CONTEXTS {
* `$sceDelegate` is a service that is used by the `$sce` service to provide {@link ng.$sce Strict
* Contextual Escaping (SCE)} services to AngularTS.
*
- * For an overview of this service and the functionnality it provides in AngularTS, see the main
- * page for {@link ng.$sce SCE}. The current page is targeted for developers who need to alter how
- * SCE works in their application, which shouldn't be needed in most cases.
- *
- *
- * AngularTS strongly relies on contextual escaping for the security of bindings: disabling or
- * modifying this might cause cross site scripting (XSS) vulnerabilities. For libraries owners,
- * changes to this service will also influence users, so be extra careful and document your changes.
- *
- *
- * Typically, you would configure or override the {@link ng.$sceDelegate $sceDelegate} instead of
- * the `$sce` service to customize the way Strict Contextual Escaping works in AngularTS. This is
- * because, while the `$sce` provides numerous shorthand methods, etc., you really only need to
- * override 3 core functions (`trustAs`, `getTrusted` and `valueOf`) to replace the way things
- * work because `$sce` delegates to `$sceDelegate` for these operations.
- *
- * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} to configure this service.
- *
- * The default instance of `$sceDelegate` should work out of the box with little pain. While you
- * can override it completely to change the behavior of `$sce`, the common case would
- * involve configuring the {@link ng.$sceDelegateProvider $sceDelegateProvider} instead by setting
- * your own trusted and banned resource lists for trusting URLs used for loading AngularTS resources
- * such as templates. Refer {@link ng.$sceDelegateProvider#trustedResourceUrlList
- * $sceDelegateProvider.trustedResourceUrlList} and {@link
- * ng.$sceDelegateProvider#bannedResourceUrlList $sceDelegateProvider.bannedResourceUrlList}
- */
-/**
- *
- * The `$sceDelegateProvider` provider allows developers to configure the {@link ng.$sceDelegate
- * $sceDelegate service}, used as a delegate for {@link ng.$sce Strict Contextual Escaping (SCE)}.
- *
- * The `$sceDelegateProvider` allows one to get/set the `trustedResourceUrlList` and
- * `bannedResourceUrlList` used to ensure that the URLs used for sourcing AngularTS templates and
- * other script-running URLs are safe (all places that use the `$sce.RESOURCE_URL` context). See
- * {@link ng.$sceDelegateProvider#trustedResourceUrlList
- * $sceDelegateProvider.trustedResourceUrlList} and
- * {@link ng.$sceDelegateProvider#bannedResourceUrlList $sceDelegateProvider.bannedResourceUrlList},
- *
- * For the general details about this service in AngularTS, read the main page for {@link ng.$sce
- * Strict Contextual Escaping (SCE)}.
- *
- * **Example**: Consider the following case.
- *
- * - your app is hosted at url `http://myapp.example.com/`
- * - but some of your templates are hosted on other domains you control such as
- * `http://srv01.assets.example.com/`, `http://srv02.assets.example.com/`, etc.
- * - and you have an open redirect at `http://myapp.example.com/clickThru?...`.
- *
- * Here is what a secure configuration for this scenario might look like:
- *
- * ```
- * angular.module('myApp', []).config(function($sceDelegateProvider) {
- * $sceDelegateProvider.trustedResourceUrlList([
- * // Allow same origin resource loads.
- * 'self',
- * // Allow loading from our assets domain. Notice the difference between * and **.
- * 'http://srv*.assets.example.com/**'
- * ]);
- *
- * // The banned resource URL list overrides the trusted resource URL list so the open redirect
- * // here is blocked.
- * $sceDelegateProvider.bannedResourceUrlList([
- * 'http://myapp.example.com/clickThru**'
- * ]);
- * });
- * ```
- * Note that an empty trusted resource URL list will block every resource URL from being loaded, and will require
- * you to manually mark each one as trusted with `$sce.trustAsResourceUrl`. However, templates
- * requested by {@link ng.$templateRequest $templateRequest} that are present in
- * {@link ng.$templateCache $templateCache} will not go through this check. If you have a mechanism
- * to populate your templates in that cache at config time, then it is a good idea to remove 'self'
- * from the trusted resource URL lsit. This helps to mitigate the security impact of certain types
- * of issues, like for instance attacker-controlled `ng-includes`.
- */
-/**
- * `$sceDelegate` is a service that is used by the `$sce` service to provide {@link ng.$sce Strict
- * Contextual Escaping (SCE)} services to AngularTS.
- *
- * For an overview of this service and the functionnality it provides in AngularTS, see the main
+ * For an overview of this service and the functionality it provides in AngularTS, see the main
* page for {@link ng.$sce SCE}. The current page is targeted for developers who need to alter how
* SCE works in their application, which shouldn't be needed in most cases.
*
@@ -179,7 +101,7 @@ export namespace SCE_CONTEXTS {
export class SceDelegateProvider {
/**
*
- * @param {Array=} trustedResourceUrlList When provided, replaces the trustedResourceUrlList with
+ * @param {Array=} value When provided, replaces the trustedResourceUrlList with
* the value provided. This must be an array or null. A snapshot of this array is used so
* further changes to the array are ignored.
* Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items
@@ -198,7 +120,7 @@ export class SceDelegateProvider {
* its origin with other apps! It is a good idea to limit it to only your application's directory.
*
*/
- trustedResourceUrlList: (value: any, ...args: any[]) => any[];
+ trustedResourceUrlList: (value?: any[] | undefined, ...args: any[]) => any[];
/**
*
* @param {Array=} bannedResourceUrlList When provided, replaces the `bannedResourceUrlList` with
@@ -226,7 +148,7 @@ export class SceDelegateProvider {
| string
| ((
$injector: ng.InjectorService,
- $$sanitizeUri: any,
+ $$sanitizeUri: import("../../core/sanitize/interface.ts").SanitizerFn,
$exceptionHandler: ng.ExceptionHandlerService,
) => {
trustAs: (type: string, trustedValue: any) => any;
diff --git a/@types/shared/utils.d.ts b/@types/shared/utils.d.ts
index 3764dcee5..62fbea116 100644
--- a/@types/shared/utils.d.ts
+++ b/@types/shared/utils.d.ts
@@ -488,7 +488,18 @@ export function toDebugString(obj: any): any;
* The resulting string key is in 'type:hashKey' format.
*/
export function hashKey(obj: any): string;
-export function mergeClasses(a: any, b: any): any;
+/**
+ * Merges two class name values into a single space-separated string.
+ * Accepts strings, arrays of strings, or null/undefined values.
+ *
+ * @param {string | string[] | null | undefined} a - The first class name(s).
+ * @param {string | string[] | null | undefined} b - The second class name(s).
+ * @returns {string} A single string containing all class names separated by spaces.
+ */
+export function mergeClasses(
+ a: string | string[] | null | undefined,
+ b: string | string[] | null | undefined,
+): string;
/**
* Converts all accepted directives format into proper directive name.
* @param {string} name Name to normalize
@@ -571,5 +582,12 @@ export function wait(t?: number): Promise;
* // returns false
*/
export function startsWith(str: string, search: string): boolean;
+/**
+ * Loads and instantiates a WebAssembly module with proper error handling.
+ *
+ * @param {string} src - URL to the wasm file
+ * @returns {Promise