-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcore.mjs
More file actions
33 lines (27 loc) · 1.47 KB
/
core.mjs
File metadata and controls
33 lines (27 loc) · 1.47 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
/**
* tweet-shots core library
*
* Shared rendering, fetching, and utility code used by both the CLI
* (tweet-shots.mjs) and the API server (src/server.mjs).
*
* This module re-exports from focused sub-modules for backward compatibility.
* Direct imports from the sub-modules are preferred for new code:
* - tweet-fetch.mjs — extractTweetId, fetchTweet, fetchThread
* - tweet-html.mjs — THEMES, GRADIENTS, generateTweetHtml, formatDate, formatNumber
* - tweet-render.mjs — DIMENSIONS, renderTweetToImage, loadFonts, fetchImageAsBase64
* - tweet-emoji.mjs — emojiToCodepoint, fetchEmoji
* - tweet-fonts.mjs — loadLanguageFont, getSupportedLanguages
* - tweet-utils.mjs — translateText, processBatch, generatePDF
*/
// Tweet data fetching
export { extractTweetId, fetchTweet, fetchThread } from './tweet-fetch.mjs';
// HTML template generation
export { THEMES, GRADIENTS, formatDate, formatNumber, generateTweetHtml } from './tweet-html.mjs';
// Rendering pipeline
export { DIMENSIONS, fetchImageAsBase64, fetchImageAsBuffer, loadFonts, renderTweetToImage, countMediaImages, SSAA_MULTIPLIER, SSAA_MAX_INTERNAL_WIDTH, FORMAT_CONTENT_TYPES } from './tweet-render.mjs';
// Emoji rendering
export { emojiToCodepoint, fetchEmoji } from './tweet-emoji.mjs';
// Multilingual font loading
export { loadLanguageFont, getSupportedLanguages } from './tweet-fonts.mjs';
// CLI utilities
export { translateText, processBatch, generatePDF } from './tweet-utils.mjs';