jsf.js_next_gen 4.0.1-beta.9 → 4.0.2-beta.2

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.
Files changed (197) hide show
  1. package/dist/window/faces-development.js +12 -2
  2. package/dist/window/faces-development.js.br +0 -0
  3. package/dist/window/faces-development.js.gz +0 -0
  4. package/dist/window/faces-development.js.map +1 -1
  5. package/dist/window/faces.js +1 -1
  6. package/dist/window/faces.js.br +0 -0
  7. package/dist/window/faces.js.gz +0 -0
  8. package/dist/window/faces.js.map +1 -1
  9. package/dist/window/jsf-development.js +12 -2
  10. package/dist/window/jsf-development.js.br +0 -0
  11. package/dist/window/jsf-development.js.gz +0 -0
  12. package/dist/window/jsf-development.js.map +1 -1
  13. package/dist/window/jsf.js +1 -1
  14. package/dist/window/jsf.js.br +0 -0
  15. package/dist/window/jsf.js.gz +0 -0
  16. package/dist/window/jsf.js.map +1 -1
  17. package/package.json +1 -1
  18. package/src/main/typescript/impl/util/HiddenInputBuilder.ts +2 -2
  19. package/src/main/typescript/impl/xhrCore/XhrRequest.ts +11 -0
  20. package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +22 -0
  21. package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +2 -1
  22. package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +45 -0
  23. package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +3 -3
  24. package/target/impl/util/HiddenInputBuilder.js +2 -2
  25. package/target/impl/util/HiddenInputBuilder.js.map +1 -1
  26. package/target/impl/xhrCore/XhrRequest.js +10 -0
  27. package/target/impl/xhrCore/XhrRequest.js.map +1 -1
  28. package/target/test/frameworkBase/_ext/shared/StandardInits.js +20 -0
  29. package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
  30. package/target/test/xhrCore/RequestParamsTest.spec.js +2 -1
  31. package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
  32. package/target/test/xhrCore/RequestTest.spec.js +36 -0
  33. package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
  34. package/target/test/xhrCore/ResponseTest.spec.js +3 -3
  35. package/target/AssocArray.js +0 -281
  36. package/target/AssocArray.js.map +0 -1
  37. package/target/Config.js +0 -235
  38. package/target/Config.js.map +0 -1
  39. package/target/CryptoExtensions.js +0 -112
  40. package/target/CryptoExtensions.js.map +0 -1
  41. package/target/DomQuery.js +0 -1963
  42. package/target/DomQuery.js.map +0 -1
  43. package/target/Es2019Array.js +0 -117
  44. package/target/Es2019Array.js.map +0 -1
  45. package/target/Global.js +0 -38
  46. package/target/Global.js.map +0 -1
  47. package/target/IDomQuery.js +0 -3
  48. package/target/IDomQuery.js.map +0 -1
  49. package/target/Lang.js +0 -183
  50. package/target/Lang.js.map +0 -1
  51. package/target/Messaging.js +0 -645
  52. package/target/Messaging.js.map +0 -1
  53. package/target/Monad.js +0 -330
  54. package/target/Monad.js.map +0 -1
  55. package/target/Promise.js +0 -296
  56. package/target/Promise.js.map +0 -1
  57. package/target/PromiseShim.js +0 -30
  58. package/target/PromiseShim.js.map +0 -1
  59. package/target/SourcesCollectors.js +0 -444
  60. package/target/SourcesCollectors.js.map +0 -1
  61. package/target/Stream.js +0 -562
  62. package/target/Stream.js.map +0 -1
  63. package/target/TagBuilder.js +0 -178
  64. package/target/TagBuilder.js.map +0 -1
  65. package/target/XmlQuery.js +0 -84
  66. package/target/XmlQuery.js.map +0 -1
  67. package/target/classes/com/example/jsfs_js_ts/DecoratedFacesJS.class +0 -0
  68. package/target/classes/com/example/jsfs_js_ts/DecoratingResourceHandlerWrapper.class +0 -0
  69. package/target/classes/com/example/jsfs_js_ts/FacesJSMapFileResourceWrapper.class +0 -0
  70. package/target/classes/com/example/jsfs_js_ts/FacesJSMappingDecorator.class +0 -0
  71. package/target/impl/core/Context.js +0 -10
  72. package/target/impl/core/Context.js.map +0 -1
  73. package/target/impl/util/AsyncQueue.js +0 -109
  74. package/target/impl/util/AsyncQueue.js.map +0 -1
  75. package/target/impl/util/HiddenElementBuilder.js +0 -7
  76. package/target/impl/util/HiddenElementBuilder.js.map +0 -1
  77. package/target/impl/util/IAsyncRunnable.js +0 -27
  78. package/target/impl/util/IAsyncRunnable.js.map +0 -1
  79. package/target/impl/util/URLCodec.js +0 -77
  80. package/target/impl/util/URLCodec.js.map +0 -1
  81. package/target/impl/xhrCore/RequestContext.js +0 -11
  82. package/target/impl/xhrCore/RequestContext.js.map +0 -1
  83. package/target/impl/xhrCore/XhrQueHandler.js +0 -11
  84. package/target/impl/xhrCore/XhrQueHandler.js.map +0 -1
  85. package/target/impl/xhrCore/XhrQueueController.js +0 -62
  86. package/target/impl/xhrCore/XhrQueueController.js.map +0 -1
  87. package/target/index.js +0 -80
  88. package/target/index.js.map +0 -1
  89. package/target/index_core.js +0 -76
  90. package/target/index_core.js.map +0 -1
  91. package/target/test/frameworkBase/_ext/monadish/ExtendedArrayTest.spec.js +0 -76
  92. package/target/test/frameworkBase/_ext/monadish/ExtendedArrayTest.spec.js.map +0 -1
  93. package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js +0 -178
  94. package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js.map +0 -1
  95. package/target/test/myfaces/OnLoadSpec.js +0 -57
  96. package/target/test/myfaces/OnLoadSpec.js.map +0 -1
  97. package/target/test-classes/.gz +0 -0
  98. package/target/test-classes/com/example/jsfs_js_ts/JsfsJsTsApplicationTests.class +0 -0
  99. package/target/test-classes/fileuploadtest.html +0 -24
  100. package/target/test-classes/jsf-development.js +0 -3559
  101. package/target/test-classes/jsf-development.js.br +0 -0
  102. package/target/test-classes/jsf-development.js.gz +0 -0
  103. package/target/test-classes/jsf-development.js.map +0 -1
  104. package/target/test-classes/jsf.js +0 -3
  105. package/target/test-classes/jsf.js.br +0 -0
  106. package/target/test-classes/jsf.js.gz +0 -0
  107. package/target/types/main/typescript/AssocArray.d.ts +0 -86
  108. package/target/types/main/typescript/Config.d.ts +0 -94
  109. package/target/types/main/typescript/CryptoExtensions.d.ts +0 -87
  110. package/target/types/main/typescript/DomQuery.d.ts +0 -587
  111. package/target/types/main/typescript/Es2019Array.d.ts +0 -30
  112. package/target/types/main/typescript/Global.d.ts +0 -23
  113. package/target/types/main/typescript/IDomQuery.d.ts +0 -480
  114. package/target/types/main/typescript/Lang.d.ts +0 -97
  115. package/target/types/main/typescript/Messaging.d.ts +0 -285
  116. package/target/types/main/typescript/Monad.d.ts +0 -161
  117. package/target/types/main/typescript/Promise.d.ts +0 -58
  118. package/target/types/main/typescript/PromiseShim.d.ts +0 -22
  119. package/target/types/main/typescript/SourcesCollectors.d.ts +0 -280
  120. package/target/types/main/typescript/Stream.d.ts +0 -284
  121. package/target/types/main/typescript/TagBuilder.d.ts +0 -50
  122. package/target/types/main/typescript/XmlQuery.d.ts +0 -31
  123. package/target/types/main/typescript/api/_api.d.ts +0 -182
  124. package/target/types/main/typescript/api/faces.d.ts +0 -17
  125. package/target/types/main/typescript/api/jsf.d.ts +0 -17
  126. package/target/types/main/typescript/impl/AjaxImpl.d.ts +0 -164
  127. package/target/types/main/typescript/impl/PushImpl.d.ts +0 -38
  128. package/target/types/main/typescript/impl/core/Const.d.ts +0 -138
  129. package/target/types/main/typescript/impl/core/ImplTypes.d.ts +0 -16
  130. package/target/types/main/typescript/impl/i18n/Messages.d.ts +0 -102
  131. package/target/types/main/typescript/impl/util/Assertions.d.ts +0 -46
  132. package/target/types/main/typescript/impl/util/AsyncRunnable.d.ts +0 -112
  133. package/target/types/main/typescript/impl/util/ExtDomQuery.d.ts +0 -100
  134. package/target/types/main/typescript/impl/util/FileUtils.d.ts +0 -25
  135. package/target/types/main/typescript/impl/util/HiddenInputBuilder.d.ts +0 -37
  136. package/target/types/main/typescript/impl/util/IListener.d.ts +0 -18
  137. package/target/types/main/typescript/impl/util/Lang.d.ts +0 -138
  138. package/target/types/main/typescript/impl/util/XhrQueueController.d.ts +0 -51
  139. package/target/types/main/typescript/impl/xhrCore/ErrorData.d.ts +0 -37
  140. package/target/types/main/typescript/impl/xhrCore/EventData.d.ts +0 -25
  141. package/target/types/main/typescript/impl/xhrCore/IResponseProcessor.d.ts +0 -136
  142. package/target/types/main/typescript/impl/xhrCore/RequestDataResolver.d.ts +0 -84
  143. package/target/types/main/typescript/impl/xhrCore/ResonseDataResolver.d.ts +0 -60
  144. package/target/types/main/typescript/impl/xhrCore/Response.d.ts +0 -29
  145. package/target/types/main/typescript/impl/xhrCore/ResponseProcessor.d.ts +0 -208
  146. package/target/types/main/typescript/impl/xhrCore/XhrFormData.d.ts +0 -83
  147. package/target/types/main/typescript/impl/xhrCore/XhrRequest.d.ts +0 -102
  148. package/target/types/main/typescript/index.d.ts +0 -34
  149. package/target/types/main/typescript/index_core.d.ts +0 -29
  150. package/target/types/main/typescript/myfaces/OamSubmit.d.ts +0 -53
  151. package/target/types/main/typescript/test/frameworkBase/LangTest.spec.d.ts +0 -1
  152. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.d.ts +0 -1
  153. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/LangTest.spec.d.ts +0 -16
  154. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/MappingProbes.d.ts +0 -39
  155. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/MappingTest.spec.d.ts +0 -16
  156. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.d.ts +0 -16
  157. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.d.ts +0 -0
  158. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-with-header.d.ts +0 -1
  159. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-without-header.d.ts +0 -1
  160. package/target/types/main/typescript/test/frameworkBase/_ext/shared/StandardInits.d.ts +0 -63
  161. package/target/types/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.d.ts +0 -23
  162. package/target/types/main/typescript/test/impl/ImplTest.spec.d.ts +0 -16
  163. package/target/types/main/typescript/test/impl/ImplTest_23.spec.d.ts +0 -16
  164. package/target/types/main/typescript/test/impl/SeparatorCharsTest.spec.d.ts +0 -16
  165. package/target/types/main/typescript/test/myfaces/OamSubmit.spec.d.ts +0 -16
  166. package/target/types/main/typescript/test/myfaces/OnLoad.spec.d.ts +0 -16
  167. package/target/types/main/typescript/test/queue/AsynchronousProbe.d.ts +0 -38
  168. package/target/types/main/typescript/test/queue/AsynchronousQueueTest.spec.d.ts +0 -16
  169. package/target/types/main/typescript/test/xhrCore/ClientWindow.spec.d.ts +0 -1
  170. package/target/types/main/typescript/test/xhrCore/ErrorChainTest.spec.d.ts +0 -16
  171. package/target/types/main/typescript/test/xhrCore/EventTests.spec.d.ts +0 -16
  172. package/target/types/main/typescript/test/xhrCore/FakeWebsocket.d.ts +0 -24
  173. package/target/types/main/typescript/test/xhrCore/FileUploadTest.spec.d.ts +0 -1
  174. package/target/types/main/typescript/test/xhrCore/NamespacesRequestTest.spec.d.ts +0 -16
  175. package/target/types/main/typescript/test/xhrCore/OamSubmitTest.spec.d.ts +0 -16
  176. package/target/types/main/typescript/test/xhrCore/RequestParamsTest.spec.d.ts +0 -1
  177. package/target/types/main/typescript/test/xhrCore/RequestTest.spec.d.ts +0 -16
  178. package/target/types/main/typescript/test/xhrCore/RequestTest_23.spec.d.ts +0 -16
  179. package/target/types/main/typescript/test/xhrCore/ResponseTest.spec.d.ts +0 -16
  180. package/target/types/main/typescript/test/xhrCore/ResponseTest23.spec.d.ts +0 -16
  181. package/target/types/main/typescript/test/xhrCore/ShadowDomTest.spec.d.ts +0 -16
  182. package/target/types/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.d.ts +0 -1
  183. package/target/types/main/typescript/test/xhrCore/WebsocketTest.d.ts +0 -1
  184. package/target/types/main/typescript/test/xhrCore/XhrFormDataTest.spec.d.ts +0 -16
  185. package/target/types/test/typescript/AssocArrayTest.spec.d.ts +0 -1
  186. package/target/types/test/typescript/DomQueryTest.spec.d.ts +0 -1
  187. package/target/types/test/typescript/ExtendedArrayTest.spec.d.ts +0 -1
  188. package/target/types/test/typescript/LangTest.spec.d.ts +0 -1
  189. package/target/types/test/typescript/MappingProbes.d.ts +0 -24
  190. package/target/types/test/typescript/MappingTest.spec.d.ts +0 -1
  191. package/target/types/test/typescript/MessagingTest.spec.d.ts +0 -1
  192. package/target/types/test/typescript/MonadTest.spec.d.ts +0 -16
  193. package/target/types/test/typescript/PromiseTest.spec.d.ts +0 -1
  194. package/target/types/test/typescript/StreamTest.spec.d.ts +0 -1
  195. package/target/types/test/typescript/XmlQueryTest.spec.d.ts +0 -1
  196. package/target/types/test/typescript/markups/tobago-with-header.d.ts +0 -1
  197. package/target/types/test/typescript/markups/tobago-without-header.d.ts +0 -1
