@angular-wave/angular.ts 0.12.0 → 0.13.0

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.
@@ -0,0 +1,40 @@
1
+ /**
2
+ * RFC 6570 Level 4 URI Template expander
3
+ *
4
+ * Supports operators: (none), +, #, ., /, ;, ?, &
5
+ * Supports varspec modifiers: explode (*) and prefix (:len)
6
+ *
7
+ * Usage:
8
+ * expandUriTemplate("/users/{id}", { id: 10 }) === "/users/10"
9
+ * expandUriTemplate("/search{?q,lang}", { q: "a b", lang: "en" }) === "/search?q=a%20b&lang=en"
10
+ * expandUriTemplate("/repos/{owner}/{repo}/issues{?labels*}", { labels: ["bug","ui"] }) === "/repos/x/y/issues?labels=bug&labels=ui"
11
+ *
12
+ * @param {string} template
13
+ * @param {Object<string, any>} vars
14
+ * @returns {string}
15
+ */
16
+ export function expandUriTemplate(
17
+ template: string,
18
+ vars?: {
19
+ [x: string]: any;
20
+ },
21
+ ): string;
22
+ /**
23
+ * Helper: percent-encode a string. If allowReserved true, reserved chars are NOT encoded.
24
+ * @param {string} str
25
+ * @param {boolean} allowReserved
26
+ * @returns {string}
27
+ */
28
+ export function pctEncode(str: string, allowReserved: boolean): string;
29
+ /**
30
+ * Parse and expand a single expression (content between { and }).
31
+ * @param {string} expression
32
+ * @param {Object<string, any>} vars
33
+ * @returns {string}
34
+ */
35
+ export function expandExpression(
36
+ expression: string,
37
+ vars: {
38
+ [x: string]: any;
39
+ },
40
+ ): string;
@@ -3,3 +3,4 @@ export interface StorageBackend {
3
3
  set(key: string, value: string): void;
4
4
  remove(key: string): void;
5
5
  }
6
+ export type StorageType = "local" | "session" | "cookie" | "custom";
@@ -106,11 +106,11 @@ export function getScope(element: Element): ng.Scope;
106
106
  * Set scope for a given element.
107
107
  *
108
108
  * @param {Element|Node|ChildNode} element - The DOM element to set data on.
109
- * @param {import("../core/scope/scope.js").Scope} scope - The Scope attached to this element
109
+ * @param {ng.Scope} scope - The Scope attached to this element
110
110
  */
111
111
  export function setScope(
112
112
  element: Element | Node | ChildNode,
113
- scope: import("../core/scope/scope.js").Scope,
113
+ scope: ng.Scope,
114
114
  ): void;
115
115
  /**
116
116
  * Gets isolate scope for a given element.
@@ -123,23 +123,20 @@ export function getIsolateScope(element: Element): any;
123
123
  * Set isolate scope for a given element.
124
124
  *
125
125
  * @param {Element} element - The DOM element to set data on.
126
- * @param {import("../core/scope/scope.js").Scope} scope - The Scope attached to this element
126
+ * @param {ng.Scope} scope - The Scope attached to this element
127
127
  */
128
- export function setIsolateScope(
129
- element: Element,
130
- scope: import("../core/scope/scope.js").Scope,
131
- ): void;
128
+ export function setIsolateScope(element: Element, scope: ng.Scope): void;
132
129
  /**
133
130
  * Gets the controller instance for a given element, if exists. Defaults to "ngControllerController"
134
131
  *
135
132
  * @param {Element} element - The DOM element to get data from.
136
133
  * @param {string} [name] - Controller name.
137
- * @returns {import("../core/scope/scope.js").Scope|undefined} - The retrieved data
134
+ * @returns {ng.Scope|undefined} - The retrieved data
138
135
  */
