@gravito/radiance 1.0.4 → 1.0.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.
Files changed (148) hide show
  1. package/README.md +30 -7
  2. package/dist/core/src/Application.d.ts +256 -0
  3. package/dist/core/src/CommandKernel.d.ts +33 -0
  4. package/dist/core/src/ConfigManager.d.ts +65 -0
  5. package/dist/core/src/Container/RequestScopeManager.d.ts +62 -0
  6. package/dist/core/src/Container/RequestScopeMetrics.d.ts +144 -0
  7. package/dist/core/src/Container.d.ts +153 -0
  8. package/dist/core/src/ErrorHandler.d.ts +66 -0
  9. package/dist/core/src/Event.d.ts +5 -0
  10. package/dist/core/src/EventManager.d.ts +123 -0
  11. package/dist/core/src/GlobalErrorHandlers.d.ts +47 -0
  12. package/dist/core/src/GravitoServer.d.ts +28 -0
  13. package/dist/core/src/HookManager.d.ts +435 -0
  14. package/dist/core/src/Listener.d.ts +4 -0
  15. package/dist/core/src/Logger.d.ts +20 -0
  16. package/dist/core/src/PlanetCore.d.ts +402 -0
  17. package/dist/core/src/RequestContext.d.ts +97 -0
  18. package/dist/core/src/Route.d.ts +36 -0
  19. package/dist/core/src/Router.d.ts +270 -0
  20. package/dist/core/src/ServiceProvider.d.ts +178 -0
  21. package/dist/core/src/adapters/GravitoEngineAdapter.d.ts +27 -0
  22. package/dist/core/src/adapters/bun/BunContext.d.ts +54 -0
  23. package/dist/core/src/adapters/bun/BunNativeAdapter.d.ts +66 -0
  24. package/dist/core/src/adapters/bun/BunRequest.d.ts +31 -0
  25. package/dist/core/src/adapters/bun/BunWebSocketHandler.d.ts +48 -0
  26. package/dist/core/src/adapters/bun/RadixNode.d.ts +19 -0
  27. package/dist/core/src/adapters/bun/RadixRouter.d.ts +32 -0
  28. package/dist/core/src/adapters/bun/index.d.ts +7 -0
  29. package/dist/core/src/adapters/bun/types.d.ts +20 -0
  30. package/dist/core/src/adapters/types.d.ts +235 -0
  31. package/dist/core/src/binary/BinaryUtils.d.ts +105 -0
  32. package/dist/core/src/binary/index.d.ts +5 -0
  33. package/dist/core/src/cli/queue-commands.d.ts +6 -0
  34. package/dist/core/src/compat/async-local-storage.d.ts +7 -0
  35. package/dist/core/src/compat/crypto.d.ts +6 -0
  36. package/dist/core/src/engine/AOTRouter.d.ts +139 -0
  37. package/dist/core/src/engine/FastContext.d.ts +141 -0
  38. package/dist/core/src/engine/Gravito.d.ts +131 -0
  39. package/dist/core/src/engine/MinimalContext.d.ts +102 -0
  40. package/dist/core/src/engine/analyzer.d.ts +113 -0
  41. package/dist/core/src/engine/constants.d.ts +23 -0
  42. package/dist/core/src/engine/index.d.ts +26 -0
  43. package/dist/core/src/engine/path.d.ts +26 -0
  44. package/dist/core/src/engine/pool.d.ts +83 -0
  45. package/dist/core/src/engine/types.d.ts +149 -0
  46. package/dist/core/src/error-handling/RequestScopeErrorContext.d.ts +126 -0
  47. package/dist/core/src/events/BackpressureManager.d.ts +215 -0
  48. package/dist/core/src/events/CircuitBreaker.d.ts +229 -0
  49. package/dist/core/src/events/DeadLetterQueue.d.ts +219 -0
  50. package/dist/core/src/events/EventBackend.d.ts +12 -0
  51. package/dist/core/src/events/EventOptions.d.ts +204 -0
  52. package/dist/core/src/events/EventPriorityQueue.d.ts +63 -0
  53. package/dist/core/src/events/FlowControlStrategy.d.ts +109 -0
  54. package/dist/core/src/events/IdempotencyCache.d.ts +60 -0
  55. package/dist/core/src/events/MessageQueueBridge.d.ts +184 -0
  56. package/dist/core/src/events/PriorityEscalationManager.d.ts +82 -0
  57. package/dist/core/src/events/RetryScheduler.d.ts +104 -0
  58. package/dist/core/src/events/WorkerPool.d.ts +98 -0
  59. package/dist/core/src/events/WorkerPoolConfig.d.ts +153 -0
  60. package/dist/core/src/events/WorkerPoolMetrics.d.ts +65 -0
  61. package/dist/core/src/events/aggregation/AggregationWindow.d.ts +77 -0
  62. package/dist/core/src/events/aggregation/DeduplicationManager.d.ts +135 -0
  63. package/dist/core/src/events/aggregation/EventAggregationManager.d.ts +108 -0
  64. package/dist/core/src/events/aggregation/EventBatcher.d.ts +99 -0
  65. package/dist/core/src/events/aggregation/types.d.ts +117 -0
  66. package/dist/core/src/events/index.d.ts +26 -0
  67. package/dist/core/src/events/observability/EventMetrics.d.ts +132 -0
  68. package/dist/core/src/events/observability/EventTracer.d.ts +68 -0
  69. package/dist/core/src/events/observability/EventTracing.d.ts +161 -0
  70. package/dist/core/src/events/observability/OTelEventMetrics.d.ts +332 -0
  71. package/dist/core/src/events/observability/ObservableHookManager.d.ts +108 -0
  72. package/dist/core/src/events/observability/StreamWorkerMetrics.d.ts +76 -0
  73. package/dist/core/src/events/observability/index.d.ts +24 -0
  74. package/dist/core/src/events/observability/metrics-types.d.ts +16 -0
  75. package/dist/core/src/events/queue-core.d.ts +77 -0
  76. package/dist/core/src/events/task-executor.d.ts +51 -0
  77. package/dist/core/src/events/types.d.ts +134 -0
  78. package/dist/core/src/exceptions/AuthenticationException.d.ts +8 -0
  79. package/dist/core/src/exceptions/AuthorizationException.d.ts +8 -0
  80. package/dist/core/src/exceptions/CircularDependencyException.d.ts +9 -0
  81. package/dist/core/src/exceptions/GravitoException.d.ts +23 -0
  82. package/dist/core/src/exceptions/HttpException.d.ts +9 -0
  83. package/dist/core/src/exceptions/ModelNotFoundException.d.ts +10 -0
  84. package/dist/core/src/exceptions/ValidationException.d.ts +22 -0
  85. package/dist/core/src/exceptions/index.d.ts +7 -0
  86. package/dist/core/src/ffi/NativeAccelerator.d.ts +62 -0
  87. package/dist/core/src/ffi/NativeHasher.d.ts +139 -0
  88. package/dist/core/src/ffi/cbor-fallback.d.ts +96 -0
  89. package/dist/core/src/ffi/hash-fallback.d.ts +33 -0
  90. package/dist/core/src/ffi/index.d.ts +10 -0
  91. package/dist/core/src/ffi/types.d.ts +135 -0
  92. package/dist/core/src/health/HealthProvider.d.ts +67 -0
  93. package/dist/core/src/helpers/Arr.d.ts +19 -0
  94. package/dist/core/src/helpers/Str.d.ts +38 -0
  95. package/dist/core/src/helpers/data.d.ts +25 -0
  96. package/dist/core/src/helpers/errors.d.ts +34 -0
  97. package/dist/core/src/helpers/response.d.ts +41 -0
  98. package/dist/core/src/helpers.d.ts +338 -0
  99. package/dist/core/src/hooks/ActionManager.d.ts +132 -0
  100. package/dist/core/src/hooks/AsyncDetector.d.ts +84 -0
  101. package/dist/core/src/hooks/FilterManager.d.ts +71 -0
  102. package/dist/core/src/hooks/MigrationWarner.d.ts +24 -0
  103. package/dist/core/src/hooks/dlq-operations.d.ts +60 -0
  104. package/dist/core/src/hooks/types.d.ts +107 -0
  105. package/dist/core/src/http/CookieJar.d.ts +51 -0
  106. package/dist/core/src/http/cookie.d.ts +29 -0
  107. package/dist/core/src/http/types.d.ts +395 -0
  108. package/dist/core/src/index.d.ts +565 -0
  109. package/dist/core/src/observability/QueueDashboard.d.ts +136 -0
  110. package/dist/core/src/observability/contracts.d.ts +137 -0
  111. package/dist/core/src/reliability/DeadLetterQueueManager.d.ts +349 -0
  112. package/dist/core/src/reliability/RetryPolicy.d.ts +217 -0
  113. package/dist/core/src/reliability/index.d.ts +6 -0
  114. package/dist/core/src/router/ControllerDispatcher.d.ts +12 -0
  115. package/dist/core/src/router/RequestValidator.d.ts +20 -0
  116. package/dist/core/src/runtime/adapter-bun.d.ts +12 -0
  117. package/dist/core/src/runtime/adapter-deno.d.ts +12 -0
  118. package/dist/core/src/runtime/adapter-node.d.ts +12 -0
  119. package/dist/core/src/runtime/adapter-unknown.d.ts +13 -0
  120. package/dist/core/src/runtime/archive.d.ts +17 -0
  121. package/dist/core/src/runtime/compression.d.ts +21 -0
  122. package/dist/core/src/runtime/deep-equals.d.ts +56 -0
  123. package/dist/core/src/runtime/detection.d.ts +22 -0
  124. package/dist/core/src/runtime/escape.d.ts +34 -0
  125. package/dist/core/src/runtime/index.d.ts +44 -0
  126. package/dist/core/src/runtime/markdown.d.ts +44 -0
  127. package/dist/core/src/runtime/types.d.ts +436 -0
  128. package/dist/core/src/runtime-helpers.d.ts +67 -0
  129. package/dist/core/src/runtime.d.ts +11 -0
  130. package/dist/core/src/security/Encrypter.d.ts +33 -0
  131. package/dist/core/src/security/Hasher.d.ts +29 -0
  132. package/dist/core/src/testing/HttpTester.d.ts +40 -0
  133. package/dist/core/src/testing/TestResponse.d.ts +78 -0
  134. package/dist/core/src/testing/index.d.ts +2 -0
  135. package/dist/core/src/transpiler-utils.d.ts +170 -0
  136. package/dist/core/src/types/events.d.ts +94 -0
  137. package/dist/index.js +1 -294
  138. package/dist/index.js.map +3 -10
  139. package/dist/radiance/src/BroadcastManager.d.ts +124 -0
  140. package/dist/radiance/src/OrbitRadiance.d.ts +98 -0
  141. package/dist/radiance/src/channels/Channel.d.ts +86 -0
  142. package/dist/radiance/src/drivers/AblyDriver.d.ts +73 -0
  143. package/dist/radiance/src/drivers/BroadcastDriver.d.ts +50 -0
  144. package/dist/radiance/src/drivers/PusherDriver.d.ts +95 -0
  145. package/dist/radiance/src/drivers/RedisDriver.d.ts +83 -0
  146. package/dist/radiance/src/drivers/WebSocketDriver.d.ts +89 -0
  147. package/dist/radiance/src/index.d.ts +39 -0
  148. package/package.json +4 -2
