-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsdk.ts
More file actions
139 lines (126 loc) · 4.08 KB
/
Copy pathsdk.ts
File metadata and controls
139 lines (126 loc) · 4.08 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
77
78
79
80
81
82
83
84
85
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
135
136
137
138
139
/**
* Delta Chat Web SDK — Multi-Account, Multi-Transport Architecture
*
* Usage:
* const dc = DeltaChatSDK({ logLevel: 'debug' });
* const { id } = await dc.register('https://relay.example');
* const acc = dc.getAccount(id);
* await acc.connect();
* acc.on('DC_EVENT_INCOMING_MSG', handler);
*
* Class hierarchy (account/):
* AccountBase → Contacts → Messaging → Groups → SecureJoin →
* Profile → Inbox → Features → DeltaChatAccount
*
* Supporting modules:
* - lib/transport.ts — WebSocket + REST API communication
* - lib/crypto.ts — PGP encryption, key gen, Autocrypt
* - lib/mime.ts — MIME parsing, decryption, attachments
* - lib/messaging.ts — Outbound message builders
* - lib/securejoin.ts — SecureJoin protocol
* - lib/profile.ts — Avatar & display name helpers
* - types.ts — Public type definitions
* - store.ts — Persistence backends
*/
import { getFingerprintFromArmored } from './lib/crypto.js';
// ─── Core API ───────────────────────────────────────────────────────────────────
export { DeltaChatSDK, type IDeltaChatManager } from './account/manager.js';
export { DeltaChatAccount } from './account/account.js';
// ─── Class layers (for extension / advanced use) ────────────────────────────────
export {
AccountBase,
AccountContacts,
AccountMessaging,
AccountGroups,
AccountSecureJoin,
AccountProfile,
AccountInbox,
AccountFeatures,
} from './account/index.js';
// ─── Logging ────────────────────────────────────────────────────────────────────
export {
log,
writeLog,
setLogLevel,
getLogLevel,
setLogger,
getLogger,
configureLogger,
addLogSink,
} from './lib/logger.js';
export type {
LogLevel,
LogMethod,
LoggerFn,
LoggerConfig,
LogSink,
MadcoreLogger,
} from './lib/logger.js';
// ─── Types ──────────────────────────────────────────────────────────────────────
export type {
Credentials,
RegisterResult,
AccountInfo,
AccountStatus,
TransportStatus,
RelayInfo,
IncomingMessage,
Attachment,
ParsedMessage,
DCEvent,
DCEventData,
SecureJoinParsed,
SecureJoinResult,
WSRequest,
WSAction,
MailboxInfo,
MessageSummary,
MessageDetail,
FlagOperation,
Viewtype,
SDKConfig,
Connectivity,
} from './types.js';
export { ALL_DC_EVENTS, ALL_WS_ACTIONS } from './types.js';
export type { GroupInfo } from './lib/group.js';
export type {
StoredContact,
StoredMessage,
StoredChat,
StoredAccount,
StoredGroup,
ChatDraft,
IDeltaChatStore,
PersistedAccountMeta,
} from './store.js';
export {
MemoryStore,
IndexedDBStore,
createStore,
} from './store.js';
export {
viewtypeToStoreType,
storeTypeToViewtype,
storeTypeFromMime,
} from './lib/viewtype.js';
export type { MessageStoreType } from './lib/viewtype.js';
export type { QrScanResult, QrKind } from './lib/securejoin.js';export { checkQr, parseSecureJoinURI, generateSecureJoinURI } from './lib/securejoin.js';
export { getFingerprintFromArmored };
// ─── JSON-RPC compatibility (core wire API) ─────────────────────────────────────
export {
DeltaChatJsonRpc,
createJsonRpcCompat,
ALL_JSONRPC_METHODS,
IMPLEMENTED_JSONRPC_METHODS,
STUB_JSONRPC_METHODS,
isJsonRpcMethod,
methodCoverage,
RpcError,
RpcNotImplemented,
} from './jsonrpc/index.js';
export type {
JsonRpcCompatOptions,
JsonRpcMethodName,
JsonRpcEvent,
JsonRpcEventHandler,
} from './jsonrpc/index.js';