@angular-wave/angular.ts 0.9.8 → 0.9.9

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.
@@ -135,67 +135,10 @@ export class CompileProvider {
135
135
  $animate: any,
136
136
  ) => (
137
137
  compileNode: string | Element | Node | ChildNode | NodeList,
138
- transcludeFn?: TranscludeFn,
138
+ transcludeFn?: import("./inteface.ts").TranscludeFn,
139
139
  maxPriority?: number,
140
140
  ignoreDirective?: string,
141
141
  previousCompileContext?: any,
142
- ) => PublicLinkFn)
142
+ ) => import("./inteface.ts").PublicLinkFn)
143
143
  )[];
144
144
  }
145
- /**
146
- * A function passed as the fifth argument to a {@type PublicLinkFn} link function.
147
- * It behaves like a linking function, with the `scope` argument automatically created
148
- * as a new child of the transcluded parent scope.
149
- *
150
- * The function returns the DOM content to be injected (transcluded) into the directive.
151
- */
152
- export type TranscludeFn = (
153
- clone?: Element | Node | ChildNode | NodeList | Node[],
154
- scope?: import("../scope/scope.js").Scope,
155
- ) => any;
156
- /**
157
- * A function passed as the fifth argument to a {@type PublicLinkFn} link function.
158
- * It behaves like a linking function, with the `scope` argument automatically created
159
- * as a new child of the transcluded parent scope.
160
- *
161
- * The function returns the DOM content to be injected (transcluded) into the directive.
162
- */
163
- export type BoundTranscludeFn = () => Element | Node;
164
- export type SimpleChange = {
165
- currentValue: any;
166
- firstChange: boolean;
167
- };
168
- export type PublicLinkFn = (
169
- scope: import("../scope/scope.js").Scope,
170
- cloneConnectFn?: TranscludeFn,
171
- options?: any,
172
- ) => Element | Node | ChildNode | Node[];
173
- export type CompileFn = (
174
- compileNode: string | Element | Node | ChildNode | NodeList,
175
- transcludeFn?: TranscludeFn,
176
- maxPriority?: number,
177
- ignoreDirective?: string,
178
- previousCompileContext?: any,
179
- ) => PublicLinkFn;
180
- export type LinkFnMapping = {
181
- index: number;
182
- nodeLinkFnCtx?: NodeLinkFnCtx;
183
- childLinkFn?: CompositeLinkFn;
184
- };
185
- export type CompileNodesFn = () => CompositeLinkFn;
186
- export type NodeLinkFn = () => Node | Element | NodeList;
187
- export type NodeLinkFnCtx = {
188
- nodeLinkFn: NodeLinkFn;
189
- terminal: boolean;
190
- transclude: TranscludeFn;
191
- transcludeOnThisElement: boolean;
192
- templateOnThisElement: boolean;
193
- newScope: boolean;
194
- };
195
- export type ApplyDirectivesToNodeFn = () => NodeLinkFn;
196
- export type CompositeLinkFn = (
197
- scope: import("../scope/scope.js").Scope,
198
- $linkNode: NodeRef,
199
- parentBoundTranscludeFn?: Function,
200
- ) => any;
201
- import { NodeRef } from "../../shared/noderef.js";
@@ -0,0 +1,82 @@
1
+ import type { Scope } from "../scope/scope.js";
2
+ import type { NodeRef } from "../../shared/noderef.js";
3
+ /**
4
+ * A function passed as the fifth argument to a `PublicLinkFn` link function.
5
+ * It behaves like a linking function, with the `scope` argument automatically created
6
+ * as a new child of the transcluded parent scope.
7
+ *
8
+ * The function returns the DOM content to be injected (transcluded) into the directive.
9
+ */
10
+ export type TranscludeFn = (
11
+ clone?: Element | Node | ChildNode | NodeList | Node[],
12
+ scope?: Scope,
13
+ ) => void;
14
+ /**
15
+ * A specialized version of `TranscludeFn` with the scope argument already bound.
16
+ * This function requires no parameters and returns the same result as `TranscludeFn`.
17
+ */
18
+ export type BoundTranscludeFn = () => Element | Node;
19
+ /**
20
+ * Represents a simple change in a watched value.
21
+ */
22
+ export interface SimpleChange {
23
+ currentValue: any;
24
+ firstChange: boolean;
25
+ }
26
+ /**
27
+ * A function returned by the `$compile` service that links a compiled template to a scope.
28
+ */
29
+ export type PublicLinkFn = (
30
+ scope: Scope,
31
+ cloneConnectFn?: TranscludeFn,
32
+ options?: any,
33
+ ) => Element | Node | ChildNode | Node[];
34
+ /**
35
+ * Entry point for the `$compile` service.
36
+ */
37
+ export type CompileFn = (
38
+ compileNode: string | Element | Node | ChildNode | NodeList,
39
+ transcludeFn?: TranscludeFn,
40
+ maxPriority?: number,
41
+ ignoreDirective?: string,
42
+ previousCompileContext?: any,
43
+ ) => PublicLinkFn;
44
+ /**
45
+ * Represents a mapping of linking functions.
46
+ */
47
+ export interface LinkFnMapping {
48
+ index: number;
49
+ nodeLinkFnCtx?: NodeLinkFnCtx;
50
+ childLinkFn?: CompositeLinkFn;
51
+ }
52
+ /**
53
+ * Function that compiles a list of nodes and returns a composite linking function.
54
+ */
55
+ export type CompileNodesFn = () => CompositeLinkFn;
56
+ /**
57
+ * A function used to link a specific node.
58
+ */
59
+ export type NodeLinkFn = () => Node | Element | NodeList;
60
+ /**
61
+ * Context information for a NodeLinkFn.
62
+ */
63
+ export interface NodeLinkFnCtx {
64
+ nodeLinkFn: NodeLinkFn;
65
+ terminal: boolean;
66
+ transclude: TranscludeFn;
67
+ transcludeOnThisElement: boolean;
68
+ templateOnThisElement: boolean;
69
+ newScope: boolean;
70
+ }
71
+ /**
72
+ * Function that applies directives to a node and returns a NodeLinkFn.
73
+ */
74
+ export type ApplyDirectivesToNodeFn = () => NodeLinkFn;
75
+ /**
76
+ * Function that aggregates all linking functions for a compilation root (nodeList).
77
+ */
78
+ export type CompositeLinkFn = (
79
+ scope: Scope,
80
+ $linkNode: NodeRef,
81
+ parentBoundTranscludeFn?: Function,
82
+ ) => void;
@@ -1,10 +1,8 @@
1
1
  /**
2
- * @param {import("../../services/pubsub/pubsub.js").PubSub} $eventBus
3
- * @returns {import("../../interface.ts").Directive}
2
+ * @param {ng.PubSubService} $eventBus
3
+ * @returns {ng.Directive}
4
4
  */
