@fidscript/instant-solidjs 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/.tshy/build.json +8 -0
  2. package/.tshy/commonjs.json +16 -0
  3. package/.tshy/esm.json +15 -0
  4. package/dist/commonjs/InstantSolidDatabase.d.ts +185 -0
  5. package/dist/commonjs/InstantSolidDatabase.d.ts.map +1 -0
  6. package/dist/commonjs/InstantSolidDatabase.js +329 -0
  7. package/dist/commonjs/InstantSolidDatabase.js.map +1 -0
  8. package/dist/commonjs/InstantSolidRoom.d.ts +97 -0
  9. package/dist/commonjs/InstantSolidRoom.d.ts.map +1 -0
  10. package/dist/commonjs/InstantSolidRoom.js +209 -0
  11. package/dist/commonjs/InstantSolidRoom.js.map +1 -0
  12. package/dist/commonjs/index.d.ts +6 -0
  13. package/dist/commonjs/index.d.ts.map +1 -0
  14. package/dist/commonjs/index.js +23 -0
  15. package/dist/commonjs/index.js.map +1 -0
  16. package/dist/commonjs/package.json +3 -0
  17. package/dist/commonjs/version.d.ts +3 -0
  18. package/dist/commonjs/version.d.ts.map +1 -0
  19. package/dist/commonjs/version.js +5 -0
  20. package/dist/commonjs/version.js.map +1 -0
  21. package/dist/esm/InstantSolidDatabase.d.ts +185 -0
  22. package/dist/esm/InstantSolidDatabase.d.ts.map +1 -0
  23. package/dist/esm/InstantSolidDatabase.js +321 -0
  24. package/dist/esm/InstantSolidDatabase.js.map +1 -0
  25. package/dist/esm/InstantSolidRoom.d.ts +97 -0
  26. package/dist/esm/InstantSolidRoom.d.ts.map +1 -0
  27. package/dist/esm/InstantSolidRoom.js +200 -0
  28. package/dist/esm/InstantSolidRoom.js.map +1 -0
  29. package/dist/esm/index.d.ts +6 -0
  30. package/dist/esm/index.d.ts.map +1 -0
  31. package/dist/esm/index.js +18 -0
  32. package/dist/esm/index.js.map +1 -0
  33. package/dist/esm/package.json +3 -0
  34. package/dist/esm/version.d.ts +3 -0
  35. package/dist/esm/version.d.ts.map +1 -0
  36. package/dist/esm/version.js +3 -0
  37. package/dist/esm/version.js.map +1 -0
  38. package/package.json +47 -0
  39. package/src/InstantSolidDatabase.ts +463 -0
  40. package/src/InstantSolidRoom.ts +330 -0
  41. package/src/index.ts +204 -0
  42. package/src/version.ts +2 -0
  43. package/tsconfig.json +45 -0
