@qrush/types 2.0.39 → 2.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.
package/README.md CHANGED
@@ -30,6 +30,8 @@ import { CommonFields } from '@qrush/types/Common';
30
30
  import { CustomDocType } from '@qrush/types/CustomDocType';
31
31
  import { Timestamp, GeoPoint, formatTimestamp } from '@qrush/types/firebase';
32
32
  import { IFireWebappUser, FireWebappUserSnapshotRef } from '@qrush/types/WebappUsers';
33
+ import { IFireChats, IFireMessages, FireChatsSnapshotRef } from '@qrush/types/Chat';
34
+ import { IFireMatchingRound, IFireAttendee, FireMatchingRoundSnapshotRef } from '@qrush/types/Matching';
33
35
  ```
34
36
 
35
37
  ## Available Types
@@ -44,6 +46,8 @@ import { IFireWebappUser, FireWebappUserSnapshotRef } from '@qrush/types/WebappU
44
46
  - **CustomDocType** - Custom document type definitions
45
47
  - **firebase** - Firebase/Firestore type re-exports and utilities
46
48
  - **WebappUsers** - Web application specific user types and interfaces
49
+ - **Chat** - Chat system types and interfaces for messaging functionality
50
+ - **Matching** - Types for the matching system and attendee management
47
51
 
48
52
  ## Development
49
53
 
package/dist/Chat.d.ts ADDED
@@ -0,0 +1,60 @@
1
+ import { FireQueryDocSnapshotRef } from '@qrush/types/CustomDocType';
2
+ import type { FieldValue, Timestamp } from '@qrush/types/firebase';
3
+ export interface IFireChats {
4
+ participants: {
5
+ [userUID: string]: Participant;
6
+ };
7
+ lastSenderUID: string | null;
8
+ lastMessageAt: Timestamp | null | undefined;
9
+ lastMessage: string | null;
10
+ newMessages: number;
11
+ chatOrigin: ChatOrigin;
12
+ draftMessages: {
13
+ [userUID: string]: IFireMessages;
14
+ };
15
+ }
16
+ export interface Participant {
17
+ name: string;
18
+ birthday: Timestamp;
19
+ pictureURI: string | null;
20
+ check: true;
21
+ }
22
+ type ChatOrigin = ChatOriginEvent | ChatOriginPersonalQR;
23
+ interface ChatOriginEvent {
24
+ type: 'event';
25
+ name: string;
26
+ }
27
+ interface ChatOriginPersonalQR {
28
+ type: 'personal';
29
+ }
30
+ export type FireChatsSnapshotRef = FireQueryDocSnapshotRef<IFireChats>;
31
+ export type IFireChatsUpdateData = {
32
+ lastSenderUID: string;
33
+ lastMessageAt: FieldValue;
34
+ lastMessage: string;
35
+ newMessages: FieldValue | number;
36
+ };
37
+ export type IFireChatsMarkAsReadData = {
38
+ newMessages: 0;
39
+ };
40
+ export interface IFireMessages {
41
+ senderUID: string;
42
+ sentAt: Timestamp | undefined;
43
+ deliveredAt: Timestamp | undefined;
44
+ readAt: Timestamp | undefined;
45
+ message?: string;
46
+ messagePayload?: MessagePayload;
47
+ }
48
+ type MessagePayload = MessageImagePayload;
49
+ interface MessageImagePayload {
50
+ type: 'image';
51
+ uri: string;
52
+ }
53
+ export type FireMessagesSnapshotRef = FireQueryDocSnapshotRef<IFireMessages>;
54
+ export interface IFireMessagesCreationData {
55
+ senderUID: string;
56
+ sentAt: FieldValue;
57
+ message?: string;
58
+ messagePayload?: MessagePayload;
59
+ }
60
+ export {};
package/dist/Chat.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,61 @@
1
+ import { Timestamp } from '@firebase/firestore';
2
+ import { FireQueryDocSnapshotRef } from '@qrush/types/CustomDocType';
3
+ import { Gender } from '@qrush/types/Users';
4
+ export interface IFireMatchingRound {
5
+ scheduledFor: Timestamp;
6
+ scheduledDuration: number;
7
+ startedAt: Timestamp | null;
8
+ closedAt: Timestamp | null;
9
+ attendees: number;
10
+ demo: boolean;
11
+ }
12
+ export type FireMatchingRoundSnapshotRef = FireQueryDocSnapshotRef<IFireMatchingRound>;
13
+ export interface IFireMatchingRoundCreationData {
14
+ scheduledFor: Date;
15
+ scheduledDuration: number;
16
+ startedAt: Date | null;
17
+ closedAt: Date | null;
18
+ attendees: number;
19
+ demo: boolean;
20
+ }
21
+ export interface IFireAttendee {
22
+ name: string;
23
+ age: number;
24
+ gender: Gender;
25
+ pictureURI: string;
26
+ preference: {
27
+ [Preference in MatchingPreference]: boolean;
28
+ };
29
+ inGroup: boolean;
30
+ matchAttendeeUID?: string;
31
+ votes: {
32
+ [receiverUID: string]: Vote;
33
+ };
34
+ ignore: boolean;
35
+ }
36
+ type MatchingPreference = 'dates' | 'friends';
37
+ interface Vote {
38
+ liked: boolean;
39
+ time: Timestamp;
40
+ }
41
+ export interface IFireAttendeeCreationData {
42
+ name: string;
43
+ age: number;
44
+ gender: Gender;
45
+ pictureURI: string;
46
+ preference: {
47
+ [Preference in MatchingPreference]: boolean;
48
+ };
49
+ inGroup: boolean;
50
+ matchAttendeeUID?: string;
51
+ votes: {
52
+ [receiverUID: string]: VoteCreationData;
53
+ };
54
+ ignore: boolean;
55
+ }
56
+ interface VoteCreationData {
57
+ liked: boolean;
58
+ time: Date;
59
+ }
60
+ export type FireAttendeeSnapshotRef = FireQueryDocSnapshotRef<IFireAttendee>;
61
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qrush/types",
3
- "version": "2.0.39",
3
+ "version": "2.1.0",
4
4
  "description": "Shared TypeScript types for the QRush ecosystem",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -64,6 +64,14 @@
64
64
  "./WebappUsers": {
65
65
  "import": "./dist/WebappUsers.js",
66
66
  "types": "./dist/WebappUsers.d.ts"
67
+ },
68
+ "./Chat": {
69
+ "import": "./dist/Chat.js",
70
+ "types": "./dist/Chat.d.ts"
71
+ },
72
+ "./Matching": {
73
+ "import": "./dist/Matching.js",
74
+ "types": "./dist/Matching.d.ts"
67
75
  }
68
76
  }
69
77
  }