react-native-email-imap-smtp 0.3.16 → 0.3.18

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.
@@ -1,3 +1,155 @@
1
- declare const Platform: any;
2
- declare let impl: any;
3
- //# sourceMappingURL=index.d.ts.map
1
+ import type {
2
+ IMAPConfig,
3
+ IMAPConnectionResult,
4
+ Mailbox,
5
+ MailboxStatus,
6
+ Folder,
7
+ FetchEmailsOptions,
8
+ Email,
9
+ SearchCriteria,
10
+ BatchResult,
11
+ Attachment,
12
+ IMAPNotification,
13
+ QuotaInfo,
14
+ AppendResult,
15
+ SMTPConfig,
16
+ SMTPConnectionResult,
17
+ SendMailOptions,
18
+ SendMailResult,
19
+ } from './types';
20
+
21
+ export {
22
+ IMAPConfig,
23
+ IMAPConnectionResult,
24
+ Mailbox,
25
+ MailboxStatus,
26
+ Folder,
27
+ FetchEmailsOptions,
28
+ Email,
29
+ SearchCriteria,
30
+ BatchResult,
31
+ Attachment,
32
+ IMAPNotification,
33
+ QuotaInfo,
34
+ AppendResult,
35
+ SMTPConfig,
36
+ SMTPConnectionResult,
37
+ SendMailOptions,
38
+ SendMailResult,
39
+ }
40
+
41
+ // ─── IMAP ──────────────────────────────────────────────────
42
+
43
+ export declare function imapConnect(
44
+ config: IMAPConfig
45
+ ): Promise<IMAPConnectionResult>;
46
+
47
+ export declare function imapDisconnect(): Promise<void>;
48
+
49
+ export declare function imapListMailboxes(): Promise<Mailbox[]>;
50
+
51
+ export declare function imapSelectMailbox(
52
+ mailbox: string,
53
+ readOnly?: boolean
54
+ ): Promise<MailboxStatus>;
55
+
56
+ export declare function imapRefreshMailbox(): Promise<MailboxStatus>;
57
+
58
+ export declare function imapFetchFolders(): Promise<Folder[]>;
59
+
60
+ export declare function imapCreateFolder(folderName: string): Promise<void>;
61
+
62
+ export declare function imapDeleteFolder(folderName: string): Promise<void>;
63
+
64
+ export declare function imapRenameFolder(
65
+ oldName: string,
66
+ newName: string
67
+ ): Promise<void>;
68
+
69
+ export declare function imapSubscribeFolder(folderName: string): Promise<void>;
70
+
71
+ export declare function imapUnsubscribeFolder(
72
+ folderName: string
73
+ ): Promise<void>;
74
+
75
+ export declare function imapFetchEmails(
76
+ options: FetchEmailsOptions
77
+ ): Promise<Email[]>;
78
+
79
+ export declare function imapFetchEmailByUID(
80
+ uid: number
81
+ ): Promise<Email | null>;
82
+
83
+ export declare function imapSearchEmails(
84
+ criteria: SearchCriteria
85
+ ): Promise<Email[]>;
86
+
87
+ export declare function imapMarkAsRead(
88
+ uids: number[],
89
+ silent?: boolean
90
+ ): Promise<void>;
91
+
92
+ export declare function imapMarkAsFlagged(
93
+ uids: number[],
94
+ flagged: boolean
95
+ ): Promise<void>;
96
+
97
+ export declare function imapMoveEmails(
98
+ uids: number[],
99
+ destinationMailbox: string
100
+ ): Promise<void>;
101
+
102
+ export declare function imapCopyEmails(
103
+ uids: number[],
104
+ destinationMailbox: string
105
+ ): Promise<void>;
106
+
107
+ export declare function imapDeleteEmails(
108
+ uids: number[]
109
+ ): Promise<BatchResult>;
110
+
111
+ export declare function imapExpunge(): Promise<void>;
112
+
113
+ export declare function imapFetchAttachments(
114
+ uid: number,
115
+ partId: string
116
+ ): Promise<Attachment | null>;
117
+
118
+ export declare function imapFetchAllAttachments(
119
+ uid: number
120
+ ): Promise<Attachment[]>;
121
+
122
+ export declare function imapIdle(
123
+ callback: (notification: IMAPNotification) => void
124
+ ): Promise<void>;
125
+
126
+ export declare function imapStopIdle(): Promise<void>;
127
+
128
+ export declare function imapGetQuota(root?: string): Promise<QuotaInfo>;
129
+
130
+ export declare function imapAppendMessage(
131
+ mailbox: string,
132
+ rawMimeData: ArrayBuffer,
133
+ flags?: string[]
134
+ ): Promise<AppendResult>;
135
+
136
+ // ─── SMTP ──────────────────────────────────────────────────
137
+
138
+ export declare function smtpConnect(
139
+ config: SMTPConfig
140
+ ): Promise<SMTPConnectionResult>;
141
+
142
+ export declare function smtpDisconnect(): Promise<void>;
143
+
144
+ export declare function smtpSendMail(
145
+ options: SendMailOptions
146
+ ): Promise<SendMailResult>;
147
+
148
+ export declare function smtpVerifyConnection(): Promise<boolean>;
149
+
150
+ // ─── Web 专属(原生平台为 undefined) ─────────────────────
151
+
152
+ export declare const setProxyUrl: ((url: string) => void) | undefined;
153
+ export declare const getProxyUrl: (() => string) | undefined;
154
+ export declare const ImapNotConnectedError: (new () => Error) | undefined;
155
+ export declare const SmtpNotConnectedError: (new () => Error) | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-email-imap-smtp",
3
- "version": "0.3.16",
3
+ "version": "0.3.18",
4
4
  "description": "The best of imap and smtp client of react native",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -50,8 +50,7 @@
50
50
  "scripts": {
51
51
  "example": "yarn workspace react-native-email-imap-smtp-example",
52
52
  "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib windows-standalone-test/build",
53
- "prepare": "bob build",
54
- "postprepare": "node scripts/fix-types.mjs",
53
+ "prepare": "bob build && node scripts/fix-types.js",
55
54
  "nitrogen": "nitrogen",
56
55
  "windows:init": "npx react-native init-windows --template cpp-lib --overwrite",
57
56
  "build:windows": "cd windows-standalone-test && cmake -B build && cmake --build build --config Debug",