react-native-email-imap-smtp 0.3.3 → 0.3.5
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/lib/module/index.js +52 -51
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/index.d.ts +0 -42
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/server/proxy.mjs +1 -1
- package/src/index.tsx +102 -108
package/lib/module/index.js
CHANGED
|
@@ -9,7 +9,10 @@
|
|
|
9
9
|
// Web / other → web.ts → throws not-supported
|
|
10
10
|
// ============================================================
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
const {
|
|
13
|
+
Platform
|
|
14
|
+
} = require('react-native');
|
|
15
|
+
|
|
13
16
|
// ─── Platform-aware module resolution ──────────────────────
|
|
14
17
|
|
|
15
18
|
let impl;
|
|
@@ -25,57 +28,55 @@ if (Platform.OS === 'android') {
|
|
|
25
28
|
// Web 等其他平台
|
|
26
29
|
impl = require('./web');
|
|
27
30
|
}
|
|
31
|
+
module.exports = {
|
|
32
|
+
// ─── IMAP exports ───────────────────────────────────────────
|
|
28
33
|
|
|
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
|
-
export const imapAppendMessage = impl.imapAppendMessage;
|
|
57
|
-
|
|
58
|
-
// ─── SMTP exports ──────────────────────────────────────────
|
|
59
|
-
|
|
60
|
-
export const smtpConnect = impl.smtpConnect;
|
|
61
|
-
export const smtpDisconnect = impl.smtpDisconnect;
|
|
62
|
-
export const smtpSendMail = impl.smtpSendMail;
|
|
63
|
-
export const smtpVerifyConnection = impl.smtpVerifyConnection;
|
|
64
|
-
|
|
65
|
-
// ─── Web 专属导出(原生平台为 undefined) ─────────────────
|
|
66
|
-
|
|
67
|
-
export const setProxyUrl = impl.setProxyUrl;
|
|
68
|
-
export const getProxyUrl = impl.getProxyUrl;
|
|
34
|
+
imapConnect: impl.imapConnect,
|
|
35
|
+
imapDisconnect: impl.imapDisconnect,
|
|
36
|
+
imapListMailboxes: impl.imapListMailboxes,
|
|
37
|
+
imapSelectMailbox: impl.imapSelectMailbox,
|
|
38
|
+
imapRefreshMailbox: impl.imapRefreshMailbox,
|
|
39
|
+
imapFetchFolders: impl.imapFetchFolders,
|
|
40
|
+
imapCreateFolder: impl.imapCreateFolder,
|
|
41
|
+
imapDeleteFolder: impl.imapDeleteFolder,
|
|
42
|
+
imapRenameFolder: impl.imapRenameFolder,
|
|
43
|
+
imapSubscribeFolder: impl.imapSubscribeFolder,
|
|
44
|
+
imapUnsubscribeFolder: impl.imapUnsubscribeFolder,
|
|
45
|
+
imapFetchEmails: impl.imapFetchEmails,
|
|
46
|
+
imapFetchEmailByUID: impl.imapFetchEmailByUID,
|
|
47
|
+
imapSearchEmails: impl.imapSearchEmails,
|
|
48
|
+
imapMarkAsRead: impl.imapMarkAsRead,
|
|
49
|
+
imapMarkAsFlagged: impl.imapMarkAsFlagged,
|
|
50
|
+
imapMoveEmails: impl.imapMoveEmails,
|
|
51
|
+
imapCopyEmails: impl.imapCopyEmails,
|
|
52
|
+
imapDeleteEmails: impl.imapDeleteEmails,
|
|
53
|
+
imapExpunge: impl.imapExpunge,
|
|
54
|
+
imapFetchAttachments: impl.imapFetchAttachments,
|
|
55
|
+
imapFetchAllAttachments: impl.imapFetchAllAttachments,
|
|
56
|
+
imapIdle: impl.imapIdle,
|
|
57
|
+
imapStopIdle: impl.imapStopIdle,
|
|
58
|
+
imapGetQuota: impl.imapGetQuota,
|
|
59
|
+
imapAppendMessage: impl.imapAppendMessage,
|
|
60
|
+
// ─── SMTP exports ──────────────────────────────────────────
|
|
69
61
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
62
|
+
smtpConnect: impl.smtpConnect,
|
|
63
|
+
smtpDisconnect: impl.smtpDisconnect,
|
|
64
|
+
smtpSendMail: impl.smtpSendMail,
|
|
65
|
+
smtpVerifyConnection: impl.smtpVerifyConnection,
|
|
66
|
+
// ─── Web 专属导出(原生平台为 undefined) ─────────────────
|
|
75
67
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
68
|
+
setProxyUrl: impl.setProxyUrl,
|
|
69
|
+
getProxyUrl: impl.getProxyUrl,
|
|
70
|
+
/**
|
|
71
|
+
* 连接错误类,可用于 `instanceof` 检查。
|
|
72
|
+
* Web 平台始终可用,原生平台暂未实现。
|
|
73
|
+
*/
|
|
74
|
+
ImapNotConnectedError: impl.ImapNotConnectedError,
|
|
75
|
+
/**
|
|
76
|
+
* SMTP 连接错误类,可用于 `instanceof` 检查。
|
|
77
|
+
* Web 平台始终可用,原生平台暂未实现。
|
|
78
|
+
*/
|
|
79
|
+
SmtpNotConnectedError: impl.SmtpNotConnectedError
|
|
80
|
+
};
|
|
81
|
+
export {};
|
|
81
82
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","impl","OS","
|
|
1
|
+
{"version":3,"names":["Platform","require","impl","OS","Error","module","exports","imapConnect","imapDisconnect","imapListMailboxes","imapSelectMailbox","imapRefreshMailbox","imapFetchFolders","imapCreateFolder","imapDeleteFolder","imapRenameFolder","imapSubscribeFolder","imapUnsubscribeFolder","imapFetchEmails","imapFetchEmailByUID","imapSearchEmails","imapMarkAsRead","imapMarkAsFlagged","imapMoveEmails","imapCopyEmails","imapDeleteEmails","imapExpunge","imapFetchAttachments","imapFetchAllAttachments","imapIdle","imapStopIdle","imapGetQuota","imapAppendMessage","smtpConnect","smtpDisconnect","smtpSendMail","smtpVerifyConnection","setProxyUrl","getProxyUrl","ImapNotConnectedError","SmtpNotConnectedError"],"sourceRoot":"..\\..\\src","sources":["index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA4CA,MAAM;EAAEA;AAAS,CAAC,GAAGC,OAAO,CAAC,cAAc,CAAC;;AAE5C;;AAEA,IAAIC,IAAS;AAEb,IAAIF,QAAQ,CAACG,EAAE,KAAK,SAAS,EAAE;EAC7B;EACAD,IAAI,GAAGD,OAAO,CAAC,UAAU,CAAC;AAC5B,CAAC,MAAM,IAAID,QAAQ,CAACG,EAAE,KAAK,SAAS,EAAE;EACpC;EACAD,IAAI,GAAGD,OAAO,CAAC,WAAW,CAAC;AAC7B,CAAC,MAAM,IAAID,QAAQ,CAACG,EAAE,KAAK,KAAK,EAAE;EAChC,MAAM,IAAIC,KAAK,CACb,sDAAsD,GACpD,mDACJ,CAAC;AACH,CAAC,MAAM;EACL;EACAF,IAAI,GAAGD,OAAO,CAAC,OAAO,CAAC;AACzB;AAEAI,MAAM,CAACC,OAAO,GAAG;EACf;;EAEAC,WAAW,EAAEL,IAAI,CAACK,WAEgB;EAClCC,cAAc,EAAEN,IAAI,CAACM,cAAqC;EAC1DC,iBAAiB,EAAEP,IAAI,CAACO,iBAA6C;EACrEC,iBAAiB,EAAER,IAAI,CAACQ,iBAGG;EAC3BC,kBAAkB,EAAET,IAAI,CAACS,kBAAkD;EAC3EC,gBAAgB,EAAEV,IAAI,CAACU,gBAA2C;EAClEC,gBAAgB,EAAEX,IAAI,CAACW,gBAEL;EAClBC,gBAAgB,EAAEZ,IAAI,CAACY,gBAEL;EAClBC,gBAAgB,EAAEb,IAAI,CAACa,gBAGL;EAClBC,mBAAmB,EAAEd,IAAI,CAACc,mBAER;EAClBC,qBAAqB,EAAEf,IAAI,CAACe,qBAEV;EAClBC,eAAe,EAAEhB,IAAI,CAACgB,eAED;EACrBC,mBAAmB,EAAEjB,IAAI,CAACiB,mBAEA;EAC1BC,gBAAgB,EAAElB,IAAI,CAACkB,gBAEF;EACrBC,cAAc,EAAEnB,IAAI,CAACmB,cAGH;EAClBC,iBAAiB,EAAEpB,IAAI,CAACoB,iBAGN;EAClBC,cAAc,EAAErB,IAAI,CAACqB,cAGH;EAClBC,cAAc,EAAEtB,IAAI,CAACsB,cAGH;EAClBC,gBAAgB,EAAEvB,IAAI,CAACuB,gBAEE;EACzBC,WAAW,EAAExB,IAAI,CAACwB,WAAkC;EACpDC,oBAAoB,EAAEzB,IAAI,CAACyB,oBAGI;EAC/BC,uBAAuB,EAAE1B,IAAI,CAAC0B,uBAEJ;EAC1BC,QAAQ,EAAE3B,IAAI,CAAC2B,QAEG;EAClBC,YAAY,EAAE5B,IAAI,CAAC4B,YAAmC;EACtDC,YAAY,EAAE7B,IAAI,CAAC6B,YAAqD;EACxEC,iBAAiB,EAAE9B,IAAI,CAAC8B,iBAIE;EAE1B;;EAEAC,WAAW,EAAE/B,IAAI,CAAC+B,WAEgB;EAClCC,cAAc,EAAEhC,IAAI,CAACgC,cAAqC;EAC1DC,YAAY,EAAEjC,IAAI,CAACiC,YAES;EAC5BC,oBAAoB,EAAElC,IAAI,CAACkC,oBAA8C;EAEzE;;EAEAC,WAAW,EAAEnC,IAAI,CAACmC,WAAkD;EACpEC,WAAW,EAAEpC,IAAI,CAACoC,WAAyC;EAE3D;AACF;AACA;AACA;EACEC,qBAAqB,EAAErC,IAAI,CAACqC,qBACG;EAE/B;AACF;AACA;AACA;EACEC,qBAAqB,EAAEtC,IAAI,CAACsC;AAE9B,CAAC;AAAC","ignoreList":[]}
|
|
@@ -1,45 +1,3 @@
|
|
|
1
1
|
import type { IMAPConfig, SMTPConfig, IMAPConnectionResult, SMTPConnectionResult, Mailbox, MailboxStatus, Folder, Email, Attachment, FetchEmailsOptions, SearchCriteria, BatchResult, IMAPNotification, QuotaInfo, AppendResult, SendMailOptions, SendMailResult, EmailError } from './types.js';
|
|
2
2
|
export type { IMAPConfig, SMTPConfig, IMAPConnectionResult, SMTPConnectionResult, Mailbox, MailboxStatus, Folder, Email, Attachment, FetchEmailsOptions, SearchCriteria, BatchResult, IMAPNotification, QuotaInfo, AppendResult, SendMailOptions, SendMailResult, EmailError, };
|
|
3
|
-
export declare const imapConnect: (config: IMAPConfig) => Promise<IMAPConnectionResult>;
|
|
4
|
-
export declare const imapDisconnect: () => Promise<void>;
|
|
5
|
-
export declare const imapListMailboxes: () => Promise<Mailbox[]>;
|
|
6
|
-
export declare const imapSelectMailbox: (mailbox: string, readOnly?: boolean) => Promise<MailboxStatus>;
|
|
7
|
-
export declare const imapRefreshMailbox: () => Promise<MailboxStatus>;
|
|
8
|
-
export declare const imapFetchFolders: () => Promise<Folder[]>;
|
|
9
|
-
export declare const imapCreateFolder: (folderName: string) => Promise<void>;
|
|
10
|
-
export declare const imapDeleteFolder: (folderName: string) => Promise<void>;
|
|
11
|
-
export declare const imapRenameFolder: (oldName: string, newName: string) => Promise<void>;
|
|
12
|
-
export declare const imapSubscribeFolder: (folderName: string) => Promise<void>;
|
|
13
|
-
export declare const imapUnsubscribeFolder: (folderName: string) => Promise<void>;
|
|
14
|
-
export declare const imapFetchEmails: (options: FetchEmailsOptions) => Promise<Email[]>;
|
|
15
|
-
export declare const imapFetchEmailByUID: (uid: number) => Promise<Email | null>;
|
|
16
|
-
export declare const imapSearchEmails: (criteria: SearchCriteria) => Promise<Email[]>;
|
|
17
|
-
export declare const imapMarkAsRead: (uids: number[], silent?: boolean) => Promise<void>;
|
|
18
|
-
export declare const imapMarkAsFlagged: (uids: number[], flagged: boolean) => Promise<void>;
|
|
19
|
-
export declare const imapMoveEmails: (uids: number[], destinationMailbox: string) => Promise<void>;
|
|
20
|
-
export declare const imapCopyEmails: (uids: number[], destinationMailbox: string) => Promise<void>;
|
|
21
|
-
export declare const imapDeleteEmails: (uids: number[]) => Promise<BatchResult>;
|
|
22
|
-
export declare const imapExpunge: () => Promise<void>;
|
|
23
|
-
export declare const imapFetchAttachments: (uid: number, partId: string) => Promise<Attachment | null>;
|
|
24
|
-
export declare const imapFetchAllAttachments: (uid: number) => Promise<Attachment[]>;
|
|
25
|
-
export declare const imapIdle: (callback: (notification: IMAPNotification) => void) => Promise<void>;
|
|
26
|
-
export declare const imapStopIdle: () => Promise<void>;
|
|
27
|
-
export declare const imapGetQuota: (root?: string) => Promise<QuotaInfo>;
|
|
28
|
-
export declare const imapAppendMessage: (mailbox: string, rawMimeData: ArrayBuffer, flags?: string[]) => Promise<AppendResult>;
|
|
29
|
-
export declare const smtpConnect: (config: SMTPConfig) => Promise<SMTPConnectionResult>;
|
|
30
|
-
export declare const smtpDisconnect: () => Promise<void>;
|
|
31
|
-
export declare const smtpSendMail: (options: SendMailOptions) => Promise<SendMailResult>;
|
|
32
|
-
export declare const smtpVerifyConnection: () => Promise<boolean>;
|
|
33
|
-
export declare const setProxyUrl: ((url: string) => void) | undefined;
|
|
34
|
-
export declare const getProxyUrl: (() => string) | undefined;
|
|
35
|
-
/**
|
|
36
|
-
* 连接错误类,可用于 `instanceof` 检查。
|
|
37
|
-
* Web 平台始终可用,原生平台暂未实现。
|
|
38
|
-
*/
|
|
39
|
-
export declare const ImapNotConnectedError: (new () => Error) | undefined;
|
|
40
|
-
/**
|
|
41
|
-
* SMTP 连接错误类,可用于 `instanceof` 检查。
|
|
42
|
-
* Web 平台始终可用,原生平台暂未实现。
|
|
43
|
-
*/
|
|
44
|
-
export declare const SmtpNotConnectedError: (new () => Error) | undefined;
|
|
45
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,oBAAoB,EACpB,oBAAoB,EACpB,OAAO,EACP,aAAa,EACb,MAAM,EACN,KAAK,EACL,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,eAAe,EACf,cAAc,EACd,UAAU,EACX,MAAM,YAAS,CAAC;AAEjB,YAAY,EACV,UAAU,EACV,UAAU,EACV,oBAAoB,EACpB,oBAAoB,EACpB,OAAO,EACP,aAAa,EACb,MAAM,EACN,KAAK,EACL,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,eAAe,EACf,cAAc,EACd,UAAU,GACX,CAAC"}
|
package/package.json
CHANGED
package/server/proxy.mjs
CHANGED
|
@@ -75,7 +75,7 @@ export async function startEmailProxy(options = {}) {
|
|
|
75
75
|
cwd: serverDir,
|
|
76
76
|
stdio: ['ignore', silent ? 'ignore' : 'inherit', 'pipe'],
|
|
77
77
|
env: { ...process.env, PROXY_PORT: String(port) },
|
|
78
|
-
shell:
|
|
78
|
+
shell: false,
|
|
79
79
|
detached: detach,
|
|
80
80
|
windowsHide: true,
|
|
81
81
|
});
|
package/src/index.tsx
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
// Web / other → web.ts → throws not-supported
|
|
8
8
|
// ============================================================
|
|
9
9
|
|
|
10
|
-
import { Platform } from 'react-native';
|
|
11
10
|
import type {
|
|
12
11
|
IMAPConfig,
|
|
13
12
|
SMTPConfig,
|
|
@@ -50,6 +49,8 @@ export type {
|
|
|
50
49
|
EmailError,
|
|
51
50
|
};
|
|
52
51
|
|
|
52
|
+
const { Platform } = require('react-native');
|
|
53
|
+
|
|
53
54
|
// ─── Platform-aware module resolution ──────────────────────
|
|
54
55
|
|
|
55
56
|
let impl: any;
|
|
@@ -70,117 +71,110 @@ if (Platform.OS === 'android') {
|
|
|
70
71
|
impl = require('./web');
|
|
71
72
|
}
|
|
72
73
|
|
|
73
|
-
|
|
74
|
+
module.exports = {
|
|
75
|
+
// ─── IMAP exports ───────────────────────────────────────────
|
|
74
76
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
) => Promise<IMAPConnectionResult
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
) => Promise<
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
) => Promise<
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
) =>
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
) => Promise<
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
root?: string
|
|
149
|
-
) => Promise<QuotaInfo>;
|
|
150
|
-
export const imapAppendMessage = impl.imapAppendMessage as (
|
|
151
|
-
mailbox: string,
|
|
152
|
-
rawMimeData: ArrayBuffer,
|
|
153
|
-
flags?: string[]
|
|
154
|
-
) => Promise<AppendResult>;
|
|
77
|
+
imapConnect: impl.imapConnect as (
|
|
78
|
+
config: IMAPConfig
|
|
79
|
+
) => Promise<IMAPConnectionResult>,
|
|
80
|
+
imapDisconnect: impl.imapDisconnect as () => Promise<void>,
|
|
81
|
+
imapListMailboxes: impl.imapListMailboxes as () => Promise<Mailbox[]>,
|
|
82
|
+
imapSelectMailbox: impl.imapSelectMailbox as (
|
|
83
|
+
mailbox: string,
|
|
84
|
+
readOnly?: boolean
|
|
85
|
+
) => Promise<MailboxStatus>,
|
|
86
|
+
imapRefreshMailbox: impl.imapRefreshMailbox as () => Promise<MailboxStatus>,
|
|
87
|
+
imapFetchFolders: impl.imapFetchFolders as () => Promise<Folder[]>,
|
|
88
|
+
imapCreateFolder: impl.imapCreateFolder as (
|
|
89
|
+
folderName: string
|
|
90
|
+
) => Promise<void>,
|
|
91
|
+
imapDeleteFolder: impl.imapDeleteFolder as (
|
|
92
|
+
folderName: string
|
|
93
|
+
) => Promise<void>,
|
|
94
|
+
imapRenameFolder: impl.imapRenameFolder as (
|
|
95
|
+
oldName: string,
|
|
96
|
+
newName: string
|
|
97
|
+
) => Promise<void>,
|
|
98
|
+
imapSubscribeFolder: impl.imapSubscribeFolder as (
|
|
99
|
+
folderName: string
|
|
100
|
+
) => Promise<void>,
|
|
101
|
+
imapUnsubscribeFolder: impl.imapUnsubscribeFolder as (
|
|
102
|
+
folderName: string
|
|
103
|
+
) => Promise<void>,
|
|
104
|
+
imapFetchEmails: impl.imapFetchEmails as (
|
|
105
|
+
options: FetchEmailsOptions
|
|
106
|
+
) => Promise<Email[]>,
|
|
107
|
+
imapFetchEmailByUID: impl.imapFetchEmailByUID as (
|
|
108
|
+
uid: number
|
|
109
|
+
) => Promise<Email | null>,
|
|
110
|
+
imapSearchEmails: impl.imapSearchEmails as (
|
|
111
|
+
criteria: SearchCriteria
|
|
112
|
+
) => Promise<Email[]>,
|
|
113
|
+
imapMarkAsRead: impl.imapMarkAsRead as (
|
|
114
|
+
uids: number[],
|
|
115
|
+
silent?: boolean
|
|
116
|
+
) => Promise<void>,
|
|
117
|
+
imapMarkAsFlagged: impl.imapMarkAsFlagged as (
|
|
118
|
+
uids: number[],
|
|
119
|
+
flagged: boolean
|
|
120
|
+
) => Promise<void>,
|
|
121
|
+
imapMoveEmails: impl.imapMoveEmails as (
|
|
122
|
+
uids: number[],
|
|
123
|
+
destinationMailbox: string
|
|
124
|
+
) => Promise<void>,
|
|
125
|
+
imapCopyEmails: impl.imapCopyEmails as (
|
|
126
|
+
uids: number[],
|
|
127
|
+
destinationMailbox: string
|
|
128
|
+
) => Promise<void>,
|
|
129
|
+
imapDeleteEmails: impl.imapDeleteEmails as (
|
|
130
|
+
uids: number[]
|
|
131
|
+
) => Promise<BatchResult>,
|
|
132
|
+
imapExpunge: impl.imapExpunge as () => Promise<void>,
|
|
133
|
+
imapFetchAttachments: impl.imapFetchAttachments as (
|
|
134
|
+
uid: number,
|
|
135
|
+
partId: string
|
|
136
|
+
) => Promise<Attachment | null>,
|
|
137
|
+
imapFetchAllAttachments: impl.imapFetchAllAttachments as (
|
|
138
|
+
uid: number
|
|
139
|
+
) => Promise<Attachment[]>,
|
|
140
|
+
imapIdle: impl.imapIdle as (
|
|
141
|
+
callback: (notification: IMAPNotification) => void
|
|
142
|
+
) => Promise<void>,
|
|
143
|
+
imapStopIdle: impl.imapStopIdle as () => Promise<void>,
|
|
144
|
+
imapGetQuota: impl.imapGetQuota as (root?: string) => Promise<QuotaInfo>,
|
|
145
|
+
imapAppendMessage: impl.imapAppendMessage as (
|
|
146
|
+
mailbox: string,
|
|
147
|
+
rawMimeData: ArrayBuffer,
|
|
148
|
+
flags?: string[]
|
|
149
|
+
) => Promise<AppendResult>,
|
|
155
150
|
|
|
156
|
-
// ─── SMTP exports ──────────────────────────────────────────
|
|
151
|
+
// ─── SMTP exports ──────────────────────────────────────────
|
|
157
152
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
) => Promise<SMTPConnectionResult
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
) => Promise<SendMailResult
|
|
165
|
-
|
|
166
|
-
impl.smtpVerifyConnection as () => Promise<boolean>;
|
|
153
|
+
smtpConnect: impl.smtpConnect as (
|
|
154
|
+
config: SMTPConfig
|
|
155
|
+
) => Promise<SMTPConnectionResult>,
|
|
156
|
+
smtpDisconnect: impl.smtpDisconnect as () => Promise<void>,
|
|
157
|
+
smtpSendMail: impl.smtpSendMail as (
|
|
158
|
+
options: SendMailOptions
|
|
159
|
+
) => Promise<SendMailResult>,
|
|
160
|
+
smtpVerifyConnection: impl.smtpVerifyConnection as () => Promise<boolean>,
|
|
167
161
|
|
|
168
|
-
// ─── Web 专属导出(原生平台为 undefined) ─────────────────
|
|
162
|
+
// ─── Web 专属导出(原生平台为 undefined) ─────────────────
|
|
169
163
|
|
|
170
|
-
|
|
171
|
-
impl.
|
|
172
|
-
export const getProxyUrl: (() => string) | undefined = impl.getProxyUrl;
|
|
164
|
+
setProxyUrl: impl.setProxyUrl as ((url: string) => void) | undefined,
|
|
165
|
+
getProxyUrl: impl.getProxyUrl as (() => string) | undefined,
|
|
173
166
|
|
|
174
|
-
/**
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
167
|
+
/**
|
|
168
|
+
* 连接错误类,可用于 `instanceof` 检查。
|
|
169
|
+
* Web 平台始终可用,原生平台暂未实现。
|
|
170
|
+
*/
|
|
171
|
+
ImapNotConnectedError: impl.ImapNotConnectedError as
|
|
172
|
+
(new () => Error) | undefined,
|
|
180
173
|
|
|
181
|
-
/**
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
174
|
+
/**
|
|
175
|
+
* SMTP 连接错误类,可用于 `instanceof` 检查。
|
|
176
|
+
* Web 平台始终可用,原生平台暂未实现。
|
|
177
|
+
*/
|
|
178
|
+
SmtpNotConnectedError: impl.SmtpNotConnectedError as
|
|
179
|
+
(new () => Error) | undefined,
|
|
180
|
+
};
|