@warp-drive-mirror/ember 5.8.0-alpha.3 → 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.
Files changed (46) hide show
  1. package/README.md +37 -16
  2. package/declarations/-private/await.d.ts +7 -7
  3. package/declarations/-private/request.d.ts +5 -5
  4. package/declarations/index.d.ts +3 -210
  5. package/dist/index.js +15 -13
  6. package/dist/unpkg/dev/declarations/-private/await.d.ts +81 -0
  7. package/dist/unpkg/dev/declarations/-private/request.d.ts +289 -0
  8. package/dist/unpkg/dev/declarations/index.d.ts +8 -0
  9. package/dist/unpkg/dev/declarations/install.d.ts +6 -0
  10. package/dist/unpkg/dev/index.js +476 -0
  11. package/dist/unpkg/dev/install.js +77 -0
  12. package/dist/unpkg/dev-deprecated/declarations/-private/await.d.ts +81 -0
  13. package/dist/unpkg/dev-deprecated/declarations/-private/request.d.ts +289 -0
  14. package/dist/unpkg/dev-deprecated/declarations/index.d.ts +8 -0
  15. package/dist/unpkg/dev-deprecated/declarations/install.d.ts +6 -0
  16. package/dist/unpkg/dev-deprecated/index.js +476 -0
  17. package/dist/unpkg/dev-deprecated/install.js +77 -0
  18. package/dist/unpkg/prod/declarations/-private/await.d.ts +81 -0
  19. package/dist/unpkg/prod/declarations/-private/request.d.ts +289 -0
  20. package/dist/unpkg/prod/declarations/index.d.ts +8 -0
  21. package/dist/unpkg/prod/declarations/install.d.ts +6 -0
  22. package/dist/unpkg/prod/index.js +476 -0
  23. package/dist/unpkg/prod/install.js +77 -0
  24. package/dist/unpkg/prod-deprecated/declarations/-private/await.d.ts +81 -0
  25. package/dist/unpkg/prod-deprecated/declarations/-private/request.d.ts +289 -0
  26. package/dist/unpkg/prod-deprecated/declarations/index.d.ts +8 -0
  27. package/dist/unpkg/prod-deprecated/declarations/install.d.ts +6 -0
  28. package/dist/unpkg/prod-deprecated/index.js +476 -0
  29. package/dist/unpkg/prod-deprecated/install.js +77 -0
  30. package/logos/README.md +2 -2
  31. package/logos/logo-yellow-slab.svg +1 -0
  32. package/logos/word-mark-black.svg +1 -0
  33. package/logos/word-mark-white.svg +1 -0
  34. package/package.json +4 -4
  35. package/logos/NCC-1701-a-blue.svg +0 -4
  36. package/logos/NCC-1701-a-gold.svg +0 -4
  37. package/logos/NCC-1701-a-gold_100.svg +0 -1
  38. package/logos/NCC-1701-a-gold_base-64.txt +0 -1
  39. package/logos/NCC-1701-a.svg +0 -4
  40. package/logos/docs-badge.svg +0 -2
  41. package/logos/ember-data-logo-dark.svg +0 -12
  42. package/logos/ember-data-logo-light.svg +0 -12
  43. package/logos/social1.png +0 -0
  44. package/logos/social2.png +0 -0
  45. package/logos/warp-drive-logo-dark.svg +0 -4
  46. package/logos/warp-drive-logo-gold.svg +0 -4
package/README.md CHANGED
@@ -1,26 +1,47 @@
1
1
  <p align="center">
2
2
  <img
3
3
  class="project-logo"
4
- src="./logos/NCC-1701-a-blue.svg#gh-light-mode-only"
4
+ src="./logos/logo-yellow-slab.svg"
5
5
  alt="WarpDrive"
