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

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,135 @@
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
+ // ─── IMAP ──────────────────────────────────────────────────
22
+
23
+ export declare function imapConnect(
24
+ config: IMAPConfig
25
+ ): Promise<IMAPConnectionResult>;
26
+
27
+ export declare function imapDisconnect(): Promise<void>;
28
+
29
+ export declare function imapListMailboxes(): Promise<Mailbox[]>;
30
+
31
+ export declare function imapSelectMailbox(
32
+ mailbox: string,
33
+ readOnly?: boolean
34
+ ): Promise<MailboxStatus>;
35
+
36
+ export declare function imapRefreshMailbox(): Promise<MailboxStatus>;
37
+
38
+ export declare function imapFetchFolders(): Promise<Folder[]>;
39
+
40
+ export declare function imapCreateFolder(folderName: string): Promise<void>;
41
+
42
+ export declare function imapDeleteFolder(folderName: string): Promise<void>;
43
+
44
+ export declare function imapRenameFolder(
45
+ oldName: string,
46
+ newName: string
47
+ ): Promise<void>;
48
+
49
+ export declare function imapSubscribeFolder(folderName: string): Promise<void>;
50
+
51
+ export declare function imapUnsubscribeFolder(
52
+ folderName: string
53
+ ): Promise<void>;
54
+
55
+ export declare function imapFetchEmails(
56
+ options: FetchEmailsOptions
57
+ ): Promise<Email[]>;
58
+
59
+ export declare function imapFetchEmailByUID(
60
+ uid: number
61
+ ): Promise<Email | null>;
62
+
63
+ export declare function imapSearchEmails(
64
+ criteria: SearchCriteria
65
+ ): Promise<Email[]>;
66
+
67
+ export declare function imapMarkAsRead(
68
+ uids: number[],
69
+ silent?: boolean
70
+ ): Promise<void>;
71
+
72
+ export declare function imapMarkAsFlagged(
73
+ uids: number[],
74
+ flagged: boolean
75
+ ): Promise<void>;
76
+
77
+ export declare function imapMoveEmails(
78
+ uids: number[],
79
+ destinationMailbox: string
80
+ ): Promise<void>;
81
+
82
+ export declare function imapCopyEmails(
83
+ uids: number[],
84
+ destinationMailbox: string
85
+ ): Promise<void>;
86
+
87
+ export declare function imapDeleteEmails(
88
+ uids: number[]
89
+ ): Promise<BatchResult>;
90
+
91
+ export declare function imapExpunge(): Promise<void>;
92
+
93
+ export declare function imapFetchAttachments(
94
+ uid: number,
95
+ partId: string
96
+ ): Promise<Attachment | null>;
97
+
98
+ export declare function imapFetchAllAttachments(
99
+ uid: number
100
+ ): Promise<Attachment[]>;
101
+
102
+ export declare function imapIdle(
103
+ callback: (notification: IMAPNotification) => void
104
+ ): Promise<void>;
105
+
106
+ export declare function imapStopIdle(): Promise<void>;
107
+
108
+ export declare function imapGetQuota(root?: string): Promise<QuotaInfo>;
109
+
110
+ export declare function imapAppendMessage(
111
+ mailbox: string,
112
+ rawMimeData: ArrayBuffer,
113
+ flags?: string[]
114
+ ): Promise<AppendResult>;
115
+
116
+ // ─── SMTP ──────────────────────────────────────────────────
117
+
118
+ export declare function smtpConnect(
119
+ config: SMTPConfig
120
+ ): Promise<SMTPConnectionResult>;
121
+
122
+ export declare function smtpDisconnect(): Promise<void>;
123
+
124
+ export declare function smtpSendMail(
125
+ options: SendMailOptions
126
+ ): Promise<SendMailResult>;
127
+
128
+ export declare function smtpVerifyConnection(): Promise<boolean>;
129
+
130
+ // ─── Web 专属(原生平台为 undefined) ─────────────────────
131
+
132
+ export declare const setProxyUrl: ((url: string) => void) | undefined;
133
+ export declare const getProxyUrl: (() => string) | undefined;
134
+ export declare const ImapNotConnectedError: (new () => Error) | undefined;
135
+ 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.17",
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",