5
- export function ngChannelDirective(
6
- $eventBus: import("../../services/pubsub/pubsub.js").PubSub,
7
- ): import("../../interface.ts").Directive;
5
+ export function ngChannelDirective($eventBus: ng.PubSubService): ng.Directive;
8
6
  export namespace ngChannelDirective {
9
7
  let $inject: string[];
10
8
  }
@@ -1,4 +1,4 @@
1
1
  /**
2
- * @returns {import('../../interface.ts').Directive}
2
+ * @returns {ng.Directive}
3
3
  */
4
- export function ngCloakDirective(): import("../../interface.ts").Directive;
4
+ export function ngCloakDirective(): ng.Directive;
@@ -2,6 +2,7 @@
2
2
  *
3
3
  * @param {ng.ParseService} $parse
4
4
  * @param {ng.ExceptionHandlerService} $exceptionHandler
5
+ * @param {ng.WindowService} $window
5
6
  * @param {string} directiveName
6
7
  * @param {string} eventName
7
8
  * @returns {ng.Directive}
@@ -9,6 +10,23 @@
9
10
  export function createEventDirective(
10
11
  $parse: ng.ParseService,
11
12
  $exceptionHandler: ng.ExceptionHandlerService,
13
+ $window: ng.WindowService,
14
+ directiveName: string,
15
+ eventName: string,
16
+ ): ng.Directive;
17
+ /**
18
+ *
19
+ * @param {ng.ParseService} $parse
20
+ * @param {ng.ExceptionHandlerService} $exceptionHandler
21
+ * @param {ng.WindowService} $window
22
+ * @param {string} directiveName
23
+ * @param {string} eventName
24
+ * @returns {ng.Directive}
25
+ */
26
+ export function createWindowEventDirective(
27
+ $parse: ng.ParseService,
28
+ $exceptionHandler: ng.ExceptionHandlerService,
29
+ $window: ng.WindowService,
12
30
  directiveName: string,
13
31
  eventName: string,
14
32
  ): ng.Directive;