6
- width="120px"
7
- title="WarpDrive" />
8
- <img
9
- class="project-logo"
10
- src="./logos/NCC-1701-a.svg#gh-dark-mode-only"
11
- alt="WarpDrive"
12
- width="120px"
13
- title="WarpDrive" />
6
+ width="180px"
7
+ title="WarpDrive"
8
+ />
14
9
  </p>
15
10
 
16
- <h3 align="center">:electron: Data utilities for using <em style="color: lightgreen">Warp</em><strong style="color: magenta">Drive</strong> with 🐹 <em style="color: orange">Ember</em><em style="color: lightblue">.js</em></h3>
17
- <h4 align="center">And of course, <em style="color: orange">Ember</em><strong style="color: lightblue">Data</strong> too! </h4>
11
+ ![NPM Stable Version](https://img.shields.io/npm/v/ember-data/latest?label=version&style=flat&color=fdb155)
12
+ ![NPM Downloads](https://img.shields.io/npm/dm/ember-data.svg?style=flat&color=fdb155)
13
+ ![License](https://img.shields.io/github/license/warp-drive-data/warp-drive.svg?style=flat&color=fdb155)
14
+ [![EmberJS Discord Community Server](https://img.shields.io/badge/EmberJS-grey?logo=discord&logoColor=fdb155)](https://discord.gg/zT3asNS
15
+ )
16
+ [![WarpDrive Discord Server](https://img.shields.io/badge/WarpDrive-grey?logo=discord&logoColor=fdb155)](https://discord.gg/PHBbnWJx5S
17
+ )
18
+
19
+ <h3 align="center">Signals Integration and Component API for using <em>Warp</em><strong>Drive</strong> with 🐹 <em style="color: orange">Ember.js</em></h3>
20
+
21
+ ***Warp*Drive** makes it easy to build scalable, fast, feature
22
+ rich applications &mdash; letting you ship better experiences more quickly without re-architecting your app or API. ***Warp*Drive** is:
23
+
24
+ - 🌌 Seamless Reactivity in any Framework
25
+ - ⚡️ Committed to Best-In-Class Performance
26
+ - 💚 Typed
27
+ - ⚛️ Works with any API
28
+ - 🌲 Focused on being as tiny as possible
29
+ - 🚀 SSR Ready
30
+ - 🐹 Built with ♥️ by [Ember](https://emberjs.com)
31
+
32
+ <br>
33
+ <br>
34
+
35
+ *Get Started* → [Guides](https://warp-drive.io/guides/)
36
+
37
+ <br>
18
38
 
19
39
  ---
20
40
 
21
- ```sh
22
- pnpm install @warp-drive-mirror/ember
23
- ```
41
+ <br>
42
+
43
+ # @warp-drive-mirror/ember
44
+
24
45
 
25
46
  **Tagged Releases**
26
47
 
@@ -568,7 +589,7 @@ export { Await as default } from '@warp-drive-mirror/ember';
568
589
  img.project-logo {
569
590
  padding: 0 5em 1em 5em;
570
591
  width: 100px;
571
- border-bottom: 2px solid #0969da;
592
+ border-bottom: 2px solid #bbb;
572
593
  margin: 0 auto;
573
594
  display: block;
574
595
  }
@@ -584,7 +605,7 @@ export { Await as default } from '@warp-drive-mirror/ember';
584
605
  display: inline-block;
585
606
  padding: .2rem 0;
586
607
  color: #000;
587
- border-bottom: 3px solid #0969da;
608
+ border-bottom: 3px solid #bbb;
588
609
  }
589
610
 
590
611
  details > details {
@@ -1,7 +1,7 @@
1
1
  import type Owner from "@ember/owner";
2
2
  import Component from "@glimmer/component";
3
+ import { type PromiseState } from "@warp-drive-mirror/core/reactive";
3
4
  import type { Awaitable } from "@warp-drive-mirror/core/request";
4
- import { type PromiseState } from "@warp-drive-mirror/core/store/-private";
5
5
  export declare const and: (x: unknown, y: unknown) => boolean;
6
6
  interface ThrowSignature<E = Error | string | object> {
7
7
  Args: {
@@ -14,11 +14,11 @@ interface ThrowSignature<E = Error | string | object> {
14
14
  * That's all it does. So don't use it unless the application should
15
15
  * throw an error if it reaches this point in the template.
16
16
  *
17
- * ```hbs
17
+ * ```gts
18
18
  * <Throw @error={{anError}} />
19
19
  * ```
20
20
  *
21
- * @class <Throw />
21
+ * @category Components
22
22
  * @public
23
23
  */ export declare class Throw<T> extends Component<ThrowSignature<T>> {
24
24
  constructor(owner: Owner, args: ThrowSignature<T>["Args"]);
@@ -37,13 +37,13 @@ interface AwaitSignature<
37
37
  };
38
38
  }
39
39
  /**
40
- * The <Await /> component allow you to utilize reactive control flow
40
+ * The `<Await />` component allow you to utilize reactive control flow
41
41
  * for asynchronous states in your application.
42
42
  *
43
43
  * Await is ideal for handling "boundaries", outside which some state is
44
44
  * still allowed to be unresolved and within which it MUST be resolved.
45
45
  *
46
- * ```gjs
46
+ * ```gts
47
47
  * import { Await } from '@warp-drive-mirror/ember';
48
48
  *
49
49
  * <template>
@@ -63,12 +63,12 @@ interface AwaitSignature<
63
63
  * </template>
64
64
  * ```
65
65
  *
66
- * The <Await /> component requires that error states are properly handled.
66
+ * The `<Await />` component requires that error states are properly handled.
67
67
  *
68
68
  * If no error block is provided and the promise rejects, the error will
69
69
  * be thrown.
70
70
  *
71
- * @class <Await />
71
+ * @category Components
72
72
  * @public
73
73
  */ export declare class Await<
74
74
  T,
@@ -118,7 +118,7 @@ interface RequestSignature<
118
118
  *
119
119
  * The loading state exposes the download `ReadableStream` instance for consumption
120
120
  *
121
- * ```gjs
121
+ * ```gts
122
122
  * import { Request } from '@warp-drive-mirror/ember';
123
123
  *
124
124
  * <template>
@@ -153,7 +153,7 @@ interface RequestSignature<
153
153
  *
154
154
  * Reload and refresh are available as methods on the `content` state.
155
155
  *
156
- * ```gjs
156
+ * ```gts
157
157
  * import { Request } from '@warp-drive-mirror/ember';
158
158
  *
159
159
  * <template>
@@ -177,7 +177,7 @@ interface RequestSignature<
177
177
  * We can nest our usage of `<Request />` to handle more advanced
178
178
  * reloading scenarios.
179
179
  *
180
- * ```gjs
180
+ * ```gts
181
181
  * import { Request } from '@warp-drive-mirror/ember';
182
182
  *
183
183
  * <template>
@@ -239,7 +239,7 @@ interface RequestSignature<
239
239
  * timer or on a websocket subscription.
240
240
  *
241
241
  *
242
- * ```gjs
242
+ * ```gts
243
243
  * import { Request } from '@warp-drive-mirror/ember';
244
244
  *
245
245
  * <template>
@@ -263,7 +263,7 @@ interface RequestSignature<
263
263
  * from multiple `<Request />` components, even if the request is not referentially the
264
264
  * same, only one actual request will be made.
265
265
  *
266
- *
266
+ * @category Components
267
267
  * @public
268
268
  */ export declare class Request<
269
269
  RT,
@@ -1,215 +1,8 @@
1
1
  /**
2
- * <h3 align="center">⚛️ Data utilities for using <em style="color: lightgreen">Warp</em><strong style="color: magenta">Drive</strong> with 🐹 <em style="color: orange">Ember</em><em style="color: lightblue">.js</em></h3>
3
- *
4
- * ## Installation
5
- *
6
- * ```sh
7
- * pnpm install @warp-drive-mirror/ember
8
- * ```
9
- *
10
- * ## About
11
- *
12
- * This library provides reactive utilities for working with promises
13
- * and requests, building over these primitives to provide functions
14
- * and components that enable you to build robust performant apps with
15
- * elegant control flow.
16
- *
17
- * ## Using .hbs
18
- *
19
- * The components and utils this library exports are intended for use with Glimmer
20
- * Flavored JavaScript (gjs). To use them in handlebars files, your app should re-
21
- * export them. For instance:
22
- *
23
- * *app/components/await.ts*
24
- * ```ts
25
- * export { Await as default } from '@warp-drive-mirror/ember';
26
- * ```
27
- *
28
- * ```hbs
29
- * <Await @promise={{this.getTheData}}></Await>
30
- * ```
31
- *
32
- * This allows renaming them to avoid conflicts just by using a different filename
33
- * if desired:
34
- *
35
- * *app/components/warp-drive-await.ts*
36
- * ```ts
37
- * export { Await as default } from '@warp-drive-mirror/ember';
38
- * ```
39
- *
40
- * ```hbs
41
- * <WarpDriveAwait @promise={{this.getTheData}}></WarpDriveAwait>
42
- * ```
43
- *
44
2
  * @module
3
+ * @mergeModuleWith <project>
45
4
  */
46
5
  export { Request, type ContentFeatures, type RecoveryFeatures } from "./-private/request.js";
47
6
  export { Await, Throw } from "./-private/await.js";
48
- /**
49
- * PromiseState provides a reactive wrapper for a promise which allows you write declarative
50
- * code around a promise's control flow. It is useful in both Template and JavaScript contexts,
51
- * allowing you to quickly derive behaviors and data from pending, error and success states.
52
- *
53
- * ```ts
54
- * interface PromiseState<T = unknown, E = unknown> {
55
- * isPending: boolean;
56
- * isSuccess: boolean;
57
- * isError: boolean;
58
- * result: T | null;
59
- * error: E | null;
60
- * }
61
- * ```
62
- *
63
- * To get the state of a promise, use `getPromiseState`.
64
- *
65
- * @class PromiseState
66
- * @public
67
- */
68
- /**
69
- * Returns a reactive state-machine for the provided promise or awaitable.
70
- *
71
- * Repeat calls to `getPromiseState` with the same promise will return the same state object
72
- * making is safe and easy to use in templates and JavaScript code to produce reactive
73
- * behaviors around promises.
74
- *
75
- * `getPromiseState` can be used in both JavaScript and Template contexts.
76
- *
77
- * ```ts
78
- * import { getPromiseState } from '@warp-drive-mirror/ember';
79
- *
80
- * const state = getPromiseState(promise);
81
- * ```
82
- *
83
- * For instance, we could write a getter on a component that updates whenever
84
- * the promise state advances or the promise changes, by combining the function
85
- * with the use of `@cached`
86
- *
87
- * ```ts
88
- * class Component {
89
- * @cached
90
- * get title() {
91
- * const state = getPromiseState(this.args.request);
92
- * if (state.isPending) {
93
- * return 'loading...';
94
- * }
95
- * if (state.isError) { return null; }
96
- * return state.result.title;
97
- * }
98
- * }
99
- * ```
100
- *
101
- * Or in a template as a helper:
102
- *
103
- * ```gjs
104
- * import { getPromiseState } from '@warp-drive-mirror/ember';
105
- *
106
- * <template>
107
- * {{#let (getPromiseState @request) as |state|}}
108
- * {{#if state.isPending}} <Spinner />
109
- * {{else if state.isError}} <ErrorForm @error={{state.error}} />
110
- * {{else}}
111
- * <h1>{{state.result.title}}</h1>
112
- * {{/if}}
113
- * {{/let}}
114
- * </template>
115
- * ```
116
- *
117
- * If looking to use in a template, consider also the `<Await />` component.
118
-
119
- * @public
120
- * @param {Promise<T> | Awaitable<T, E>} promise
121
- * @return {PromiseState<T, E>}
122
- */
123
- export { getPromiseState } from "@warp-drive-mirror/core/store/-private";
124
- /**
125
- * Lazily consumes the stream of a request, providing a number of
126
- * reactive properties that can be used to build UIs that respond
127
- * to the progress of a request.
128
- *
129
- * @class RequestLoadingState
130
- * @public
131
- */
132
- /**
133
- * RequestState extends the concept of PromiseState to provide a reactive
134
- * wrapper for a request `Future` which allows you write declarative code
135
- * around a Future's control flow.
136
- *
137
- * It is useful in both Template and JavaScript contexts, allowing you
138
- * to quickly derive behaviors and data from pending, error and success
139
- * states.
140
- *
141
- * The key difference between a Promise and a Future is that Futures provide
142
- * access to a stream of their content, the identity of the request (if any)
143
- * as well as the ability to attempt to abort the request.
144
- *
145
- * ```ts
146
- * interface Future<T> extends Promise<T>> {
147
- * getStream(): Promise<ReadableStream>;
148
- * abort(): void;
149
- * lid: RequestKey | null;
150
- * }
151
- * ```
152
- *
153
- * These additional APIs allow us to craft even richer state experiences.
154
- *
155
- * To get the state of a request, use `getRequestState`.
156
- *
157
- * @class RequestState
158
- * @public
159
- */
160
- /**
161
- *
162
- *
163
- * `getRequestState` can be used in both JavaScript and Template contexts.
164
- *
165
- * ```ts
166
- * import { getRequestState } from '@warp-drive-mirror/ember';
167
- *
168
- * const state = getRequestState(future);
169
- * ```
170
- *
171
- * For instance, we could write a getter on a component that updates whenever
172
- * the request state advances or the future changes, by combining the function
173
- * with the use of `@cached`
174
- *
175
- * ```ts
176
- * class Component {
177
- * @cached
178
- * get title() {
179
- * const state = getRequestState(this.args.request);
180
- * if (state.isPending) {
181
- * return 'loading...';
182
- * }
183
- * if (state.isError) { return null; }
184
- * return state.result.title;
185
- * }
186
- * }
187
- * ```
188
- *
189
- * Or in a template as a helper:
190
- *
191
- * ```gjs
192
- * import { getRequestState } from '@warp-drive-mirror/ember';
193
- *
194
- * <template>
195
- * {{#let (getRequestState @request) as |state|}}
196
- * {{#if state.isPending}}
197
- * <Spinner />
198
- * {{else if state.isError}}
199
- * <ErrorForm @error={{state.error}} />
200
- * {{else}}
201
- * <h1>{{state.result.title}}</h1>
202
- * {{/if}}
203
- * {{/let}}
204
- * </template>
205
- * ```
206
- *
207
- * If looking to use in a template, consider also the `<Request />` component
208
- * which offers a numbe of additional capabilities for requests *beyond* what
209
- * `RequestState` provides.
210
- *
211
- * @public
212
- * @param future
213
- * @return {RequestState}
214
- */
215
- export { getRequestState, createRequestSubscription, type RequestLoadingState } from "@warp-drive-mirror/core/store/-private";
7
+ export { getRequestState, createRequestSubscription, type RequestLoadingState, type RequestState } from "@warp-drive-mirror/core/store/-private";
8
+ export { getPromiseState, type PromiseState } from "@warp-drive-mirror/core/reactive";
package/dist/index.js CHANGED
@@ -1,8 +1,10 @@
1
1
  import { service } from '@ember/service';
2
2
  import Component from '@glimmer/component';
3
3
  import { macroCondition, getGlobalConfig, moduleExists, importSync } from '@embroider/macros';
4
- import { getPromiseState, DISPOSE, createRequestSubscription, memoized } from '@warp-drive-mirror/core/store/-private';
5
- export { createRequestSubscription, getPromiseState, getRequestState } from '@warp-drive-mirror/core/store/-private';
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';
6
8
  import { precompileTemplate } from '@ember/template-compilation';
7
9
  import { setComponentTemplate } from '@ember/component';
8
10
  import templateOnly from '@ember/component/template-only';
@@ -14,11 +16,11 @@ const and = (x, y) => Boolean(x && y);
14
16
  * That's all it does. So don't use it unless the application should
15
17
  * throw an error if it reaches this point in the template.
16
18
  *
17
- * ```hbs
19
+ * ```gts
18
20
  * <Throw @error={{anError}} />
19
21
  * ```
20
22
  *
21
- * @class <Throw />
23
+ * @category Components
22
24
  * @public
23
25
  */
24
26
  class Throw extends Component {
@@ -41,13 +43,13 @@ class Throw extends Component {
41
43
  }
42
44
  }
43
45
  /**
44
- * The <Await /> component allow you to utilize reactive control flow
46
+ * The `<Await />` component allow you to utilize reactive control flow
45
47
  * for asynchronous states in your application.
46
48
  *
47
49
  * Await is ideal for handling "boundaries", outside which some state is
48
50
  * still allowed to be unresolved and within which it MUST be resolved.
49
51
  *
50
- * ```gjs
52
+ * ```gts
51
53
  * import { Await } from '@warp-drive-mirror/ember';
52
54
  *
53
55
  * <template>
@@ -67,12 +69,12 @@ class Throw extends Component {
67
69
  * </template>
68
70
  * ```
69
71
  *
70
- * The <Await /> component requires that error states are properly handled.
72
+ * The `<Await />` component requires that error states are properly handled.
71
73
  *
72
74
  * If no error block is provided and the promise rejects, the error will
73
75
  * be thrown.
74
76
  *
75
- * @class <Await />
77
+ * @category Components
76
78
  * @public
77
79
  */
78
80
  class Await extends Component {
@@ -249,7 +251,7 @@ const DefaultChrome = setComponentTemplate(precompileTemplate("{{yield}}", {
249
251
  *
250
252
  * The loading state exposes the download `ReadableStream` instance for consumption
251
253
  *
252
- * ```gjs
254
+ * ```gts
253
255
  * import { Request } from '@warp-drive-mirror/ember';
254
256
  *
255
257
  * <template>
@@ -284,7 +286,7 @@ const DefaultChrome = setComponentTemplate(precompileTemplate("{{yield}}", {
284
286
  *
285
287
  * Reload and refresh are available as methods on the `content` state.
286
288
  *
287
- * ```gjs
289
+ * ```gts
288
290
  * import { Request } from '@warp-drive-mirror/ember';
289
291
  *
290
292
  * <template>
@@ -308,7 +310,7 @@ const DefaultChrome = setComponentTemplate(precompileTemplate("{{yield}}", {
308
310
  * We can nest our usage of `<Request />` to handle more advanced
309
311
  * reloading scenarios.
310
312
  *
311
- * ```gjs
313
+ * ```gts
312
314
  * import { Request } from '@warp-drive-mirror/ember';
313
315
  *
314
316
  * <template>
@@ -370,7 +372,7 @@ const DefaultChrome = setComponentTemplate(precompileTemplate("{{yield}}", {
370
372
  * timer or on a websocket subscription.
371
373
  *
372
374
  *
373
- * ```gjs
375
+ * ```gts
374
376
  * import { Request } from '@warp-drive-mirror/ember';
375
377
  *
376
378
  * <template>
@@ -394,7 +396,7 @@ const DefaultChrome = setComponentTemplate(precompileTemplate("{{yield}}", {
394
396
  * from multiple `<Request />` components, even if the request is not referentially the
395
397
  * same, only one actual request will be made.
396
398
  *
397
- *
399
+ * @category Components
398
400
  * @public
399
401
  */
400
402
  class Request extends Component {
@@ -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 {};