@warp-drive-mirror/ember 5.8.0-alpha.30 → 5.8.0-alpha.32

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,476 @@
1
+ import { service } from '@ember/service';
2
+ import Component from '@glimmer/component';
3
+ import { macroCondition, getGlobalConfig, moduleExists, importSync } from '@embroider/macros';
4
+ import { DISPOSE, createRequestSubscription, memoized } from '@warp-drive-mirror/core/store/-private';
5
+ export { createRequestSubscription, getRequestState } from '@warp-drive-mirror/core/store/-private';
6
+ import { getPromiseState } from '@warp-drive-mirror/core/reactive';
7
+ export { getPromiseState } from '@warp-drive-mirror/core/reactive';
8
+ import { precompileTemplate } from '@ember/template-compilation';
9
+ import { setComponentTemplate } from '@ember/component';
10
+ import templateOnly from '@ember/component/template-only';
11
+
12
+ const and = (x, y) => Boolean(x && y);
13
+ /**
14
+ * The `<Throw />` component is used to throw an error in a template.
15
+ *
16
+ * That's all it does. So don't use it unless the application should
17
+ * throw an error if it reaches this point in the template.
18
+ *
19
+ * ```gts
20
+ * <Throw @error={{anError}} />
21
+ * ```
22
+ *
23
+ * @category Components
24
+ * @public
25
+ */
26
+ class Throw extends Component {
27
+ constructor(owner, args) {
28
+ super(owner, args);
29
+ // this error is opaque (user supplied) so we don't validate it
30
+ // as an Error instance.
31
+ if (macroCondition(getGlobalConfig().WarpDriveMirror.env.PRODUCTION)) {
32
+ // eslint-disable-next-line no-console
33
+ console.error(this.args.error);
34
+ } else {
35
+ // eslint-disable-next-line @typescript-eslint/only-throw-error
36
+ throw this.args.error;
37
+ }
38
+ }
39
+ static {
40
+ setComponentTemplate(precompileTemplate("", {
41
+ strictMode: true
42
+ }), this);
43
+ }
44
+ }
45
+ /**
46
+ * The `<Await />` component allow you to utilize reactive control flow
47
+ * for asynchronous states in your application.
48
+ *
49
+ * Await is ideal for handling "boundaries", outside which some state is
50
+ * still allowed to be unresolved and within which it MUST be resolved.
51
+ *
52
+ * ```gts
53
+ * import { Await } from '@warp-drive-mirror/ember';
54
+ *
55
+ * <template>
56
+ * <Await @promise={{@request}}>
57
+ * <:pending>
58
+ * <Spinner />
59
+ * </:pending>
60
+ *
61
+ * <:error as |error|>
62
+ * <ErrorForm @error={{error}} />
63
+ * </:error>
64
+ *
65
+ * <:success as |result|>
66
+ * <h1>{{result.title}}</h1>
67
+ * </:success>
68
+ * </Await>
69
+ * </template>
70
+ * ```
71
+ *
72
+ * The `<Await />` component requires that error states are properly handled.
73
+ *
74
+ * If no error block is provided and the promise rejects, the error will
75
+ * be thrown.
76
+ *
77
+ * @category Components
78
+ * @public
79
+ */
80
+ class Await extends Component {
81
+ get state() {
82
+ return getPromiseState(this.args.promise);
83
+ }
84
+ get error() {
85
+ return this.state.error;
86
+ }
87
+ get result() {
88
+ return this.state.result;
89
+ }
90
+ static {
91
+ setComponentTemplate(precompileTemplate("\n {{#if this.state.isPending}}\n {{yield to=\"pending\"}}\n {{else if (and this.state.isError (has-block \"error\"))}}\n {{yield this.error to=\"error\"}}\n {{else if this.state.isSuccess}}\n {{yield this.result to=\"success\"}}\n {{else}}\n <Throw @error={{this.error}} />\n {{/if}}\n ", {
92
+ strictMode: true,
93
+ scope: () => ({
94
+ and,
95
+ Throw
96
+ })
97
+ }), this);
98
+ }
99
+ }
100
+
101
+ const deferred = /* @__PURE__ */new WeakMap();
102
+ function deferDecorator(proto, prop, desc) {
103
+ let map = deferred.get(proto);
104
+ if (!map) {
105
+ map = /* @__PURE__ */new Map();
106
+ deferred.set(proto, map);
107
+ }
108
+ map.set(prop, desc);
109
+ }
110
+ function findDeferredDecorator(target, prop) {
111
+ var _a;
112
+ let cursor = target.prototype;
113
+ while (cursor) {
114
+ let desc = (_a = deferred.get(cursor)) == null ? void 0 : _a.get(prop);
115
+ if (desc) {
116
+ return desc;
117
+ }
118
+ cursor = cursor.prototype;
119
+ }
120
+ }
121
+ function decorateFieldV2(prototype, prop, decorators, initializer) {
122
+ let desc = {
123
+ configurable: true,
124
+ enumerable: true,
125
+ writable: true,
126
+ initializer: null
127
+ };
128
+ if (initializer) {
129
+ desc.initializer = initializer;
130
+ }
131
+ for (let decorator of decorators) {
132
+ desc = decorator(prototype, prop, desc) || desc;
133
+ }
134
+ if (desc.initializer === void 0) {
135
+ Object.defineProperty(prototype, prop, desc);
136
+ } else {
137
+ deferDecorator(prototype, prop, desc);
138
+ }
139
+ }
140
+ function decorateMethodV2(prototype, prop, decorators) {
141
+ const origDesc = Object.getOwnPropertyDescriptor(prototype, prop);
142
+ let desc = {
143
+ ...origDesc
144
+ };
145
+ for (let decorator of decorators) {
146
+ desc = decorator(prototype, prop, desc) || desc;
147
+ }
148
+ if (desc.initializer !== void 0) {
149
+ desc.value = desc.initializer ? desc.initializer.call(prototype) : void 0;
150
+ desc.initializer = void 0;
151
+ }
152
+ Object.defineProperty(prototype, prop, desc);
153
+ }
154
+ function initializeDeferredDecorator(target, prop) {
155
+ let desc = findDeferredDecorator(target.constructor, prop);
156
+ if (desc) {
157
+ Object.defineProperty(target, prop, {
158
+ enumerable: desc.enumerable,
159
+ configurable: desc.configurable,
160
+ writable: desc.writable,
161
+ value: desc.initializer ? desc.initializer.call(target) : void 0
162
+ });
163
+ }
164
+ }
165
+
166
+ function notNull(x) {
167
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
168
+ if (!test) {
169
+ throw new Error('Expected a non-null value, but got null');
170
+ }
171
+ })(x !== null) : {};
172
+ return x;
173
+ }
174
+ const not = x => !x;
175
+ const IdleBlockMissingError = new Error('No idle block provided for <Request> component, and no query or request was provided.');
176
+ let consume = service;
177
+ if (macroCondition(moduleExists('ember-provide-consume-context'))) {
178
+ const {
179
+ consume: contextConsume
180
+ } = importSync('ember-provide-consume-context');
181
+ consume = contextConsume;
182
+ }
183
+ const DefaultChrome = setComponentTemplate(precompileTemplate("{{yield}}", {
184
+ strictMode: true
185
+ }), templateOnly());
186
+ /**
187
+ * The `<Request />` component is a powerful tool for managing data fetching and
188
+ * state in your Ember application. It provides a declarative approach to reactive
189
+ * control-flow for managing requests and state in your application.
190
+ *
191
+ * The `<Request />` component is ideal for handling "boundaries", outside which some
192
+ * state is still allowed to be unresolved and within which it MUST be resolved.
193
+ *
194
+ * ## Request States
195
+ *
196
+ * `<Request />` has five states, only one of which will be active and rendered at a time.
197
+ *
198
+ * - `idle`: The component is waiting to be given a request to monitor
199
+ * - `loading`: The request is in progress
200
+ * - `error`: The request failed
201
+ * - `content`: The request succeeded
202
+ * - `cancelled`: The request was cancelled
203
+ *
204
+ * Additionally, the `content` state has a `refresh` method that can be used to
205
+ * refresh the request in the background, which is available as a sub-state of
206
+ * the `content` state.
207
+ *
208
+ * As with the `<Await />` component, if no error block is provided and the request
209
+ * rejects, the error will be thrown. Cancellation errors are swallowed instead of
210
+ * rethrown if no error block or cancellation block is present.
211
+ *
212
+ * ```gts
213
+ * import { Request } from '@warp-drive-mirror/ember';
214
+ *
215
+ * <template>
216
+ * <Request @request={{@request}}>
217
+ * <:loading as |state|>
218
+ * <Spinner @percentDone={{state.completedRatio}} />
219
+ * <button {{on "click" state.abort}}>Cancel</button>
220
+ * </:loading>
221
+ *
222
+ * <:error as |error state|>
223
+ * <ErrorForm @error={{error}} />
224
+ * <button {{on "click" state.retry}}>Retry</button>
225
+ * </:error>
226
+ *
227
+ * <:content as |data state|>
228
+ * <h1>{{data.title}}</h1>
229
+ * {{#if state.isBackgroundReloading}}
230
+ * <SmallSpinner />
231
+ * <button {{on "click" state.abort}}>Cancel</button>
232
+ * {{else}}
233
+ * <button {{on "click" state.refresh}}>Refresh</button>
234
+ * {{/if}}
235
+ * </:content>
236
+ *
237
+ * <:cancelled as |error state|>
238
+ * <h2>The Request was cancelled</h2>
239
+ * <button {{on "click" state.retry}}>Retry</button>
240
+ * </:cancelled>
241
+ *
242
+ * <:idle>
243
+ * <button {{on "click" @kickOffRequest}}>Load Preview?</button>
244
+ * </:idle>
245
+ *
246
+ * </Request>
247
+ * </template>
248
+ * ```
249
+ *
250
+ * ## Streaming Data
251
+ *
252
+ * The loading state exposes the download `ReadableStream` instance for consumption
253
+ *
254
+ * ```gts
255
+ * import { Request } from '@warp-drive-mirror/ember';
256
+ *
257
+ * <template>
258
+ * <Request @request={{@request}}>
259
+ * <:loading as |state|>
260
+ * <Video @stream={{state.stream}} />
261
+ * </:loading>
262
+ *
263
+ * <:error as |error|>
264
+ * <ErrorForm @error={{error}} />
265
+ * </:error>
266
+ * </Request>
267
+ * </template>
268
+ * ```
269
+ *
270
+ * ## Retry
271
+ *
272
+ * Cancelled and error'd requests may be retried by calling the `retry` method.
273
+ *
274
+ * Retry will restart the state progression, using the loading, error, cancelled,
275
+ * and content blocks as appropriate.
276
+ *
277
+ * ## Reloading
278
+ *
279
+ * The `reload` method will force the request to be fully re-executed, bypassing
280
+ * cache and restarting the state progression through the loading, error, and
281
+ * content blocks as appropriate.
282
+ *
283
+ * Background reload (refresh) is a special substate of the content state that
284
+ * allows you to refresh the request in the background. This is useful for when
285
+ * you want to update the data in the background without blocking the UI.
286
+ *
287
+ * Reload and refresh are available as methods on the `content` state.
288
+ *
289
+ * ```gts
290
+ * import { Request } from '@warp-drive-mirror/ember';
291
+ *
292
+ * <template>
293
+ * <Request @request={{@request}}>
294
+ * <:content as |data state|>
295
+ * <h1>{{data.title}}</h1>
296
+ * {{#if state.isBackgroundReloading}}
297
+ * <SmallSpinner />
298
+ * <button {{on "click" state.abort}}>Cancel</button>
299
+ * {{/if}}
300
+ *
301
+ * <button {{on "click" state.refresh}}>Refresh</button>
302
+ * <button {{on "click" state.reload}}>Reload</button>
303
+ * </:content>
304
+ * </Request>
305
+ * </template>
306
+ * ```
307
+ *
308
+ * ## Advanced Reloading
309
+ *
310
+ * We can nest our usage of `<Request />` to handle more advanced
311
+ * reloading scenarios.
312
+ *
313
+ * ```gts
314
+ * import { Request } from '@warp-drive-mirror/ember';
315
+ *
316
+ * <template>
317
+ * <Request @request={{@request}}>
318
+ * <:cancelled>
319
+ * <h2>The Request Cancelled</h2>
320
+ * </:cancelled>
321
+ *
322
+ * <:error as |error|>
323
+ * <ErrorForm @error={{error}} />
324
+ * </:error>
325
+ *
326
+ * <:content as |result state|>
327
+ * <Request @request={{state.latestRequest}}>
328
+ * <!-- Handle Background Request -->
329
+ * </Request>
330
+ *
331
+ * <h1>{{result.title}}</h1>
332
+ *
333
+ * <button {{on "click" state.refresh}}>Refresh</button>
334
+ * </:content>
335
+ * </Request>
336
+ * </template>
337
+ * ```
338
+ *
339
+ * ## Autorefresh
340
+ *
341
+ * `<Request />` supports automatic refresh and reload under certain conditions.
342
+ *
343
+ * - `online`: This occurs when a browser window or tab comes back to the foreground
344
+ * after being backgrounded or when the network reports as being online after
345
+ * having been offline.
346
+ * - `interval`: This occurs when a specified amount of time has passed.
347
+ * - `invalid`: This occurs when the store emits a notification that the request
348
+ * has become invalid.
349
+ *
350
+ * You can specify when autorefresh should occur by setting the `autorefresh` arg
351
+ * to `true` or a comma-separated list of the above values.
352
+ *
353
+ * A value of `true` is equivalent to `'online,invalid'`.
354
+ *
355
+ * By default, an autorefresh will only occur if the browser was backgrounded or
356
+ * offline for more than 30s before coming back available. This amount of time can
357
+ * be tweaked by setting the number of milliseconds via `@autorefreshThreshold`.
358
+ *
359
+ * This arg also controls the interval at which the request will be refreshed
360
+ * if the `interval` autorefresh type is enabled.
361
+ *
362
+ * Finally, the behavior of the request initiated by autorefresh can be adjusted
363
+ * by setting the `autorefreshBehavior` arg to `'refresh'`, `'reload'`, or `'policy'`.
364
+ *
365
+ * - `'refresh'`: Refresh the request in the background
366
+ * - `'reload'`: Force a reload of the request
367
+ * - `'policy'` (**default**): Let the store's configured CachePolicy decide whether to
368
+ * reload, refresh, or do nothing.
369
+ *
370
+ * More advanced refresh and reload behaviors can be created by passing the reload and
371
+ * refresh actions into another component. For instance, refresh could be set up on a
372
+ * timer or on a websocket subscription.
373
+ *
374
+ *
375
+ * ```gts
376
+ * import { Request } from '@warp-drive-mirror/ember';
377
+ *
378
+ * <template>
379
+ * <Request @request={{@request}}>
380
+ * <:content as |result state|>
381
+ * <h1>{{result.title}}</h1>
382
+ *
383
+ * <Interval @period={{30_000}} @fn={{state.refresh}} />
384
+ * <Subscribe @channel={{@someValue}} @fn={{state.refresh}} />
385
+ * </:content>
386
+ * </Request>
387
+ * </template>
388
+ * ```
389
+ *
390
+ * If a matching request is refreshed or reloaded by any other component,
391
+ * the `Request` component will react accordingly.
392
+ *
393
+ * ## Deduping
394
+ *
395
+ * The store dedupes requests by identity. If a request is made for the same identity
396
+ * from multiple `<Request />` components, even if the request is not referentially the
397
+ * same, only one actual request will be made.
398
+ *
399
+ * @category Components
400
+ * @public
401
+ */
402
+ class Request extends Component {
403
+ static {
404
+ decorateFieldV2(this.prototype, "_store", [consume('store')]);
405
+ }
406
+ #_store = (initializeDeferredDecorator(this, "_store"), void 0);
407
+ /**
408
+ * The store instance to use for making requests. If contexts are available, this
409
+ * will be the `store` on the context, else it will be the store service.
410
+ *
411
+ * @internal
412
+ */
413
+ get store() {
414
+ const store = this.args.store || this._store;
415
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
416
+ if (!test) {
417
+ throw new Error(moduleExists('ember-provide-consume-context') ? `No store was provided to the <Request> component. Either provide a store via the @store arg or via the context API provided by ember-provide-consume-context.` : `No store was provided to the <Request> component. Either provide a store via the @store arg or by registering a store service.`);
418
+ }
419
+ })(store) : {};
420
+ return store;
421
+ }
422
+ _state = null;
423
+ get state() {
424
+ let {
425
+ _state
426
+ } = this;
427
+ const {
428
+ store
429
+ } = this;
430
+ const {
431
+ subscription
432
+ } = this.args;
433
+ if (_state && (_state.store !== store || subscription)) {
434
+ _state[DISPOSE]();
435
+ _state = null;
436
+ }
437
+ if (subscription) {
438
+ return subscription;
439
+ }
440
+ if (!_state) {
441
+ this._state = _state = createRequestSubscription(store, this.args);
442
+ }
443
+ return _state;
444
+ }
445
+ /**
446
+ * The chrome component to use for rendering the request.
447
+ *
448
+ * @private
449
+ */
450
+ get Chrome() {
451
+ return this.args.chrome || DefaultChrome;
452
+ }
453
+ static {
454
+ decorateMethodV2(this.prototype, "Chrome", [memoized]);
455
+ }
456
+ willDestroy() {
457
+ if (this._state) {
458
+ this._state[DISPOSE]();
459
+ this._state = null;
460
+ }
461
+ }
462
+ static {
463
+ setComponentTemplate(precompileTemplate("\n <this.Chrome @state={{if this.state.isIdle null this.state.reqState}} @features={{this.state.contentFeatures}}>\n {{#if (and this.state.isIdle (has-block \"idle\"))}}\n {{yield to=\"idle\"}}\n\n {{else if this.state.isIdle}}\n <Throw @error={{IdleBlockMissingError}} />\n\n {{else if this.state.reqState.isLoading}}\n {{yield this.state.reqState.loadingState to=\"loading\"}}\n\n {{else if (and this.state.reqState.isCancelled (has-block \"cancelled\"))}}\n {{yield (notNull this.state.reqState.reason) this.state.errorFeatures to=\"cancelled\"}}\n\n {{else if (and this.state.reqState.isError (has-block \"error\"))}}\n {{yield (notNull this.state.reqState.reason) this.state.errorFeatures to=\"error\"}}\n\n {{else if this.state.reqState.isSuccess}}\n {{yield this.state.result this.state.contentFeatures to=\"content\"}}\n\n {{else if (not this.state.reqState.isCancelled)}}\n <Throw @error={{(notNull this.state.reqState.reason)}} />\n {{/if}}\n\n {{yield this.state.reqState to=\"always\"}}\n </this.Chrome>\n ", {
464
+ strictMode: true,
465
+ scope: () => ({
466
+ and,
467
+ Throw,
468
+ IdleBlockMissingError,
469
+ notNull,
470
+ not
471
+ })
472
+ }), this);
473
+ }
474
+ }
475
+
476
+ export { Await, Request, Throw };
@@ -0,0 +1,77 @@
1
+ import { tagForProperty } from '@ember/-internals/metal';
2
+ import { _backburner } from '@ember/runloop';
3
+ import { createCache, track, updateTag, consumeTag, getValue, dirtyTag } from '@glimmer/validator';
4
+ import { macroCondition, getGlobalConfig, importSync } from '@embroider/macros';
5
+ import { setupSignals } from '@warp-drive-mirror/core/configure';
6
+
7
+ const emberDirtyTag = dirtyTag;
8
+ function buildSignalConfig(options) {
9
+ const ARRAY_SIGNAL = options.wellknown.Array;
10
+ return {
11
+ createSignal(obj, key) {
12
+ if (macroCondition(getGlobalConfig().WarpDriveMirror.deprecations.DEPRECATE_COMPUTED_CHAINS)) {
13
+ if (key === ARRAY_SIGNAL) {
14
+ return [tagForProperty(obj, key), tagForProperty(obj, 'length'), tagForProperty(obj, '[]')];
15
+ }
16
+ }
17
+ return tagForProperty(obj, key);
18
+ },
19
+ consumeSignal(signal) {
20
+ if (macroCondition(getGlobalConfig().WarpDriveMirror.deprecations.DEPRECATE_COMPUTED_CHAINS)) {
21
+ if (Array.isArray(signal)) {
22
+ consumeTag(signal[0]);
23
+ consumeTag(signal[1]);
24
+ consumeTag(signal[2]);
25
+ return;
26
+ }
27
+ }
28
+ consumeTag(signal);
29
+ },
30
+ notifySignal(signal) {
31
+ if (macroCondition(getGlobalConfig().WarpDriveMirror.deprecations.DEPRECATE_COMPUTED_CHAINS)) {
32
+ if (Array.isArray(signal)) {
33
+ emberDirtyTag(signal[0]);
34
+ emberDirtyTag(signal[1]);
35
+ emberDirtyTag(signal[2]);
36
+ return;
37
+ }
38
+ }
39
+ emberDirtyTag(signal);
40
+ },
41
+ createMemo: (object, key, fn) => {
42
+ if (macroCondition(getGlobalConfig().WarpDriveMirror.deprecations.DEPRECATE_COMPUTED_CHAINS)) {
43
+ const propertyTag = tagForProperty(object, key);
44
+ const memo = createCache(fn);
45
+ let ret;
46
+ const wrappedFn = () => {
47
+ ret = getValue(memo);
48
+ };
49
+ return () => {
50
+ const tag = track(wrappedFn);
51
+ updateTag(propertyTag, tag);
52
+ consumeTag(tag);
53
+ return ret;
54
+ };
55
+ } else {
56
+ const memo = createCache(fn);
57
+ return () => getValue(memo);
58
+ }
59
+ },
60
+ willSyncFlushWatchers: () => {
61
+ //@ts-expect-error
62
+ return !!_backburner.currentInstance && _backburner._autorun !== true;
63
+ },
64
+ waitFor: async promise => {
65
+ if (macroCondition(getGlobalConfig().WarpDriveMirror.env.TESTING)) {
66
+ const {
67
+ waitForPromise
68
+ } = importSync('@ember/test-waiters');
69
+ return waitForPromise(promise);
70
+ }
71
+ return promise;
72
+ }
73
+ };
74
+ }
75
+ setupSignals(buildSignalConfig);
76
+
77
+ export { buildSignalConfig };
@@ -0,0 +1,81 @@
1
+ import type Owner from "@ember/owner";
2
+ import Component from "@glimmer/component";
3
+ import { type PromiseState } from "@warp-drive-mirror/core/reactive";
4
+ import type { Awaitable } from "@warp-drive-mirror/core/request";
5
+ export declare const and: (x: unknown, y: unknown) => boolean;
6
+ interface ThrowSignature<E = Error | string | object> {
7
+ Args: {
8
+ error: E;
9
+ };
10
+ }
11
+ /**
12
+ * The `<Throw />` component is used to throw an error in a template.
13
+ *
14
+ * That's all it does. So don't use it unless the application should
15
+ * throw an error if it reaches this point in the template.
16
+ *
17
+ * ```gts
18
+ * <Throw @error={{anError}} />
19
+ * ```
20
+ *
21
+ * @category Components
22
+ * @public
23
+ */ export declare class Throw<T> extends Component<ThrowSignature<T>> {
24
+ constructor(owner: Owner, args: ThrowSignature<T>["Args"]);
25
+ }
26
+ interface AwaitSignature<
27
+ T,
28
+ E = Error | string | object
29
+ > {
30
+ Args: {
31
+ promise: Promise<T> | Awaitable<T, E>;
32
+ };
33
+ Blocks: {
34
+ pending: [];
35
+ error: [error: E];
36
+ success: [value: T];
37
+ };
38
+ }
39
+ /**
40
+ * The `<Await />` component allow you to utilize reactive control flow
41
+ * for asynchronous states in your application.
42
+ *
43
+ * Await is ideal for handling "boundaries", outside which some state is
44
+ * still allowed to be unresolved and within which it MUST be resolved.
45
+ *
46
+ * ```gts
47
+ * import { Await } from '@warp-drive-mirror/ember';
48
+ *
49
+ * <template>
50
+ * <Await @promise={{@request}}>
51
+ * <:pending>
52
+ * <Spinner />
53
+ * </:pending>
54
+ *
55
+ * <:error as |error|>
56
+ * <ErrorForm @error={{error}} />
57
+ * </:error>
58
+ *
59
+ * <:success as |result|>
60
+ * <h1>{{result.title}}</h1>
61
+ * </:success>
62
+ * </Await>
63
+ * </template>
64
+ * ```
65
+ *
66
+ * The `<Await />` component requires that error states are properly handled.
67
+ *
68
+ * If no error block is provided and the promise rejects, the error will
69
+ * be thrown.
70
+ *
71
+ * @category Components
72
+ * @public
73
+ */ export declare class Await<
74
+ T,
75
+ E
76
+ > extends Component<AwaitSignature<T, E>> {
77
+ get state(): Readonly<PromiseState<T, E>>;
78
+ get error(): E;
79
+ get result(): T;
80
+ }
81
+ export {};