@@ -1,280 +0,0 @@
1
- /*!
2
- * Licensed to the Apache Software Foundation (ASF) under one or more
3
- * contributor license agreements. See the NOTICE file distributed with
4
- * this work for additional information regarding copyright ownership.
5
- * The ASF licenses this file to you under the Apache License, Version 2.0
6
- * (the "License"); you may not use this file except in compliance with
7
- * the License. You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { DomQuery } from "./DomQuery";
18
- import { Config } from "./Config";
19
- /**
20
- * special status of the datasource location pointer
21
- * if an access, outside - of the possible data boundaries is happening
22
- * (example for instance current without a first next call, or next
23
- * which goes over the last possible dataset), an iteration status return
24
- * value is returned marking this boundary instead of a classical element
25
- *
26
- * Note this is only internally used but must be implemented to fulfill
27
- * internal contracts, the end user will never see those values if he uses
28
- * streams!
29
- */
30
- export declare enum ITERATION_STATUS {
31
- EO_STRM = "__EO_STRM__",
32
- BEF_STRM = "___BEF_STRM__"
33
- }
34
- export declare function calculateSkips(next_strm: IStreamDataSource<any>): number;
35
- /**
36
- * Every data source wich feeds data into the lazy stream
37
- * or stream generally must implement this interface
38
- *
39
- * It is basically an iteratable to the core
40
- */
41
- export interface IStreamDataSource<T> {
42
- /**
43
- * @returns true if additional data is present false if not
44
- */
45
- hasNext(): boolean;
46
- /**
47
- * returns the next element in the stream
48
- */
49
- next(): T | ITERATION_STATUS;
50
- /**
51
- * looks ahead cnt without changing the internal data "pointers" of the data source
52
- * (this is mostly needed by possibly infinite constructs like lazy streams,
53
- * because they do not know by definition their
54
- * boundaries)
55
- *
56
- * @param cnt the elements to look ahead
57
- * @return either the element or ITERATION_STATUS.EO_STRM if we hit the end of the stream before
58
- * finding the "cnt" element
59
- */
60
- lookAhead(cnt?: number): T | ITERATION_STATUS;
61
- /**
62
- * returns the current element, returns the same element as the previous next call
63
- * if there is no next before current called then we will call next as initial element
64
- */
65
- current(): T | ITERATION_STATUS;
66
- /**
67
- * resets the position to the beginning
68
- */
69
- reset(): void;
70
- }
71
- /**
72
- * A collector, needs to be implemented
73
- */
74
- export interface ICollector<T, S> {
75
- /**
76
- * this method basically takes a single stream element
77
- * and does something with it (collecting it one way or the other
78
- * in most cases)
79
- *
80
- * @param element
81
- */
82
- collect(element: T): any;
83
- /**
84
- * the final result after all the collecting is done
85
- */
86
- finalValue: S;
87
- }
88
- /**
89
- * A data source which combines multiple streams sequentially into one
90
- * (this is used internally by flatmap, but also can be used externally)
91
- */
92
- export declare class MultiStreamDatasource<T> implements IStreamDataSource<T> {
93
- private first;
94
- private activeStrm;
95
- private selectedPos;
96
- private strms;
97
- constructor(first: any, ...strms: Array<IStreamDataSource<T>>);
98
- current(): any;
99
- hasNext(): boolean;
100
- private findNextStrm;
101
- lookAhead(cnt?: number): T | ITERATION_STATUS;
102
- next(): any;
103
- reset(): void;
104
- }
105
- /**
106
- * defines a sequence of numbers for our stream input
107
- */
108
- export declare class SequenceDataSource implements IStreamDataSource<number> {
109
- start: number;
110
- total: number;
111
- value: number;
112
- constructor(start: number, total: number);
113
- hasNext(): boolean;
114
- next(): number | ITERATION_STATUS;
115
- lookAhead(cnt?: number): number | ITERATION_STATUS;
116
- reset(): void;
117
- current(): number | ITERATION_STATUS;
118
- }
119
- /**
120
- * implementation of a datasource on top of a standard array
121
- */
122
- export declare class ArrayStreamDataSource<T> implements IStreamDataSource<T> {
123
- value: Array<T>;
124
- dataPos: number;
125
- constructor(...value: Array<T>);
126
- lookAhead(cnt?: number): T | ITERATION_STATUS;
127
- hasNext(): boolean;
128
- next(): T | ITERATION_STATUS;
129
- reset(): void;
130
- current(): T;
131
- }
132
- /**
133
- * an intermediate data source which prefilters
134
- * incoming stream data
135
- * and lets only the data out which
136
- * passes the filter function check
137
- */
138
- export declare class FilteredStreamDatasource<T> implements IStreamDataSource<T> {
139
- filterFunc: (T: any) => boolean;
140
- inputDataSource: IStreamDataSource<T>;
141
- _current: T | ITERATION_STATUS;
142
- _filterIdx: {};
143
- _unfilteredPos: number;
144
- constructor(filterFunc: (T: any) => boolean, parent: IStreamDataSource<T>);
145
- /**
146
- * in order to filter we have to make a look ahead until the
147
- * first next allowed element
148
- * hence we prefetch the element and then
149
- * serve it via next
150
- */
151
- hasNext(): boolean;
152
- /**
153
- * serve the next element
154
- */
155
- next(): T | ITERATION_STATUS;
156
- /**
157
- * looks ahead cnt without changing the internal data "pointers" of the data source
158
- * (this is mostly needed by LazyStreams, because they do not know by definition their
159
- * boundaries)
160
- *
161
- * @param cnt the elements to look ahead
162
- * @return either the element or ITERATION_STATUS.EO_STRM if we hit the end of the stream before
163
- * finding the "cnt" element
164
- */
165
- lookAhead(cnt?: number): ITERATION_STATUS | T;
166
- current(): T | ITERATION_STATUS;
167
- reset(): void;
168
- }
169
- /**
170
- * an intermediate datasource which maps the items from
171
- * one into another
172
- */
173
- export declare class MappedStreamDataSource<T, S> implements IStreamDataSource<S> {
174
- mapFunc: (T: any) => S;
175
- inputDataSource: IStreamDataSource<T>;
176
- constructor(mapFunc: (T: any) => S, parent: IStreamDataSource<T>);
177
- hasNext(): boolean;
178
- next(): S;
179
- reset(): void;
180
- current(): S;
181
- lookAhead(cnt?: number): ITERATION_STATUS | S;
182
- }
183
- /**
184
- * For the time being we only need one collector
185
- * a collector which collects a stream back into arrays
186
- */
187
- export declare class ShimArrayCollector<S> implements ICollector<S, Array<S>> {
188
- private data;
189
- collect(element: S): void;
190
- get finalValue(): Array<S>;
191
- }
192
- /**
193
- * collects the values as inverse array
194
- */
195
- export declare class InverseArrayCollector<S> implements ICollector<S, Array<S>> {
196
- private data;
197
- collect(element: S): void;
198
- get finalValue(): Array<S>;
199
- }
200
- /**
201
- * collects an tuple array stream into an assoc array with elements being collected into arrays
202
- *
203
- */
204
- export declare class ArrayAssocArrayCollector<S> implements ICollector<[string, S] | string, {
205
- [key: string]: S;
206
- }> {
207
- finalValue: {
208
- [key: string]: any;
209
- };
210
- collect(element: [string, S] | string): void;
211
- }
212
- /**
213
- * dummy collector which just triggers a run
214
- * on lazy streams without collecting anything
215
- */
216
- export declare class Run<S> implements ICollector<S, any> {
217
- collect(element: S): void;
218
- get finalValue(): any;
219
- }
220
- /**
221
- * collects an assoc stream back to an assoc array
222
- */
223
- export declare class AssocArrayCollector<S> implements ICollector<[string, S] | string, {
224
- [key: string]: S;
225
- }> {
226
- finalValue: {
227
- [key: string]: any;
228
- };
229
- collect(element: [string, S] | string): void;
230
- }
231
- /**
232
- * A Config collector similar to the FormDFata Collector
233
- */
234
- export declare class ConfigCollector implements ICollector<{
235
- key: string;
236
- value: any;
237
- }, Config> {
238
- finalValue: Config;
239
- collect(element: {
240
- key: string;
241
- value: any;
242
- }): void;
243
- }
244
- /**
245
- * Form data collector for key value pair streams
246
- */
247
- export declare class FormDataCollector implements ICollector<{
248
- key: string;
249
- value: any;
250
- }, FormData> {
251
- finalValue: FormData;
252
- collect(element: {
253
- key: string;
254
- value: any;
255
- }): void;
256
- }
257
- /**
258
- * Form data collector for DomQuery streams
259
- */
260
- export declare class QueryFormDataCollector implements ICollector<DomQuery, FormData> {
261
- finalValue: FormData;
262
- collect(element: DomQuery): void;
263
- }
264
- /**
265
- * Encoded String collector from dom query streams
266
- */
267
- export declare class QueryFormStringCollector implements ICollector<DomQuery, string> {
268
- formData: [[string, string]];
269
- collect(element: DomQuery): void;
270
- get finalValue(): string;
271
- }
272
- /**
273
- * For the time being we only need one collector
274
- * a collector which collects a stream back into arrays
275
- */
276
- export declare class ArrayCollector<S> implements ICollector<S, Array<S>> {
277
- private data;
278
- collect(element: S): void;
279
- get finalValue(): Array<S>;
280
- }
@@ -1,284 +0,0 @@
1
- /*!
2
- * Licensed to the Apache Software Foundation (ASF) under one or more
3
- * contributor license agreements. See the NOTICE file distributed with
4
- * this work for additional information regarding copyright ownership.
5
- * The ASF licenses this file to you under the Apache License, Version 2.0
6
- * (the "License"); you may not use this file except in compliance with
7
- * the License. You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { IMonad, IValueHolder, Optional } from "./Monad";
18
- import { ICollector, IStreamDataSource, ITERATION_STATUS } from "./SourcesCollectors";
19
- import { DomQuery } from "./DomQuery";
20
- import { Config } from "./Config";
21
- export type StreamMapper<T> = (data: T) => IStreamDataSource<any>;
22
- export type ArrayMapper<T> = (data: T) => Array<any>;
23
- export type IteratableConsumer<T> = (data: T, pos?: number) => void | boolean;
24
- export type Reducable<T, V> = (val1: T | V, val2: T) => V;
25
- export type Matchable<T> = (data: T) => boolean;
26
- export type Mappable<T, R> = (data: T) => R;
27
- export type Comparator<T> = (el1: T, el2: T) => number;
28
- /**
29
- * Same for flatmap to deal with element -> stream mappings
30
- */
31
- export declare class FlatMapStreamDataSource<T, S> implements IStreamDataSource<S> {
32
- mapFunc: StreamMapper<T>;
33
- inputDataSource: IStreamDataSource<T>;
34
- /**
35
- * the currently active stream
36
- * coming from an incoming element
37
- * once the end of this one is reached
38
- * it is swapped out by another one
39
- * from the next element
40
- */
41
- activeDataSource: IStreamDataSource<S>;
42
- walkedDataSources: any[];
43
- _currPos: number;
44
- constructor(func: StreamMapper<T>, parent: IStreamDataSource<T>);
45
- hasNext(): boolean;
46
- private resolveActiveHasNext;
47
- lookAhead(cnt?: number): ITERATION_STATUS | S;
48
- private toDatasource;
49
- private resolveNextHasNext;
50
- next(): S | ITERATION_STATUS;
51
- reset(): void;
52
- current(): S | ITERATION_STATUS;
53
- }
54
- /**
55
- * Generic interface defining a stream
56
- */
57
- export interface IStream<T> {
58
- /**
59
- * Perform the operation fn on a single element in the stream at a time
60
- * then pass the stream over for further processing
61
- * This is basically an intermediate point in the stream
62
- * with further processing happening later, do not use
63
- * this method to gather data or iterate over all date for processing
64
- * (for the second case each has to be used)
65
- *
66
- * @param fn the processing function, if it returns false, further processing is stopped
67
- */
68
- onElem(fn: IteratableConsumer<T>): IStream<T>;
69
- /**
70
- * Iterate over all elements in the stream and do some processing via fn
71
- *
72
- * @param fn takes a single element and if it returns false
73
- * then further processing is stopped
74
- */
75
- each(fn: IteratableConsumer<T>): void;
76
- /**
77
- * maps a single element into another via fn
78
- * @param fn function which takes one element in and returns another
79
- */
80
- map<R>(fn?: Mappable<T, R>): IStream<R>;
81
- /**
82
- * Takes an element in and returns a set of something
83
- * the set then is flatted into a single stream to be further processed
84
- *
85
- * @param fn
86
- */
87
- flatMap<R>(fn?: StreamMapper<T> | ArrayMapper<T>): IStream<R>;
88
- /**
89
- * filtering, takes an element in and is processed by fn.
90
- * If it returns false then further processing on this element is skipped
91
- * if it returns true it is passed down the chain.
92
- *
93
- * @param fn
94
- */
95
- filter(fn?: Matchable<T>): IStream<T>;
96
- /**
97
- * functional reduce... takes two elements in the stream and reduces to
98
- * one from left to right
99
- *
100
- * @param fn the reduction function for instance (val1,val2) => val1l+val2
101
- * @param startVal an optional starting value, if provided the the processing starts with this element
102
- * and further goes down into the stream, if not, then the first two elements are taken as reduction starting point
103
- */
104
- reduce<V>(fn: Reducable<T, V>, startVal: T | V): Optional<T | V>;
105
- /**
106
- * returns the first element in the stream is given as Optional
107
- */
108
- first(): Optional<T>;
109
- /**
110
- * Returns the last stream element (note in endless streams without filtering and limiting you will never reach that
111
- * point hence producing an endless loop)
112
- */
113
- last(): Optional<T>;
114
- /**
115
- * returns true if there is at least one element where a call fn(element) produces true
116
- *
117
- * @param fn
118
- */
119
- anyMatch(fn: Matchable<T>): boolean;
120
- /**
121
- * returns true if all elmements produce true on a call to fn(element)
122
- *
123
- * @param fn
124
- */
125
- allMatch(fn: Matchable<T>): boolean;
126
- /**
127
- * returns true if no elmements produce true on a call to fn(element)
128
- *
129
- * @param fn
130
- */
131
- noneMatch(fn: Matchable<T>): boolean;
132
- /**
133
- * Collect the elements with a collector given
134
- * There are a number of collectors provided
135
- *
136
- * @param collector
137
- */
138
- collect(collector: ICollector<T, any>): any;
139
- /**
140
- * sort on the stream, this is a special case
141
- * of an endpoint, so your data which is fed in needs
142
- * to be limited otherwise it will fail
143
- * it still returns a stream for further processing
144
- *
145
- * @param comparator
146
- */
147
- sort(comparator: Comparator<T>): IStream<T>;
148
- /**
149
- * Limits the stream to a certain number of elements
150
- *
151
- * @param end the limit of the stream
152
- */
153
- limits(end: number): IStream<T>;
154
- concat(...toAppend: Array<IStream<T>>): IStream<T>;
155
- /**
156
- * returns the stream collected into an array (90% use-case abbreviation
157
- */
158
- value: Array<T>;
159
- /**
160
- * returns the currently element selected in the stream
161
- */
162
- current(): T | ITERATION_STATUS;
163
- /**
164
- * returns an observable of the given stream
165
- */
166
- [Symbol.iterator](): Iterator<T>;
167
- }
168
- /**
169
- * A simple typescript based reimplementation of streams
170
- *
171
- * This is the early eval version
172
- * for a lazy eval version check, LazyStream, which is api compatible
173
- * to this implementation, however with the benefit of being able
174
- * to provide infinite data sources and generic data providers, the downside
175
- * is, it might be a tad slower in some situations
176
- */
177
- export declare class Stream<T> implements IMonad<T, Stream<any>>, IValueHolder<Array<T>>, IStream<T>, IStreamDataSource<T> {
178
- value: Array<T>;
179
- _limits: number;
180
- private pos;
181
- constructor(...value: T[]);
182
- static of<T>(...data: Array<T>): Stream<T>;
183
- static ofAssoc<T>(data: {
184
- [key: string]: T;
185
- }): Stream<[string, T]>;
186
- static ofDataSource<T>(dataSource: IStreamDataSource<T>): Stream<T>;
187
- static ofDomQuery(value: DomQuery): Stream<DomQuery>;
188
- static ofConfig(value: Config): Stream<[string, any]>;
189
- current(): T | ITERATION_STATUS;
190
- limits(end: number): Stream<T>;
191
- /**
192
- * concat for streams, so that you can concat two streams together
193
- * @param toAppend
194
- */
195
- concat(...toAppend: Array<IStream<T>>): Stream<T>;
196
- onElem(fn: (data: T, pos?: number) => void | boolean): Stream<T>;
197
- each(fn: (data: T, pos?: number) => void | boolean): void;
198
- map<R>(fn?: (data: T) => R): Stream<R>;
199
- flatMap<IStreamDataSource>(fn: (data: T) => IStreamDataSource | Array<any>): Stream<any>;
200
- filter(fn?: (data: T) => boolean): Stream<T>;
201
- reduce<V>(fn: Reducable<T, V | T>, startVal?: V): Optional<V | T>;
202
- first(): Optional<T>;
203
- last(): Optional<T>;
204
- anyMatch(fn: Matchable<T>): boolean;
205
- allMatch(fn: Matchable<T>): boolean;
206
- noneMatch(fn: Matchable<T>): boolean;
207
- sort(comparator: Comparator<T>): IStream<T>;
208
- collect(collector: ICollector<T, any>): any;
209
- hasNext(): boolean;
210
- next(): T;
211
- lookAhead(cnt?: number): T | ITERATION_STATUS;
212
- [Symbol.iterator](): Iterator<T>;
213
- reset(): void;
214
- }
215
- /**
216
- * Lazy implementation of a Stream
217
- * The idea is to connect the intermediate
218
- * streams as datasources like a linked list
219
- * with reverse referencing and for special
220
- * operations like filtering flatmapping
221
- * have intermediate datasources in the list
222
- * with specialized functions.
223
- *
224
- * Sort of a modified pipe valve pattern
225
- * the streams are the pipes the intermediate
226
- * data sources are the valves
227
- *
228
- * We then can use passed in functions to control
229
- * the flow in the valves
230
- *
231
- * That way we can have a lazy evaluating stream
232
- *
233
- * So if an endpoint requests data
234
- * a callback trace goes back the stream list
235
- * which triggers an operation upwards
236
- * which sends data down the drain which then is processed
237
- * and filtered until one element hits the endpoint.
238
- *
239
- * That is repeated, until all elements are processed
240
- * or an internal limit is hit.
241
- *
242
- */
243
- export declare class LazyStream<T> implements IStreamDataSource<T>, IStream<T>, IMonad<T, LazyStream<any>> {
244
- protected dataSource: IStreamDataSource<T>;
245
- _limits: number;
246
- pos: number;
247
- static of<T>(...values: Array<T>): LazyStream<T>;
248
- static ofAssoc<T>(data: {
249
- [key: string]: T;
250
- }): LazyStream<[string, T]>;
251
- static ofStreamDataSource<T>(value: IStreamDataSource<T>): LazyStream<T>;
252
- static ofDomQuery(value: DomQuery): LazyStream<DomQuery>;
253
- static ofConfig(value: Config): LazyStream<[string, any]>;
254
- constructor(parent: IStreamDataSource<T>);
255
- hasNext(): boolean;
256
- next(): T | ITERATION_STATUS;
257
- lookAhead(cnt?: number): ITERATION_STATUS | T;
258
- current(): T | ITERATION_STATUS;
259
- reset(): void;
260
- /**
261
- * concat for streams, so that you can concat two streams together
262
- * @param toAppend
263
- */
264
- concat(...toAppend: Array<IStream<T>>): LazyStream<T>;
265
- nextFilter(fn: Matchable<T>): T;
266
- limits(max: number): LazyStream<T>;
267
- collect(collector: ICollector<T, any>): any;
268
- onElem(fn: IteratableConsumer<T>): LazyStream<T>;
269
- filter(fn: Matchable<T>): LazyStream<T>;
270
- map<R>(fn: Mappable<T, R>): LazyStream<any>;
271
- flatMap<StreamMapper>(fn: StreamMapper | ArrayMapper<any>): LazyStream<any>;
272
- each(fn: IteratableConsumer<T>): void;
273
- reduce<V>(fn: Reducable<T, V>, startVal?: T | V): Optional<T | V>;
274
- last(): Optional<T>;
275
- first(): Optional<T>;
276
- anyMatch(fn: Matchable<T>): boolean;
277
- allMatch(fn: Matchable<T>): boolean;
278
- noneMatch(fn: Matchable<T>): boolean;
279
- sort(comparator: Comparator<T>): IStream<T>;
280
- get value(): Array<T>;
281
- [Symbol.iterator](): Iterator<T>;
282
- private stop;
283
- private isOverLimits;
284
- }
@@ -1,50 +0,0 @@
1
- /*!
2
- * Licensed to the Apache Software Foundation (ASF) under one or more
3
- * contributor license agreements. See the NOTICE file distributed with
4
- * this work for additional information regarding copyright ownership.
5
- * The ASF licenses this file to you under the Apache License, Version 2.0
6
- * (the "License"); you may not use this file except in compliance with
7
- * the License. You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- /**
18
- * beginning custom tag support
19
- *
20
- * This api is still experimental
21
- * and might be interwoven with DomQuery
22
- * so it is bound to change
23
- *
24
- * it follows a builder pattern to allow easier creations
25
- * with less code of custom tags
26
- */
27
- export declare class TagBuilder {
28
- tagName: string;
29
- connectedCallback?: Function;
30
- clazz?: CustomElementConstructor;
31
- extendsType: CustomElementConstructor;
32
- theOptions: ElementDefinitionOptions | null;
33
- markup: string;
34
- disconnectedCallback?: Function;
35
- adoptedCallback?: Function;
36
- attributeChangedCallback?: Function;
37
- observedAttrs: string[];
38
- static withTagName(tagName: any): TagBuilder;
39
- constructor(tagName: string);
40
- withObservedAttributes(...oAttrs: any[]): void;
41
- withConnectedCallback(callback: Function): this;
42
- withDisconnectedCallback(callback: Function): this;
43
- withAdoptedCallback(callback: Function): this;
44
- withAttributeChangedCallback(callback: Function): this;
45
- withExtendsType(extendsType: CustomElementConstructor): this;
46
- withOptions(theOptions: any): this;
47
- withClass(clazz: any): this;
48
- withMarkup(markup: any): this;
49
- register(): void;
50
- }
@@ -1,31 +0,0 @@
1
- /*!
2
- * Licensed to the Apache Software Foundation (ASF) under one or more
3
- * contributor license agreements. See the NOTICE file distributed with
4
- * this work for additional information regarding copyright ownership.
5
- * The ASF licenses this file to you under the Apache License, Version 2.0
6
- * (the "License"); you may not use this file except in compliance with
7
- * the License. You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { DomQuery } from "./DomQuery";
18
- /**
19
- * xml query as specialized case for DomQuery
20
- */
21
- export declare class XMLQuery extends DomQuery {
22
- constructor(rootNode: Document | string | DomQuery, docType?: string);
23
- isXMLParserError(): boolean;
24
- toString(): string;
25
- parserErrorText(joinstr: string): string;
26
- static parseXML(txt: string): XMLQuery;
27
- static parseHTML(txt: string): XMLQuery;
28
- static fromString(txt: string, parseType?: string): XMLQuery;
29
- }
30
- export declare const XQ: typeof XMLQuery;
31
- export type XQ = XMLQuery;