@angular-wave/angular.ts 0.0.33 → 0.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/types/index.d.ts CHANGED
@@ -16,6 +16,7 @@ export as namespace ng;
16
16
  export = angular;
17
17
 
18
18
  import ng = angular;
19
+ import { Obj } from "./router";
19
20
 
20
21
  ///////////////////////////////////////////////////////////////////////////////
21
22
  // ng module (angular.js)
@@ -104,7 +105,7 @@ declare namespace angular {
104
105
  * @param directiveFactory An injectable directive factory function.
105
106
  */
106
107
  directive<
107
- TScope extends IScope = IScope,
108
+ TScope extends Scope = Scope,
108
109
  TElement extends JQLite = JQLite,
109
110
  TAttributes extends IAttributes = IAttributes,
110
111
  TController extends IDirectiveController = IController,
@@ -115,7 +116,7 @@ declare namespace angular {
115
116
  >,
116
117
  ): IModule;
117
118
  directive<
118
- TScope extends IScope = IScope,
119
+ TScope extends Scope = Scope,
119
120
  TElement extends JQLite = JQLite,
120
121
  TAttributes extends IAttributes = IAttributes,
121
122
  TController extends IDirectiveController = IController,
@@ -380,14 +381,34 @@ declare namespace angular {
380
381
  * $rootScope - $rootScopeProvider - service in module ng
381
382
  * see https://docs.angularjs.org/api/ng/type/$rootScope.Scope and https://docs.angularjs.org/api/ng/service/$rootScope
382
383
  */
383
- interface IScope {
384
+ class Scope {
385
+ $id: number;
386
+ $parent: Scope | null;
387
+ $root: Scope | null;
388
+ $$destroyed: boolean;
389
+ $$isolateBindings: any;
390
+ $$phase: any;
391
+
392
+ private $$watches: Array<any>;
393
+ private $$nextSibling: Scope | null;
394
+ private $$prevSibling: Scope | null;
395
+ private $$childHead: Scope | null;
396
+ private $$childTail: Scope | null;
397
+ private $$ChildScope: Scope | null;
398
+ private $$watchersCount: number;
399
+ private $$digestWatchIndex: number;
400
+ private $$suspended: boolean;
401
+
402
+ private $$listeners: Object;
403
+ private $$listenerCount: Object;
404
+
384
405
  $apply(): any;
385
- $apply(exp: string): any;
386
- $apply(exp: (scope: IScope) => any): any;
406
+ $apply(expr: string): any;
407
+ $apply(expr: (scope: Scope) => any): any;
387
408
 
388
409
  $applyAsync(): any;
389
410
  $applyAsync(exp: string): any;
390
- $applyAsync(exp: (scope: IScope) => any): any;
411
+ $applyAsync(exp: (scope: Scope) => any): any;
391
412
 
392
413
  /**
393
414
  * Dispatches an event name downwards to all child scopes (and their children) notifying the registered $rootScope.Scope listeners.
@@ -486,14 +507,14 @@ declare namespace angular {
486
507
 
487
508
  $eval(): any;
488
509
  $eval(expression: string, locals?: Object): any;
489
- $eval(expression: (scope: IScope) => any, locals?: Object): any;
510
+ $eval(expression: (scope: Scope) => any, locals?: Object): any;
490
511
 
491
512
  $evalAsync(): void;
492
513
  $evalAsync(expression: string, locals?: Object): void;
493
- $evalAsync(expression: (scope: IScope) => void, locals?: Object): void;
514
+ $evalAsync(expression: (scope: Scope) => void, locals?: Object): void;
494
515
 
495
516
  // Defaults to false by the implementation checking strategy
496
- $new(isolate?: boolean, parent?: IScope): IScope;
517
+ $new(isolate?: boolean, parent?: Scope): Scope;
497
518
 
498
519
  /**
499
520
  * Listens on events of a given type. See $emit for discussion of event life cycle.
@@ -515,55 +536,46 @@ declare namespace angular {
515
536
  ): () => void;
516
537
  $watch<T>(
517
538
  watchExpression: string,
518
- listener?: (newValue: T, oldValue: T, scope: IScope) => any,
539
+ listener?: (newValue: T, oldValue: T, scope: Scope) => any,
519
540
  objectEquality?: boolean,
520
541
  ): () => void;
521
542
  $watch(
522
- watchExpression: (scope: IScope) => any,
543
+ watchExpression: (scope: Scope) => any,
523
544
  listener?: string,
524
545
  objectEquality?: boolean,
525
546
  ): () => void;
526
547
  $watch<T>(
527
- watchExpression: (scope: IScope) => T,
528
- listener?: (newValue: T, oldValue: T, scope: IScope) => any,
548
+ watchExpression: (scope: Scope) => T,
549
+ listener?: (newValue: T, oldValue: T, scope: Scope) => any,
529
550
  objectEquality?: boolean,
530
551
  ): () => void;
531
552
 
532
553
  $watchCollection<T>(
533
554
  watchExpression: string,
534
- listener: (newValue: T, oldValue: T, scope: IScope) => any,
555
+ listener: (newValue: T, oldValue: T, scope: Scope) => any,
535
556
  ): () => void;
536
557
  $watchCollection<T>(
537
- watchExpression: (scope: IScope) => T,
538
- listener: (newValue: T, oldValue: T, scope: IScope) => any,
558
+ watchExpression: (scope: Scope) => T,
559
+ listener: (newValue: T, oldValue: T, scope: Scope) => any,
539
560
  ): () => void;
540
561
 
541
562
  $watchGroup(
542
563
  watchExpressions: any[],
543
- listener: (newValue: any, oldValue: any, scope: IScope) => any,
564
+ listener: (newValue: any, oldValue: any, scope: Scope) => any,
544
565
  ): () => void;
545
566
  $watchGroup(
546
- watchExpressions: Array<{ (scope: IScope): any }>,
547
- listener: (newValue: any, oldValue: any, scope: IScope) => any,
567
+ watchExpressions: Array<{ (scope: Scope): any }>,
568
+ listener: (newValue: any, oldValue: any, scope: Scope) => any,
548
569
  ): () => void;
549
-
550
- $parent: IScope;
551
- $root: IScope;
552
- $id: number;
553
-
554
- // Hidden members
555
- $$isolateBindings: any;
556
- $$phase: any;
557
- $$destroyed: boolean;
558
570
  }
559
571
 
560
- interface IRootScopeService extends IScope {}
572
+ interface IRootScopeService extends Scope {}
561
573
 
562
574
  /**
563
575
  * $scope for ngRepeat directive.
564
576
  * see https://docs.angularjs.org/api/ng/directive/ngRepeat
565
577
  */
566
- interface IRepeatScope extends IScope {
578
+ interface IRepeatScope extends Scope {
567
579
  /**
568
580
  * iterator offset of the repeated element (0..length-1).
569
581
  */
@@ -599,11 +611,11 @@ declare namespace angular {
599
611
  /**
600
612
  * the scope on which the event was $emit-ed or $broadcast-ed.
601
613
  */
602
- targetScope: IScope;
614
+ targetScope: Scope;
603
615
  /**
604
616
  * the scope that is currently handling the event. Once the event propagates through the scope hierarchy, this property is set to null.
605
617
  */
606
- currentScope: IScope;
618
+ currentScope: Scope;
607
619
  /**
608
620
  * name of the event.
609
621
  */
@@ -913,8 +925,8 @@ declare namespace angular {
913
925
  ///////////////////////////////////////////////////////////////////////////
914
926
  interface IParseService {
915
927
  (
916
- expression: string,
917
- interceptorFn?: (value: any, scope: IScope, locals: any) => any,
928
+ expression: string | ((scope: Scope) => any),
929
+ interceptorFn?: (value: any, scope: Scope, locals: any) => any,
918
930
  expensiveChecks?: boolean,
919
931
  ): ICompiledExpression;
920
932
  }
@@ -1457,7 +1469,7 @@ declare namespace angular {
1457
1469
 
1458
1470
  interface ICompileProvider extends IServiceProvider {
1459
1471
  directive<
1460
- TScope extends IScope = IScope,
1472
+ TScope extends Scope = Scope,
1461
1473
  TElement extends JQLite = JQLite,
1462
1474
  TAttributes extends IAttributes = IAttributes,
1463
1475
  TController extends IDirectiveController = IController,
@@ -1468,7 +1480,7 @@ declare namespace angular {
1468
1480
  >,
1469
1481
  ): ICompileProvider;
1470
1482
  directive<
1471
- TScope extends IScope = IScope,
1483
+ TScope extends Scope = Scope,
1472
1484
  TElement extends JQLite = JQLite,
1473
1485
  TAttributes extends IAttributes = IAttributes,
1474
1486
  TController extends IDirectiveController = IController,
@@ -1543,13 +1555,13 @@ declare namespace angular {
1543
1555
 
1544
1556
  interface ICloneAttachFunction {
1545
1557
  // Let's hint but not force cloneAttachFn's signature
1546
- (clonedElement?: JQLite, scope?: IScope): any;
1558
+ (clonedElement?: JQLite, scope?: Scope): any;
1547
1559
  }
1548
1560
 
1549
1561
  // This corresponds to the "publicLinkFn" returned by $compile.
1550
1562
  interface ITemplateLinkingFunction {
1551
1563
  (
1552
- scope: IScope,
1564
+ scope: Scope,
1553
1565
  cloneAttachFn?: ICloneAttachFunction,
1554
1566
  options?: ITemplateLinkingFunctionOptions,
1555
1567
  ): JQLite;
@@ -1573,7 +1585,7 @@ declare namespace angular {
1573
1585
  interface ITranscludeFunction {
1574
1586
  // If the scope is provided, then the cloneAttachFn must be as well.
1575
1587
  (
1576
- scope: IScope,
1588
+ scope: Scope,
1577
1589
  cloneAttachFn: ICloneAttachFunction,
1578
1590
  futureParentElement?: JQLite,
1579
1591
  slotName?: string,
@@ -1601,7 +1613,7 @@ declare namespace angular {
1601
1613
  * The minimal local definitions required by $controller(ctrl, locals) calls.
1602
1614
  */
1603
1615
  interface IControllerLocals {
1604
- $scope: ng.IScope;
1616
+ $scope: ng.Scope;
1605
1617
  $element: JQLite;
1606
1618
  }
1607
1619
 
@@ -2268,7 +2280,7 @@ declare namespace angular {
2268
2280
  | { [key: string]: IController };
2269
2281
 
2270
2282
  interface IDirectiveFactory<
2271
- TScope extends IScope = IScope,
2283
+ TScope extends Scope = Scope,
2272
2284
  TElement extends JQLite = JQLite,
2273
2285
  TAttributes extends IAttributes = IAttributes,
2274
2286
  TController extends IDirectiveController = IController,
@@ -2281,7 +2293,7 @@ declare namespace angular {
2281
2293
  }
2282
2294
 
2283
2295
  interface IDirectiveLinkFn<
2284
- TScope extends IScope = IScope,
2296
+ TScope extends Scope = Scope,
2285
2297
  TElement extends JQLite = JQLite,
2286
2298
  TAttributes extends IAttributes = IAttributes,
2287
2299
  TController extends IDirectiveController = IController,
@@ -2296,7 +2308,7 @@ declare namespace angular {
2296
2308
  }
2297
2309
 
2298
2310
  interface IDirectivePrePost<
2299
- TScope extends IScope = IScope,
2311
+ TScope extends Scope = Scope,
2300
2312
  TElement extends JQLite = JQLite,
2301
2313
  TAttributes extends IAttributes = IAttributes,
2302
2314
  TController extends IDirectiveController = IController,
@@ -2310,7 +2322,7 @@ declare namespace angular {
2310
2322
  }
2311
2323
 
2312
2324
  interface IDirectiveCompileFn<
2313
- TScope extends IScope = IScope,
2325
+ TScope extends Scope = Scope,
2314
2326
  TElement extends JQLite = JQLite,
2315
2327
  TAttributes extends IAttributes = IAttributes,
2316
2328
  TController extends IDirectiveController = IController,
@@ -2332,7 +2344,7 @@ declare namespace angular {
2332
2344
  }
2333
2345
 
2334
2346
  interface IDirective<
2335
- TScope extends IScope = IScope,
2347
+ TScope extends Scope = Scope,
2336
2348
  TElement extends JQLite = JQLite,
2337
2349
  TAttributes extends IAttributes = IAttributes,
2338
2350
  TController extends IDirectiveController = IController,
@@ -1,6 +1,5 @@
1
1
  /**
2
2
  * Main entry point for angular 1.x build
3
- * @publicapi @module ng1
4
3
  */ /** */
5
4
  export * from "./interface";
6
5
  export * from "./services";
@@ -1,4 +1,3 @@
1
- /** @publicapi @module ng1 */ /** */
2
1
  import {
3
2
  StateDeclaration,
4
3
  _ViewDeclaration,
@@ -1,4 +1,3 @@
1
- /** @publicapi @module ng1 */ /** */
2
1
  import { Obj } from "../core";
3
2
  /** @hidden */
4
3
  export declare const resolveFactory: () => {
@@ -1,4 +1,5 @@
1
- import { IAngularEvent } from "angular";
1
+ import { IAngularEvent } from "../..";
2
+
2
3
  /**
3
4
  * An event broadcast on `$rootScope` when the state transition **begins**.
4
5
  *
@@ -1,4 +1,3 @@
1
- /** @publicapi @module ng1 */ /** */
2
1
  import { StateService } from "./core";
3
2
  declare function $IsStateFilter($state: StateService): any;
4
3
  declare namespace $IsStateFilter {
@@ -1,4 +1,3 @@
1
- /** @publicapi @module ng1 */ /** */
2
1
  import {
3
2
  BuilderFunction,
4
3
  StateRegistry,
@@ -1,4 +1,3 @@
1
- /** @publicapi @module ng1 */ /** */
2
1
  import { StateObject, TransitionStateHookFn } from "../core";
3
2
  /**
4
3
  * This is a [[StateBuilder.builder]] function for angular1 `onEnter`, `onExit`,
@@ -1,50 +0,0 @@
1
- /** @publicapi @module ng1 */ /** */
2
- import { LocationConfig, LocationServices, Router } from "./core";
3
- import { ILocationService, ILocationProvider, IWindowService } from "../index";
4
- /**
5
- * Implements Router LocationServices and LocationConfig using Angular 1's $location service
6
- * @internalapi
7
- */
8
- export declare class Ng1LocationServices
9
- implements LocationConfig, LocationServices
10
- {
11
- private $locationProvider;
12
- private $location;
13
- private $sniffer;
14
- private $browser;
15
- private $window;
16
- path: any;
17
- search: any;
18
- hash: any;
19
- hashPrefix: any;
20
- port: any;
21
- protocol: any;
22
- host: any;
23
- private _baseHref;
24
- private _urlListeners;
25
- /**
26
- * Applys ng1-specific path parameter encoding
27
- *
28
- * The Angular 1 `$location` service is a bit weird.
29
- * It doesn't allow slashes to be encoded/decoded bi-directionally.
30
- *
31
- * See the writeup at https://github.com/angular-ui/ui-router/issues/2598
32
- *
33
- * This code patches the `path` parameter type so it encoded/decodes slashes as ~2F
34
- *
35
- * @param router
36
- */
37
- static monkeyPatchPathParameterType(router: Router): void;
38
- constructor($locationProvider: ILocationProvider);
39
- onChange(callback: Function): () => Function[];
40
- html5Mode(): any;
41
- baseHref(): any;
42
- url(newUrl?: string, replace?: boolean, state?: any): string;
43
- _runtimeServices(
44
- $rootScope: any,
45
- $location: ILocationService,
46
- $sniffer: any,
47
- $browser: any,
48
- $window: IWindowService,
49
- ): void;
50
- }