@@ -0,0 +1,97 @@
1
+ import { type PresenceOpts, type PresenceResponse, type RoomSchemaShape, InstantCoreDatabase, InstantSchemaDef } from '@fidscript/instant-sdk';
2
+ import type { Accessor } from 'solid-js';
3
+ export type PresenceHandle<PresenceShape, Keys extends keyof PresenceShape> = PresenceResponse<PresenceShape, Keys> & {
4
+ publishPresence: (data: Partial<PresenceShape>) => void;
5
+ };
6
+ export type TypingIndicatorOpts = {
7
+ timeout?: number | null;
8
+ stopOnEnter?: boolean;
9
+ writeOnly?: boolean;
10
+ };
11
+ export type TypingIndicatorHandle<PresenceShape> = {
12
+ active: Accessor<PresenceShape[]>;
13
+ setActive(active: boolean): void;
14
+ inputProps: {
15
+ onKeyDown: (e: KeyboardEvent) => void;
16
+ onBlur: () => void;
17
+ };
18
+ };
19
+ export declare const defaultActivityStopTimeout = 1000;
20
+ /**
21
+ * Listen for broadcasted events given a room and topic.
22
+ *
23
+ * @see https://instantdb.com/docs/presence-and-topics
24
+ * @example
25
+ * function App({ roomId }) {
26
+ * const room = db.room('chats', roomId);
27
+ * db.rooms.useTopicEffect(room, 'emoji', (message, peer) => {
28
+ * console.log(peer.name, 'sent', message);
29
+ * });
30
+ * // ...
31
+ * }
32
+ */
33
+ export declare function useTopicEffect<RoomSchema extends RoomSchemaShape, RoomType extends keyof RoomSchema, TopicType extends keyof RoomSchema[RoomType]['topics']>(room: InstantSolidRoom<any, RoomSchema, RoomType>, topic: TopicType, onEvent: (event: RoomSchema[RoomType]['topics'][TopicType], peer: RoomSchema[RoomType]['presence']) => any): void;
34
+ /**
35
+ * Broadcast an event to a room.
36
+ *
37
+ * @see https://instantdb.com/docs/presence-and-topics
38
+ * @example
39
+ * function App({ roomId }) {
40
+ * const room = db.room('chat', roomId);
41
+ * const publishTopic = db.rooms.usePublishTopic(room, "emoji");
42
+ *
43
+ * return (
44
+ * <button onClick={() => publishTopic({ emoji: "🔥" })}>Send emoji</button>
45
+ * );
46
+ * }
47
+ *
48
+ */
49
+ export declare function usePublishTopic<RoomSchema extends RoomSchemaShape, RoomType extends keyof RoomSchema, TopicType extends keyof RoomSchema[RoomType]['topics']>(room: InstantSolidRoom<any, RoomSchema, RoomType>, topic: TopicType): (data: RoomSchema[RoomType]['topics'][TopicType]) => void;
50
+ /**
51
+ * Listen for peer's presence data in a room, and publish the current user's presence.
52
+ *
53
+ * @see https://instantdb.com/docs/presence-and-topics
54
+ * @example
55
+ * function App({ roomId }) {
56
+ * const presence = db.rooms.usePresence(room, { keys: ["name", "avatar"] });
57
+ * // presence().peers, presence().isLoading, presence().publishPresence
58
+ * }
59
+ */
60
+ export declare function usePresence<RoomSchema extends RoomSchemaShape, RoomType extends keyof RoomSchema, Keys extends keyof RoomSchema[RoomType]['presence']>(room: InstantSolidRoom<any, RoomSchema, RoomType>, opts?: PresenceOpts<RoomSchema[RoomType]['presence'], Keys>): Accessor<PresenceHandle<RoomSchema[RoomType]['presence'], Keys>>;
61
+ /**
62
+ * Publishes presence data to a room
63
+ *
64
+ * @see https://instantdb.com/docs/presence-and-topics
65
+ * @example
66
+ * function App({ roomId, nickname }) {
67
+ * const room = db.room('chat', roomId);
68
+ * db.rooms.useSyncPresence(room, { nickname });
69
+ * }
70
+ */
71
+ export declare function useSyncPresence<RoomSchema extends RoomSchemaShape, RoomType extends keyof RoomSchema>(room: InstantSolidRoom<any, RoomSchema, RoomType>, data: Partial<RoomSchema[RoomType]['presence']>, deps?: any[]): void;
72
+ /**
73
+ * Manage typing indicator state
74
+ *
75
+ * @see https://instantdb.com/docs/presence-and-topics
76
+ * @example
77
+ * function App({ roomId }) {
78
+ * const room = db.room('chat', roomId);
79
+ * const typing = db.rooms.useTypingIndicator(room, "chat-input");
80
+ * // typing.active(), typing.setActive(bool), typing.inputProps
81
+ * }
82
+ */
83
+ export declare function useTypingIndicator<RoomSchema extends RoomSchemaShape, RoomType extends keyof RoomSchema>(room: InstantSolidRoom<any, RoomSchema, RoomType>, inputName: string, opts?: TypingIndicatorOpts): TypingIndicatorHandle<RoomSchema[RoomType]['presence']>;
84
+ export declare const rooms: {
85
+ useTopicEffect: typeof useTopicEffect;
86
+ usePublishTopic: typeof usePublishTopic;
87
+ usePresence: typeof usePresence;
88
+ useSyncPresence: typeof useSyncPresence;
89
+ useTypingIndicator: typeof useTypingIndicator;
90
+ };
91
+ export declare class InstantSolidRoom<Schema extends InstantSchemaDef<any, any, any>, RoomSchema extends RoomSchemaShape, RoomType extends keyof RoomSchema> {
92
+ core: InstantCoreDatabase<Schema, boolean>;
93
+ type: RoomType;
94
+ id: string;
95
+ constructor(core: InstantCoreDatabase<Schema, boolean>, type: RoomType, id: string);
96
+ }
97
+ //# sourceMappingURL=InstantSolidRoom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InstantSolidRoom.d.ts","sourceRoot":"","sources":["../../src/InstantSolidRoom.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAKzC,MAAM,MAAM,cAAc,CACxB,aAAa,EACb,IAAI,SAAS,MAAM,aAAa,IAC9B,gBAAgB,CAAC,aAAa,EAAE,IAAI,CAAC,GAAG;IAC1C,eAAe,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;CACzD,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,WAAW,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I,EAAE,mBAAmB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,IAAI,EAAE,QAAQ,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;gBAGT,IAAI,EAAE,mBAAmB,CAAC,MAAM,EAAE,OAAO,CAAC,EAC1C,IAAI,EAAE,QAAQ,EACd,EAAE,EAAE,MAAM;CAMb"}
@@ -0,0 +1,209 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InstantSolidRoom = exports.rooms = exports.defaultActivityStopTimeout = void 0;
4
+ exports.useTopicEffect = useTopicEffect;
5
+ exports.usePublishTopic = usePublishTopic;
6
+ exports.usePresence = usePresence;
7
+ exports.useSyncPresence = useSyncPresence;
8
+ exports.useTypingIndicator = useTypingIndicator;
9
+ const solid_js_1 = require("solid-js");
10
+ exports.defaultActivityStopTimeout = 1_000;
11
+ // ------
12
+ // Topics
13
+ /**
14
+ * Listen for broadcasted events given a room and topic.
15
+ *
16
+ * @see https://instantdb.com/docs/presence-and-topics
17
+ * @example
18
+ * function App({ roomId }) {
19
+ * const room = db.room('chats', roomId);
20
+ * db.rooms.useTopicEffect(room, 'emoji', (message, peer) => {
21
+ * console.log(peer.name, 'sent', message);
22
+ * });
23
+ * // ...
24
+ * }
25
+ */
26
+ function useTopicEffect(room, topic, onEvent) {
27
+ (0, solid_js_1.createEffect)(() => {
28
+ const unsub = room.core._reactor.subscribeTopic(room.type, room.id, topic, (event, peer) => {
29
+ onEvent(event, peer);
30
+ });
31
+ (0, solid_js_1.onCleanup)(unsub);
32
+ });
33
+ }
34
+ /**
35
+ * Broadcast an event to a room.
36
+ *
37
+ * @see https://instantdb.com/docs/presence-and-topics
38
+ * @example
39
+ * function App({ roomId }) {
40
+ * const room = db.room('chat', roomId);
41
+ * const publishTopic = db.rooms.usePublishTopic(room, "emoji");
42
+ *
43
+ * return (
44
+ * <button onClick={() => publishTopic({ emoji: "🔥" })}>Send emoji</button>
45
+ * );
46
+ * }
47
+ *
48
+ */
49
+ function usePublishTopic(room, topic) {
50
+ (0, solid_js_1.createEffect)(() => {
51
+ const unsub = room.core._reactor.joinRoom(room.type, room.id);
52
+ (0, solid_js_1.onCleanup)(unsub);
53
+ });
54
+ return (data) => {
55
+ room.core._reactor.publishTopic({
56
+ roomType: room.type,
57
+ roomId: room.id,
58
+ topic,
59
+ data,
60
+ });
61
+ };
62
+ }
63
+ // ---------
64
+ // Presence
65
+ /**
66
+ * Listen for peer's presence data in a room, and publish the current user's presence.
67
+ *
68
+ * @see https://instantdb.com/docs/presence-and-topics
69
+ * @example
70
+ * function App({ roomId }) {
71
+ * const presence = db.rooms.usePresence(room, { keys: ["name", "avatar"] });
72
+ * // presence().peers, presence().isLoading, presence().publishPresence
73
+ * }
74
+ */
75
+ function usePresence(room, opts = {}) {
76
+ const [state, setState] = (0, solid_js_1.createSignal)((room.core._reactor.getPresence(room.type, room.id, opts) ?? {
77
+ peers: {},
78
+ isLoading: true,
79
+ }));
80
+ (0, solid_js_1.createEffect)(() => {
81
+ const unsub = room.core._reactor.subscribePresence(room.type, room.id, opts, (data) => {
82
+ setState(data);
83
+ });
84
+ (0, solid_js_1.onCleanup)(unsub);
85
+ });
86
+ const publishPresence = (data) => {
87
+ room.core._reactor.publishPresence(room.type, room.id, data);
88
+ };
89
+ return (0, solid_js_1.createMemo)(() => ({
90
+ ...state(),
91
+ publishPresence,
92
+ }));
93
+ }
94
+ /**
95
+ * Publishes presence data to a room
96
+ *
97
+ * @see https://instantdb.com/docs/presence-and-topics
98
+ * @example
99
+ * function App({ roomId, nickname }) {
100
+ * const room = db.room('chat', roomId);
101
+ * db.rooms.useSyncPresence(room, { nickname });
102
+ * }
103
+ */
104
+ function useSyncPresence(room, data, deps) {
105
+ (0, solid_js_1.createEffect)(() => {
106
+ const unsub = room.core._reactor.joinRoom(room.type, room.id, data);
107
+ (0, solid_js_1.onCleanup)(unsub);
108
+ });
109
+ (0, solid_js_1.createEffect)(() => {
110
+ // Track deps if provided, otherwise track serialized data
111
+ if (deps) {
112
+ deps.forEach((d) => (typeof d === 'function' ? d() : d));
113
+ }
114
+ else {
115
+ JSON.stringify(data);
116
+ }
117
+ room.core._reactor.publishPresence(room.type, room.id, data);
118
+ });
119
+ }
120
+ // -----------------
121
+ // Typing Indicator
122
+ /**
123
+ * Manage typing indicator state
124
+ *
125
+ * @see https://instantdb.com/docs/presence-and-topics
126
+ * @example
127
+ * function App({ roomId }) {
128
+ * const room = db.room('chat', roomId);
129
+ * const typing = db.rooms.useTypingIndicator(room, "chat-input");
130
+ * // typing.active(), typing.setActive(bool), typing.inputProps
131
+ * }
132
+ */
133
+ function useTypingIndicator(room, inputName, opts = {}) {
134
+ let timeoutId = null;
135
+ const presence = exports.rooms.usePresence(room, {
136
+ keys: [inputName],
137
+ });
138
+ const active = (0, solid_js_1.createMemo)(() => {
139
+ if (opts?.writeOnly)
140
+ return [];
141
+ // Access presence to track it
142
+ presence();
143
+ const presenceSnapshot = room.core._reactor.getPresence(room.type, room.id);
144
+ return Object.values(presenceSnapshot?.peers ?? {}).filter((p) => p[inputName] === true);
145
+ });
146
+ const setActive = (isActive) => {
147
+ room.core._reactor.publishPresence(room.type, room.id, {
148
+ [inputName]: isActive ? true : null,
149
+ });
150
+ if (timeoutId) {
151
+ clearTimeout(timeoutId);
152
+ timeoutId = null;
153
+ }
154
+ if (!isActive)
155
+ return;
156
+ if (opts?.timeout === null || opts?.timeout === 0)
157
+ return;
158
+ timeoutId = setTimeout(() => {
159
+ room.core._reactor.publishPresence(room.type, room.id, {
160
+ [inputName]: null,
161
+ });
162
+ }, opts?.timeout ?? exports.defaultActivityStopTimeout);
163
+ };
164
+ (0, solid_js_1.onCleanup)(() => {
165
+ if (timeoutId) {
166
+ clearTimeout(timeoutId);
167
+ timeoutId = null;
168
+ }
169
+ // Ensure we don't leave a sticky typing state behind on unmount,
170
+ // even when opts.timeout is null/0 (i.e. no auto-timeout).
171
+ setActive(false);
172
+ });
173
+ const onKeyDown = (e) => {
174
+ const isEnter = opts?.stopOnEnter && e.key === 'Enter';
175
+ const isActive = !isEnter;
176
+ setActive(isActive);
177
+ };
178
+ const onBlur = () => {
179
+ setActive(false);
180
+ };
181
+ return {
182
+ active,
183
+ setActive,
184
+ inputProps: { onKeyDown, onBlur },
185
+ };
186
+ }
187
+ // --------------
188
+ // Hooks namespace
189
+ exports.rooms = {
190
+ useTopicEffect,
191
+ usePublishTopic,
192
+ usePresence,
193
+ useSyncPresence,
194
+ useTypingIndicator,
195
+ };
196
+ // ------------
197
+ // Class
198
+ class InstantSolidRoom {
199
+ core;
200
+ type;
201
+ id;
202
+ constructor(core, type, id) {
203
+ this.core = core;
204
+ this.type = type;
205
+ this.id = id;
206
+ }
207
+ }
208
+ exports.InstantSolidRoom = InstantSolidRoom;
209
+ //# sourceMappingURL=InstantSolidRoom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InstantSolidRoom.js","sourceRoot":"","sources":["../../src/InstantSolidRoom.ts"],"names":[],"mappings":";;;AAuDA,wCAwBC;AAiBD,0CAqBC;AAeD,kCAsCC;AAYD,0CA0BC;AAgBD,gDAuEC;AA/RD,uCAA6E;AA6BhE,QAAA,0BAA0B,GAAG,KAAK,CAAC;AAEhD,SAAS;AACT,SAAS;AAET;;;;;;;;;;;;GAYG;AACH,SAAgB,cAAc,CAK5B,IAAiD,EACjD,KAAgB,EAChB,OAGQ;IAER,IAAA,uBAAY,EAAC,GAAG,EAAE;QAChB,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAC7C,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,EAAE,EACP,KAAK,EACL,CAAC,KAAU,EAAE,IAAS,EAAE,EAAE;YACxB,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACvB,CAAC,CACF,CAAC;QAEF,IAAA,oBAAS,EAAC,KAAK,CAAC,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;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D,4CAkBC","sourcesContent":["import {\n type PresenceOpts,\n type PresenceResponse,\n type RoomSchemaShape,\n InstantCoreDatabase,\n InstantSchemaDef,\n} from '@fidscript/instant-sdk';\n\nimport { createSignal, createEffect, onCleanup, createMemo } from 'solid-js';\nimport type { Accessor } from 'solid-js';\n\n// ------\n// Types\n\nexport type PresenceHandle<\n PresenceShape,\n Keys extends keyof PresenceShape,\n> = PresenceResponse<PresenceShape, Keys> & {\n publishPresence: (data: Partial<PresenceShape>) => void;\n};\n\nexport type TypingIndicatorOpts = {\n timeout?: number | null;\n stopOnEnter?: boolean;\n // Perf opt - `active` will always be an empty array\n writeOnly?: boolean;\n};\n\nexport type TypingIndicatorHandle<PresenceShape> = {\n active: Accessor<PresenceShape[]>;\n setActive(active: boolean): void;\n inputProps: {\n onKeyDown: (e: KeyboardEvent) => void;\n onBlur: () => void;\n };\n};\n\nexport const defaultActivityStopTimeout = 1_000;\n\n// ------\n// Topics\n\n/**\n * Listen for broadcasted events given a room and topic.\n *\n * @see https://instantdb.com/docs/presence-and-topics\n * @example\n * function App({ roomId }) {\n * const room = db.room('chats', roomId);\n * db.rooms.useTopicEffect(room, 'emoji', (message, peer) => {\n * console.log(peer.name, 'sent', message);\n * });\n * // ...\n * }\n */\nexport function useTopicEffect<\n RoomSchema extends RoomSchemaShape,\n RoomType extends keyof RoomSchema,\n TopicType extends keyof RoomSchema[RoomType]['topics'],\n>(\n room: InstantSolidRoom<any, RoomSchema, RoomType>,\n topic: TopicType,\n onEvent: (\n event: RoomSchema[RoomType]['topics'][TopicType],\n peer: RoomSchema[RoomType]['presence'],\n ) => any,\n): void {\n createEffect(() => {\n const unsub = room.core._reactor.subscribeTopic(\n room.type,\n room.id,\n topic,\n (event: any, peer: any) => {\n onEvent(event, peer);\n },\n );\n\n onCleanup(unsub);\n });\n}\n\n/**\n * Broadcast an event to a room.\n *\n * @see https://instantdb.com/docs/presence-and-topics\n * @example\n * function App({ roomId }) {\n * const room = db.room('chat', roomId);\n * const publishTopic = db.rooms.usePublishTopic(room, \"emoji\");\n *\n * return (\n * <button onClick={() => publishTopic({ emoji: \"🔥\" })}>Send emoji</button>\n * );\n * }\n *\n */\nexport function usePublishTopic<\n RoomSchema extends RoomSchemaShape,\n RoomType extends keyof RoomSchema,\n TopicType extends keyof RoomSchema[RoomType]['topics'],\n>(\n room: InstantSolidRoom<any, RoomSchema, RoomType>,\n topic: TopicType,\n): (data: RoomSchema[RoomType]['topics'][TopicType]) => void {\n createEffect(() => {\n const unsub = room.core._reactor.joinRoom(room.type as string, room.id);\n onCleanup(unsub);\n });\n\n return (data: RoomSchema[RoomType]['topics'][TopicType]) => {\n room.core._reactor.publishTopic({\n roomType: room.type,\n roomId: room.id,\n topic,\n data,\n });\n };\n}\n\n// ---------\n// Presence\n\n/**\n * Listen for peer's presence data in a room, and publish the current user's presence.\n *\n * @see https://instantdb.com/docs/presence-and-topics\n * @example\n * function App({ roomId }) {\n * const presence = db.rooms.usePresence(room, { keys: [\"name\", \"avatar\"] });\n * // presence().peers, presence().isLoading, presence().publishPresence\n * }\n */\nexport function usePresence<\n RoomSchema extends RoomSchemaShape,\n RoomType extends keyof RoomSchema,\n Keys extends keyof RoomSchema[RoomType]['presence'],\n>(\n room: InstantSolidRoom<any, RoomSchema, RoomType>,\n opts: PresenceOpts<RoomSchema[RoomType]['presence'], Keys> = {},\n): Accessor<PresenceHandle<RoomSchema[RoomType]['presence'], Keys>> {\n const [state, setState] = createSignal<\n PresenceResponse<RoomSchema[RoomType]['presence'], Keys>\n >(\n (room.core._reactor.getPresence(room.type, room.id, opts) ?? {\n peers: {},\n isLoading: true,\n }) as PresenceResponse<RoomSchema[RoomType]['presence'], Keys>,\n );\n\n createEffect(() => {\n const unsub = room.core._reactor.subscribePresence(\n room.type,\n room.id,\n opts,\n (data: any) => {\n setState(data);\n },\n );\n\n onCleanup(unsub);\n });\n\n const publishPresence = (data: Partial<RoomSchema[RoomType]['presence']>) => {\n room.core._reactor.publishPresence(room.type, room.id, data);\n };\n\n return createMemo(() => ({\n ...state(),\n publishPresence,\n }));\n}\n\n/**\n * Publishes presence data to a room\n *\n * @see https://instantdb.com/docs/presence-and-topics\n * @example\n * function App({ roomId, nickname }) {\n * const room = db.room('chat', roomId);\n * db.rooms.useSyncPresence(room, { nickname });\n * }\n */\nexport function useSyncPresence<\n RoomSchema extends RoomSchemaShape,\n RoomType extends keyof RoomSchema,\n>(\n room: InstantSolidRoom<any, RoomSchema, RoomType>,\n data: Partial<RoomSchema[RoomType]['presence']>,\n deps?: any[],\n): void {\n createEffect(() => {\n const unsub = room.core._reactor.joinRoom(\n room.type as string,\n room.id,\n data,\n );\n onCleanup(unsub);\n });\n\n createEffect(() => {\n // Track deps if provided, otherwise track serialized data\n if (deps) {\n deps.forEach((d) => (typeof d === 'function' ? d() : d));\n } else {\n JSON.stringify(data);\n }\n room.core._reactor.publishPresence(room.type, room.id, data);\n });\n}\n\n// -----------------\n// Typing Indicator\n\n/**\n * Manage typing indicator state\n *\n * @see https://instantdb.com/docs/presence-and-topics\n * @example\n * function App({ roomId }) {\n * const room = db.room('chat', roomId);\n * const typing = db.rooms.useTypingIndicator(room, \"chat-input\");\n * // typing.active(), typing.setActive(bool), typing.inputProps\n * }\n */\nexport function useTypingIndicator<\n RoomSchema extends RoomSchemaShape,\n RoomType extends keyof RoomSchema,\n>(\n room: InstantSolidRoom<any, RoomSchema, RoomType>,\n inputName: string,\n opts: TypingIndicatorOpts = {},\n): TypingIndicatorHandle<RoomSchema[RoomType]['presence']> {\n let timeoutId: ReturnType<typeof setTimeout> | null = null;\n\n const presence = rooms.usePresence(room, {\n keys: [inputName] as (keyof RoomSchema[RoomType]['presence'])[],\n });\n\n const active = createMemo(() => {\n if (opts?.writeOnly) return [];\n // Access presence to track it\n presence();\n const presenceSnapshot = room.core._reactor.getPresence(room.type, room.id);\n return Object.values(presenceSnapshot?.peers ?? {}).filter(\n (p: any) => p[inputName] === true,\n );\n });\n\n const setActive = (isActive: boolean) => {\n room.core._reactor.publishPresence(room.type, room.id, {\n [inputName]: isActive ? true : null,\n } as Partial<RoomSchema[RoomType]['presence']>);\n\n if (timeoutId) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n\n if (!isActive) return;\n\n if (opts?.timeout === null || opts?.timeout === 0) return;\n\n timeoutId = setTimeout(() => {\n room.core._reactor.publishPresence(room.type, room.id, {\n [inputName]: null,\n } as Partial<RoomSchema[RoomType]['presence']>);\n }, opts?.timeout ?? defaultActivityStopTimeout);\n };\n\n onCleanup(() => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n\n // Ensure we don't leave a sticky typing state behind on unmount,\n // even when opts.timeout is null/0 (i.e. no auto-timeout).\n setActive(false);\n });\n\n const onKeyDown = (e: KeyboardEvent) => {\n const isEnter = opts?.stopOnEnter && e.key === 'Enter';\n const isActive = !isEnter;\n setActive(isActive);\n };\n\n const onBlur = () => {\n setActive(false);\n };\n\n return {\n active,\n setActive,\n inputProps: { onKeyDown, onBlur },\n };\n}\n\n// --------------\n// Hooks namespace\n\nexport const rooms = {\n useTopicEffect,\n usePublishTopic,\n usePresence,\n useSyncPresence,\n useTypingIndicator,\n};\n\n// ------------\n// Class\n\nexport class InstantSolidRoom<\n Schema extends InstantSchemaDef<any, any, any>,\n RoomSchema extends RoomSchemaShape,\n RoomType extends keyof RoomSchema,\n> {\n core: InstantCoreDatabase<Schema, boolean>;\n type: RoomType;\n id: string;\n\n constructor(\n core: InstantCoreDatabase<Schema, boolean>,\n type: RoomType,\n id: string,\n ) {\n this.core = core;\n this.type = type;\n this.id = id;\n }\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import { id, tx, lookup, i, InstantAPIError, SyncTableCallbackEventType, type QueryResponse, type InstantQuery, type InstantQueryResult, type InstantSchema, type InstantObject, type InstantEntity, type InstantSchemaDatabase, type InstantUnknownSchemaDef, type IInstantDatabase, type User, type AuthState, type Query, type Config, type InstaQLParams, type ConnectionStatus, type ValidQuery, type PresencePeer, type AttrsDefs, type CardinalityKind, type DataAttrDef, type EntitiesDef, type EntitiesWithLinks, type EntityDef, type InstantGraph, type InstantConfig, type LinkAttrDef, type LinkDef, type LinksDef, type ResolveAttrs, type ValueTypes, type InstaQLEntity, type InstaQLFields, type InstaQLResult, type InstaQLEntitySubquery, type RoomsOf, type RoomsDef, type PresenceOf, type TopicsOf, type TopicOf, type RoomHandle, type TransactionChunk, type InstantUnknownSchema, type InstantSchemaDef, type BackwardsCompatibleSchema, type InstantRules, type UpdateParams, type LinkParams, type CreateParams, type CheckMagicCodeParams, type CheckMagicCodeResponse, type ExchangeCodeForTokenParams, type SendMagicCodeParams, type SendMagicCodeResponse, type SignInWithIdTokenParams, type VerifyMagicCodeParams, type VerifyResponse, type FileOpts, type UploadFileResponse, type DeleteFileResponse, type SyncTableCallback, type SyncTableCallbackEvent, type SyncTableInitialSyncBatch, type SyncTableInitialSyncComplete, type SyncTableSyncTransaction, type SyncTableLoadFromStorage, type SyncTableSetupError, StoreInterface, createInstantRouteHandler, type InstantRouteHandlerPayloadByType, type InstantRouteHandlerType, type InstantRouteHandlerBody, type StoreInterfaceStoreName, type Logger } from '@fidscript/instant-sdk';
2
+ import { InstantSolidDatabase } from './InstantSolidDatabase.js';
3
+ import { init } from './InstantSolidDatabase.js';
4
+ import { InstantSolidRoom } from './InstantSolidRoom.js';
5
+ export { id, tx, lookup, init, InstantSolidDatabase, InstantSolidRoom, i, InstantAPIError, SyncTableCallbackEventType, type Config, type InstantConfig, type InstantUnknownSchemaDef, type Query, type QueryResponse, type InstantObject, type User, type AuthState, type ConnectionStatus, type InstantQuery, type InstantQueryResult, type InstantSchema, type InstantEntity, type InstantSchemaDatabase, type IInstantDatabase, type InstaQLParams, type ValidQuery, type InstaQLFields, type PresencePeer, type AttrsDefs, type CardinalityKind, type DataAttrDef, type EntitiesDef, type EntitiesWithLinks, type EntityDef, type InstantGraph, type LinkAttrDef, type LinkDef, type LinksDef, type ResolveAttrs, type ValueTypes, type InstaQLEntity, type InstaQLResult, type InstaQLEntitySubquery, type RoomsOf, type RoomsDef, type TransactionChunk, type PresenceOf, type TopicsOf, type TopicOf, type RoomHandle, type InstantUnknownSchema, type InstantSchemaDef, type BackwardsCompatibleSchema, type InstantRules, type UpdateParams, type LinkParams, type CreateParams, type CheckMagicCodeParams, type CheckMagicCodeResponse, type ExchangeCodeForTokenParams, type SendMagicCodeParams, type SendMagicCodeResponse, type SignInWithIdTokenParams, type VerifyMagicCodeParams, type VerifyResponse, type FileOpts, type UploadFileResponse, type DeleteFileResponse, StoreInterface, type StoreInterfaceStoreName, type SyncTableCallback, type SyncTableCallbackEvent, type SyncTableInitialSyncBatch, type SyncTableInitialSyncComplete, type SyncTableSyncTransaction, type SyncTableLoadFromStorage, type SyncTableSetupError, createInstantRouteHandler, type InstantRouteHandlerPayloadByType, type InstantRouteHandlerType, type InstantRouteHandlerBody, type Logger, };
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,EAAE,EACF,EAAE,EACF,MAAM,EACN,CAAC,EAGD,eAAe,EAGf,0BAA0B,EAG1B,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EACrB,KAAK,IAAI,EACT,KAAK,SAAS,EACd,KAAK,KAAK,EACV,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EAGf,KAAK,YAAY,EAGjB,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,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C7B,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EAGxB,yBAAyB,EACzB,KAAK,gCAAgC,EACrC,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAG5B,KAAK,MAAM,GACZ,CAAC"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createInstantRouteHandler = exports.StoreInterface = exports.SyncTableCallbackEventType = exports.InstantAPIError = exports.i = exports.InstantSolidRoom = exports.InstantSolidDatabase = exports.init = exports.lookup = exports.tx = exports.id = void 0;
4
+ const instant_sdk_1 = require("@fidscript/instant-sdk");
5
+ Object.defineProperty(exports, "id", { enumerable: true, get: function () { return instant_sdk_1.id; } });
6
+ Object.defineProperty(exports, "tx", { enumerable: true, get: function () { return instant_sdk_1.tx; } });
7
+ Object.defineProperty(exports, "lookup", { enumerable: true, get: function () { return instant_sdk_1.lookup; } });
8
+ Object.defineProperty(exports, "i", { enumerable: true, get: function () { return instant_sdk_1.i; } });
9
+ Object.defineProperty(exports, "InstantAPIError", { enumerable: true, get: function () { return
10
+ // error
11
+ instant_sdk_1.InstantAPIError; } });
12
+ Object.defineProperty(exports, "SyncTableCallbackEventType", { enumerable: true, get: function () { return
13
+ // sync table enums
14
+ instant_sdk_1.SyncTableCallbackEventType; } });
15
+ Object.defineProperty(exports, "StoreInterface", { enumerable: true, get: function () { return instant_sdk_1.StoreInterface; } });
16
+ Object.defineProperty(exports, "createInstantRouteHandler", { enumerable: true, get: function () { return instant_sdk_1.createInstantRouteHandler; } });
17
+ const InstantSolidDatabase_js_1 = require("./InstantSolidDatabase.js");
18
+ Object.defineProperty(exports, "InstantSolidDatabase", { enumerable: true, get: function () { return InstantSolidDatabase_js_1.InstantSolidDatabase; } });
19
+ const InstantSolidDatabase_js_2 = require("./InstantSolidDatabase.js");
20
+ Object.defineProperty(exports, "init", { enumerable: true, get: function () { return InstantSolidDatabase_js_2.init; } });
21
+ const InstantSolidRoom_js_1 = require("./InstantSolidRoom.js");
22
+ Object.defineProperty(exports, "InstantSolidRoom", { enumerable: true, get: function () { return InstantSolidRoom_js_1.InstantSolidRoom; } });
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,wDA8FgC;AAO9B,mFApGA,gBAAE,OAoGA;AACF,mFApGA,gBAAE,OAoGA;AACF,uFApGA,oBAAM,OAoGA;AAIN,kFAvGA,eAAC,OAuGA;AAGD;IAxGA,QAAQ;IACR,6BAAe,OAuGA;AAGf;IAxGA,mBAAmB;IACnB,wCAA0B,OAuGA;AAsE1B,+FAhGA,4BAAc,OAgGA;AAad,0GA5GA,uCAAyB,OA4GA;AApG3B,uEAAiE;AAS/D,qGATO,8CAAoB,OASP;AARtB,uEAAiD;AAO/C,qFAPO,8BAAI,OAOP;AANN,+DAAyD;AAQvD,iGARO,sCAAgB,OAQP","sourcesContent":["import {\n id,\n tx,\n lookup,\n i,\n\n // error\n InstantAPIError,\n\n // sync table enums\n SyncTableCallbackEventType,\n\n // types\n type QueryResponse,\n type InstantQuery,\n type InstantQueryResult,\n type InstantSchema,\n type InstantObject,\n type InstantEntity,\n type InstantSchemaDatabase,\n type InstantUnknownSchemaDef,\n type IInstantDatabase,\n type User,\n type AuthState,\n type Query,\n type Config,\n type InstaQLParams,\n type ConnectionStatus,\n type ValidQuery,\n\n // presence types\n type PresencePeer,\n\n // schema types\n type AttrsDefs,\n type CardinalityKind,\n type DataAttrDef,\n type EntitiesDef,\n type EntitiesWithLinks,\n type EntityDef,\n type InstantGraph,\n type InstantConfig,\n type LinkAttrDef,\n type LinkDef,\n type LinksDef,\n type ResolveAttrs,\n type ValueTypes,\n type InstaQLEntity,\n type InstaQLFields,\n type InstaQLResult,\n type InstaQLEntitySubquery,\n type RoomsOf,\n type RoomsDef,\n type PresenceOf,\n type TopicsOf,\n type TopicOf,\n type RoomHandle,\n type TransactionChunk,\n type InstantUnknownSchema,\n type InstantSchemaDef,\n type BackwardsCompatibleSchema,\n type InstantRules,\n type UpdateParams,\n type LinkParams,\n type CreateParams,\n type CheckMagicCodeParams,\n type CheckMagicCodeResponse,\n type ExchangeCodeForTokenParams,\n type SendMagicCodeParams,\n type SendMagicCodeResponse,\n type SignInWithIdTokenParams,\n type VerifyMagicCodeParams,\n type VerifyResponse,\n\n // storage types\n type FileOpts,\n type UploadFileResponse,\n type DeleteFileResponse,\n\n // sync table types\n type SyncTableCallback,\n type SyncTableCallbackEvent,\n type SyncTableInitialSyncBatch,\n type SyncTableInitialSyncComplete,\n type SyncTableSyncTransaction,\n type SyncTableLoadFromStorage,\n type SyncTableSetupError,\n StoreInterface,\n createInstantRouteHandler,\n type InstantRouteHandlerPayloadByType,\n type InstantRouteHandlerType,\n type InstantRouteHandlerBody,\n type StoreInterfaceStoreName,\n type Logger,\n} from '@fidscript/instant-sdk';\n\nimport { InstantSolidDatabase } from './InstantSolidDatabase.js';\nimport { init } from './InstantSolidDatabase.js';\nimport { InstantSolidRoom } from './InstantSolidRoom.js';\n\nexport {\n id,\n tx,\n lookup,\n init,\n InstantSolidDatabase,\n InstantSolidRoom,\n i,\n\n // error\n InstantAPIError,\n\n // sync table enums\n SyncTableCallbackEventType,\n\n // types\n type Config,\n type InstantConfig,\n type InstantUnknownSchemaDef,\n type Query,\n type QueryResponse,\n type InstantObject,\n type User,\n type AuthState,\n type ConnectionStatus,\n type InstantQuery,\n type InstantQueryResult,\n type InstantSchema,\n type InstantEntity,\n type InstantSchemaDatabase,\n type IInstantDatabase,\n type InstaQLParams,\n type ValidQuery,\n type InstaQLFields,\n\n // presence types\n type PresencePeer,\n\n // schema types\n type AttrsDefs,\n type CardinalityKind,\n type DataAttrDef,\n type EntitiesDef,\n type EntitiesWithLinks,\n type EntityDef,\n type InstantGraph,\n type LinkAttrDef,\n type LinkDef,\n type LinksDef,\n type ResolveAttrs,\n type ValueTypes,\n type InstaQLEntity,\n type InstaQLResult,\n type InstaQLEntitySubquery,\n type RoomsOf,\n type RoomsDef,\n type TransactionChunk,\n type PresenceOf,\n type TopicsOf,\n type TopicOf,\n type RoomHandle,\n type InstantUnknownSchema,\n type InstantSchemaDef,\n type BackwardsCompatibleSchema,\n type InstantRules,\n type UpdateParams,\n type LinkParams,\n type CreateParams,\n type CheckMagicCodeParams,\n type CheckMagicCodeResponse,\n type ExchangeCodeForTokenParams,\n type SendMagicCodeParams,\n type SendMagicCodeResponse,\n type SignInWithIdTokenParams,\n type VerifyMagicCodeParams,\n type VerifyResponse,\n\n // storage types\n type FileOpts,\n type UploadFileResponse,\n type DeleteFileResponse,\n\n // custom store\n StoreInterface,\n type StoreInterfaceStoreName,\n\n // sync table types\n type SyncTableCallback,\n type SyncTableCallbackEvent,\n type SyncTableInitialSyncBatch,\n type SyncTableInitialSyncComplete,\n type SyncTableSyncTransaction,\n type SyncTableLoadFromStorage,\n type SyncTableSetupError,\n\n // Server helper\n createInstantRouteHandler,\n type InstantRouteHandlerPayloadByType,\n type InstantRouteHandlerType,\n type InstantRouteHandlerBody,\n\n // logger\n type Logger,\n};\n"]}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,3 @@
1
+ declare const version = "0.1.0";
2
+ export default version;
3
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,OAAO,UAAU,CAAC;AACxB,eAAe,OAAO,CAAC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const version = '0.1.0';
4
+ exports.default = version;
5
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;AAAA,MAAM,OAAO,GAAG,OAAO,CAAC;AACxB,kBAAe,OAAO,CAAC","sourcesContent":["const version = '0.1.0';\nexport default version;\n"]}
@@ -0,0 +1,185 @@
1
+ import { type AuthState, type User, type ConnectionStatus, type TransactionChunk, type RoomSchemaShape, type InstaQLOptions, type InstantConfig, type PageInfoResponse, type InstaQLLifecycleState, type InstaQLResponse, type ValidQuery, Auth, Storage, Streams, InstantCoreDatabase, InstantSchemaDef, RoomsOf, IInstantDatabase } from '@fidscript/instant-sdk';
2
+ import type { Accessor } from 'solid-js';
3
+ import { InstantSolidRoom } from './InstantSolidRoom.js';
4
+ export type InfiniteQueryState<Schema extends InstantSchemaDef<any, any, any>, Q extends ValidQuery<Q, Schema>, UseDates extends boolean> = {
5
+ isLoading: boolean;
6
+ error: {
7
+ message: string;
8
+ } | undefined;
9
+ data: InstaQLResponse<Schema, Q, UseDates> | undefined;
10
+ canLoadNextPage: boolean;
11
+ loadNextPage: () => void;
12
+ };
13
+ export declare class InstantSolidDatabase<Schema extends InstantSchemaDef<any, any, any>, UseDates extends boolean = false, Rooms extends RoomSchemaShape = RoomsOf<Schema>> implements IInstantDatabase<Schema> {
14
+ tx: import("@fidscript/instant-sdk").TxChunk<Schema>;
15
+ auth: Auth;
16
+ storage: Storage;
17
+ streams: Streams;
18
+ core: InstantCoreDatabase<Schema, UseDates>;
19
+ constructor(core: InstantCoreDatabase<Schema, UseDates>);
20
+ /**
21
+ * Returns a unique ID for a given `name`. It's stored in local storage,
22
+ * so you will get the same ID across sessions.
23
+ *
24
+ * @example
25
+ * const deviceId = await db.getLocalId('device');
26
+ */
27
+ getLocalId: (name: string) => Promise<string>;
28
+ /**
29
+ * Use this to write data! You can create, update, delete, and link objects
30
+ *
31
+ * @see https://instantdb.com/docs/instaml
32
+ *
33
+ * @example
34
+ * const goalId = id();
35
+ * db.transact(db.tx.goals[goalId].update({title: "Get fit"}))
36
+ */
37
+ transact: (chunks: TransactionChunk<any, any> | TransactionChunk<any, any>[]) => Promise<import("@fidscript/instant-sdk").TransactionResult>;
38
+ /**
39
+ * One time query for the logged in state.
40
+ *
41
+ * @see https://instantdb.com/docs/auth
42
+ * @example
43
+ * const user = await db.getAuth();
44
+ * console.log('logged in as', user.email)
45
+ */
46
+ getAuth(): Promise<User | null>;
47
+ /**
48
+ * Use this for one-off queries.
49
+ * Returns local data if available, otherwise fetches from the server.
50
+ *
51
+ * @see https://instantdb.com/docs/instaql
52
+ *
53
+ * @example
54
+ * const resp = await db.queryOnce({ goals: {} });
55
+ * console.log(resp.data.goals)
56
+ */
57
+ queryOnce: <Q extends ValidQuery<Q, Schema>>(query: Q, opts?: InstaQLOptions) => Promise<{
58
+ data: InstaQLResponse<Schema, Q, UseDates>;
59
+ pageInfo: PageInfoResponse<Q>;
60
+ }>;
61
+ /**
62
+ * Use this to query your data!
63
+ *
64
+ * @see https://instantdb.com/docs/instaql
65
+ *
66
+ * @example
67
+ * const state = db.useQuery({ goals: {} });
68
+ * // state().isLoading, state().error, state().data
69
+ */
70
+ useQuery: <Q extends ValidQuery<Q, Schema>>(query: (() => null | Q) | null | Q, opts?: InstaQLOptions) => Accessor<InstaQLLifecycleState<Schema, Q, UseDates>>;
71
+ /**
72
+ * Subscribe to a query and incrementally load more items.
73
+ *
74
+ * Only one top level namespace in the query is allowed.
75
+ *
76
+ * @see https://instantdb.com/docs/instaql
77
+ *
78
+ * @example
79
+ * const state = db.useInfiniteQuery({
80
+ * posts: {
81
+ * $: {
82
+ * limit: 20,
83
+ * order: { createdAt: 'desc' },
84
+ * },
85
+ * },
86
+ * });
87
+ * // state().data, state().isLoading, state().error,
88
+ * // state().canLoadNextPage, state().loadNextPage()
89
+ */
90
+ useInfiniteQuery: <Q extends ValidQuery<Q, Schema>>(query: (() => null | Q) | null | Q, opts?: InstaQLOptions) => Accessor<InfiniteQueryState<Schema, Q, UseDates>>;
91
+ /**
92
+ * Listen for the logged in state. This is useful
93
+ * for deciding when to show a login screen.
94
+ *
95
+ * @see https://instantdb.com/docs/auth
96
+ * @example
97
+ * function App() {
98
+ * const auth = db.useAuth();
99
+ * // auth().isLoading, auth().user, auth().error
100
+ * }
101
+ */
102
+ useAuth: () => Accessor<AuthState>;
103
+ /**
104
+ * Subscribe to the currently logged in user.
105
+ * If the user is not logged in, this will throw an Error.
106
+ *
107
+ * @see https://instantdb.com/docs/auth
108
+ * @example
109
+ * function UserDisplay() {
110
+ * const user = db.useUser();
111
+ * return <div>Logged in as: {user().email}</div>
112
+ * }
113
+ */
114
+ useUser: () => Accessor<User>;
115
+ /**
116
+ * Listen for connection status changes to Instant.
117
+ *
118
+ * @see https://www.instantdb.com/docs/patterns#connection-status
119
+ * @example
120
+ * function App() {
121
+ * const status = db.useConnectionStatus();
122
+ * return <div>Connection state: {status()}</div>
123
+ * }
124
+ */
125
+ useConnectionStatus: () => Accessor<ConnectionStatus>;
126
+ /**
127
+ * A hook that returns a unique ID for a given `name`. localIds are
128
+ * stored in local storage, so you will get the same ID across sessions.
129
+ *
130
+ * Initially returns `null`, and then loads the localId.
131
+ *
132
+ * @example
133
+ * const deviceId = db.useLocalId('device');
134
+ * // deviceId() is null initially, then the ID string
135
+ */
136
+ useLocalId: (name: string) => Accessor<string | null>;
137
+ /**
138
+ * Obtain a handle to a room, which allows you to listen to topics and presence data
139
+ *
140
+ * @see https://instantdb.com/docs/presence-and-topics
141
+ *
142
+ * @example
143
+ * const room = db.room('chat', roomId);
144
+ * const presence = db.rooms.usePresence(room);
145
+ */
146
+ room<RoomType extends keyof Rooms>(type?: RoomType, id?: string): InstantSolidRoom<Schema, Rooms, RoomType>;
147
+ /**
148
+ * Hooks for working with rooms
149
+ *
150
+ * @see https://instantdb.com/docs/presence-and-topics
151
+ *
152
+ * @example
153
+ * const room = db.room('chat', roomId);
154
+ * const presence = db.rooms.usePresence(room);
155
+ * const publish = db.rooms.usePublishTopic(room, 'emoji');
156
+ */
157
+ rooms: {
158
+ useTopicEffect: typeof import("./InstantSolidRoom.js").useTopicEffect;
159
+ usePublishTopic: typeof import("./InstantSolidRoom.js").usePublishTopic;
160
+ usePresence: typeof import("./InstantSolidRoom.js").usePresence;
161
+ useSyncPresence: typeof import("./InstantSolidRoom.js").useSyncPresence;
162
+ useTypingIndicator: typeof import("./InstantSolidRoom.js").useTypingIndicator;
163
+ };
164
+ }
165
+ /**
166
+ * The first step: init your application!
167
+ *
168
+ * Visit https://instantdb.com/dash to get your `appId` :)
169
+ *
170
+ * @example
171
+ * import { init } from "@instantdb/solidjs"
172
+ *
173
+ * const db = init({ appId: "my-app-id" })
174
+ *
175
+ * // You can also provide a schema for type safety and editor autocomplete!
176
+ *
177
+ * import { init } from "@instantdb/solidjs"
178
+ * import schema from "../instant.schema.ts";
179
+ *
180
+ * const db = init({ appId: "my-app-id", schema })
181
+ */
182
+ export declare function init<Schema extends InstantSchemaDef<any, any, any>, UseDates extends boolean = false>(config: Omit<InstantConfig<Schema, UseDates>, 'useDateObjects'> & {
183
+ useDateObjects?: UseDates;
184
+ }): InstantSolidDatabase<Schema, UseDates>;
185
+ //# sourceMappingURL=InstantSolidDatabase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InstantSolidDatabase.d.ts","sourceRoot":"","sources":["../../src/InstantSolidDatabase.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,IAAI,EACT,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EAEpB,KAAK,UAAU,EAEf,IAAI,EACJ,OAAO,EACP,OAAO,EAEP,mBAAmB,EAInB,gBAAgB,EAChB,OAAO,EAEP,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAS,MAAM,uBAAuB,CAAC;AAUhE,MAAM,MAAM,kBAAkB,CAC5B,MAAM,SAAS,gBAAgB,CAAC,GAAG,E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