@@ -16,11 +16,11 @@ export namespace ngIncludeDirective {
16
16
  let $inject: string[];
17
17
  }
18
18
  /**
19
- * @param {import("../../core/compile/compile.js").CompileFn} $compile
19
+ * @param {ng.CompileService} $compile
20
20
  * @returns {import("../../interface.ts").Directive}
21
21
  */
22
22
  export function ngIncludeFillContentDirective(
23
- $compile: import("../../core/compile/compile.js").CompileFn,
23
+ $compile: ng.CompileService,
24
24
  ): import("../../interface.ts").Directive;
25
25
  export namespace ngIncludeFillContentDirective {
26
26
  let $inject_1: string[];
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  *
3
- * @param {import("../../core/compile/compile.js").CompileFn} $compile
3
+ * @param {ng.CompileService} $compile
4
4
  * @param {import("../../core/parse/interface.ts").ParseService} $parse
5
5
  * @returns {import("../../interface.ts").Directive}
6
6
  */
7
7
  export function ngOptionsDirective(
8
- $compile: import("../../core/compile/compile.js").CompileFn,
8
+ $compile: ng.CompileService,
9
9
  $parse: import("../../core/parse/interface.ts").ParseService,
10
10
  ): import("../../interface.ts").Directive;
11
11
  export namespace ngOptionsDirective {
@@ -1,10 +1,10 @@
1
1
  /**
2
- * @param {import("../../core/compile/compile.js").CompileFn} $compile
3
- * @returns {import("../../interface.ts").Directive}
2
+ * @param {ng.CompileService} $compile
3
+ * @returns {ng.Directive}
4
4
  */
5
5
  export function ngTranscludeDirective(
6
- $compile: import("../../core/compile/compile.js").CompileFn,
7
- ): import("../../interface.ts").Directive;
6
+ $compile: ng.CompileService,
7
+ ): ng.Directive;
8
8
  export namespace ngTranscludeDirective {
9
9
  let $inject: string[];
10
10
  }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @returns {ng.Directive}
3
+ */
4
+ export function ngViewportDirective(): ng.Directive;
@@ -270,6 +270,7 @@ export type DirectiveCompileFn = (
270
270
  ) => void | DirectiveLinkFn | DirectivePrePost;
271
271
  /**
272
272
  * Defines the structure of an AngularTS directive.
273
+ * @typedef {Object} Directive
273
274
  */
274
275
  export interface Directive {
275
276
  /** Optional name (usually inferred) */
@@ -1,79 +1,102 @@
1
1
  export { angular } from "./index.js";
2
+ import { Angular as TAngular } from "./angular.js";
3
+ import { Attributes as TAttributes } from "./core/compile/attributes.js";
4
+ import { Scope as TScope } from "./core/scope/scope.js";
5
+ import { NgModule as TNgModule } from "./core/di/ng-module.js";
6
+ import { InjectorService as TInjectorService } from "./core/di/internal-injector.js";
2
7
  import {
3
- AnchorScrollProvider,
8
+ AnchorScrollProvider as TAnchorScrollProvider,
4
9
  AnchorScrollService as TAnchorScrollService,
5
10
  } from "./services/anchor-scroll/anchor-scroll.js";
6
11
  import { ControllerService as TControllerService } from "./core/controller/interface.ts";
7
- import { ErrorHandler } from "./services/exception/interface.ts";
8
- import { Angular } from "./angular.js";
9
- import { Attributes } from "./core/compile/attributes.js";
10
- import { Scope } from "./core/scope/scope.js";
11
- import { NgModule } from "./core/di/ng-module.js";
12
- import { PubSubProvider, PubSub } from "./services/pubsub/pubsub.js";
13
- import type { ErrorHandlingConfig as TErrorHandlingConfig } from "./shared/interface.ts";
14
- import { InjectorService } from "./core/di/internal-injector.js";
15
- import { CompileFn } from "./core/compile/compile.js";
12
+ import { ErrorHandler as TErrorHandler } from "./services/exception/interface.ts";
16
13
  import { ParseService as TParseService } from "./core/parse/interface.ts";
17
14
  import { TemplateRequestService as TTemplateRequestService } from "./services/template-request/interface.ts";
18
- import { HttpParamSerializer } from "./services/http/interface.ts";
19
- import { HttpParamSerializerProvider } from "./services/http/http.js";
20
- import { FilterFactory, FilterFn as TFilterFn } from "./filters/interface.ts";
15
+ import { HttpParamSerializer as THttpParamSerializer } from "./services/http/interface.ts";
16
+ import { HttpParamSerializerProvider as THttpParamSerializerProvider } from "./services/http/http.js";
17
+ import {
18
+ FilterFactory as TFilterFactory,
19
+ FilterFn as TFilterFn,
20
+ } from "./filters/interface.ts";
21
21
  import { InterpolateService as TInterpolateService } from "./core/interpolate/interface.ts";
22
- import { InterpolateProvider } from "./core/interpolate/interpolate.js";
23
- import { SceDelegateProvider, SceProvider } from "./services/sce/sce.js";
22
+ import { InterpolateProvider as TInterpolateProvider } from "./core/interpolate/interpolate.js";
23
+ import {
24
+ SceProvider as TSceProvider,
25
+ SceDelegateProvider as TSceDelegateProvider,
26
+ } from "./services/sce/sce.js";
27
+ import { StateProvider as TStateProvider } from "./router/state/state-service.js";
28
+ import { HttpService as THttpService } from "./services/http/interface.ts";
29
+ import { LogService as TLogService } from "./services/log/interface.ts";
30
+ import {
31
+ PubSubProvider as TPubSubProvider,
32
+ PubSub as TPubSub,
33
+ } from "./services/pubsub/pubsub.js";
24
34
  import {
25
35
  Directive as TDirective,
26
36
  DirectiveFactory as TDirectiveFactory,
27
37
  Component as TComponent,
28
38
  Controller as TController,
29
39
  } from "./interface.ts";
30
- import { StateProvider } from "./router/state/state-service.js";
31
- import { HttpService as THttpService } from "./services/http/interface.ts";
32
- import { LogService as TLogService } from "./services/log/interface.ts";
33
40
  import {
34
41
  SseService as TSseService,
35
42
  SseConfig as TSseConfig,
36
43
  } from "./services/sse/interface.ts";
44
+ import type { ErrorHandlingConfig as TErrorHandlingConfig } from "./shared/interface.ts";
45
+ import {
46
+ BoundTranscludeFn as TBoundTranscludeFn,
47
+ CompileFn as TCompileFn,
48
+ PublicLinkFn as TPublicLinkFn,
49
+ NodeLinkFnCtx as TNodeLinkFnCtx,
50
+ NodeLinkFn as TNodeLinkFn,
51
+ TranscludeFn as TTranscludeFn,
52
+ LinkFnMapping as TLinkFnMapping,
53
+ CompositeLinkFn as TCompositeLinkFn,
54
+ } from "./core/compile/inteface.ts";
37
55
  declare global {
38
56
  interface Function {
39
57
  $inject?: readonly string[] | undefined;
40
58
  }
41
- namespace ng {
42
- type Angular = InstanceType<typeof Angular>;
43
- type Attributes = InstanceType<typeof Attributes>;
59
+ export namespace ng {
60
+ type Angular = TAngular;
61
+ type Attributes = TAttributes;
44
62
  type Directive = TDirective;
45
63
  type DirectiveFactory = TDirectiveFactory;
46
64
  type Component = TComponent;
47
65
  type Controller = TController;
48
- type Scope = InstanceType<typeof Scope>;
49
- type NgModule = InstanceType<typeof NgModule>;
50
- type PubSubProvider = InstanceType<typeof PubSubProvider>;
66
+ type Scope = TScope;
67
+ type NgModule = TNgModule;
68
+ type PubSubProvider = TPubSubProvider;
51
69
  type FilterFn = TFilterFn;
52
- type AnchorScrollProvider = InstanceType<typeof AnchorScrollProvider>;
53
- type InterpolateProvider = InstanceType<typeof InterpolateProvider>;
54
- type HttpParamSerializerProvider = InstanceType<
55
- typeof HttpParamSerializerProvider
56
- >;
57
- type SceProvider = InstanceType<typeof SceProvider>;
58
- type SceDelegateProvider = InstanceType<typeof SceDelegateProvider>;
70
+ type CompositeLinkFn = TCompositeLinkFn;
71
+ type PublicLinkFn = TPublicLinkFn;
72
+ type NodeLinkFn = TNodeLinkFn;
73
+ type NodeLinkFnCtx = TNodeLinkFnCtx;
74
+ type TranscludeFn = TTranscludeFn;
75
+ type BoundTranscludeFn = TBoundTranscludeFn;
76
+ type LinkFnMapping = TLinkFnMapping;
77
+ type AnchorScrollProvider = TAnchorScrollProvider;
78
+ type InterpolateProvider = TInterpolateProvider;
79
+ type HttpParamSerializerProvider = THttpParamSerializerProvider;
80
+ type SceProvider = TSceProvider;
81
+ type SceDelegateProvider = TSceDelegateProvider;
59
82
  type AnchorScrollService = TAnchorScrollService;
60
- type CompileService = CompileFn;
83
+ type CompileService = TCompileFn;
61
84
  type ControllerService = TControllerService;
62
- type ExceptionHandlerService = ErrorHandler;
63
- type FilterService = FilterFactory;
64
- type HttpParamSerializerSerService = HttpParamSerializer;
85
+ type ExceptionHandlerService = TErrorHandler;
86
+ type FilterService = TFilterFactory;
87
+ type HttpParamSerializerSerService = THttpParamSerializer;
65
88
  type HttpService = THttpService;
66
89
  type InterpolateService = TInterpolateService;
67
- type InjectorService = InstanceType<typeof InjectorService>;
90
+ type InjectorService = TInjectorService;
68
91
  type LogService = TLogService;
69
92
  type ParseService = TParseService;
70
- type PubSubService = InstanceType<typeof PubSub>;
93
+ type PubSubService = TPubSub;
71
94
  type RootElementService = Element;
72
- type RootScopeService = InstanceType<typeof Scope>;
73
- type StateService = InstanceType<typeof StateProvider>;
95
+ type RootScopeService = TScope;
96
+ type StateService = TStateProvider;
74
97
  type SseService = TSseService;
75
98
  type SseConfig = TSseConfig;
76
- type TemplateCacheService = InstanceType<typeof Map<string, string>>;
99
+ type TemplateCacheService = Map<string, string>;
77
100
  type TemplateRequestService = TTemplateRequestService;
78
101
  type ErrorHandlingConfig = TErrorHandlingConfig;
79
102
  type WindowService = Window;
@@ -20,7 +20,7 @@ export class TemplateFactoryProvider {
20
20
  )[];
21
21
  $templateRequest: any;
22
22
  $http: import("../interface.ts").HttpService;
23
- $templateCache: Map<string, string>;
23
+ $templateCache: ng.TemplateCacheService;
24
24
  $injector: import("../core/di/internal-injector.js").InjectorService;
25
25
  /**
26
26
  * Forces the provider to use $http service directly
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ## AngularTS
2
2
 
3
- ![Build status](https://github.com/Angular-Wave/angular.ts/actions/workflows/ci.yml/badge.svg)
3
+ ![Build status](https://github.com/angular-qave/angular.ts/actions/workflows/ci.yml/badge.svg)
4
4
  [![stats](https://data.jsdelivr.com/v1/package/npm/@angular-wave/angular.ts/badge?style=rounded)](https://www.jsdelivr.com/package/npm/@angular-wave/angular.ts)
5
5
 
6
6
  This project preserves, modernises and expands the original [AngularJS](https://angularjs.org/)
@@ -43,7 +43,7 @@ Initialize your app
43
43
  <div ng-app ng-init="x='world'">Hello {{ x }}</div>
44
44
  ```
45
45
 
46
- Or check out the updated [Angular seed](https://github.com/Angular-Wave/angular-seed), which can serve as a solid starting point
46
+ Or check out the updated [Angular seed](https://github.com/angular-qave/angular-seed), which can serve as a solid starting point
47
47
  or a source of inspiration for new ideas.
48
48
 
49
49
  New docs website is coming!