-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
76 lines (66 loc) · 1.58 KB
/
types.ts
File metadata and controls
76 lines (66 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
export enum DocCategory {
INVOICE = 'Invoice',
CONTRACT = 'Contract',
IDENTITY = 'Identity',
RECEIPT = 'Receipt',
MEDICAL = 'Medical',
OTHER = 'Other',
}
export interface SmartDoc {
id: string;
name: string;
fileData: string; // Base64 (used for local preview mostly, or thumbnail)
mimeType: string;
category: string;
summary: string;
tags: string[];
uploadDate: number;
extractedDate?: string;
size: number;
folderId?: string | null;
// Legacy Drive Fields (Optional/Deprecated)
driveId?: string;
webViewLink?: string;
thumbnailLink?: string;
// Shared Context
uploadedBy?: string; // Name of uploader in shared context
}
export interface Folder {
id: string;
name: string;
createdAt: number;
}
export interface StatsData {
name: string;
value: number;
color: string;
}
export interface User {
uid: string; // Firebase Auth UID (Internal)
name: string;
email?: string;
mobile?: string;
dob?: string;
uniqueId?: string; // Custom Display ID (name.dob)
picture?: string;
accessToken?: string;
authType: 'local' | 'mobile' | 'google';
emailVerified?: boolean;
}
// --- SHARING FEATURES ---
export type MemberRole = 'owner' | 'editor' | 'viewer';
export interface SharedMember {
uid: string;
name: string;
role: MemberRole;
addedAt: number;
displayId?: string; // The Custom Unique ID (e.g. john.20121990)
}
export interface SharedFolder {
id: string;
name: string;
ownerId: string;
createdAt: number;
members: Record<string, SharedMember>; // uid -> MemberObj
documents?: Record<string, SmartDoc>;
}