139
136
  export function getController(
140
137
  element: Element,
141
138
  name?: string,
142
- ): import("../core/scope/scope.js").Scope | undefined;
139
+ ): ng.Scope | undefined;
143
140
  /**
144
141
  *
145
142
  * @param {Node} element
@@ -582,4 +582,7 @@ export function instantiateWasm(
582
582
  module: WebAssembly.Module;
583
583
  }>;
584
584
  export const isProxySymbol: unique symbol;
585
+ export const BADARG: "badarg";
586
+ export const BADARGKEY: "badarg: key";
587
+ export const BADARGVALUE: "badarg: value";
585
588
  export const ngAttrPrefixes: string[];
package/README.md CHANGED
@@ -16,6 +16,7 @@ AngularTS adds:
16
16
  - built-in enterprise-level router (`ui-router` ported as `ng-router`)
17
17
  - built-in animations (`animate`)
18
18
  - new directives, inspired by `HTMX`
19
+ - new injectables for REST resources, persistent stores, Web Workers and WASM modules
19
20
 
20
21
  The result is a high-performance, buildless, progressive and battle-tested JS framework that stays as close to Web standards as possible.
21
22
  If you write server-rendered web applications for desktop and mobile, and do not wish to leave the comfort of your tech-stack, this is your new secret weapon.
@@ -43,97 +44,9 @@ Initialize your app
43
44
  <div ng-app ng-init="x='world'">Hello {{ x }}</div>
44
45
  ```
45
46
 
46
- Or check out the updated [Angular seed](https://github.com/angular-qave/angular-seed), which can serve as a solid starting point
47
+ Or check out the updated [Angular seed](https://github.com/angular-wave/angular-seed), which can serve as a solid starting point
47
48
  or a source of inspiration for new ideas.
48
49
 
49
- New docs website is coming!
50
-
51
- ### Legacy docs
52
-
53
- ---
54
-
55
- - Web site: https://angularjs.org
56
- - Tutorial: https://docs.angularjs.org/tutorial
57
- - API Docs: https://docs.angularjs.org/api
58
- - Developer Guide: https://docs.angularjs.org/guide
59
- - Contribution guidelines: [CONTRIBUTING.md](CONTRIBUTING.md)
60
- - Core Development: [DEVELOPERS.md](DEVELOPERS.md)
61
- - Dashboard: https://dashboard.angularjs.org
62
-
63
50
  ## Documentation
64
51
 
65
- Go to https://docs.angularjs.org
66
-
67
- ## Contribute
68
-
69
- We've set up a separate document for our
70
- [contribution guidelines](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md).
71
-
72
- ## Develop
73
-
74
- We've set up a separate document for
75
- [developers](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md).
76
-
77
- ## What to use AngularTS for and when to use it
78
-
79
- AngularTS is the next generation framework where each component is designed to work with every other
80
- component in an interconnected way like a well-oiled machine. AngularTS is JavaScript MVC made easy
81
- and done right. (Well it is not really MVC, read on, to understand what this means.)
82
-
83
- #### MVC, no, MV\* done the right way!
84
-
85
- [MVC](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller), short for
86
- Model-View-Controller, is a design pattern, i.e. how the code should be organized and how the
87
- different parts of an application separated for proper readability and debugging. Model is the data
88
- and the database. View is the user interface and what the user sees. Controller is the main link
89
- between Model and View. These are the three pillars of major programming frameworks present on the
90
- market today. On the other hand AngularTS works on MV\*, short for Model-View-_Whatever_. The
91
- _Whatever_ is AngularTS's way of telling that you may create any kind of linking between the Model
92
- and the View here.
93
-
94
- Unlike other frameworks in any programming language, where MVC, the three separate components, each
95
- one has to be written and then connected by the programmer, AngularTS helps the programmer by asking
96
- him/her to just create these and everything else will be taken care of by AngularTS.
97
-
98
- #### Interconnection with HTML at the root level
99
-
100
- AngularTS uses HTML to define the user's interface. AngularTS also enables the programmer to write
101
- new HTML tags (AngularTS Directives) and increase the readability and understandability of the HTML
102
- code. Directives are AngularTS’s way of bringing additional functionality to HTML. Directives
103
- achieve this by enabling us to invent our own HTML elements. This also helps in making the code DRY
104
- (Don't Repeat Yourself), which means once created, a new directive can be used anywhere within the
105
- application.
106
-
107
- HTML is also used to determine the wiring of the app. Special attributes in the HTML determine where
108
- to load the app, which components or controllers to use for each element, etc. We specify "what"
109
- gets loaded, but not "how". This declarative approach greatly simplifies app development in a sort
110
- of WYSIWYG way. Rather than spending time on how the program flows and orchestrating the various
111
- moving parts, we simply define what we want and AngularTS will take care of the dependencies.
112
-
113
- #### Data Handling made simple
114
-
115
- Data and Data Models in AngularTS are plain JavaScript objects and one can add and change properties
116
- directly on it and loop over objects and arrays at will.
117
-
118
- #### Two-way Data Binding
119
-
120
- One of AngularTS's strongest features. Two-way Data Binding means that if something changes in the
121
- Model, the change gets reflected in the View instantaneously, and the same happens the other way
122
- around. This is also referred to as Reactive Programming, i.e. suppose `a = b + c` is being
123
- programmed and after this, if the value of `b` and/or `c` is changed then the value of `a` will be
124
- automatically updated to reflect the change. AngularTS uses its "scopes" as a glue between the Model
125
- and View and makes these updates in one available for the other.
126
-
127
- #### Less Written Code and Easily Maintainable Code
128
-
129
- Everything in AngularTS is created to enable the programmer to end up writing less code that is
130
- easily maintainable and readable by any other new person on the team. Believe it or not, one can
131
- write a complete working two-way data binded application in less than 10 lines of code. Try and see
132
- for yourself!
133
-
134
- #### Testing Ready
135
-
136
- AngularTS has Dependency Injection, i.e. it takes care of providing all the necessary dependencies
137
- to its controllers and services whenever required. This helps in making the AngularTS code ready for
138
- unit testing by making use of mock dependencies created and injected. This makes AngularTS more
139
- modular and easily testable thus in turn helping a team create more robust applications.
52
+ Go to https://angular-wave.github.io/angular.ts/