@@ -0,0 +1,12 @@
1
+ import type { GravitoHandler } from '../http/types';
2
+ import type { PlanetCore } from '../PlanetCore';
3
+ import type { ControllerClass } from '../Router';
4
+ export declare class ControllerDispatcher {
5
+ private core;
6
+ private controllers;
7
+ constructor(core: PlanetCore);
8
+ /**
9
+ * Resolve Controller Instance and Method
10
+ */
11
+ resolve(CtrlClass: ControllerClass, methodName: string): GravitoHandler;
12
+ }
@@ -0,0 +1,20 @@
1
+ import type { GravitoMiddleware } from '../http/types';
2
+ import { type FormRequestClass } from '../Router';
3
+ /**
4
+ * Handles validation of incoming requests using FormRequest classes.
5
+ * Provides mechanisms to detect and convert FormRequest classes into Gravito middleware.
6
+ */
7
+ export declare class RequestValidator {
8
+ /**
9
+ * Check if a value is a FormRequest class.
10
+ * Optimized with Symbol check, prototype check, and caching.
11
+ * @internal
12
+ */
13
+ static isFormRequestClass(value: unknown): value is FormRequestClass;
14
+ /**
15
+ * Convert a FormRequest class to middleware.
16
+ * Uses instance caching to avoid re-instantiation on every request.
17
+ * @internal
18
+ */
19
+ static formRequestToMiddleware(RequestClass: FormRequestClass): GravitoMiddleware;
20
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Bun runtime adapter implementation.
3
+ *
4
+ * @module runtime/adapter-bun
5
+ * @since 3.2.0
6
+ */
7
+ import type { RuntimeAdapter } from './types';
8
+ /**
9
+ * Create a RuntimeAdapter for the Bun runtime.
10
+ * @internal
11
+ */
12
+ export declare function createBunAdapter(): RuntimeAdapter;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Deno runtime adapter implementation.
3
+ *
4
+ * @module runtime/adapter-deno
5
+ * @since 3.2.0
6
+ */
7
+ import type { RuntimeAdapter } from './types';
8
+ /**
9
+ * Create a RuntimeAdapter for the Deno runtime.
10
+ * @internal
11
+ */
12
+ export declare function createDenoAdapter(): RuntimeAdapter;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Node.js runtime adapter implementation.
3
+ *
4
+ * @module runtime/adapter-node
5
+ * @since 3.2.0
6
+ */
7
+ import type { RuntimeAdapter } from './types';
8
+ /**
9
+ * Create a RuntimeAdapter for the Node.js runtime.
10
+ * @internal
11
+ */
12
+ export declare function createNodeAdapter(): RuntimeAdapter;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Unknown runtime adapter implementation (fallback).
3
+ *
4
+ * @module runtime/adapter-unknown
5
+ * @since 3.2.0
6
+ */
7
+ import type { RuntimeAdapter } from './types';
8
+ /**
9
+ * Create a RuntimeAdapter for unsupported runtimes.
10
+ * All methods throw with descriptive error messages.
11
+ * @internal
12
+ */
13
+ export declare function createUnknownAdapter(): RuntimeAdapter;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Runtime archive adapter implementations.
3
+ *
4
+ * @module runtime/archive
5
+ * @since 3.2.0
6
+ */
7
+ import type { ArchiveFromDirectoryOptions, RuntimeArchiveAdapter } from './types';
8
+ /**
9
+ * 取得封裝操作 adapter
10
+ * @public
11
+ */
12
+ export declare function getArchiveAdapter(): RuntimeArchiveAdapter;
13
+ /**
14
+ * 將目錄封裝為歸檔檔案
15
+ * @public
16
+ */
17
+ export declare function archiveFromDirectory(dirPath: string, archivePath: string, options?: ArchiveFromDirectoryOptions): Promise<Uint8Array>;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Runtime compression adapter implementations.
3
+ *
4
+ * Provides unified gzip/deflate compression across Bun and Node.js runtimes.
5
+ * Bun uses native C++ implementations (Bun.gzipSync etc.) for 2-5x better performance.
6
+ * Node.js falls back to the standard node:zlib module.
7
+ *
8
+ * @module runtime/compression
9
+ * @since 3.2.0
10
+ */
11
+ import type { RuntimeCompressionAdapter } from './types';
12
+ /**
13
+ * 取得壓縮操作 adapter(依運行時自動選擇最佳實作)
14
+ *
15
+ * - Bun: 使用原生 C++ 壓縮(2-5x 更快)
16
+ * - Node.js: 使用 node:zlib
17
+ * - Deno/Unknown: 拋出錯誤
18
+ *
19
+ * @public
20
+ */
21
+ export declare function getCompressionAdapter(): RuntimeCompressionAdapter;
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Deep equality comparison abstraction.
3
+ *
4
+ * Provides unified deep equality checking across Bun, Node.js, and Deno runtimes.
5
+ * Uses Bun.deepEquals() when available, falls back to recursive comparison.
6
+ *
7
+ * @module runtime/deep-equals
8
+ * @since 3.2.0
9
+ */
10
+ /**
11
+ * Options for deep equality comparison.
12
+ * @public
13
+ */
14
+ export interface DeepEqualsOptions {
15
+ /**
16
+ * When true, uses strict equality semantics:
17
+ * - NaN !== NaN
18
+ * - +0 !== -0
19
+ *
20
+ * When false (default), uses lenient semantics:
21
+ * - NaN === NaN
22
+ * - +0 === -0
23
+ */
24
+ strict?: boolean;
25
+ }
26
+ /**
27
+ * Function signature for deep equality comparison.
28
+ * @public
29
+ */
30
+ export type DeepEqualsFn = (a: unknown, b: unknown, options?: DeepEqualsOptions) => boolean;
31
+ /**
32
+ * Get the optimized deep equality comparison function for the current runtime.
33
+ *
34
+ * - **Bun**: Uses native Bun.deepEquals() for maximum performance (C++ optimized)
35
+ * - **Node.js/Deno/Unknown**: Uses fallback recursive implementation with cycle detection
36
+ *
37
+ * Results are cached after first invocation for efficiency.
38
+ *
39
+ * @returns A function that performs deep equality comparison
40
+ * @public
41
+ *
42
+ * @example
43
+ * ```typescript
44
+ * const deepEquals = getDeepEquals()
45
+ *
46
+ * const obj1 = { a: [1, 2], b: { c: 3 } }
47
+ * const obj2 = { a: [1, 2], b: { c: 3 } }
48
+ *
49
+ * console.log(deepEquals(obj1, obj2)) // true
50
+ *
51
+ * // Strict mode for +0 / -0 and NaN
52
+ * console.log(deepEquals(NaN, NaN)) // true (lenient)
53
+ * console.log(deepEquals(NaN, NaN, { strict: true })) // false
54
+ * ```
55
+ */
56
+ export declare function getDeepEquals(): DeepEqualsFn;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Runtime detection utilities.
3
+ *
4
+ * @module runtime/detection
5
+ * @since 3.2.0
6
+ */
7
+ import type { RuntimeKind } from './types';
8
+ /**
9
+ * Detect the current JavaScript runtime environment.
10
+ * @internal
11
+ */
12
+ export declare function getRuntimeKind(): RuntimeKind;
13
+ /**
14
+ * Get environment variables from the current runtime.
15
+ * @public
16
+ */
17
+ export declare function getRuntimeEnv(): Record<string, string | undefined>;
18
+ /**
19
+ * Convert various data types to Uint8Array.
20
+ * @internal
21
+ */
22
+ export declare function toUint8Array(data: Blob | Buffer | string | ArrayBuffer | Uint8Array): Promise<Uint8Array>;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Runtime HTML escape abstraction.
3
+ *
4
+ * Provides unified HTML escaping across Bun, Node.js, and Deno runtimes.
5
+ * Bun uses the native C++ `Bun.escapeHTML()` for 10-100x better performance.
6
+ * Node.js/Deno fall back to manual entity replacement.
7
+ *
8
+ * @module runtime/escape
9
+ * @since 3.4.0
10
+ */
11
+ /**
12
+ * HTML escape function type.
13
+ * @public
14
+ */
15
+ export type EscapeHtmlFn = (value: string) => string;
16
+ /**
17
+ * Get the HTML escape function (auto-selects best implementation based on runtime).
18
+ *
19
+ * - Bun: Uses native C++ `Bun.escapeHTML()` (10-100x faster, SIMD accelerated)
20
+ * - Node.js/Deno/Unknown: Uses .replace() chain fallback with same behavior
21
+ *
22
+ * @returns HTML escape function
23
+ * @public
24
+ *
25
+ * @example
26
+ * ```typescript
27
+ * import { getEscapeHtml } from '@gravito/core'
28
+ *
29
+ * const escapeHtml = getEscapeHtml()
30
+ * const safe = escapeHtml('<script>alert("xss")</script>')
31
+ * // '&lt;script&gt;alert(&quot;xss&quot;)&lt;/script&gt;'
32
+ * ```
33
+ */
34
+ export declare function getEscapeHtml(): EscapeHtmlFn;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Runtime abstraction module.
3
+ *
4
+ * Provides unified APIs for filesystem, process, archive, and compression
5
+ * operations across Bun, Node.js, and Deno runtimes.
6
+ *
7
+ * @module runtime
8
+ * @since 3.2.0
9
+ */
10
+ import type { RuntimeAdapter, RuntimePasswordAdapter, RuntimeSqliteDatabase } from './types';
11
+ export type { ArchiveCreateOptions, ArchiveEntry, ArchiveExtractOptions, ArchiveFileInfo, ArchiveFromDirectoryOptions, CompressionOptions, MarkdownRenderCallbacks, MarkdownRenderOptions, OptionalRuntimeResourceUsage, RuntimeAdapter, RuntimeArchiveAdapter, RuntimeCompressionAdapter, RuntimeFileSink, RuntimeFileStat, RuntimeKind, RuntimeMarkdownAdapter, RuntimePasswordAdapter, RuntimeProcess, RuntimeProcessOutput, RuntimeResourceUsage, RuntimeServeConfig, RuntimeServer, RuntimeSpawnOptions, RuntimeSpawnSyncResult, RuntimeSqliteDatabase, RuntimeSqliteStatement, } from './types';
12
+ export { getRuntimeEnv, getRuntimeKind } from './detection';
13
+ export { archiveFromDirectory, getArchiveAdapter, } from './archive';
14
+ export { getCompressionAdapter } from './compression';
15
+ export { createHtmlRenderCallbacks, getMarkdownAdapter } from './markdown';
16
+ export type { DeepEqualsFn, DeepEqualsOptions } from './deep-equals';
17
+ export { getDeepEquals } from './deep-equals';
18
+ export type { EscapeHtmlFn } from './escape';
19
+ export { getEscapeHtml } from './escape';
20
+ /**
21
+ * Get the runtime abstraction adapter (Bun/Node/Deno).
22
+ * @public
23
+ */
24
+ export declare function getRuntimeAdapter(): RuntimeAdapter;
25
+ /**
26
+ * Reset the runtime adapter (mainly for testing).
27
+ * @internal
28
+ */
29
+ export declare function resetRuntimeAdapter(): void;
30
+ /**
31
+ * Get the password hashing adapter using native optimized implementations if available.
32
+ * @public
33
+ */
34
+ export declare function getPasswordAdapter(): RuntimePasswordAdapter;
35
+ /**
36
+ * Create a SQLite database connection using runtime-native drivers.
37
+ * @public
38
+ */
39
+ export declare function createSqliteDatabase(path: string): Promise<RuntimeSqliteDatabase>;
40
+ /**
41
+ * Convert various data types to Uint8Array.
42
+ * @internal
43
+ */
44
+ export declare function toUint8Array(data: Blob | Buffer | string | ArrayBuffer | Uint8Array): Promise<Uint8Array>;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Runtime markdown adapter implementations.
3
+ *
4
+ * Provides unified Markdown -> HTML rendering across Bun and Node.js runtimes.
5
+ * Bun uses the native C++ Markdown parser (Bun.markdown) for 10-100x better performance.
6
+ * Node.js falls back to the `marked` library (lazy-loaded optional dependency).
7
+ *
8
+ * @module runtime/markdown
9
+ * @since 3.3.0
10
+ */
11
+ import type { MarkdownRenderCallbacks, RuntimeMarkdownAdapter } from './types';
12
+ /**
13
+ * 建立預設的 HTML 渲染回調集合。
14
+ *
15
+ * 提供完整的 HTML 元素生成回調,產生與 `html()` 相同的 HTML 輸出。
16
+ * 使用者可透過覆寫個別回調來自訂特定元素的渲染行為(例如 XSS 防護、
17
+ * 自訂 CSS class 等),同時保留其他元素的預設 HTML 渲染。
18
+ *
19
+ * @param overrides - 要覆寫的回調。未指定的回調使用預設 HTML 渲染。
20
+ * @returns 完整的 MarkdownRenderCallbacks 物件
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * // 自訂 link 和 html 渲染(XSS 防護)
25
+ * const callbacks = createHtmlRenderCallbacks({
26
+ * html: (raw) => escapeHtml(raw),
27
+ * link: (content, { href }) => `<a href="${href}" rel="noopener">${content}</a>`,
28
+ * })
29
+ * const result = adapter.render(markdown, callbacks)
30
+ * ```
31
+ *
32
+ * @public
33
+ */
34
+ export declare function createHtmlRenderCallbacks(overrides?: Partial<MarkdownRenderCallbacks>): MarkdownRenderCallbacks;
35
+ /**
36
+ * 取得 Markdown 操作 adapter(依運行時自動選擇最佳實作)
37
+ *
38
+ * - Bun: 使用原生 C++ Markdown 解析器(10-100x 更快)
39
+ * - Node.js: 使用 marked 函式庫(延遲載入 optional dependency)
40
+ * - Deno/Unknown: 拋出錯誤
41
+ *
42
+ * @public
43
+ */
44
+ export declare function getMarkdownAdapter(): RuntimeMarkdownAdapter;