@rool-dev/svelte 0.2.0 → 0.3.0-dev.381ac43
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.
- package/README.md +167 -54
- package/dist/channel.svelte.d.ts +144 -0
- package/dist/channel.svelte.d.ts.map +1 -0
- package/dist/channel.svelte.js +354 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/rool.svelte.d.ts +36 -16
- package/dist/rool.svelte.d.ts.map +1 -1
- package/dist/rool.svelte.js +58 -28
- package/package.json +2 -2
- package/dist/space.svelte.d.ts +0 -144
- package/dist/space.svelte.d.ts.map +0 -1
- package/dist/space.svelte.js +0 -311
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ npm install @rool-dev/svelte
|
|
|
19
19
|
const rool = createRool();
|
|
20
20
|
rool.init();
|
|
21
21
|
|
|
22
|
-
let
|
|
22
|
+
let channel = $state(null);
|
|
23
23
|
</script>
|
|
24
24
|
|
|
25
25
|
{#if !rool.authenticated}
|
|
@@ -27,13 +27,13 @@ npm install @rool-dev/svelte
|
|
|
27
27
|
{:else}
|
|
28
28
|
<h1>My Spaces</h1>
|
|
29
29
|
{#each rool.spaces ?? [] as space}
|
|
30
|
-
<button onclick={async () =>
|
|
30
|
+
<button onclick={async () => channel = await rool.openChannel(space.id, 'main')}>
|
|
31
31
|
{space.name}
|
|
32
32
|
</button>
|
|
33
33
|
{/each}
|
|
34
34
|
|
|
35
|
-
{#if
|
|
36
|
-
<p>Interactions: {
|
|
35
|
+
{#if channel}
|
|
36
|
+
<p>Interactions: {channel.interactions.length}</p>
|
|
37
37
|
{/if}
|
|
38
38
|
{/if}
|
|
39
39
|
```
|
|
@@ -50,9 +50,10 @@ The Svelte wrapper adds reactive state on top of the SDK:
|
|
|
50
50
|
| `rool.spacesError` | Error from loading spaces |
|
|
51
51
|
| `rool.connectionState` | SSE connection state |
|
|
52
52
|
| `rool.userStorage` | User storage (cross-device preferences) |
|
|
53
|
-
| `
|
|
54
|
-
| `
|
|
55
|
-
| `
|
|
53
|
+
| `channel.interactions` | Channel interactions (auto-updates) |
|
|
54
|
+
| `channel.objectIds` | All object IDs in the space (auto-updates on create/delete) |
|
|
55
|
+
| `watch.objects` | Objects matching a filter (auto-updates) |
|
|
56
|
+
| `watch.loading` | Whether watch is loading |
|
|
56
57
|
|
|
57
58
|
Everything else passes through to the SDK directly. See the [SDK documentation](../sdk/README.md) for full API details.
|
|
58
59
|
|
|
@@ -65,7 +66,7 @@ const rool = createRool();
|
|
|
65
66
|
|
|
66
67
|
rool.init(); // Process auth callbacks (call on app startup)
|
|
67
68
|
rool.login('My App'); // Redirect to login page
|
|
68
|
-
rool.logout(); // Clear auth state and close all
|
|
69
|
+
rool.logout(); // Clear auth state and close all channels
|
|
69
70
|
rool.destroy(); // Clean up all resources
|
|
70
71
|
```
|
|
71
72
|
|
|
@@ -118,60 +119,108 @@ Reactive cross-device storage for user preferences. Synced from server on `init(
|
|
|
118
119
|
</button>
|
|
119
120
|
```
|
|
120
121
|
|
|
121
|
-
###
|
|
122
|
+
### Spaces & Channels
|
|
122
123
|
|
|
123
124
|
```typescript
|
|
124
|
-
|
|
125
|
-
const
|
|
125
|
+
// Open a channel — reactive, with SSE
|
|
126
|
+
const channel = await rool.openChannel('space-id', 'my-channel');
|
|
127
|
+
|
|
128
|
+
// Create a space, then open a channel on it
|
|
126
129
|
const space = await rool.createSpace('My New Space');
|
|
130
|
+
const channel = await space.openChannel('main');
|
|
131
|
+
|
|
132
|
+
// Open a space for admin operations (lightweight, no SSE)
|
|
133
|
+
const space = await rool.openSpace('space-id');
|
|
134
|
+
await space.rename('New Name');
|
|
135
|
+
await space.addUser(userId, 'editor');
|
|
127
136
|
|
|
128
|
-
//
|
|
129
|
-
|
|
130
|
-
|
|
137
|
+
// Delete a space
|
|
138
|
+
await rool.deleteSpace('space-id');
|
|
139
|
+
|
|
140
|
+
// Import a space from a zip archive
|
|
141
|
+
const space = await rool.importArchive('Imported', archiveBlob);
|
|
131
142
|
|
|
132
143
|
// Clean up
|
|
133
|
-
|
|
144
|
+
channel.close();
|
|
134
145
|
```
|
|
135
146
|
|
|
136
|
-
###
|
|
147
|
+
### ReactiveChannel
|
|
137
148
|
|
|
138
|
-
`
|
|
149
|
+
`openChannel` returns a `ReactiveChannel` — the SDK's `RoolChannel` with reactive `interactions` and `objectIds`:
|
|
139
150
|
|
|
140
151
|
```svelte
|
|
141
152
|
<script>
|
|
142
|
-
let
|
|
153
|
+
let channel = $state(null);
|
|
143
154
|
|
|
144
|
-
async function open(
|
|
145
|
-
|
|
155
|
+
async function open(spaceId) {
|
|
156
|
+
channel = await rool.openChannel(spaceId, 'main');
|
|
146
157
|
}
|
|
147
158
|
</script>
|
|
148
159
|
|
|
149
|
-
{#if
|
|
160
|
+
{#if channel}
|
|
150
161
|
<!-- Reactive: updates as AI makes tool calls -->
|
|
151
|
-
{#each
|
|
162
|
+
{#each channel.interactions as interaction}
|
|
152
163
|
<div>
|
|
153
164
|
<strong>{interaction.operation}</strong>: {interaction.output}
|
|
154
165
|
</div>
|
|
155
166
|
{/each}
|
|
156
167
|
|
|
157
168
|
<!-- All SDK methods work directly -->
|
|
158
|
-
<button onclick={() =>
|
|
169
|
+
<button onclick={() => channel.prompt('Hello')}>Send</button>
|
|
159
170
|
{/if}
|
|
160
171
|
```
|
|
161
172
|
|
|
162
|
-
### Reactive
|
|
173
|
+
### Reactive Object
|
|
163
174
|
|
|
164
|
-
|
|
175
|
+
Track a single object by ID with auto-updates:
|
|
165
176
|
|
|
166
177
|
```svelte
|
|
167
178
|
<script>
|
|
168
|
-
let
|
|
179
|
+
let channel = $state(null);
|
|
180
|
+
let item = $state(null);
|
|
181
|
+
|
|
182
|
+
async function open(spaceId, objectId) {
|
|
183
|
+
channel = await rool.openChannel(spaceId, 'main');
|
|
184
|
+
item = channel.object(objectId);
|
|
185
|
+
}
|
|
186
|
+
</script>
|
|
187
|
+
|
|
188
|
+
{#if item}
|
|
189
|
+
{#if item.loading}
|
|
190
|
+
<p>Loading...</p>
|
|
191
|
+
{:else if item.data}
|
|
192
|
+
<div>{item.data.title}</div>
|
|
193
|
+
{:else}
|
|
194
|
+
<p>Object not found</p>
|
|
195
|
+
{/if}
|
|
196
|
+
{/if}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
```typescript
|
|
200
|
+
// Reactive state
|
|
201
|
+
item.data // $state<RoolObject | undefined>
|
|
202
|
+
item.loading // $state<boolean>
|
|
203
|
+
|
|
204
|
+
// Methods
|
|
205
|
+
item.refresh() // Manual re-fetch
|
|
206
|
+
item.close() // Stop listening for updates
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
**Lifecycle:** Reactive objects are tied to their channel. Closing the channel stops all updates — existing reactive objects will retain their last data but no longer refresh. Calling `channel.object()` after `close()` throws.
|
|
210
|
+
|
|
211
|
+
### Reactive Watches
|
|
212
|
+
|
|
213
|
+
Create auto-updating watches of objects filtered by field values:
|
|
214
|
+
|
|
215
|
+
```svelte
|
|
216
|
+
<script>
|
|
217
|
+
let channel = $state(null);
|
|
169
218
|
let articles = $state(null);
|
|
170
219
|
|
|
171
|
-
async function open(
|
|
172
|
-
|
|
173
|
-
// Create a reactive
|
|
174
|
-
articles =
|
|
220
|
+
async function open(spaceId) {
|
|
221
|
+
channel = await rool.openChannel(spaceId, 'main');
|
|
222
|
+
// Create a reactive watch of all objects where type === 'article'
|
|
223
|
+
articles = channel.watch({ where: { type: 'article' } });
|
|
175
224
|
}
|
|
176
225
|
</script>
|
|
177
226
|
|
|
@@ -186,11 +235,13 @@ Create auto-updating collections of objects filtered by field values:
|
|
|
186
235
|
{/if}
|
|
187
236
|
```
|
|
188
237
|
|
|
189
|
-
|
|
238
|
+
Watches automatically re-fetch when objects matching the filter are created, updated, or deleted. Since the SDK caches objects locally, re-fetches are typically instant (no network round-trip).
|
|
239
|
+
|
|
240
|
+
**Lifecycle:** Watches are tied to their channel. Closing the channel stops all updates — existing watches will retain their last data but no longer refresh. Calling `channel.watch()` after `close()` throws.
|
|
190
241
|
|
|
191
242
|
```typescript
|
|
192
|
-
//
|
|
193
|
-
const articles =
|
|
243
|
+
// Watch options (same as findObjects, but no AI prompt)
|
|
244
|
+
const articles = channel.watch({
|
|
194
245
|
where: { type: 'article', status: 'published' },
|
|
195
246
|
order: 'desc', // by modifiedAt (default)
|
|
196
247
|
limit: 20,
|
|
@@ -205,36 +256,92 @@ articles.refresh() // Manual re-fetch
|
|
|
205
256
|
articles.close() // Stop listening for updates
|
|
206
257
|
```
|
|
207
258
|
|
|
259
|
+
### Reactive Channel List
|
|
260
|
+
|
|
261
|
+
List channels for a space with auto-updates:
|
|
262
|
+
|
|
263
|
+
```svelte
|
|
264
|
+
<script>
|
|
265
|
+
const channelList = rool.channels('space-id');
|
|
266
|
+
|
|
267
|
+
// Clean up when done
|
|
268
|
+
import { onDestroy } from 'svelte';
|
|
269
|
+
onDestroy(() => channelList.close());
|
|
270
|
+
</script>
|
|
271
|
+
|
|
272
|
+
{#if channelList.loading}
|
|
273
|
+
<p>Loading channels...</p>
|
|
274
|
+
{:else}
|
|
275
|
+
{#each channelList.list as ch}
|
|
276
|
+
<button onclick={() => openChannel(ch.id)}>{ch.name ?? ch.id}</button>
|
|
277
|
+
{/each}
|
|
278
|
+
{/if}
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
```typescript
|
|
282
|
+
// Reactive state
|
|
283
|
+
channelList.list // $state<ChannelInfo[]>
|
|
284
|
+
channelList.loading // $state<boolean>
|
|
285
|
+
|
|
286
|
+
// Methods
|
|
287
|
+
channelList.refresh() // Manual re-fetch
|
|
288
|
+
channelList.close() // Stop listening for updates
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### Channel Management
|
|
292
|
+
|
|
293
|
+
```typescript
|
|
294
|
+
// Rename a channel (thin GraphQL call, no SSE needed)
|
|
295
|
+
await rool.renameChannel('space-id', 'channel-id', 'New Name');
|
|
296
|
+
|
|
297
|
+
// Delete a channel
|
|
298
|
+
await rool.deleteChannel('space-id', 'channel-id');
|
|
299
|
+
|
|
300
|
+
// Rename from within a channel
|
|
301
|
+
await channel.rename('New Name');
|
|
302
|
+
```
|
|
303
|
+
|
|
208
304
|
### Using the SDK
|
|
209
305
|
|
|
210
|
-
All `
|
|
306
|
+
All `RoolChannel` methods and properties are available on `ReactiveChannel`:
|
|
211
307
|
|
|
212
308
|
```typescript
|
|
213
309
|
// Properties
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
310
|
+
channel.id
|
|
311
|
+
channel.name
|
|
312
|
+
channel.role
|
|
313
|
+
channel.channelId
|
|
218
314
|
|
|
219
315
|
// Object operations
|
|
220
|
-
await
|
|
221
|
-
await
|
|
222
|
-
await
|
|
223
|
-
await
|
|
224
|
-
await
|
|
316
|
+
await channel.getObject(id)
|
|
317
|
+
await channel.createObject({ data: { type: 'note', text: 'Hello' } })
|
|
318
|
+
await channel.updateObject(id, { data: { text: 'Updated' } })
|
|
319
|
+
await channel.deleteObjects([id])
|
|
320
|
+
await channel.findObjects({ where: { type: 'note' } })
|
|
225
321
|
|
|
226
322
|
// AI
|
|
227
|
-
await
|
|
323
|
+
await channel.prompt('Summarize everything')
|
|
324
|
+
|
|
325
|
+
// Schema
|
|
326
|
+
channel.getSchema()
|
|
327
|
+
await channel.createCollection('article', [
|
|
328
|
+
{ name: 'title', type: { kind: 'string' } },
|
|
329
|
+
{ name: 'status', type: { kind: 'enum', values: ['draft', 'published'] } },
|
|
330
|
+
])
|
|
331
|
+
await channel.alterCollection('article', [...updatedProps])
|
|
332
|
+
await channel.dropCollection('article')
|
|
228
333
|
|
|
229
334
|
// Undo/Redo
|
|
230
|
-
await
|
|
231
|
-
await
|
|
232
|
-
await
|
|
233
|
-
|
|
234
|
-
//
|
|
235
|
-
await
|
|
236
|
-
|
|
237
|
-
|
|
335
|
+
await channel.checkpoint('Before edit')
|
|
336
|
+
await channel.undo()
|
|
337
|
+
await channel.redo()
|
|
338
|
+
|
|
339
|
+
// Interaction history
|
|
340
|
+
await channel.setSystemInstruction('You are helpful')
|
|
341
|
+
channel.getInteractions()
|
|
342
|
+
|
|
343
|
+
// Channel admin
|
|
344
|
+
await channel.rename('New Name')
|
|
238
345
|
```
|
|
239
346
|
|
|
240
347
|
See the [SDK documentation](../sdk/README.md) for complete API details.
|
|
@@ -252,21 +359,27 @@ const id = generateId();
|
|
|
252
359
|
|
|
253
360
|
```typescript
|
|
254
361
|
// Package types
|
|
255
|
-
import type { Rool,
|
|
362
|
+
import type { Rool, ReactiveChannel, ReactiveObject, ReactiveWatch, WatchOptions, ReactiveChannelList } from '@rool-dev/svelte';
|
|
256
363
|
|
|
257
364
|
// Re-exported from @rool-dev/sdk
|
|
258
365
|
import type {
|
|
366
|
+
RoolChannel,
|
|
259
367
|
RoolSpace,
|
|
260
368
|
RoolSpaceInfo,
|
|
261
369
|
RoolObject,
|
|
370
|
+
RoolObjectStat,
|
|
262
371
|
RoolUserRole,
|
|
263
372
|
ConnectionState,
|
|
264
|
-
|
|
373
|
+
ChannelInfo,
|
|
265
374
|
Interaction,
|
|
266
375
|
FindObjectsOptions,
|
|
267
376
|
PromptOptions,
|
|
268
377
|
CreateObjectOptions,
|
|
269
378
|
UpdateObjectOptions,
|
|
379
|
+
FieldType,
|
|
380
|
+
FieldDef,
|
|
381
|
+
CollectionDef,
|
|
382
|
+
SpaceSchema,
|
|
270
383
|
} from '@rool-dev/svelte';
|
|
271
384
|
```
|
|
272
385
|
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import type { RoolChannel, RoolClient, Interaction, RoolObject, ChannelInfo } from '@rool-dev/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Options for creating a reactive watch.
|
|
4
|
+
* Same as FindObjectsOptions but without `prompt` (AI queries are too slow for reactive updates).
|
|
5
|
+
*/
|
|
6
|
+
export interface WatchOptions {
|
|
7
|
+
/** Field requirements for exact matching */
|
|
8
|
+
where?: Record<string, unknown>;
|
|
9
|
+
/** Maximum number of objects */
|
|
10
|
+
limit?: number;
|
|
11
|
+
/** Sort order by modifiedAt: 'asc' or 'desc' (default: 'desc') */
|
|
12
|
+
order?: 'asc' | 'desc';
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A reactive watch of objects that auto-updates when matching objects change.
|
|
16
|
+
*/
|
|
17
|
+
declare class ReactiveWatchImpl {
|
|
18
|
+
#private;
|
|
19
|
+
objects: RoolObject[];
|
|
20
|
+
loading: boolean;
|
|
21
|
+
constructor(channel: RoolChannel, options: WatchOptions);
|
|
22
|
+
/**
|
|
23
|
+
* Re-fetch the watched objects from the channel.
|
|
24
|
+
*/
|
|
25
|
+
refresh(): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Stop listening for updates and clean up.
|
|
28
|
+
*/
|
|
29
|
+
close(): void;
|
|
30
|
+
}
|
|
31
|
+
export type ReactiveWatch = ReactiveWatchImpl;
|
|
32
|
+
/**
|
|
33
|
+
* A reactive single object that auto-updates when the object changes.
|
|
34
|
+
*/
|
|
35
|
+
declare class ReactiveObjectImpl {
|
|
36
|
+
#private;
|
|
37
|
+
data: RoolObject | undefined;
|
|
38
|
+
loading: boolean;
|
|
39
|
+
constructor(channel: RoolChannel, objectId: string);
|
|
40
|
+
/**
|
|
41
|
+
* Re-fetch the object from the channel.
|
|
42
|
+
*/
|
|
43
|
+
refresh(): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Stop listening for updates and clean up.
|
|
46
|
+
*/
|
|
47
|
+
close(): void;
|
|
48
|
+
}
|
|
49
|
+
export type ReactiveObject = ReactiveObjectImpl;
|
|
50
|
+
/**
|
|
51
|
+
* Minimal wrapper that adds reactive `interactions` to RoolChannel.
|
|
52
|
+
* All other properties and methods are proxied to the underlying channel.
|
|
53
|
+
*/
|
|
54
|
+
declare class ReactiveChannelImpl {
|
|
55
|
+
#private;
|
|
56
|
+
interactions: Interaction[];
|
|
57
|
+
objectIds: string[];
|
|
58
|
+
constructor(channel: RoolChannel);
|
|
59
|
+
get id(): string;
|
|
60
|
+
get name(): string;
|
|
61
|
+
get role(): import("@rool-dev/sdk").RoolUserRole;
|
|
62
|
+
get userId(): string;
|
|
63
|
+
get channelId(): string;
|
|
64
|
+
get isReadOnly(): boolean;
|
|
65
|
+
get linkAccess(): import("@rool-dev/sdk").LinkAccess;
|
|
66
|
+
close(): void;
|
|
67
|
+
getObject(...args: Parameters<RoolChannel['getObject']>): Promise<RoolObject | undefined>;
|
|
68
|
+
stat(...args: Parameters<RoolChannel['stat']>): import("@rool-dev/sdk").RoolObjectStat | undefined;
|
|
69
|
+
findObjects(...args: Parameters<RoolChannel['findObjects']>): Promise<{
|
|
70
|
+
objects: RoolObject[];
|
|
71
|
+
message: string;
|
|
72
|
+
}>;
|
|
73
|
+
getObjectIds(...args: Parameters<RoolChannel['getObjectIds']>): string[];
|
|
74
|
+
createObject(...args: Parameters<RoolChannel['createObject']>): Promise<{
|
|
75
|
+
object: RoolObject;
|
|
76
|
+
message: string;
|
|
77
|
+
}>;
|
|
78
|
+
updateObject(...args: Parameters<RoolChannel['updateObject']>): Promise<{
|
|
79
|
+
object: RoolObject;
|
|
80
|
+
message: string;
|
|
81
|
+
}>;
|
|
82
|
+
deleteObjects(...args: Parameters<RoolChannel['deleteObjects']>): Promise<void>;
|
|
83
|
+
prompt(...args: Parameters<RoolChannel['prompt']>): Promise<{
|
|
84
|
+
message: string;
|
|
85
|
+
objects: RoolObject[];
|
|
86
|
+
}>;
|
|
87
|
+
checkpoint(...args: Parameters<RoolChannel['checkpoint']>): Promise<string>;
|
|
88
|
+
canUndo(): Promise<boolean>;
|
|
89
|
+
canRedo(): Promise<boolean>;
|
|
90
|
+
undo(): Promise<boolean>;
|
|
91
|
+
redo(): Promise<boolean>;
|
|
92
|
+
clearHistory(): Promise<void>;
|
|
93
|
+
setMetadata(...args: Parameters<RoolChannel['setMetadata']>): void;
|
|
94
|
+
getMetadata(...args: Parameters<RoolChannel['getMetadata']>): unknown;
|
|
95
|
+
getAllMetadata(): Record<string, unknown>;
|
|
96
|
+
getInteractions(): Interaction[];
|
|
97
|
+
getSystemInstruction(): string | undefined;
|
|
98
|
+
setSystemInstruction(...args: Parameters<RoolChannel['setSystemInstruction']>): Promise<void>;
|
|
99
|
+
getSchema(): import("@rool-dev/sdk").SpaceSchema;
|
|
100
|
+
createCollection(...args: Parameters<RoolChannel['createCollection']>): Promise<import("@rool-dev/sdk").CollectionDef>;
|
|
101
|
+
alterCollection(...args: Parameters<RoolChannel['alterCollection']>): Promise<import("@rool-dev/sdk").CollectionDef>;
|
|
102
|
+
dropCollection(...args: Parameters<RoolChannel['dropCollection']>): Promise<void>;
|
|
103
|
+
uploadMedia(...args: Parameters<RoolChannel['uploadMedia']>): Promise<string>;
|
|
104
|
+
fetchMedia(...args: Parameters<RoolChannel['fetchMedia']>): Promise<import("@rool-dev/sdk").MediaResponse>;
|
|
105
|
+
deleteMedia(...args: Parameters<RoolChannel['deleteMedia']>): Promise<void>;
|
|
106
|
+
listMedia(): Promise<import("@rool-dev/sdk").MediaInfo[]>;
|
|
107
|
+
rename(...args: Parameters<RoolChannel['rename']>): Promise<void>;
|
|
108
|
+
on(...args: Parameters<RoolChannel['on']>): () => void;
|
|
109
|
+
off(...args: Parameters<RoolChannel['off']>): void;
|
|
110
|
+
/**
|
|
111
|
+
* Create a reactive object that auto-updates when the object changes.
|
|
112
|
+
* Throws if the channel has been closed.
|
|
113
|
+
*/
|
|
114
|
+
object(objectId: string): ReactiveObject;
|
|
115
|
+
/**
|
|
116
|
+
* Create a reactive watch that auto-updates when matching objects change.
|
|
117
|
+
* Throws if the channel has been closed.
|
|
118
|
+
*/
|
|
119
|
+
watch(options: WatchOptions): ReactiveWatch;
|
|
120
|
+
}
|
|
121
|
+
export declare function wrapChannel(channel: RoolChannel): ReactiveChannel;
|
|
122
|
+
export type ReactiveChannel = ReactiveChannelImpl;
|
|
123
|
+
/**
|
|
124
|
+
* A reactive list of channels for a space that auto-updates via SSE events.
|
|
125
|
+
*/
|
|
126
|
+
declare class ReactiveChannelListImpl {
|
|
127
|
+
#private;
|
|
128
|
+
list: ChannelInfo[];
|
|
129
|
+
loading: boolean;
|
|
130
|
+
constructor(client: RoolClient, spaceId: string);
|
|
131
|
+
/**
|
|
132
|
+
* Re-fetch the channel list from the server.
|
|
133
|
+
* Opens a lightweight space handle to get the channel list.
|
|
134
|
+
*/
|
|
135
|
+
refresh(): Promise<void>;
|
|
136
|
+
/**
|
|
137
|
+
* Stop listening for updates and clean up.
|
|
138
|
+
*/
|
|
139
|
+
close(): void;
|
|
140
|
+
}
|
|
141
|
+
export declare function createChannelList(client: RoolClient, spaceId: string): ReactiveChannelList;
|
|
142
|
+
export type ReactiveChannelList = ReactiveChannelListImpl;
|
|
143
|
+
export {};
|
|
144
|
+
//# sourceMappingURL=channel.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel.svelte.d.ts","sourceRoot":"","sources":["../src/channel.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAsB,WAAW,EAAE,MAAM,eAAe,CAAC;AAEvH;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CACxB;AAGD;;GAEG;AACH,cAAM,iBAAiB;;IAOrB,OAAO,eAA4B;IACnC,OAAO,UAAgB;gBAEX,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY;IAqEvD;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAiB9B;;OAEG;IACH,KAAK,IAAI,IAAI;CAId;AAED,MAAM,MAAM,a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