Skip to content

Commit 0b056f7

Browse files
author
Anatoly Ostrovsky
committed
Test fixes
1 parent ad1ca11 commit 0b056f7

48 files changed

Lines changed: 389 additions & 382 deletions

Some content is hidden

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

@types/core/compile/attributes.d.ts

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
/**
2-
* @extends {Record<string, any>}
3-
*/
41
export class Attributes {
52
static $nonscope: boolean;
63
/**
@@ -16,7 +13,7 @@ export class Attributes {
1613
* - Used when cloning attributes for directive linking / child scopes.
1714
* - Performs a shallow copy of all properties from the source Attributes object,
1815
* including `$attr`, normalized attribute values, and internal fields
19-
* (e.g. `$$observers`).
16+
* (e.g. `_observers`).
2017
* - `$attr` is intentionally **not reinitialized** in this case, because the
2118
* source object already contains the correct normalized → DOM attribute mapping.
2219
*
@@ -33,14 +30,18 @@ export class Attributes {
3330
nodeRef?: import("../../shared/noderef.js").NodeRef,
3431
attributesToCopy?: any & Record<string, any>,
3532
);
36-
_$animate: import("../../animations/interface.ts").AnimateService;
37-
_$exceptionHandler: import("../../services/exception/interface.ts").ExceptionHandler;
38-
_$sce: import("../../services/sce/interface.ts").SCEService;
33+
/** @type {ng.AnimateService} */
34+
_animate: ng.AnimateService;
35+
/** @type {ng.ExceptionHandlerService} */
36+
_exceptionHandler: ng.ExceptionHandlerService;
37+
/** @type {ng.SCEService} */
38+
_sce: ng.SCEService;
3939
/**
4040
* A map of DOM element attribute names to the normalized name. This is needed
4141
* to do reverse lookup from normalized name back to actual name.
42+
* @type {Record<string, string>}
4243
*/
43-
$attr: {};
44+
$attr: Record<string, string>;
4445
/** @type {import("../../shared/noderef.js").NodeRef | undefined} */
4546
_nodeRef: import("../../shared/noderef.js").NodeRef | undefined;
4647
/** @ignore @returns {Node|Element} */
@@ -109,8 +110,23 @@ export class Attributes {
109110
* @returns {Function} Returns a deregistration function for this observer.
110111
*/
111112
$observe<T>(key: string, fn: (value?: T) => any): Function;
112-
$$observers: any;
113-
setSpecialAttr(element: any, attrName: any, value: any): void;
113+
_observers: any;
114+
/**
115+
* Sets a special (non-standard) attribute on an element.
116+
*
117+
* Used for attribute names that cannot be set via `setAttribute`
118+
* (e.g. names not starting with a letter like `(click)`).
119+
*
120+
* @param {Element} element
121+
* @param {string} attrName
122+
* @param {string | null} value
123+
* @returns {void}
124+
*/
125+
setSpecialAttr(
126+
element: Element,
127+
attrName: string,
128+
value: string | null,
129+
): void;
114130
/**
115131
*
116132
* @param {unknown} value

@types/core/compile/compile.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export class CompileProvider {
113113
*
114114
* @param {string} elementName The element name or '*' to match any element.
115115
* @param {string} propertyName The DOM property name.
116-
* @param {string} ctx The {@link _$sce} security context in which this value is safe for use, e.g. `$sce.URL`
116+
* @param {string} ctx The {@link _sce} security context in which this value is safe for use, e.g. `$sce.URL`
117117
* @returns {object} `this` for chaining
118118
*/
119119
addPropertySecurityContext: (

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export interface CompiledExpressionProps {
2424
_watchDelegate?: (
2525
scope: Scope,
2626
listener: Function,
27-
equalityCheck: boolean,
2827
expression: CompiledExpression | string | ((scope: Scope) => any),
2928
) => any;
3029
/** Expression inputs; may be an array or a function. */

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
export function constantWatchDelegate(
22
scope: any,
33
listener: any,
4-
objectEquality: any,
54
parsedExpression: any,
65
): any;
76
export class ParseProvider {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { CompiledExpression } from "../parse/interface.ts";
22
export type ListenerFn = (newValue?: any, originalTarget?: object) => void;
3+
export type NonScope = string[] | boolean | undefined;
34
export interface Listener {
45
originalTarget: any;
56
listenerFn: ListenerFn;

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,24 @@
33
* Creates a deep proxy for the target object, intercepting property changes
44
* and recursively applying proxies to nested objects.
55
*
6-
* @param {Object} target - The object to be wrapped in a proxy.
6+
* @param {Object & {$nonscope?: import("./interface.ts").NonScope} & Record<string, any>} target - The object to be wrapped in a proxy.
77
* @param {Scope} [context] - The context for the handler, used to track listeners.
88
* @returns {Scope|Object} - A proxy that intercepts operations on the target object,
99
* or the original value if the target is not an object.
1010
*/
11-
export function createScope(target?: any, context?: Scope): Scope | any;
11+
export function createScope(
12+
target?: any & {
13+
$nonscope?: import("./interface.ts").NonScope;
14+
} & Record<string, any>,
15+
context?: Scope,
16+
): Scope | any;
1217
/**
13-
* @ignore
1418
* Checks if a target should be excluded from scope observability
1519
* @param {any} target
1620
* @returns {boolean}
1721
*/
1822
export function isNonScope(target: any): boolean;
19-
/** @ignore @type {Function[]}*/
23+
/** @ignore @type {Function[]} */
2024
export const $postUpdateQueue: Function[];
2125
export class RootScopeProvider {
2226
rootScope: any;

@types/directive/form/form.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@ export class FormController {
101101
$invalid: boolean;
102102
$submitted: boolean;
103103
/** @type {FormController|Object} */
104-
$$parentForm: FormController | any;
104+
_parentForm: FormController | any;
105105
_element: Element;
106-
$$animate: import("../../animations/interface.ts").AnimateService;
106+
_animate: import("../../animations/interface.ts").AnimateService;
107107
$error: {};
108-
$$success: {};
108+
_success: {};
109109
$pending: any;
110-
$$classCache: {};
110+
_classCache: {};
111111
$target: {};
112112
/**
113113
* Rollback all form controls pending updates to the `$modelValue`.

@types/directive/model-options/model-options.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ export type ModelOptionsConfig = {
2727
updateOnDefault?: boolean;
2828
};
2929
/**
30-
*
3130
* A container for the options set by the {@link ngModelOptions} directive
3231
*/
3332
declare class ModelOptions {

@types/namespace.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ import {
128128
declare global {
129129
interface Function {
130130
$inject?: readonly string[] | undefined;
131+
$nonscope?: readonly string[] | boolean | undefined;
131132
}
132133
interface Window {
133134
angular: TAngular;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
export function silentRejection<E = unknown>(error: E): Promise<never>;
12
/**
23
* Provides services related to ng-router states.
34
*

0 commit comments

Comments
 (0)