@navios/commander-tui 1.3.0 → 1.5.0
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/CHANGELOG.md +36 -0
- package/{src/__tests__/mocks/scm-mock.ts → dist/base/src/__tests__/mocks/scm-mock.d.ts} +3 -1
- package/dist/base/src/__tests__/mocks/scm-mock.d.ts.map +1 -0
- package/dist/base/src/__tests__/setup.d.ts +2 -0
- package/dist/base/src/__tests__/setup.d.ts.map +1 -0
- package/dist/base/src/__tests__/utils/factories.d.ts +67 -0
- package/dist/base/src/__tests__/utils/factories.d.ts.map +1 -0
- package/dist/base/src/__tests__/utils/render-utils.d.ts +21 -0
- package/dist/base/src/__tests__/utils/render-utils.d.ts.map +1 -0
- package/dist/base/src/__tests__/utils/test-container.d.ts +20 -0
- package/dist/base/src/__tests__/utils/test-container.d.ts.map +1 -0
- package/dist/base/src/adapters/interface.d.ts +9 -2
- package/dist/base/src/adapters/interface.d.ts.map +1 -1
- package/dist/base/src/overrides/missing-adapter.override.d.ts +10 -0
- package/dist/base/src/overrides/missing-adapter.override.d.ts.map +1 -1
- package/dist/base/src/services/index.d.ts +1 -0
- package/dist/base/src/services/index.d.ts.map +1 -1
- package/dist/base/src/services/logger.d.ts.map +1 -1
- package/dist/base/src/services/readline_prompt.d.ts +27 -0
- package/dist/base/src/services/readline_prompt.d.ts.map +1 -0
- package/dist/base/src/services/screen.d.ts +14 -8
- package/dist/base/src/services/screen.d.ts.map +1 -1
- package/dist/base/src/services/screen_manager.d.ts +62 -12
- package/dist/base/src/services/screen_manager.d.ts.map +1 -1
- package/dist/base/src/tokens/logger.d.ts +2 -2
- package/dist/base/src/types/events.types.d.ts +40 -0
- package/dist/base/src/types/events.types.d.ts.map +1 -0
- package/dist/base/src/types/index.d.ts +1 -0
- package/dist/base/src/types/index.d.ts.map +1 -1
- package/dist/base/src/types/screen.types.d.ts +28 -0
- package/dist/base/src/types/screen.types.d.ts.map +1 -1
- package/dist/base/src/utils/colors/helpers.d.ts +0 -16
- package/dist/base/src/utils/colors/helpers.d.ts.map +1 -1
- package/dist/base/src/utils/index.d.ts +2 -0
- package/dist/base/src/utils/index.d.ts.map +1 -1
- package/dist/base/src/utils/prompt.d.ts +7 -0
- package/dist/base/src/utils/prompt.d.ts.map +1 -0
- package/dist/base/src/utils/runtime.d.ts +10 -0
- package/dist/base/src/utils/runtime.d.ts.map +1 -0
- package/dist/base/src/utils/stdout-printer.d.ts +5 -0
- package/dist/base/src/utils/stdout-printer.d.ts.map +1 -1
- package/dist/base/tsconfig.base.tsbuildinfo +1 -1
- package/dist/base/tsconfig.tsbuildinfo +1 -0
- package/dist/ink/src/adapters/ink/components/file/file_log.d.ts +28 -0
- package/dist/ink/src/adapters/ink/components/file/file_log.d.ts.map +1 -0
- package/dist/ink/src/adapters/ink/components/file/index.d.ts +2 -0
- package/dist/ink/src/adapters/ink/components/file/index.d.ts.map +1 -0
- package/dist/ink/src/adapters/ink/components/filter/filter_bar.d.ts +7 -0
- package/dist/ink/src/adapters/ink/components/filter/filter_bar.d.ts.map +1 -0
- package/dist/ink/src/adapters/ink/components/filter/index.d.ts +2 -0
- package/dist/ink/src/adapters/ink/components/filter/index.d.ts.map +1 -0
- package/dist/ink/src/adapters/ink/components/help/help_overlay.d.ts +6 -0
- package/dist/ink/src/adapters/ink/components/help/help_overlay.d.ts.map +1 -0
- package/dist/ink/src/adapters/ink/components/help/index.d.ts +2 -0
- package/dist/ink/src/adapters/ink/components/help/index.d.ts.map +1 -0
- package/dist/ink/src/adapters/ink/components/index.d.ts +9 -0
- package/dist/ink/src/adapters/ink/components/index.d.ts.map +1 -0
- package/dist/ink/src/adapters/ink/components/log/index.d.ts +2 -0
- package/dist/ink/src/adapters/ink/components/log/index.d.ts.map +1 -0
- package/dist/ink/src/adapters/ink/components/log/log_message.d.ts +15 -0
- package/dist/ink/src/adapters/ink/components/log/log_message.d.ts.map +1 -0
- package/dist/ink/src/adapters/ink/components/prompt/index.d.ts +2 -0
- package/dist/ink/src/adapters/ink/components/prompt/index.d.ts.map +1 -0
- package/dist/ink/src/adapters/ink/components/prompt/prompt_renderer.d.ts +6 -0
- package/dist/ink/src/adapters/ink/components/prompt/prompt_renderer.d.ts.map +1 -0
- package/dist/ink/src/adapters/ink/components/screen/group_renderer.d.ts +14 -0
- package/dist/ink/src/adapters/ink/components/screen/group_renderer.d.ts.map +1 -0
- package/dist/ink/src/adapters/ink/components/screen/index.d.ts +7 -0
- package/dist/ink/src/adapters/ink/components/screen/index.d.ts.map +1 -0
- package/dist/ink/src/adapters/ink/components/screen/loading_message.d.ts +6 -0
- package/dist/ink/src/adapters/ink/components/screen/loading_message.d.ts.map +1 -0
- package/dist/ink/src/adapters/ink/components/screen/message_renderer.d.ts +6 -0
- package/dist/ink/src/adapters/ink/components/screen/message_renderer.d.ts.map +1 -0
- package/dist/ink/src/adapters/ink/components/screen/progress_message.d.ts +6 -0
- package/dist/ink/src/adapters/ink/components/screen/progress_message.d.ts.map +1 -0
- package/dist/ink/src/adapters/ink/components/screen/screen_bridge.d.ts +14 -0
- package/dist/ink/src/adapters/ink/components/screen/screen_bridge.d.ts.map +1 -0
- package/dist/ink/src/adapters/ink/components/screen/table_message.d.ts +6 -0
- package/dist/ink/src/adapters/ink/components/screen/table_message.d.ts.map +1 -0
- package/dist/ink/src/adapters/ink/components/screen_manager_bridge.d.ts +8 -0
- package/dist/ink/src/adapters/ink/components/screen_manager_bridge.d.ts.map +1 -0
- package/dist/ink/src/adapters/ink/components/sidebar/index.d.ts +4 -0
- package/dist/ink/src/adapters/ink/components/sidebar/index.d.ts.map +1 -0
- package/dist/ink/src/adapters/ink/components/sidebar/sidebar.d.ts +11 -0
- package/dist/ink/src/adapters/ink/components/sidebar/sidebar.d.ts.map +1 -0
- package/dist/ink/src/adapters/ink/components/sidebar/sidebar_item.d.ts +9 -0
- package/dist/ink/src/adapters/ink/components/sidebar/sidebar_item.d.ts.map +1 -0
- package/dist/ink/src/adapters/ink/components/sidebar/sidebar_separator.d.ts +2 -0
- package/dist/ink/src/adapters/ink/components/sidebar/sidebar_separator.d.ts.map +1 -0
- package/dist/ink/src/adapters/ink/context/index.d.ts +2 -0
- package/dist/ink/src/adapters/ink/context/index.d.ts.map +1 -0
- package/dist/ink/src/adapters/ink/context/logger_context.d.ts +33 -0
- package/dist/ink/src/adapters/ink/context/logger_context.d.ts.map +1 -0
- package/dist/ink/src/adapters/ink/hooks/index.d.ts +2 -0
- package/dist/ink/src/adapters/ink/hooks/index.d.ts.map +1 -0
- package/dist/ink/src/adapters/ink/hooks/use_theme.d.ts +7 -0
- package/dist/ink/src/adapters/ink/hooks/use_theme.d.ts.map +1 -0
- package/dist/ink/src/adapters/ink/index.d.ts +18 -0
- package/dist/ink/src/adapters/ink/index.d.ts.map +1 -0
- package/dist/ink/src/adapters/react-shared/hooks/index.d.ts +4 -0
- package/dist/ink/src/adapters/react-shared/hooks/index.d.ts.map +1 -0
- package/dist/ink/src/adapters/react-shared/hooks/use_filter_state.d.ts +18 -0
- package/dist/ink/src/adapters/react-shared/hooks/use_filter_state.d.ts.map +1 -0
- package/dist/ink/src/adapters/react-shared/hooks/use_keyboard_manager.d.ts +26 -0
- package/dist/ink/src/adapters/react-shared/hooks/use_keyboard_manager.d.ts.map +1 -0
- package/dist/ink/src/adapters/react-shared/hooks/use_manager_subscription.d.ts +7 -0
- package/dist/ink/src/adapters/react-shared/hooks/use_manager_subscription.d.ts.map +1 -0
- package/dist/ink/src/adapters/react-shared/index.d.ts +2 -0
- package/dist/ink/src/adapters/react-shared/index.d.ts.map +1 -0
- package/dist/ink/tsconfig.ink.tsbuildinfo +1 -0
- package/dist/react/src/adapters/react-shared/hooks/index.d.ts +4 -0
- package/dist/react/src/adapters/react-shared/hooks/index.d.ts.map +1 -0
- package/dist/react/src/adapters/react-shared/hooks/use_filter_state.d.ts +18 -0
- package/dist/react/src/adapters/react-shared/hooks/use_filter_state.d.ts.map +1 -0
- package/dist/react/src/adapters/react-shared/hooks/use_keyboard_manager.d.ts +26 -0
- package/dist/react/src/adapters/react-shared/hooks/use_keyboard_manager.d.ts.map +1 -0
- package/dist/react/src/adapters/react-shared/hooks/use_manager_subscription.d.ts +7 -0
- package/dist/react/src/adapters/react-shared/hooks/use_manager_subscription.d.ts.map +1 -0
- package/dist/react/src/adapters/react-shared/index.d.ts +2 -0
- package/dist/react/src/adapters/react-shared/index.d.ts.map +1 -0
- package/dist/react/tsconfig.react.tsbuildinfo +1 -1
- package/dist/solid/tsconfig.solid.tsbuildinfo +1 -1
- package/lib/index.cjs +2180 -181
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +3199 -277
- package/lib/index.d.cts.map +1 -0
- package/lib/index.d.mts +3199 -277
- package/lib/index.d.mts.map +1 -0
- package/lib/index.mjs +2101 -138
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -31
- package/src/__tests__/services/logger.spec.ts +32 -0
- package/src/__tests__/services/screen.spec.ts +114 -101
- package/src/__tests__/utils/factories.ts +2 -0
- package/src/adapters/interface.ts +10 -2
- package/src/overrides/missing-adapter.override.ts +16 -6
- package/src/services/index.ts +1 -0
- package/src/services/logger.ts +7 -1
- package/src/services/readline_prompt.ts +194 -0
- package/src/services/screen.ts +108 -57
- package/src/services/screen_manager.ts +287 -74
- package/src/types/events.types.ts +84 -0
- package/src/types/index.ts +3 -0
- package/src/types/screen.types.ts +34 -0
- package/src/utils/colors/helpers.ts +0 -25
- package/src/utils/index.ts +6 -0
- package/src/utils/prompt.ts +18 -0
- package/src/utils/runtime.ts +14 -0
- package/src/utils/stdout-printer.ts +16 -5
- package/tsconfig.base.json +1 -17
- package/tsconfig.json +1 -6
- package/tsdown.config.mts +13 -70
- package/lib/adapters/react/index.cjs +0 -1768
- package/lib/adapters/react/index.cjs.map +0 -1
- package/lib/adapters/react/index.d.cts +0 -80
- package/lib/adapters/react/index.d.mts +0 -80
- package/lib/adapters/react/index.mjs +0 -1760
- package/lib/adapters/react/index.mjs.map +0 -1
- package/lib/adapters/solid/index.cjs +0 -3855
- package/lib/adapters/solid/index.cjs.map +0 -1
- package/lib/adapters/solid/index.d.cts +0 -74
- package/lib/adapters/solid/index.d.mts +0 -74
- package/lib/adapters/solid/index.mjs +0 -3847
- package/lib/adapters/solid/index.mjs.map +0 -1
- package/lib/filter_engine-DXqu9Vaq.cjs +0 -1836
- package/lib/filter_engine-DXqu9Vaq.cjs.map +0 -1
- package/lib/filter_engine-DmqhEhpA.mjs +0 -1609
- package/lib/filter_engine-DmqhEhpA.mjs.map +0 -1
- package/lib/interface-CTHQ08aY.d.mts +0 -699
- package/lib/interface-DQEIz9Mb.d.cts +0 -699
- package/src/__tests__/components/__snapshots__/filter_bar.spec.tsx.snap +0 -2293
- package/src/__tests__/components/__snapshots__/loading_message.spec.tsx.snap +0 -1414
- package/src/__tests__/components/__snapshots__/log_message.spec.tsx.snap +0 -3245
- package/src/__tests__/components/__snapshots__/progress_message.spec.tsx.snap +0 -1783
- package/src/__tests__/components/__snapshots__/prompt_renderer.spec.tsx.snap +0 -3203
- package/src/__tests__/components/__snapshots__/sidebar.spec.tsx.snap +0 -2857
- package/src/__tests__/components/filter_bar.spec.tsx +0 -190
- package/src/__tests__/components/loading_message.spec.tsx +0 -110
- package/src/__tests__/components/log_message.spec.tsx +0 -166
- package/src/__tests__/components/progress_message.spec.tsx +0 -147
- package/src/__tests__/components/prompt_renderer.spec.tsx +0 -274
- package/src/__tests__/components/sidebar.spec.tsx +0 -322
- package/src/__tests__/utils/render-utils.tsx +0 -39
- package/src/adapters/react/components/file/file_log.tsx +0 -241
- package/src/adapters/react/components/file/index.ts +0 -1
- package/src/adapters/react/components/filter/filter_bar.tsx +0 -79
- package/src/adapters/react/components/filter/index.ts +0 -1
- package/src/adapters/react/components/help/help_overlay.tsx +0 -100
- package/src/adapters/react/components/help/index.ts +0 -1
- package/src/adapters/react/components/log/index.ts +0 -1
- package/src/adapters/react/components/log/log_message.tsx +0 -102
- package/src/adapters/react/components/prompt/index.ts +0 -2
- package/src/adapters/react/components/prompt/prompt_renderer.tsx +0 -346
- package/src/adapters/react/components/screen/group_renderer.tsx +0 -64
- package/src/adapters/react/components/screen/index.ts +0 -6
- package/src/adapters/react/components/screen/loading_message.tsx +0 -43
- package/src/adapters/react/components/screen/message_renderer.tsx +0 -108
- package/src/adapters/react/components/screen/progress_message.tsx +0 -60
- package/src/adapters/react/components/screen/screen_bridge.tsx +0 -149
- package/src/adapters/react/components/screen/table_message.tsx +0 -57
- package/src/adapters/react/components/screen_manager_bridge.tsx +0 -245
- package/src/adapters/react/components/sidebar/index.ts +0 -3
- package/src/adapters/react/components/sidebar/sidebar.tsx +0 -102
- package/src/adapters/react/components/sidebar/sidebar_item.tsx +0 -50
- package/src/adapters/react/components/sidebar/sidebar_separator.tsx +0 -13
- package/src/adapters/react/context/index.ts +0 -1
- package/src/adapters/react/context/logger_context.tsx +0 -109
- package/src/adapters/react/hooks/index.ts +0 -1
- package/src/adapters/react/hooks/use_theme.ts +0 -12
- package/src/adapters/react/index.ts +0 -39
- package/src/adapters/solid/components/file/file_log.tsx +0 -221
- package/src/adapters/solid/components/file/index.ts +0 -1
- package/src/adapters/solid/components/filter/filter_bar.tsx +0 -84
- package/src/adapters/solid/components/filter/index.ts +0 -1
- package/src/adapters/solid/components/help/help_overlay.tsx +0 -106
- package/src/adapters/solid/components/help/index.ts +0 -1
- package/src/adapters/solid/components/log/index.ts +0 -1
- package/src/adapters/solid/components/log/log_message.tsx +0 -92
- package/src/adapters/solid/components/prompt/index.ts +0 -2
- package/src/adapters/solid/components/prompt/prompt_renderer.tsx +0 -350
- package/src/adapters/solid/components/screen/group_renderer.tsx +0 -61
- package/src/adapters/solid/components/screen/index.ts +0 -6
- package/src/adapters/solid/components/screen/loading_message.tsx +0 -39
- package/src/adapters/solid/components/screen/message_renderer.tsx +0 -122
- package/src/adapters/solid/components/screen/progress_message.tsx +0 -61
- package/src/adapters/solid/components/screen/screen_bridge.tsx +0 -155
- package/src/adapters/solid/components/screen/table_message.tsx +0 -58
- package/src/adapters/solid/components/screen_manager_bridge.tsx +0 -243
- package/src/adapters/solid/components/sidebar/index.ts +0 -3
- package/src/adapters/solid/components/sidebar/sidebar.tsx +0 -108
- package/src/adapters/solid/components/sidebar/sidebar_item.tsx +0 -55
- package/src/adapters/solid/components/sidebar/sidebar_separator.tsx +0 -13
- package/src/adapters/solid/context/index.ts +0 -2
- package/src/adapters/solid/context/logger_context.tsx +0 -95
- package/src/adapters/solid/hooks/index.ts +0 -1
- package/src/adapters/solid/hooks/use_theme.ts +0 -12
- package/src/adapters/solid/index.tsx +0 -43
- package/src/adapters/solid/jsx.d.ts +0 -98
- package/tsconfig.react.json +0 -16
- package/tsconfig.solid.json +0 -16
package/lib/index.d.cts
CHANGED
|
@@ -1,31 +1,2806 @@
|
|
|
1
|
-
import { $ as FileLogBaseProps, A as ScreenDefinition, B as HelpTheme, C as InputPromptData, Ct as TableMessageData, D as BindOptions, E as PromptData, F as ErrorHighlightTheme, G as SemanticColors, H as PartialTheme, I as FileTheme, J as StatusIndicator, K as SeparatorTheme, L as FilterTheme, M as ScreenProps, N as ScreenStatus, O as FocusArea, P as DeepPartial, Q as ThemePreset, R as GroupTheme, S as InputOptions, St as PromiseOptions, T as MultiChoicePromptData, U as ProgressTheme, V as LogLevelTheme, W as PromptTheme, X as TableTheme, Y as StatusIndicatorsTheme, Z as Theme, _ as ChoiceOption, _t as LogMessageVariant, a as FilterState, at as LogLevelColorMap, b as ConfirmOptions, bt as ProgressHandle, c as hasActiveFilter, ct as VariantColorMap, d as KeyBindingCondition, dt as FileErrorMessageData, et as FileLogDiffProps, f as KeyBindingsConfig, ft as FileMessageData, g as BasePromptData, gt as LogMessageData, h as KeyboardContext, ht as LoadingMessageData, i as ALL_LOG_LEVELS, it as FileLogProps, j as ScreenManagerProps, k as LoggerContextValue, l as KeyBinding, lt as BaseMessage, m as KeyHandler, mt as LoadingHandle, n as AdapterRenderProps, nt as FileLogMode, o as LevelCounts, ot as LogLevelColors, p as KeyEvent, pt as GroupMessageData, q as SidebarTheme, r as AdapterRoot, rt as FileLogPartialProps, s as createDefaultFilterState, st as LogMessageProps, t as AdapterInterface, tt as FileLogFullProps, u as KeyBindingCategory, ut as DiffMessageData, v as ChoiceOptions, vt as MessageData, w as MultiChoiceOptions, x as ConfirmPromptData, xt as ProgressMessageData, y as ChoicePromptData, yt as MessageType, z as HeaderTheme } from "./interface-DQEIz9Mb.cjs";
|
|
2
|
-
import { RGBA } from "@opentui/core";
|
|
3
1
|
import { ClassTypeWithInstance, FactoryContext, InjectionToken, LogLevel, LoggerInstance, LoggerService, OnServiceDestroy } from "@navios/core";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
2
|
+
import { CliRenderer, RGBA, SyntaxStyle, TreeSitterClient } from "@opentui/core";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
import { EventEmitter } from "node:events";
|
|
7
5
|
|
|
6
|
+
//#region src/types/message.types.d.ts
|
|
7
|
+
type MessageType = 'log' | 'file' | 'diff' | 'fileError' | 'loading' | 'progress' | 'group' | 'table';
|
|
8
|
+
interface BaseMessage {
|
|
9
|
+
id: string;
|
|
10
|
+
type: MessageType;
|
|
11
|
+
timestamp: Date;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Semantic variants for log messages that don't map directly to LogLevel.
|
|
15
|
+
* These affect styling but the underlying LogLevel is used for filtering.
|
|
16
|
+
*/
|
|
17
|
+
type LogMessageVariant = 'success' | 'trace';
|
|
18
|
+
interface LogMessageData extends BaseMessage {
|
|
19
|
+
type: 'log';
|
|
20
|
+
level: LogLevel;
|
|
21
|
+
/** Content is always a string - objects are formatted before storage */
|
|
22
|
+
content: string;
|
|
23
|
+
label?: string;
|
|
24
|
+
trace?: string;
|
|
25
|
+
/** Optional semantic variant for styling (e.g., 'success' shows green even though level is 'log') */
|
|
26
|
+
variant?: LogMessageVariant;
|
|
27
|
+
}
|
|
28
|
+
interface FileMessageData extends BaseMessage {
|
|
29
|
+
type: 'file';
|
|
30
|
+
filePath: string;
|
|
31
|
+
content: string;
|
|
32
|
+
}
|
|
33
|
+
interface DiffMessageData extends BaseMessage {
|
|
34
|
+
type: 'diff';
|
|
35
|
+
filePath: string;
|
|
36
|
+
diff: string;
|
|
37
|
+
view?: 'unified' | 'split';
|
|
38
|
+
}
|
|
39
|
+
interface FileErrorMessageData extends BaseMessage {
|
|
40
|
+
type: 'fileError';
|
|
41
|
+
filePath: string;
|
|
42
|
+
content: string;
|
|
43
|
+
errorLines: number[];
|
|
44
|
+
startLine: number;
|
|
45
|
+
}
|
|
46
|
+
interface LoadingMessageData extends BaseMessage {
|
|
47
|
+
type: 'loading';
|
|
48
|
+
content: string;
|
|
49
|
+
status: 'loading' | 'success' | 'fail';
|
|
50
|
+
resolvedContent?: string;
|
|
51
|
+
}
|
|
52
|
+
interface ProgressMessageData extends BaseMessage {
|
|
53
|
+
type: 'progress';
|
|
54
|
+
label: string;
|
|
55
|
+
current: number;
|
|
56
|
+
total: number;
|
|
57
|
+
status: 'active' | 'complete' | 'failed';
|
|
58
|
+
resolvedContent?: string;
|
|
59
|
+
}
|
|
60
|
+
interface GroupMessageData extends BaseMessage {
|
|
61
|
+
type: 'group';
|
|
62
|
+
label: string;
|
|
63
|
+
collapsed: boolean;
|
|
64
|
+
isEnd: boolean;
|
|
65
|
+
}
|
|
66
|
+
interface TableMessageData extends BaseMessage {
|
|
67
|
+
type: 'table';
|
|
68
|
+
headers: string[];
|
|
69
|
+
rows: string[][];
|
|
70
|
+
title?: string;
|
|
71
|
+
}
|
|
72
|
+
type MessageData = LogMessageData | FileMessageData | DiffMessageData | FileErrorMessageData | LoadingMessageData | ProgressMessageData | GroupMessageData | TableMessageData;
|
|
73
|
+
interface PromiseOptions<T> {
|
|
74
|
+
loading: string;
|
|
75
|
+
success: string | ((data: T) => string);
|
|
76
|
+
error: string | ((error: Error) => string);
|
|
77
|
+
}
|
|
78
|
+
interface LoadingHandle {
|
|
79
|
+
success: (message: string) => void;
|
|
80
|
+
fail: (message: string) => void;
|
|
81
|
+
}
|
|
82
|
+
interface ProgressHandle {
|
|
83
|
+
update: (current: number, label?: string) => void;
|
|
84
|
+
complete: (message?: string) => void;
|
|
85
|
+
fail: (message?: string) => void;
|
|
86
|
+
}
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/types/log.types.d.ts
|
|
89
|
+
interface LogLevelColors {
|
|
90
|
+
border: string;
|
|
91
|
+
background: string;
|
|
92
|
+
text?: string;
|
|
93
|
+
}
|
|
94
|
+
type LogLevelColorMap = Record<LogLevel, LogLevelColors>;
|
|
95
|
+
/**
|
|
96
|
+
* Color map for semantic variants (success, trace) that override level colors.
|
|
97
|
+
*/
|
|
98
|
+
type VariantColorMap = Record<LogMessageVariant, LogLevelColors>;
|
|
99
|
+
interface LogMessageProps {
|
|
100
|
+
/** Log level determines the color scheme */
|
|
101
|
+
level: LogLevel;
|
|
102
|
+
/** Optional semantic variant for styling (e.g., 'success' shows green even though level is 'log') */
|
|
103
|
+
variant?: LogMessageVariant;
|
|
104
|
+
/** Message content - can be string or React nodes */
|
|
105
|
+
children: ReactNode;
|
|
106
|
+
/** Optional timestamp to display */
|
|
107
|
+
timestamp?: Date | string;
|
|
108
|
+
/** Optional label/prefix (e.g., "API", "Database") */
|
|
109
|
+
label?: string;
|
|
110
|
+
/** Optional stack trace to display (for trace level) */
|
|
111
|
+
trace?: string;
|
|
112
|
+
/** Optional custom border color (overrides level color) */
|
|
113
|
+
borderColor?: string | RGBA;
|
|
114
|
+
/** Optional custom background color (overrides level color) */
|
|
115
|
+
backgroundColor?: string | RGBA;
|
|
116
|
+
/** Border width style - 'thin' uses left border only, 'thick' uses left+top+bottom */
|
|
117
|
+
borderStyle?: 'thin' | 'thick';
|
|
118
|
+
/** Padding inside the message box */
|
|
119
|
+
padding?: number;
|
|
120
|
+
/** Margin around the message */
|
|
121
|
+
margin?: number;
|
|
122
|
+
}
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/types/file.types.d.ts
|
|
125
|
+
type FileLogMode = 'full' | 'diff' | 'partial';
|
|
126
|
+
interface FileLogBaseProps {
|
|
127
|
+
/** File path or name to display in header */
|
|
128
|
+
filePath: string;
|
|
129
|
+
/** Override auto-detected filetype for syntax highlighting */
|
|
130
|
+
filetype?: string;
|
|
131
|
+
/** Show line numbers */
|
|
132
|
+
showLineNumbers?: boolean;
|
|
133
|
+
/** Show header with file path */
|
|
134
|
+
showHeader?: boolean;
|
|
135
|
+
/** Custom header background color */
|
|
136
|
+
headerBackgroundColor?: string | RGBA;
|
|
137
|
+
}
|
|
138
|
+
interface FileLogFullProps extends FileLogBaseProps {
|
|
139
|
+
mode: 'full';
|
|
140
|
+
/** The complete file content */
|
|
141
|
+
content: string;
|
|
142
|
+
}
|
|
143
|
+
interface FileLogDiffProps extends FileLogBaseProps {
|
|
144
|
+
mode: 'diff';
|
|
145
|
+
/** Unified diff string */
|
|
146
|
+
diff: string;
|
|
147
|
+
/** Diff view mode */
|
|
148
|
+
view?: 'unified' | 'split';
|
|
149
|
+
}
|
|
150
|
+
interface FileLogPartialProps extends FileLogBaseProps {
|
|
151
|
+
mode: 'partial';
|
|
152
|
+
/** File content (full or partial) */
|
|
153
|
+
content: string;
|
|
154
|
+
/** Starting line number of the content (1-indexed) */
|
|
155
|
+
startLine: number;
|
|
156
|
+
/** Lines to highlight as errors */
|
|
157
|
+
errorLines?: number[];
|
|
158
|
+
/** Error highlighting colors */
|
|
159
|
+
errorLineBackground?: string | RGBA;
|
|
160
|
+
errorLineBorderColor?: string | RGBA;
|
|
161
|
+
}
|
|
162
|
+
type FileLogProps = FileLogFullProps | FileLogDiffProps | FileLogPartialProps;
|
|
163
|
+
//#endregion
|
|
164
|
+
//#region src/types/theme.types.d.ts
|
|
165
|
+
/**
|
|
166
|
+
* Color scheme for a single log level.
|
|
167
|
+
*/
|
|
168
|
+
interface LogLevelTheme {
|
|
169
|
+
border: string;
|
|
170
|
+
background: string;
|
|
171
|
+
text?: string;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Sidebar color scheme.
|
|
175
|
+
*/
|
|
176
|
+
interface SidebarTheme {
|
|
177
|
+
background?: string;
|
|
178
|
+
selectedBackground: string;
|
|
179
|
+
hoverBackground: string;
|
|
180
|
+
text: string;
|
|
181
|
+
textDim: string;
|
|
182
|
+
border: string;
|
|
183
|
+
badge: string;
|
|
184
|
+
focusBorder: string;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Screen header color scheme.
|
|
188
|
+
*/
|
|
189
|
+
interface HeaderTheme {
|
|
190
|
+
background?: string;
|
|
191
|
+
text: string;
|
|
192
|
+
border: string;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Status indicator with icon and color.
|
|
196
|
+
*/
|
|
197
|
+
interface StatusIndicator {
|
|
198
|
+
icon: string;
|
|
199
|
+
color: string;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Status indicators for all screen states.
|
|
203
|
+
*/
|
|
204
|
+
interface StatusIndicatorsTheme {
|
|
205
|
+
waiting: StatusIndicator;
|
|
206
|
+
pending: StatusIndicator;
|
|
207
|
+
success: StatusIndicator;
|
|
208
|
+
fail: StatusIndicator;
|
|
209
|
+
static: StatusIndicator;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Separator colors for sidebar sections.
|
|
213
|
+
*/
|
|
214
|
+
interface SeparatorTheme {
|
|
215
|
+
line: string;
|
|
216
|
+
text: string;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Progress bar and loading indicator colors.
|
|
220
|
+
*/
|
|
221
|
+
interface ProgressTheme {
|
|
222
|
+
border: string;
|
|
223
|
+
background: string;
|
|
224
|
+
barFilled: string;
|
|
225
|
+
barEmpty: string;
|
|
226
|
+
text: string;
|
|
227
|
+
textDim: string;
|
|
228
|
+
complete: string;
|
|
229
|
+
completeBackground: string;
|
|
230
|
+
failed: string;
|
|
231
|
+
failedBackground: string;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Collapsible group colors.
|
|
235
|
+
*/
|
|
236
|
+
interface GroupTheme {
|
|
237
|
+
border: string;
|
|
238
|
+
background: string;
|
|
239
|
+
headerText: string;
|
|
240
|
+
icon: string;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Table display colors.
|
|
244
|
+
*/
|
|
245
|
+
interface TableTheme {
|
|
246
|
+
border: string;
|
|
247
|
+
background: string;
|
|
248
|
+
headerText: string;
|
|
249
|
+
cellText: string;
|
|
250
|
+
title: string;
|
|
251
|
+
separator: string;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* File display colors.
|
|
255
|
+
*/
|
|
256
|
+
interface FileTheme {
|
|
257
|
+
border: string;
|
|
258
|
+
background: string;
|
|
259
|
+
headerText: string;
|
|
260
|
+
headerBackground: string;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Interactive prompt colors.
|
|
264
|
+
*/
|
|
265
|
+
interface PromptTheme {
|
|
266
|
+
question: string;
|
|
267
|
+
optionText: string;
|
|
268
|
+
optionTextDim: string;
|
|
269
|
+
optionSelected: string;
|
|
270
|
+
optionSelectedBackground: string;
|
|
271
|
+
confirmButton: string;
|
|
272
|
+
cancelButton: string;
|
|
273
|
+
buttonBackground: string;
|
|
274
|
+
buttonSelectedBackground: string;
|
|
275
|
+
inputBorder: string;
|
|
276
|
+
inputBackground: string;
|
|
277
|
+
inputText: string;
|
|
278
|
+
inputPlaceholder: string;
|
|
279
|
+
inputCursor: string;
|
|
280
|
+
border: string;
|
|
281
|
+
focusBorder: string;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Error highlighting colors for file displays.
|
|
285
|
+
*/
|
|
286
|
+
interface ErrorHighlightTheme {
|
|
287
|
+
background: string;
|
|
288
|
+
border: string;
|
|
289
|
+
gutterBackground: string;
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Filter bar colors.
|
|
293
|
+
*/
|
|
294
|
+
interface FilterTheme {
|
|
295
|
+
background: string;
|
|
296
|
+
border: string;
|
|
297
|
+
text: string;
|
|
298
|
+
textDim: string;
|
|
299
|
+
inputBackground: string;
|
|
300
|
+
inputText: string;
|
|
301
|
+
inputPlaceholder: string;
|
|
302
|
+
cursor: string;
|
|
303
|
+
activeLevel: string;
|
|
304
|
+
inactiveLevel: string;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Help overlay colors.
|
|
308
|
+
*/
|
|
309
|
+
interface HelpTheme {
|
|
310
|
+
background: string;
|
|
311
|
+
border: string;
|
|
312
|
+
title: string;
|
|
313
|
+
category: string;
|
|
314
|
+
key: string;
|
|
315
|
+
description: string;
|
|
316
|
+
hint: string;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* General semantic colors.
|
|
320
|
+
*/
|
|
321
|
+
interface SemanticColors {
|
|
322
|
+
primary: string;
|
|
323
|
+
secondary: string;
|
|
324
|
+
success: string;
|
|
325
|
+
warning: string;
|
|
326
|
+
error: string;
|
|
327
|
+
muted: string;
|
|
328
|
+
background?: string;
|
|
329
|
+
foreground: string;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Complete theme definition.
|
|
333
|
+
*/
|
|
334
|
+
interface Theme {
|
|
335
|
+
/** Theme identifier */
|
|
336
|
+
name: string;
|
|
337
|
+
/** Log level color schemes */
|
|
338
|
+
logLevels: Record<LogLevel, LogLevelTheme>;
|
|
339
|
+
/** Sidebar colors */
|
|
340
|
+
sidebar: SidebarTheme;
|
|
341
|
+
/** Screen header colors */
|
|
342
|
+
header: HeaderTheme;
|
|
343
|
+
/** Status indicator colors and icons */
|
|
344
|
+
statusIndicators: StatusIndicatorsTheme;
|
|
345
|
+
/** Separator colors */
|
|
346
|
+
separator: SeparatorTheme;
|
|
347
|
+
/** Progress bar colors */
|
|
348
|
+
progress: ProgressTheme;
|
|
349
|
+
/** Collapsible group colors */
|
|
350
|
+
group: GroupTheme;
|
|
351
|
+
/** Table display colors */
|
|
352
|
+
table: TableTheme;
|
|
353
|
+
/** File display colors */
|
|
354
|
+
file: FileTheme;
|
|
355
|
+
/** Prompt colors */
|
|
356
|
+
prompt: PromptTheme;
|
|
357
|
+
/** Error highlighting colors */
|
|
358
|
+
errorHighlight: ErrorHighlightTheme;
|
|
359
|
+
/** Filter bar colors */
|
|
360
|
+
filter: FilterTheme;
|
|
361
|
+
/** Help overlay colors */
|
|
362
|
+
help: HelpTheme;
|
|
363
|
+
/** General semantic colors */
|
|
364
|
+
colors: SemanticColors;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Theme preset names.
|
|
368
|
+
*/
|
|
369
|
+
type ThemePreset = 'dark' | 'light' | 'high-contrast';
|
|
370
|
+
/**
|
|
371
|
+
* Deep partial type for theme overrides.
|
|
372
|
+
*/
|
|
373
|
+
type DeepPartial<T> = { [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P] };
|
|
374
|
+
/**
|
|
375
|
+
* Partial theme for creating custom themes.
|
|
376
|
+
*/
|
|
377
|
+
type PartialTheme = DeepPartial<Theme>;
|
|
378
|
+
//#endregion
|
|
379
|
+
//#region src/types/screen.types.d.ts
|
|
380
|
+
interface ScreenProps {
|
|
381
|
+
/** Screen title/name displayed in header */
|
|
382
|
+
name: string;
|
|
383
|
+
/** Child log messages/file logs */
|
|
384
|
+
children: ReactNode;
|
|
385
|
+
/** Enable auto-scroll to bottom on new content */
|
|
386
|
+
stickyScroll?: boolean;
|
|
387
|
+
/** Show scroll position indicator */
|
|
388
|
+
showScrollIndicator?: boolean;
|
|
389
|
+
/** Screen header background color */
|
|
390
|
+
headerBackgroundColor?: string | RGBA;
|
|
391
|
+
/** Screen header text color */
|
|
392
|
+
headerTextColor?: string | RGBA;
|
|
393
|
+
/** Whether this screen is currently focused */
|
|
394
|
+
focused?: boolean;
|
|
395
|
+
/** Callback when screen is scrolled */
|
|
396
|
+
onScroll?: (scrollTop: number, scrollHeight: number) => void;
|
|
397
|
+
}
|
|
398
|
+
interface ScreenDefinition {
|
|
399
|
+
/** Unique screen identifier */
|
|
400
|
+
id: string;
|
|
401
|
+
/** Display name for sidebar */
|
|
402
|
+
name: string;
|
|
403
|
+
/** Optional icon/badge character */
|
|
404
|
+
icon?: string;
|
|
405
|
+
/** Unread/notification count */
|
|
406
|
+
badgeCount?: number;
|
|
407
|
+
}
|
|
408
|
+
interface ScreenManagerProps {
|
|
409
|
+
/** Screen definitions for the sidebar */
|
|
410
|
+
screens: ScreenDefinition[];
|
|
411
|
+
/** Currently active screen ID */
|
|
412
|
+
activeScreenId: string;
|
|
413
|
+
/** Callback when screen selection changes */
|
|
414
|
+
onScreenChange?: (screenId: string) => void;
|
|
415
|
+
/** Screen content - should be conditionally rendered based on activeScreenId */
|
|
416
|
+
children: ReactNode;
|
|
417
|
+
/** Force show/hide sidebar (overrides auto behavior) */
|
|
418
|
+
sidebarVisible?: boolean;
|
|
419
|
+
/** Callback when sidebar visibility changes */
|
|
420
|
+
onSidebarVisibilityChange?: (visible: boolean) => void;
|
|
421
|
+
/** Sidebar width (columns) */
|
|
422
|
+
sidebarWidth?: number;
|
|
423
|
+
/** Sidebar position */
|
|
424
|
+
sidebarPosition?: 'left' | 'right';
|
|
425
|
+
/** Key to toggle sidebar visibility */
|
|
426
|
+
toggleSidebarKey?: string;
|
|
427
|
+
/** Sidebar header title */
|
|
428
|
+
sidebarTitle?: string;
|
|
429
|
+
}
|
|
430
|
+
type FocusArea = 'sidebar' | 'content';
|
|
431
|
+
interface LoggerContextValue {
|
|
432
|
+
/** Shared SyntaxStyle instance for code highlighting */
|
|
433
|
+
syntaxStyle?: SyntaxStyle;
|
|
434
|
+
/** Shared TreeSitterClient for parsing */
|
|
435
|
+
treeSitterClient?: TreeSitterClient;
|
|
436
|
+
/** Default colors for log levels (derived from theme for backwards compatibility) */
|
|
437
|
+
levelColors: LogLevelColorMap;
|
|
438
|
+
/** Current theme */
|
|
439
|
+
theme: Theme;
|
|
440
|
+
}
|
|
441
|
+
type ScreenStatus = 'waiting' | 'pending' | 'success' | 'fail' | 'static';
|
|
442
|
+
/**
|
|
443
|
+
* Render mode determines how the TUI operates.
|
|
444
|
+
* This is set during bind() and affects prompts, screen printing, and exit behavior.
|
|
445
|
+
*/
|
|
446
|
+
declare enum RenderMode {
|
|
447
|
+
/** bind() never called - screens print on completion, prompts return defaults */
|
|
448
|
+
UNBOUND = "unbound",
|
|
449
|
+
/** bind() called with useOpenTUI: false - stdout mode with readline prompts */
|
|
450
|
+
STDOUT_INTERACTIVE = "stdout",
|
|
451
|
+
/** bind() called with useOpenTUI: true but adapter unavailable - fallback to stdout with warning */
|
|
452
|
+
STDOUT_FALLBACK = "fallback",
|
|
453
|
+
/** Full TUI rendering active with adapter */
|
|
454
|
+
TUI_ACTIVE = "tui",
|
|
455
|
+
}
|
|
456
|
+
interface BindOptions {
|
|
457
|
+
exitOnCtrlC?: boolean;
|
|
458
|
+
sidebarWidth?: number;
|
|
459
|
+
sidebarPosition?: 'left' | 'right';
|
|
460
|
+
sidebarTitle?: string;
|
|
461
|
+
/** Auto close after all screens complete successfully (delay in ms, default 5000) */
|
|
462
|
+
autoClose?: boolean | number;
|
|
463
|
+
/** Theme to use for the TUI (theme object or preset name) */
|
|
464
|
+
theme?: Theme | ThemePreset;
|
|
465
|
+
/** Enable mouse support (default: true) */
|
|
466
|
+
useMouse?: boolean;
|
|
467
|
+
/**
|
|
468
|
+
* Use OpenTUI for terminal rendering.
|
|
469
|
+
* When true: Full TUI with sidebar, scrolling, interactive prompts.
|
|
470
|
+
* When false: Stdout mode - static screens print immediately, others on completion.
|
|
471
|
+
* Default: true for Node.js, false for Bun (OpenTUI not supported).
|
|
472
|
+
*/
|
|
473
|
+
useOpenTUI?: boolean;
|
|
474
|
+
}
|
|
475
|
+
interface SetupOptions {
|
|
476
|
+
/** Theme to use for the TUI (theme object or preset name) */
|
|
477
|
+
theme?: Theme | ThemePreset;
|
|
478
|
+
/** Global log levels filter - only these levels will be displayed across all loggers */
|
|
479
|
+
logLevels?: LogLevel[];
|
|
480
|
+
}
|
|
481
|
+
//#endregion
|
|
482
|
+
//#region src/types/prompt.types.d.ts
|
|
483
|
+
interface ChoiceOption {
|
|
484
|
+
label: string;
|
|
485
|
+
value: string;
|
|
486
|
+
/** If true, this option allows text input */
|
|
487
|
+
input?: boolean;
|
|
488
|
+
}
|
|
489
|
+
interface BasePromptData {
|
|
490
|
+
id: string;
|
|
491
|
+
timestamp: Date;
|
|
492
|
+
resolved: boolean;
|
|
493
|
+
/** Auto-resolve timeout in ms */
|
|
494
|
+
timeout?: number;
|
|
495
|
+
/** Timestamp when timeout started */
|
|
496
|
+
timeoutStarted?: number;
|
|
497
|
+
}
|
|
498
|
+
interface ChoicePromptData extends BasePromptData {
|
|
499
|
+
type: 'choice';
|
|
500
|
+
question: string;
|
|
501
|
+
choices: ChoiceOption[];
|
|
502
|
+
defaultChoice: string;
|
|
503
|
+
selectedIndex: number;
|
|
504
|
+
inputMode: boolean;
|
|
505
|
+
inputValue: string;
|
|
506
|
+
resolvedValue?: string;
|
|
507
|
+
}
|
|
508
|
+
interface ConfirmPromptData extends BasePromptData {
|
|
509
|
+
type: 'confirm';
|
|
510
|
+
question: string;
|
|
511
|
+
confirmText: string;
|
|
512
|
+
cancelText: string;
|
|
513
|
+
defaultValue: boolean;
|
|
514
|
+
selectedValue: boolean;
|
|
515
|
+
resolvedValue?: boolean;
|
|
516
|
+
}
|
|
517
|
+
interface InputPromptData extends BasePromptData {
|
|
518
|
+
type: 'input';
|
|
519
|
+
question: string;
|
|
520
|
+
placeholder: string;
|
|
521
|
+
defaultValue: string;
|
|
522
|
+
value: string;
|
|
523
|
+
resolvedValue?: string;
|
|
524
|
+
}
|
|
525
|
+
interface MultiChoicePromptData extends BasePromptData {
|
|
526
|
+
type: 'multiChoice';
|
|
527
|
+
question: string;
|
|
528
|
+
choices: ChoiceOption[];
|
|
529
|
+
selectedIndices: Set<number>;
|
|
530
|
+
focusedIndex: number;
|
|
531
|
+
minSelect: number;
|
|
532
|
+
maxSelect: number;
|
|
533
|
+
resolvedValues?: string[];
|
|
534
|
+
}
|
|
535
|
+
type PromptData = ChoicePromptData | ConfirmPromptData | InputPromptData | MultiChoicePromptData;
|
|
536
|
+
interface ChoiceOptions {
|
|
537
|
+
question: string;
|
|
538
|
+
choices: ChoiceOption[];
|
|
539
|
+
defaultChoice?: string;
|
|
540
|
+
/** Auto-resolve with default after timeout (ms) */
|
|
541
|
+
timeout?: number;
|
|
542
|
+
}
|
|
543
|
+
interface ConfirmOptions {
|
|
544
|
+
question: string;
|
|
545
|
+
confirmText?: string;
|
|
546
|
+
cancelText?: string;
|
|
547
|
+
defaultValue?: boolean;
|
|
548
|
+
/** Auto-resolve with default after timeout (ms) */
|
|
549
|
+
timeout?: number;
|
|
550
|
+
}
|
|
551
|
+
interface InputOptions {
|
|
552
|
+
question: string;
|
|
553
|
+
placeholder?: string;
|
|
554
|
+
defaultValue?: string;
|
|
555
|
+
/** Auto-resolve with default after timeout (ms) */
|
|
556
|
+
timeout?: number;
|
|
557
|
+
}
|
|
558
|
+
interface MultiChoiceOptions {
|
|
559
|
+
question: string;
|
|
560
|
+
choices: ChoiceOption[];
|
|
561
|
+
defaultChoices?: string[];
|
|
562
|
+
minSelect?: number;
|
|
563
|
+
maxSelect?: number;
|
|
564
|
+
/** Auto-resolve with default after timeout (ms) */
|
|
565
|
+
timeout?: number;
|
|
566
|
+
}
|
|
567
|
+
//#endregion
|
|
568
|
+
//#region src/types/keyboard.types.d.ts
|
|
569
|
+
/**
|
|
570
|
+
* Key event from the terminal.
|
|
571
|
+
*/
|
|
572
|
+
interface KeyEvent {
|
|
573
|
+
name: string;
|
|
574
|
+
sequence?: string;
|
|
575
|
+
ctrl?: boolean;
|
|
576
|
+
meta?: boolean;
|
|
577
|
+
shift?: boolean;
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* Context available to keyboard handlers.
|
|
581
|
+
*/
|
|
582
|
+
interface KeyboardContext {
|
|
583
|
+
/** Has multiple screens (sidebar visible) */
|
|
584
|
+
hasSidebar: boolean;
|
|
585
|
+
/** Currently focused area */
|
|
586
|
+
focusArea: FocusArea;
|
|
587
|
+
/** Whether a prompt is active */
|
|
588
|
+
hasPrompt: boolean;
|
|
589
|
+
/** Whether prompt is in text input mode */
|
|
590
|
+
inInputMode: boolean;
|
|
591
|
+
/** Whether filter bar is visible */
|
|
592
|
+
isFilterActive: boolean;
|
|
593
|
+
/** Whether help overlay is visible */
|
|
594
|
+
isHelpVisible: boolean;
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* Handler function for a key binding.
|
|
598
|
+
* Return true to prevent further processing, false/void to continue.
|
|
599
|
+
*/
|
|
600
|
+
type KeyHandler = (key: KeyEvent, context: KeyboardContext) => boolean | void;
|
|
601
|
+
/**
|
|
602
|
+
* Category for organizing bindings in help overlay.
|
|
603
|
+
*/
|
|
604
|
+
type KeyBindingCategory = 'general' | 'navigation' | 'screen' | 'prompt' | 'filter';
|
|
605
|
+
/**
|
|
606
|
+
* Condition for when a binding is active.
|
|
607
|
+
*/
|
|
608
|
+
interface KeyBindingCondition {
|
|
609
|
+
hasPrompt?: boolean;
|
|
610
|
+
inInputMode?: boolean;
|
|
611
|
+
focusArea?: FocusArea;
|
|
612
|
+
isFilterActive?: boolean;
|
|
613
|
+
isHelpVisible?: boolean;
|
|
614
|
+
hasSidebar?: boolean;
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* A single key binding definition.
|
|
618
|
+
*/
|
|
619
|
+
interface KeyBinding {
|
|
620
|
+
/** Key name(s) that trigger this binding */
|
|
621
|
+
key: string | string[];
|
|
622
|
+
/** Require Ctrl modifier */
|
|
623
|
+
ctrl?: boolean;
|
|
624
|
+
/** Require Meta/Cmd modifier */
|
|
625
|
+
meta?: boolean;
|
|
626
|
+
/** Require Shift modifier (for capital letters) */
|
|
627
|
+
shift?: boolean;
|
|
628
|
+
/** Handler function */
|
|
629
|
+
handler: KeyHandler;
|
|
630
|
+
/** Description for help overlay */
|
|
631
|
+
description: string;
|
|
632
|
+
/** Category for grouping in help */
|
|
633
|
+
category: KeyBindingCategory;
|
|
634
|
+
/** Condition when this binding is active */
|
|
635
|
+
when?: KeyBindingCondition;
|
|
636
|
+
/** Priority (higher = checked first, default 0) */
|
|
637
|
+
priority?: number;
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* Configuration for the keyboard manager.
|
|
641
|
+
*/
|
|
642
|
+
interface KeyBindingsConfig {
|
|
643
|
+
/** Custom bindings (added to defaults) */
|
|
644
|
+
bindings?: KeyBinding[];
|
|
645
|
+
/** Override specific default bindings by key */
|
|
646
|
+
overrides?: Record<string, Partial<KeyBinding>>;
|
|
647
|
+
/** Disable specific keys */
|
|
648
|
+
disabled?: string[];
|
|
649
|
+
}
|
|
650
|
+
//#endregion
|
|
651
|
+
//#region src/types/filter.types.d.ts
|
|
652
|
+
/**
|
|
653
|
+
* Filter state for log filtering.
|
|
654
|
+
*/
|
|
655
|
+
interface FilterState {
|
|
656
|
+
/** Which log levels are enabled (shown) */
|
|
657
|
+
enabledLevels: Set<LogLevel>;
|
|
658
|
+
/** Text search query */
|
|
659
|
+
searchQuery: string;
|
|
660
|
+
/** Whether the filter bar is visible */
|
|
661
|
+
isVisible: boolean;
|
|
662
|
+
/** Which filter field is focused */
|
|
663
|
+
focusedField: 'search' | 'levels';
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
* All log levels in order.
|
|
667
|
+
*/
|
|
668
|
+
declare const ALL_LOG_LEVELS: LogLevel[];
|
|
669
|
+
/**
|
|
670
|
+
* Create a default filter state.
|
|
671
|
+
*/
|
|
672
|
+
declare function createDefaultFilterState(): FilterState;
|
|
673
|
+
/**
|
|
674
|
+
* Check if any filtering is active.
|
|
675
|
+
*/
|
|
676
|
+
declare function hasActiveFilter(filter: FilterState): boolean;
|
|
677
|
+
/**
|
|
678
|
+
* Level counts for display.
|
|
679
|
+
*/
|
|
680
|
+
type LevelCounts = Record<LogLevel, number>;
|
|
681
|
+
//#endregion
|
|
682
|
+
//#region src/types/events.types.d.ts
|
|
683
|
+
interface ScreenManagerEventMap {
|
|
684
|
+
'screen:added': [screenId: string];
|
|
685
|
+
'screen:removed': [screenId: string];
|
|
686
|
+
'screen:reordered': [];
|
|
687
|
+
'activeScreen:changed': [screenId: string | null];
|
|
688
|
+
'focus:changed': [area: FocusArea];
|
|
689
|
+
'sidebar:indexChanged': [index: number];
|
|
690
|
+
'mode:changed': [mode: RenderMode];
|
|
691
|
+
}
|
|
692
|
+
type ScreenManagerEventType = keyof ScreenManagerEventMap;
|
|
693
|
+
/**
|
|
694
|
+
* All manager events that adapters typically subscribe to for re-renders.
|
|
695
|
+
*/
|
|
696
|
+
declare const MANAGER_EVENTS: ScreenManagerEventType[];
|
|
697
|
+
interface ScreenEventMap {
|
|
698
|
+
'message:added': [messageId: string];
|
|
699
|
+
'message:updated': [messageId: string];
|
|
700
|
+
'messages:cleared': [];
|
|
701
|
+
'status:changed': [status: ScreenStatus];
|
|
702
|
+
'visibility:changed': [hidden: boolean];
|
|
703
|
+
'badge:changed': [count: number];
|
|
704
|
+
'prompt:activated': [];
|
|
705
|
+
'prompt:updated': [];
|
|
706
|
+
'prompt:resolved': [];
|
|
707
|
+
}
|
|
708
|
+
type ScreenEventType = keyof ScreenEventMap;
|
|
709
|
+
/**
|
|
710
|
+
* All screen events that adapters typically subscribe to for re-renders.
|
|
711
|
+
*/
|
|
712
|
+
declare const SCREEN_EVENTS: ScreenEventType[];
|
|
713
|
+
/**
|
|
714
|
+
* Sidebar-specific events that require re-render.
|
|
715
|
+
*/
|
|
716
|
+
declare const SIDEBAR_EVENTS: ScreenManagerEventType[];
|
|
717
|
+
/**
|
|
718
|
+
* Content area events that affect active screen changes.
|
|
719
|
+
*/
|
|
720
|
+
declare const CONTENT_MANAGER_EVENTS: ScreenManagerEventType[];
|
|
721
|
+
//#endregion
|
|
722
|
+
//#region ../../node_modules/zod/v4/core/json-schema.d.cts
|
|
723
|
+
type _JSONSchema = boolean | JSONSchema;
|
|
724
|
+
type JSONSchema = {
|
|
725
|
+
[k: string]: unknown;
|
|
726
|
+
$schema?: "https://json-schema.org/draft/2020-12/schema" | "http://json-schema.org/draft-07/schema#" | "http://json-schema.org/draft-04/schema#";
|
|
727
|
+
$id?: string;
|
|
728
|
+
$anchor?: string;
|
|
729
|
+
$ref?: string;
|
|
730
|
+
$dynamicRef?: string;
|
|
731
|
+
$dynamicAnchor?: string;
|
|
732
|
+
$vocabulary?: Record<string, boolean>;
|
|
733
|
+
$comment?: string;
|
|
734
|
+
$defs?: Record<string, JSONSchema>;
|
|
735
|
+
type?: "object" | "array" | "string" | "number" | "boolean" | "null" | "integer";
|
|
736
|
+
additionalItems?: _JSONSchema;
|
|
737
|
+
unevaluatedItems?: _JSONSchema;
|
|
738
|
+
prefixItems?: _JSONSchema[];
|
|
739
|
+
items?: _JSONSchema | _JSONSchema[];
|
|
740
|
+
contains?: _JSONSchema;
|
|
741
|
+
additionalProperties?: _JSONSchema;
|
|
742
|
+
unevaluatedProperties?: _JSONSchema;
|
|
743
|
+
properties?: Record<string, _JSONSchema>;
|
|
744
|
+
patternProperties?: Record<string, _JSONSchema>;
|
|
745
|
+
dependentSchemas?: Record<string, _JSONSchema>;
|
|
746
|
+
propertyNames?: _JSONSchema;
|
|
747
|
+
if?: _JSONSchema;
|
|
748
|
+
then?: _JSONSchema;
|
|
749
|
+
else?: _JSONSchema;
|
|
750
|
+
allOf?: JSONSchema[];
|
|
751
|
+
anyOf?: JSONSchema[];
|
|
752
|
+
oneOf?: JSONSchema[];
|
|
753
|
+
not?: _JSONSchema;
|
|
754
|
+
multipleOf?: number;
|
|
755
|
+
maximum?: number;
|
|
756
|
+
exclusiveMaximum?: number | boolean;
|
|
757
|
+
minimum?: number;
|
|
758
|
+
exclusiveMinimum?: number | boolean;
|
|
759
|
+
maxLength?: number;
|
|
760
|
+
minLength?: number;
|
|
761
|
+
pattern?: string;
|
|
762
|
+
maxItems?: number;
|
|
763
|
+
minItems?: number;
|
|
764
|
+
uniqueItems?: boolean;
|
|
765
|
+
maxContains?: number;
|
|
766
|
+
minContains?: number;
|
|
767
|
+
maxProperties?: number;
|
|
768
|
+
minProperties?: number;
|
|
769
|
+
required?: string[];
|
|
770
|
+
dependentRequired?: Record<string, string[]>;
|
|
771
|
+
enum?: Array<string | number | boolean | null>;
|
|
772
|
+
const?: string | number | boolean | null;
|
|
773
|
+
id?: string;
|
|
774
|
+
title?: string;
|
|
775
|
+
description?: string;
|
|
776
|
+
default?: unknown;
|
|
777
|
+
deprecated?: boolean;
|
|
778
|
+
readOnly?: boolean;
|
|
779
|
+
writeOnly?: boolean;
|
|
780
|
+
nullable?: boolean;
|
|
781
|
+
examples?: unknown[];
|
|
782
|
+
format?: string;
|
|
783
|
+
contentMediaType?: string;
|
|
784
|
+
contentEncoding?: string;
|
|
785
|
+
contentSchema?: JSONSchema;
|
|
786
|
+
_prefault?: unknown;
|
|
787
|
+
};
|
|
788
|
+
type BaseSchema = JSONSchema;
|
|
789
|
+
//#endregion
|
|
790
|
+
//#region ../../node_modules/zod/v4/core/standard-schema.d.cts
|
|
791
|
+
/** The Standard interface. */
|
|
792
|
+
interface StandardTypedV1<Input = unknown, Output = Input> {
|
|
793
|
+
/** The Standard properties. */
|
|
794
|
+
readonly "~standard": StandardTypedV1.Props<Input, Output>;
|
|
795
|
+
}
|
|
796
|
+
declare namespace StandardTypedV1 {
|
|
797
|
+
/** The Standard properties interface. */
|
|
798
|
+
interface Props<Input = unknown, Output = Input> {
|
|
799
|
+
/** The version number of the standard. */
|
|
800
|
+
readonly version: 1;
|
|
801
|
+
/** The vendor name of the schema library. */
|
|
802
|
+
readonly vendor: string;
|
|
803
|
+
/** Inferred types associated with the schema. */
|
|
804
|
+
readonly types?: Types<Input, Output> | undefined;
|
|
805
|
+
}
|
|
806
|
+
/** The Standard types interface. */
|
|
807
|
+
interface Types<Input = unknown, Output = Input> {
|
|
808
|
+
/** The input type of the schema. */
|
|
809
|
+
readonly input: Input;
|
|
810
|
+
/** The output type of the schema. */
|
|
811
|
+
readonly output: Output;
|
|
812
|
+
}
|
|
813
|
+
/** Infers the input type of a Standard. */
|
|
814
|
+
type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
815
|
+
/** Infers the output type of a Standard. */
|
|
816
|
+
type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
817
|
+
}
|
|
818
|
+
/** The Standard Schema interface. */
|
|
819
|
+
interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
820
|
+
/** The Standard Schema properties. */
|
|
821
|
+
readonly "~standard": StandardSchemaV1.Props<Input, Output>;
|
|
822
|
+
}
|
|
823
|
+
declare namespace StandardSchemaV1 {
|
|
824
|
+
/** The Standard Schema properties interface. */
|
|
825
|
+
interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
|
|
826
|
+
/** Validates unknown input values. */
|
|
827
|
+
readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
|
|
828
|
+
}
|
|
829
|
+
/** The result interface of the validate function. */
|
|
830
|
+
type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
831
|
+
/** The result interface if validation succeeds. */
|
|
832
|
+
interface SuccessResult<Output> {
|
|
833
|
+
/** The typed output value. */
|
|
834
|
+
readonly value: Output;
|
|
835
|
+
/** The absence of issues indicates success. */
|
|
836
|
+
readonly issues?: undefined;
|
|
837
|
+
}
|
|
838
|
+
interface Options {
|
|
839
|
+
/** Implicit support for additional vendor-specific parameters, if needed. */
|
|
840
|
+
readonly libraryOptions?: Record<string, unknown> | undefined;
|
|
841
|
+
}
|
|
842
|
+
/** The result interface if validation fails. */
|
|
843
|
+
interface FailureResult {
|
|
844
|
+
/** The issues of failed validation. */
|
|
845
|
+
readonly issues: ReadonlyArray<Issue>;
|
|
846
|
+
}
|
|
847
|
+
/** The issue interface of the failure output. */
|
|
848
|
+
interface Issue {
|
|
849
|
+
/** The error message of the issue. */
|
|
850
|
+
readonly message: string;
|
|
851
|
+
/** The path of the issue, if any. */
|
|
852
|
+
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
|
853
|
+
}
|
|
854
|
+
/** The path segment interface of the issue. */
|
|
855
|
+
interface PathSegment {
|
|
856
|
+
/** The key representing a path segment. */
|
|
857
|
+
readonly key: PropertyKey;
|
|
858
|
+
}
|
|
859
|
+
/** The Standard types interface. */
|
|
860
|
+
interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
|
|
861
|
+
/** Infers the input type of a Standard. */
|
|
862
|
+
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
863
|
+
/** Infers the output type of a Standard. */
|
|
864
|
+
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
865
|
+
}
|
|
866
|
+
/** The Standard JSON Schema interface. */
|
|
867
|
+
interface StandardJSONSchemaV1<Input = unknown, Output = Input> {
|
|
868
|
+
/** The Standard JSON Schema properties. */
|
|
869
|
+
readonly "~standard": StandardJSONSchemaV1.Props<Input, Output>;
|
|
870
|
+
}
|
|
871
|
+
declare namespace StandardJSONSchemaV1 {
|
|
872
|
+
/** The Standard JSON Schema properties interface. */
|
|
873
|
+
interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
|
|
874
|
+
/** Methods for generating the input/output JSON Schema. */
|
|
875
|
+
readonly jsonSchema: Converter;
|
|
876
|
+
}
|
|
877
|
+
/** The Standard JSON Schema converter interface. */
|
|
878
|
+
interface Converter {
|
|
879
|
+
/** Converts the input type to JSON Schema. May throw if conversion is not supported. */
|
|
880
|
+
readonly input: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
|
|
881
|
+
/** Converts the output type to JSON Schema. May throw if conversion is not supported. */
|
|
882
|
+
readonly output: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
|
|
883
|
+
}
|
|
884
|
+
/** The target version of the generated JSON Schema.
|
|
885
|
+
*
|
|
886
|
+
* It is *strongly recommended* that implementers support `"draft-2020-12"` and `"draft-07"`, as they are both in wide use.
|
|
887
|
+
*
|
|
888
|
+
* The `"openapi-3.0"` target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema `"draft-04"`.
|
|
889
|
+
*
|
|
890
|
+
* All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target.
|
|
891
|
+
*/
|
|
892
|
+
type Target = "draft-2020-12" | "draft-07" | "openapi-3.0" | ({} & string);
|
|
893
|
+
/** The options for the input/output methods. */
|
|
894
|
+
interface Options {
|
|
895
|
+
/** Specifies the target version of the generated JSON Schema. Support for all versions is on a best-effort basis. If a given version is not supported, the library should throw. */
|
|
896
|
+
readonly target: Target;
|
|
897
|
+
/** Implicit support for additional vendor-specific parameters, if needed. */
|
|
898
|
+
readonly libraryOptions?: Record<string, unknown> | undefined;
|
|
899
|
+
}
|
|
900
|
+
/** The Standard types interface. */
|
|
901
|
+
interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
|
|
902
|
+
/** Infers the input type of a Standard. */
|
|
903
|
+
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
904
|
+
/** Infers the output type of a Standard. */
|
|
905
|
+
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
906
|
+
}
|
|
907
|
+
interface StandardSchemaWithJSONProps<Input = unknown, Output = Input> extends StandardSchemaV1.Props<Input, Output>, StandardJSONSchemaV1.Props<Input, Output> {}
|
|
908
|
+
//#endregion
|
|
909
|
+
//#region ../../node_modules/zod/v4/core/registries.d.cts
|
|
910
|
+
declare const $output: unique symbol;
|
|
911
|
+
type $output = typeof $output;
|
|
912
|
+
declare const $input: unique symbol;
|
|
913
|
+
type $input = typeof $input;
|
|
914
|
+
type $replace<Meta, S extends $ZodType> = Meta extends $output ? output<S> : Meta extends $input ? input<S> : Meta extends (infer M)[] ? $replace<M, S>[] : Meta extends ((...args: infer P) => infer R) ? (...args: { [K in keyof P]: $replace<P[K], S> }) => $replace<R, S> : Meta extends object ? { [K in keyof Meta]: $replace<Meta[K], S> } : Meta;
|
|
915
|
+
type MetadataType = object | undefined;
|
|
916
|
+
declare class $ZodRegistry<Meta extends MetadataType = MetadataType, Schema extends $ZodType = $ZodType> {
|
|
917
|
+
_meta: Meta;
|
|
918
|
+
_schema: Schema;
|
|
919
|
+
_map: WeakMap<Schema, $replace<Meta, Schema>>;
|
|
920
|
+
_idmap: Map<string, Schema>;
|
|
921
|
+
add<S extends Schema>(schema: S, ..._meta: undefined extends Meta ? [$replace<Meta, S>?] : [$replace<Meta, S>]): this;
|
|
922
|
+
clear(): this;
|
|
923
|
+
remove(schema: Schema): this;
|
|
924
|
+
get<S extends Schema>(schema: S): $replace<Meta, S> | undefined;
|
|
925
|
+
has(schema: Schema): boolean;
|
|
926
|
+
}
|
|
927
|
+
interface JSONSchemaMeta {
|
|
928
|
+
id?: string | undefined;
|
|
929
|
+
title?: string | undefined;
|
|
930
|
+
description?: string | undefined;
|
|
931
|
+
deprecated?: boolean | undefined;
|
|
932
|
+
[k: string]: unknown;
|
|
933
|
+
}
|
|
934
|
+
interface GlobalMeta extends JSONSchemaMeta {}
|
|
935
|
+
//#endregion
|
|
936
|
+
//#region ../../node_modules/zod/v4/core/to-json-schema.d.cts
|
|
937
|
+
type Processor<T extends $ZodType = $ZodType> = (schema: T, ctx: ToJSONSchemaContext, json: BaseSchema, params: ProcessParams) => void;
|
|
938
|
+
interface JSONSchemaGeneratorParams {
|
|
939
|
+
processors: Record<string, Processor>;
|
|
940
|
+
/** A registry used to look up metadata for each schema. Any schema with an `id` property will be extracted as a $def.
|
|
941
|
+
* @default globalRegistry */
|
|
942
|
+
metadata?: $ZodRegistry<Record<string, any>>;
|
|
943
|
+
/** The JSON Schema version to target.
|
|
944
|
+
* - `"draft-2020-12"` — Default. JSON Schema Draft 2020-12
|
|
945
|
+
* - `"draft-07"` — JSON Schema Draft 7
|
|
946
|
+
* - `"draft-04"` — JSON Schema Draft 4
|
|
947
|
+
* - `"openapi-3.0"` — OpenAPI 3.0 Schema Object */
|
|
948
|
+
target?: "draft-04" | "draft-07" | "draft-2020-12" | "openapi-3.0" | ({} & string) | undefined;
|
|
949
|
+
/** How to handle unrepresentable types.
|
|
950
|
+
* - `"throw"` — Default. Unrepresentable types throw an error
|
|
951
|
+
* - `"any"` — Unrepresentable types become `{}` */
|
|
952
|
+
unrepresentable?: "throw" | "any";
|
|
953
|
+
/** Arbitrary custom logic that can be used to modify the generated JSON Schema. */
|
|
954
|
+
override?: (ctx: {
|
|
955
|
+
zodSchema: $ZodTypes;
|
|
956
|
+
jsonSchema: BaseSchema;
|
|
957
|
+
path: (string | number)[];
|
|
958
|
+
}) => void;
|
|
959
|
+
/** Whether to extract the `"input"` or `"output"` type. Relevant to transforms, defaults, coerced primitives, etc.
|
|
960
|
+
* - `"output"` — Default. Convert the output schema.
|
|
961
|
+
* - `"input"` — Convert the input schema. */
|
|
962
|
+
io?: "input" | "output";
|
|
963
|
+
cycles?: "ref" | "throw";
|
|
964
|
+
reused?: "ref" | "inline";
|
|
965
|
+
external?: {
|
|
966
|
+
registry: $ZodRegistry<{
|
|
967
|
+
id?: string | undefined;
|
|
968
|
+
}>;
|
|
969
|
+
uri?: ((id: string) => string) | undefined;
|
|
970
|
+
defs: Record<string, BaseSchema>;
|
|
971
|
+
} | undefined;
|
|
972
|
+
}
|
|
973
|
+
/**
|
|
974
|
+
* Parameters for the toJSONSchema function.
|
|
975
|
+
*/
|
|
976
|
+
type ToJSONSchemaParams = Omit<JSONSchemaGeneratorParams, "processors" | "external">;
|
|
977
|
+
interface ProcessParams {
|
|
978
|
+
schemaPath: $ZodType[];
|
|
979
|
+
path: (string | number)[];
|
|
980
|
+
}
|
|
981
|
+
interface Seen {
|
|
982
|
+
/** JSON Schema result for this Zod schema */
|
|
983
|
+
schema: BaseSchema;
|
|
984
|
+
/** A cached version of the schema that doesn't get overwritten during ref resolution */
|
|
985
|
+
def?: BaseSchema;
|
|
986
|
+
defId?: string | undefined;
|
|
987
|
+
/** Number of times this schema was encountered during traversal */
|
|
988
|
+
count: number;
|
|
989
|
+
/** Cycle path */
|
|
990
|
+
cycle?: (string | number)[] | undefined;
|
|
991
|
+
isParent?: boolean | undefined;
|
|
992
|
+
/** Schema to inherit JSON Schema properties from (set by processor for wrappers) */
|
|
993
|
+
ref?: $ZodType | null;
|
|
994
|
+
/** JSON Schema property path for this schema */
|
|
995
|
+
path?: (string | number)[] | undefined;
|
|
996
|
+
}
|
|
997
|
+
interface ToJSONSchemaContext {
|
|
998
|
+
processors: Record<string, Processor>;
|
|
999
|
+
metadataRegistry: $ZodRegistry<Record<string, any>>;
|
|
1000
|
+
target: "draft-04" | "draft-07" | "draft-2020-12" | "openapi-3.0" | ({} & string);
|
|
1001
|
+
unrepresentable: "throw" | "any";
|
|
1002
|
+
override: (ctx: {
|
|
1003
|
+
zodSchema: $ZodType;
|
|
1004
|
+
jsonSchema: BaseSchema;
|
|
1005
|
+
path: (string | number)[];
|
|
1006
|
+
}) => void;
|
|
1007
|
+
io: "input" | "output";
|
|
1008
|
+
counter: number;
|
|
1009
|
+
seen: Map<$ZodType, Seen>;
|
|
1010
|
+
cycles: "ref" | "throw";
|
|
1011
|
+
reused: "ref" | "inline";
|
|
1012
|
+
external?: {
|
|
1013
|
+
registry: $ZodRegistry<{
|
|
1014
|
+
id?: string | undefined;
|
|
1015
|
+
}>;
|
|
1016
|
+
uri?: ((id: string) => string) | undefined;
|
|
1017
|
+
defs: Record<string, BaseSchema>;
|
|
1018
|
+
} | undefined;
|
|
1019
|
+
}
|
|
1020
|
+
type ZodStandardSchemaWithJSON$1<T> = StandardSchemaWithJSONProps<input<T>, output<T>>;
|
|
1021
|
+
interface ZodStandardJSONSchemaPayload<T> extends BaseSchema {
|
|
1022
|
+
"~standard": ZodStandardSchemaWithJSON$1<T>;
|
|
1023
|
+
}
|
|
1024
|
+
//#endregion
|
|
1025
|
+
//#region ../../node_modules/zod/v4/core/util.d.cts
|
|
1026
|
+
type JWTAlgorithm = "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "EdDSA" | (string & {});
|
|
1027
|
+
type MimeTypes = "application/json" | "application/xml" | "application/x-www-form-urlencoded" | "application/javascript" | "application/pdf" | "application/zip" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/octet-stream" | "application/graphql" | "text/html" | "text/plain" | "text/css" | "text/javascript" | "text/csv" | "image/png" | "image/jpeg" | "image/gif" | "image/svg+xml" | "image/webp" | "audio/mpeg" | "audio/ogg" | "audio/wav" | "audio/webm" | "video/mp4" | "video/webm" | "video/ogg" | "font/woff" | "font/woff2" | "font/ttf" | "font/otf" | "multipart/form-data" | (string & {});
|
|
1028
|
+
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
1029
|
+
type Omit$1<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
1030
|
+
type MakePartial<T, K extends keyof T> = Omit$1<T, K> & InexactPartial<Pick<T, K>>;
|
|
1031
|
+
type NoUndefined<T> = T extends undefined ? never : T;
|
|
1032
|
+
type LoosePartial<T extends object> = InexactPartial<T> & {
|
|
1033
|
+
[k: string]: unknown;
|
|
1034
|
+
};
|
|
1035
|
+
type Mask<Keys extends PropertyKey> = { [K in Keys]?: true };
|
|
1036
|
+
type InexactPartial<T> = { [P in keyof T]?: T[P] | undefined };
|
|
1037
|
+
type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | {
|
|
1038
|
+
readonly [Symbol.toStringTag]: string;
|
|
1039
|
+
} | Date | Error | Generator | Promise<unknown> | RegExp;
|
|
1040
|
+
type MakeReadonly<T> = T extends Map<infer K, infer V> ? ReadonlyMap<K, V> : T extends Set<infer V> ? ReadonlySet<V> : T extends [infer Head, ...infer Tail] ? readonly [Head, ...Tail] : T extends Array<infer V> ? ReadonlyArray<V> : T extends BuiltIn ? T : Readonly<T>;
|
|
1041
|
+
type SomeObject = Record<PropertyKey, any>;
|
|
1042
|
+
type Identity<T> = T;
|
|
1043
|
+
type Flatten<T> = Identity<{ [k in keyof T]: T[k] }>;
|
|
1044
|
+
type Prettify<T> = { [K in keyof T]: T[K] } & {};
|
|
1045
|
+
type Extend<A extends SomeObject, B extends SomeObject> = Flatten<keyof A & keyof B extends never ? A & B : { [K in keyof A as K extends keyof B ? never : K]: A[K] } & { [K in keyof B]: B[K] }>;
|
|
1046
|
+
type TupleItems = ReadonlyArray<SomeType>;
|
|
1047
|
+
type AnyFunc = (...args: any[]) => any;
|
|
1048
|
+
type MaybeAsync<T> = T | Promise<T>;
|
|
1049
|
+
type EnumValue = string | number;
|
|
1050
|
+
type EnumLike = Readonly<Record<string, EnumValue>>;
|
|
1051
|
+
type ToEnum<T extends EnumValue> = Flatten<{ [k in T]: k }>;
|
|
1052
|
+
type Literal = string | number | bigint | boolean | null | undefined;
|
|
1053
|
+
type Primitive = string | number | symbol | bigint | boolean | null | undefined;
|
|
1054
|
+
type HasLength = {
|
|
1055
|
+
length: number;
|
|
1056
|
+
};
|
|
1057
|
+
type Numeric = number | bigint | Date;
|
|
1058
|
+
type PropValues = Record<string, Set<Primitive>>;
|
|
1059
|
+
type PrimitiveSet = Set<Primitive>;
|
|
1060
|
+
type EmptyToNever<T> = keyof T extends never ? never : T;
|
|
1061
|
+
declare abstract class Class {
|
|
1062
|
+
constructor(..._args: any[]);
|
|
1063
|
+
}
|
|
1064
|
+
//#endregion
|
|
1065
|
+
//#region ../../node_modules/zod/v4/core/versions.d.cts
|
|
1066
|
+
declare const version: {
|
|
1067
|
+
readonly major: 4;
|
|
1068
|
+
readonly minor: 3;
|
|
1069
|
+
readonly patch: number;
|
|
1070
|
+
};
|
|
1071
|
+
//#endregion
|
|
1072
|
+
//#region ../../node_modules/zod/v4/core/schemas.d.cts
|
|
1073
|
+
interface ParseContext<T extends $ZodIssueBase = never> {
|
|
1074
|
+
/** Customize error messages. */
|
|
1075
|
+
readonly error?: $ZodErrorMap<T>;
|
|
1076
|
+
/** Include the `input` field in issue objects. Default `false`. */
|
|
1077
|
+
readonly reportInput?: boolean;
|
|
1078
|
+
/** Skip eval-based fast path. Default `false`. */
|
|
1079
|
+
readonly jitless?: boolean;
|
|
1080
|
+
}
|
|
1081
|
+
/** @internal */
|
|
1082
|
+
interface ParseContextInternal<T extends $ZodIssueBase = never> extends ParseContext<T> {
|
|
1083
|
+
readonly async?: boolean | undefined;
|
|
1084
|
+
readonly direction?: "forward" | "backward";
|
|
1085
|
+
readonly skipChecks?: boolean;
|
|
1086
|
+
}
|
|
1087
|
+
interface ParsePayload<T = unknown> {
|
|
1088
|
+
value: T;
|
|
1089
|
+
issues: $ZodRawIssue[];
|
|
1090
|
+
/** A may to mark a whole payload as aborted. Used in codecs/pipes. */
|
|
1091
|
+
aborted?: boolean;
|
|
1092
|
+
}
|
|
1093
|
+
type CheckFn<T> = (input: ParsePayload<T>) => MaybeAsync<void>;
|
|
1094
|
+
interface $ZodTypeDef {
|
|
1095
|
+
type: "string" | "number" | "int" | "boolean" | "bigint" | "symbol" | "null" | "undefined" | "void" | "never" | "any" | "unknown" | "date" | "object" | "record" | "file" | "array" | "tuple" | "union" | "intersection" | "map" | "set" | "enum" | "literal" | "nullable" | "optional" | "nonoptional" | "success" | "transform" | "default" | "prefault" | "catch" | "nan" | "pipe" | "readonly" | "template_literal" | "promise" | "lazy" | "function" | "custom";
|
|
1096
|
+
error?: $ZodErrorMap<never> | undefined;
|
|
1097
|
+
checks?: $ZodCheck<never>[];
|
|
1098
|
+
}
|
|
1099
|
+
interface _$ZodTypeInternals {
|
|
1100
|
+
/** The `@zod/core` version of this schema */
|
|
1101
|
+
version: typeof version;
|
|
1102
|
+
/** Schema definition. */
|
|
1103
|
+
def: $ZodTypeDef;
|
|
1104
|
+
/** @internal Randomly generated ID for this schema. */
|
|
1105
|
+
/** @internal List of deferred initializers. */
|
|
1106
|
+
deferred: AnyFunc[] | undefined;
|
|
1107
|
+
/** @internal Parses input and runs all checks (refinements). */
|
|
1108
|
+
run(payload: ParsePayload<any>, ctx: ParseContextInternal): MaybeAsync<ParsePayload>;
|
|
1109
|
+
/** @internal Parses input, doesn't run checks. */
|
|
1110
|
+
parse(payload: ParsePayload<any>, ctx: ParseContextInternal): MaybeAsync<ParsePayload>;
|
|
1111
|
+
/** @internal Stores identifiers for the set of traits implemented by this schema. */
|
|
1112
|
+
traits: Set<string>;
|
|
1113
|
+
/** @internal Indicates that a schema output type should be considered optional inside objects.
|
|
1114
|
+
* @default Required
|
|
1115
|
+
*/
|
|
1116
|
+
/** @internal */
|
|
1117
|
+
optin?: "optional" | undefined;
|
|
1118
|
+
/** @internal */
|
|
1119
|
+
optout?: "optional" | undefined;
|
|
1120
|
+
/** @internal The set of literal values that will pass validation. Must be an exhaustive set. Used to determine optionality in z.record().
|
|
1121
|
+
*
|
|
1122
|
+
* Defined on: enum, const, literal, null, undefined
|
|
1123
|
+
* Passthrough: optional, nullable, branded, default, catch, pipe
|
|
1124
|
+
* Todo: unions?
|
|
1125
|
+
*/
|
|
1126
|
+
values?: PrimitiveSet | undefined;
|
|
1127
|
+
/** Default value bubbled up from */
|
|
1128
|
+
/** @internal A set of literal discriminators used for the fast path in discriminated unions. */
|
|
1129
|
+
propValues?: PropValues | undefined;
|
|
1130
|
+
/** @internal This flag indicates that a schema validation can be represented with a regular expression. Used to determine allowable schemas in z.templateLiteral(). */
|
|
1131
|
+
pattern: RegExp | undefined;
|
|
1132
|
+
/** @internal The constructor function of this schema. */
|
|
1133
|
+
constr: new (def: any) => $ZodType;
|
|
1134
|
+
/** @internal A catchall object for bag metadata related to this schema. Commonly modified by checks using `onattach`. */
|
|
1135
|
+
bag: Record<string, unknown>;
|
|
1136
|
+
/** @internal The set of issues this schema might throw during type checking. */
|
|
1137
|
+
isst: $ZodIssueBase;
|
|
1138
|
+
/** @internal Subject to change, not a public API. */
|
|
1139
|
+
processJSONSchema?: ((ctx: ToJSONSchemaContext, json: BaseSchema, params: ProcessParams) => void) | undefined;
|
|
1140
|
+
/** An optional method used to override `toJSONSchema` logic. */
|
|
1141
|
+
toJSONSchema?: () => unknown;
|
|
1142
|
+
/** @internal The parent of this schema. Only set during certain clone operations. */
|
|
1143
|
+
parent?: $ZodType | undefined;
|
|
1144
|
+
}
|
|
1145
|
+
/** @internal */
|
|
1146
|
+
interface $ZodTypeInternals<out O = unknown, out I = unknown> extends _$ZodTypeInternals {
|
|
1147
|
+
/** @internal The inferred output type */
|
|
1148
|
+
output: O;
|
|
1149
|
+
/** @internal The inferred input type */
|
|
1150
|
+
input: I;
|
|
1151
|
+
}
|
|
1152
|
+
type $ZodStandardSchema<T> = StandardSchemaV1.Props<input<T>, output<T>>;
|
|
1153
|
+
type SomeType = {
|
|
1154
|
+
_zod: _$ZodTypeInternals;
|
|
1155
|
+
};
|
|
1156
|
+
interface $ZodType<O = unknown, I = unknown, Internals extends $ZodTypeInternals<O, I> = $ZodTypeInternals<O, I>> {
|
|
1157
|
+
_zod: Internals;
|
|
1158
|
+
"~standard": $ZodStandardSchema<this>;
|
|
1159
|
+
}
|
|
1160
|
+
interface _$ZodType<T extends $ZodTypeInternals = $ZodTypeInternals> extends $ZodType<T["output"], T["input"], T> {}
|
|
1161
|
+
declare const $ZodType: $constructor<$ZodType>;
|
|
1162
|
+
interface $ZodStringDef extends $ZodTypeDef {
|
|
1163
|
+
type: "string";
|
|
1164
|
+
coerce?: boolean;
|
|
1165
|
+
checks?: $ZodCheck<string>[];
|
|
1166
|
+
}
|
|
1167
|
+
interface $ZodStringInternals<Input> extends $ZodTypeInternals<string, Input> {
|
|
1168
|
+
def: $ZodStringDef;
|
|
1169
|
+
/** @deprecated Internal API, use with caution (not deprecated) */
|
|
1170
|
+
pattern: RegExp;
|
|
1171
|
+
/** @deprecated Internal API, use with caution (not deprecated) */
|
|
1172
|
+
isst: $ZodIssueInvalidType;
|
|
1173
|
+
bag: LoosePartial<{
|
|
1174
|
+
minimum: number;
|
|
1175
|
+
maximum: number;
|
|
1176
|
+
patterns: Set<RegExp>;
|
|
1177
|
+
format: string;
|
|
1178
|
+
contentEncoding: string;
|
|
1179
|
+
}>;
|
|
1180
|
+
}
|
|
1181
|
+
interface $ZodString<Input = unknown> extends _$ZodType<$ZodStringInternals<Input>> {}
|
|
1182
|
+
declare const $ZodString: $constructor<$ZodString>;
|
|
1183
|
+
interface $ZodStringFormatDef<Format extends string = string> extends $ZodStringDef, $ZodCheckStringFormatDef<Format> {}
|
|
1184
|
+
interface $ZodStringFormatInternals<Format extends string = string> extends $ZodStringInternals<string>, $ZodCheckStringFormatInternals {
|
|
1185
|
+
def: $ZodStringFormatDef<Format>;
|
|
1186
|
+
}
|
|
1187
|
+
interface $ZodStringFormat<Format extends string = string> extends $ZodType {
|
|
1188
|
+
_zod: $ZodStringFormatInternals<Format>;
|
|
1189
|
+
}
|
|
1190
|
+
declare const $ZodStringFormat: $constructor<$ZodStringFormat>;
|
|
1191
|
+
interface $ZodGUIDInternals extends $ZodStringFormatInternals<"guid"> {}
|
|
1192
|
+
interface $ZodGUID extends $ZodType {
|
|
1193
|
+
_zod: $ZodGUIDInternals;
|
|
1194
|
+
}
|
|
1195
|
+
declare const $ZodGUID: $constructor<$ZodGUID>;
|
|
1196
|
+
interface $ZodUUIDDef extends $ZodStringFormatDef<"uuid"> {
|
|
1197
|
+
version?: "v1" | "v2" | "v3" | "v4" | "v5" | "v6" | "v7" | "v8";
|
|
1198
|
+
}
|
|
1199
|
+
interface $ZodUUIDInternals extends $ZodStringFormatInternals<"uuid"> {
|
|
1200
|
+
def: $ZodUUIDDef;
|
|
1201
|
+
}
|
|
1202
|
+
interface $ZodUUID extends $ZodType {
|
|
1203
|
+
_zod: $ZodUUIDInternals;
|
|
1204
|
+
}
|
|
1205
|
+
declare const $ZodUUID: $constructor<$ZodUUID>;
|
|
1206
|
+
interface $ZodEmailInternals extends $ZodStringFormatInternals<"email"> {}
|
|
1207
|
+
interface $ZodEmail extends $ZodType {
|
|
1208
|
+
_zod: $ZodEmailInternals;
|
|
1209
|
+
}
|
|
1210
|
+
declare const $ZodEmail: $constructor<$ZodEmail>;
|
|
1211
|
+
interface $ZodURLDef extends $ZodStringFormatDef<"url"> {
|
|
1212
|
+
hostname?: RegExp | undefined;
|
|
1213
|
+
protocol?: RegExp | undefined;
|
|
1214
|
+
normalize?: boolean | undefined;
|
|
1215
|
+
}
|
|
1216
|
+
interface $ZodURLInternals extends $ZodStringFormatInternals<"url"> {
|
|
1217
|
+
def: $ZodURLDef;
|
|
1218
|
+
}
|
|
1219
|
+
interface $ZodURL extends $ZodType {
|
|
1220
|
+
_zod: $ZodURLInternals;
|
|
1221
|
+
}
|
|
1222
|
+
declare const $ZodURL: $constructor<$ZodURL>;
|
|
1223
|
+
interface $ZodEmojiInternals extends $ZodStringFormatInternals<"emoji"> {}
|
|
1224
|
+
interface $ZodEmoji extends $ZodType {
|
|
1225
|
+
_zod: $ZodEmojiInternals;
|
|
1226
|
+
}
|
|
1227
|
+
declare const $ZodEmoji: $constructor<$ZodEmoji>;
|
|
1228
|
+
interface $ZodNanoIDInternals extends $ZodStringFormatInternals<"nanoid"> {}
|
|
1229
|
+
interface $ZodNanoID extends $ZodType {
|
|
1230
|
+
_zod: $ZodNanoIDInternals;
|
|
1231
|
+
}
|
|
1232
|
+
declare const $ZodNanoID: $constructor<$ZodNanoID>;
|
|
1233
|
+
interface $ZodCUIDInternals extends $ZodStringFormatInternals<"cuid"> {}
|
|
1234
|
+
interface $ZodCUID extends $ZodType {
|
|
1235
|
+
_zod: $ZodCUIDInternals;
|
|
1236
|
+
}
|
|
1237
|
+
declare const $ZodCUID: $constructor<$ZodCUID>;
|
|
1238
|
+
interface $ZodCUID2Internals extends $ZodStringFormatInternals<"cuid2"> {}
|
|
1239
|
+
interface $ZodCUID2 extends $ZodType {
|
|
1240
|
+
_zod: $ZodCUID2Internals;
|
|
1241
|
+
}
|
|
1242
|
+
declare const $ZodCUID2: $constructor<$ZodCUID2>;
|
|
1243
|
+
interface $ZodULIDInternals extends $ZodStringFormatInternals<"ulid"> {}
|
|
1244
|
+
interface $ZodULID extends $ZodType {
|
|
1245
|
+
_zod: $ZodULIDInternals;
|
|
1246
|
+
}
|
|
1247
|
+
declare const $ZodULID: $constructor<$ZodULID>;
|
|
1248
|
+
interface $ZodXIDInternals extends $ZodStringFormatInternals<"xid"> {}
|
|
1249
|
+
interface $ZodXID extends $ZodType {
|
|
1250
|
+
_zod: $ZodXIDInternals;
|
|
1251
|
+
}
|
|
1252
|
+
declare const $ZodXID: $constructor<$ZodXID>;
|
|
1253
|
+
interface $ZodKSUIDInternals extends $ZodStringFormatInternals<"ksuid"> {}
|
|
1254
|
+
interface $ZodKSUID extends $ZodType {
|
|
1255
|
+
_zod: $ZodKSUIDInternals;
|
|
1256
|
+
}
|
|
1257
|
+
declare const $ZodKSUID: $constructor<$ZodKSUID>;
|
|
1258
|
+
interface $ZodISODateTimeDef extends $ZodStringFormatDef<"datetime"> {
|
|
1259
|
+
precision: number | null;
|
|
1260
|
+
offset: boolean;
|
|
1261
|
+
local: boolean;
|
|
1262
|
+
}
|
|
1263
|
+
interface $ZodISODateTimeInternals extends $ZodStringFormatInternals {
|
|
1264
|
+
def: $ZodISODateTimeDef;
|
|
1265
|
+
}
|
|
1266
|
+
interface $ZodISODateTime extends $ZodType {
|
|
1267
|
+
_zod: $ZodISODateTimeInternals;
|
|
1268
|
+
}
|
|
1269
|
+
declare const $ZodISODateTime: $constructor<$ZodISODateTime>;
|
|
1270
|
+
interface $ZodISODateInternals extends $ZodStringFormatInternals<"date"> {}
|
|
1271
|
+
interface $ZodISODate extends $ZodType {
|
|
1272
|
+
_zod: $ZodISODateInternals;
|
|
1273
|
+
}
|
|
1274
|
+
declare const $ZodISODate: $constructor<$ZodISODate>;
|
|
1275
|
+
interface $ZodISOTimeDef extends $ZodStringFormatDef<"time"> {
|
|
1276
|
+
precision?: number | null;
|
|
1277
|
+
}
|
|
1278
|
+
interface $ZodISOTimeInternals extends $ZodStringFormatInternals<"time"> {
|
|
1279
|
+
def: $ZodISOTimeDef;
|
|
1280
|
+
}
|
|
1281
|
+
interface $ZodISOTime extends $ZodType {
|
|
1282
|
+
_zod: $ZodISOTimeInternals;
|
|
1283
|
+
}
|
|
1284
|
+
declare const $ZodISOTime: $constructor<$ZodISOTime>;
|
|
1285
|
+
interface $ZodISODurationInternals extends $ZodStringFormatInternals<"duration"> {}
|
|
1286
|
+
interface $ZodISODuration extends $ZodType {
|
|
1287
|
+
_zod: $ZodISODurationInternals;
|
|
1288
|
+
}
|
|
1289
|
+
declare const $ZodISODuration: $constructor<$ZodISODuration>;
|
|
1290
|
+
interface $ZodIPv4Def extends $ZodStringFormatDef<"ipv4"> {
|
|
1291
|
+
version?: "v4";
|
|
1292
|
+
}
|
|
1293
|
+
interface $ZodIPv4Internals extends $ZodStringFormatInternals<"ipv4"> {
|
|
1294
|
+
def: $ZodIPv4Def;
|
|
1295
|
+
}
|
|
1296
|
+
interface $ZodIPv4 extends $ZodType {
|
|
1297
|
+
_zod: $ZodIPv4Internals;
|
|
1298
|
+
}
|
|
1299
|
+
declare const $ZodIPv4: $constructor<$ZodIPv4>;
|
|
1300
|
+
interface $ZodIPv6Def extends $ZodStringFormatDef<"ipv6"> {
|
|
1301
|
+
version?: "v6";
|
|
1302
|
+
}
|
|
1303
|
+
interface $ZodIPv6Internals extends $ZodStringFormatInternals<"ipv6"> {
|
|
1304
|
+
def: $ZodIPv6Def;
|
|
1305
|
+
}
|
|
1306
|
+
interface $ZodIPv6 extends $ZodType {
|
|
1307
|
+
_zod: $ZodIPv6Internals;
|
|
1308
|
+
}
|
|
1309
|
+
declare const $ZodIPv6: $constructor<$ZodIPv6>;
|
|
1310
|
+
interface $ZodCIDRv4Def extends $ZodStringFormatDef<"cidrv4"> {
|
|
1311
|
+
version?: "v4";
|
|
1312
|
+
}
|
|
1313
|
+
interface $ZodCIDRv4Internals extends $ZodStringFormatInternals<"cidrv4"> {
|
|
1314
|
+
def: $ZodCIDRv4Def;
|
|
1315
|
+
}
|
|
1316
|
+
interface $ZodCIDRv4 extends $ZodType {
|
|
1317
|
+
_zod: $ZodCIDRv4Internals;
|
|
1318
|
+
}
|
|
1319
|
+
declare const $ZodCIDRv4: $constructor<$ZodCIDRv4>;
|
|
1320
|
+
interface $ZodCIDRv6Def extends $ZodStringFormatDef<"cidrv6"> {
|
|
1321
|
+
version?: "v6";
|
|
1322
|
+
}
|
|
1323
|
+
interface $ZodCIDRv6Internals extends $ZodStringFormatInternals<"cidrv6"> {
|
|
1324
|
+
def: $ZodCIDRv6Def;
|
|
1325
|
+
}
|
|
1326
|
+
interface $ZodCIDRv6 extends $ZodType {
|
|
1327
|
+
_zod: $ZodCIDRv6Internals;
|
|
1328
|
+
}
|
|
1329
|
+
declare const $ZodCIDRv6: $constructor<$ZodCIDRv6>;
|
|
1330
|
+
interface $ZodBase64Internals extends $ZodStringFormatInternals<"base64"> {}
|
|
1331
|
+
interface $ZodBase64 extends $ZodType {
|
|
1332
|
+
_zod: $ZodBase64Internals;
|
|
1333
|
+
}
|
|
1334
|
+
declare const $ZodBase64: $constructor<$ZodBase64>;
|
|
1335
|
+
interface $ZodBase64URLInternals extends $ZodStringFormatInternals<"base64url"> {}
|
|
1336
|
+
interface $ZodBase64URL extends $ZodType {
|
|
1337
|
+
_zod: $ZodBase64URLInternals;
|
|
1338
|
+
}
|
|
1339
|
+
declare const $ZodBase64URL: $constructor<$ZodBase64URL>;
|
|
1340
|
+
interface $ZodE164Internals extends $ZodStringFormatInternals<"e164"> {}
|
|
1341
|
+
interface $ZodE164 extends $ZodType {
|
|
1342
|
+
_zod: $ZodE164Internals;
|
|
1343
|
+
}
|
|
1344
|
+
declare const $ZodE164: $constructor<$ZodE164>;
|
|
1345
|
+
interface $ZodJWTDef extends $ZodStringFormatDef<"jwt"> {
|
|
1346
|
+
alg?: JWTAlgorithm | undefined;
|
|
1347
|
+
}
|
|
1348
|
+
interface $ZodJWTInternals extends $ZodStringFormatInternals<"jwt"> {
|
|
1349
|
+
def: $ZodJWTDef;
|
|
1350
|
+
}
|
|
1351
|
+
interface $ZodJWT extends $ZodType {
|
|
1352
|
+
_zod: $ZodJWTInternals;
|
|
1353
|
+
}
|
|
1354
|
+
declare const $ZodJWT: $constructor<$ZodJWT>;
|
|
1355
|
+
interface $ZodNumberDef extends $ZodTypeDef {
|
|
1356
|
+
type: "number";
|
|
1357
|
+
coerce?: boolean;
|
|
1358
|
+
}
|
|
1359
|
+
interface $ZodNumberInternals<Input = unknown> extends $ZodTypeInternals<number, Input> {
|
|
1360
|
+
def: $ZodNumberDef;
|
|
1361
|
+
/** @deprecated Internal API, use with caution (not deprecated) */
|
|
1362
|
+
pattern: RegExp;
|
|
1363
|
+
/** @deprecated Internal API, use with caution (not deprecated) */
|
|
1364
|
+
isst: $ZodIssueInvalidType;
|
|
1365
|
+
bag: LoosePartial<{
|
|
1366
|
+
minimum: number;
|
|
1367
|
+
maximum: number;
|
|
1368
|
+
exclusiveMinimum: number;
|
|
1369
|
+
exclusiveMaximum: number;
|
|
1370
|
+
format: string;
|
|
1371
|
+
pattern: RegExp;
|
|
1372
|
+
}>;
|
|
1373
|
+
}
|
|
1374
|
+
interface $ZodNumber<Input = unknown> extends $ZodType {
|
|
1375
|
+
_zod: $ZodNumberInternals<Input>;
|
|
1376
|
+
}
|
|
1377
|
+
declare const $ZodNumber: $constructor<$ZodNumber>;
|
|
1378
|
+
interface $ZodBooleanDef extends $ZodTypeDef {
|
|
1379
|
+
type: "boolean";
|
|
1380
|
+
coerce?: boolean;
|
|
1381
|
+
checks?: $ZodCheck<boolean>[];
|
|
1382
|
+
}
|
|
1383
|
+
interface $ZodBooleanInternals<T = unknown> extends $ZodTypeInternals<boolean, T> {
|
|
1384
|
+
pattern: RegExp;
|
|
1385
|
+
def: $ZodBooleanDef;
|
|
1386
|
+
isst: $ZodIssueInvalidType;
|
|
1387
|
+
}
|
|
1388
|
+
interface $ZodBoolean<T = unknown> extends $ZodType {
|
|
1389
|
+
_zod: $ZodBooleanInternals<T>;
|
|
1390
|
+
}
|
|
1391
|
+
declare const $ZodBoolean: $constructor<$ZodBoolean>;
|
|
1392
|
+
interface $ZodBigIntDef extends $ZodTypeDef {
|
|
1393
|
+
type: "bigint";
|
|
1394
|
+
coerce?: boolean;
|
|
1395
|
+
}
|
|
1396
|
+
interface $ZodBigIntInternals<T = unknown> extends $ZodTypeInternals<bigint, T> {
|
|
1397
|
+
pattern: RegExp;
|
|
1398
|
+
/** @internal Internal API, use with caution */
|
|
1399
|
+
def: $ZodBigIntDef;
|
|
1400
|
+
isst: $ZodIssueInvalidType;
|
|
1401
|
+
bag: LoosePartial<{
|
|
1402
|
+
minimum: bigint;
|
|
1403
|
+
maximum: bigint;
|
|
1404
|
+
format: string;
|
|
1405
|
+
}>;
|
|
1406
|
+
}
|
|
1407
|
+
interface $ZodBigInt<T = unknown> extends $ZodType {
|
|
1408
|
+
_zod: $ZodBigIntInternals<T>;
|
|
1409
|
+
}
|
|
1410
|
+
declare const $ZodBigInt: $constructor<$ZodBigInt>;
|
|
1411
|
+
interface $ZodSymbolDef extends $ZodTypeDef {
|
|
1412
|
+
type: "symbol";
|
|
1413
|
+
}
|
|
1414
|
+
interface $ZodSymbolInternals extends $ZodTypeInternals<symbol, symbol> {
|
|
1415
|
+
def: $ZodSymbolDef;
|
|
1416
|
+
isst: $ZodIssueInvalidType;
|
|
1417
|
+
}
|
|
1418
|
+
interface $ZodSymbol extends $ZodType {
|
|
1419
|
+
_zod: $ZodSymbolInternals;
|
|
1420
|
+
}
|
|
1421
|
+
declare const $ZodSymbol: $constructor<$ZodSymbol>;
|
|
1422
|
+
interface $ZodUndefinedDef extends $ZodTypeDef {
|
|
1423
|
+
type: "undefined";
|
|
1424
|
+
}
|
|
1425
|
+
interface $ZodUndefinedInternals extends $ZodTypeInternals<undefined, undefined> {
|
|
1426
|
+
pattern: RegExp;
|
|
1427
|
+
def: $ZodUndefinedDef;
|
|
1428
|
+
values: PrimitiveSet;
|
|
1429
|
+
isst: $ZodIssueInvalidType;
|
|
1430
|
+
}
|
|
1431
|
+
interface $ZodUndefined extends $ZodType {
|
|
1432
|
+
_zod: $ZodUndefinedInternals;
|
|
1433
|
+
}
|
|
1434
|
+
declare const $ZodUndefined: $constructor<$ZodUndefined>;
|
|
1435
|
+
interface $ZodNullDef extends $ZodTypeDef {
|
|
1436
|
+
type: "null";
|
|
1437
|
+
}
|
|
1438
|
+
interface $ZodNullInternals extends $ZodTypeInternals<null, null> {
|
|
1439
|
+
pattern: RegExp;
|
|
1440
|
+
def: $ZodNullDef;
|
|
1441
|
+
values: PrimitiveSet;
|
|
1442
|
+
isst: $ZodIssueInvalidType;
|
|
1443
|
+
}
|
|
1444
|
+
interface $ZodNull extends $ZodType {
|
|
1445
|
+
_zod: $ZodNullInternals;
|
|
1446
|
+
}
|
|
1447
|
+
declare const $ZodNull: $constructor<$ZodNull>;
|
|
1448
|
+
interface $ZodAnyDef extends $ZodTypeDef {
|
|
1449
|
+
type: "any";
|
|
1450
|
+
}
|
|
1451
|
+
interface $ZodAnyInternals extends $ZodTypeInternals<any, any> {
|
|
1452
|
+
def: $ZodAnyDef;
|
|
1453
|
+
isst: never;
|
|
1454
|
+
}
|
|
1455
|
+
interface $ZodAny extends $ZodType {
|
|
1456
|
+
_zod: $ZodAnyInternals;
|
|
1457
|
+
}
|
|
1458
|
+
declare const $ZodAny: $constructor<$ZodAny>;
|
|
1459
|
+
interface $ZodUnknownDef extends $ZodTypeDef {
|
|
1460
|
+
type: "unknown";
|
|
1461
|
+
}
|
|
1462
|
+
interface $ZodUnknownInternals extends $ZodTypeInternals<unknown, unknown> {
|
|
1463
|
+
def: $ZodUnknownDef;
|
|
1464
|
+
isst: never;
|
|
1465
|
+
}
|
|
1466
|
+
interface $ZodUnknown extends $ZodType {
|
|
1467
|
+
_zod: $ZodUnknownInternals;
|
|
1468
|
+
}
|
|
1469
|
+
declare const $ZodUnknown: $constructor<$ZodUnknown>;
|
|
1470
|
+
interface $ZodNeverDef extends $ZodTypeDef {
|
|
1471
|
+
type: "never";
|
|
1472
|
+
}
|
|
1473
|
+
interface $ZodNeverInternals extends $ZodTypeInternals<never, never> {
|
|
1474
|
+
def: $ZodNeverDef;
|
|
1475
|
+
isst: $ZodIssueInvalidType;
|
|
1476
|
+
}
|
|
1477
|
+
interface $ZodNever extends $ZodType {
|
|
1478
|
+
_zod: $ZodNeverInternals;
|
|
1479
|
+
}
|
|
1480
|
+
declare const $ZodNever: $constructor<$ZodNever>;
|
|
1481
|
+
interface $ZodVoidDef extends $ZodTypeDef {
|
|
1482
|
+
type: "void";
|
|
1483
|
+
}
|
|
1484
|
+
interface $ZodVoidInternals extends $ZodTypeInternals<void, void> {
|
|
1485
|
+
def: $ZodVoidDef;
|
|
1486
|
+
isst: $ZodIssueInvalidType;
|
|
1487
|
+
}
|
|
1488
|
+
interface $ZodVoid extends $ZodType {
|
|
1489
|
+
_zod: $ZodVoidInternals;
|
|
1490
|
+
}
|
|
1491
|
+
declare const $ZodVoid: $constructor<$ZodVoid>;
|
|
1492
|
+
interface $ZodDateDef extends $ZodTypeDef {
|
|
1493
|
+
type: "date";
|
|
1494
|
+
coerce?: boolean;
|
|
1495
|
+
}
|
|
1496
|
+
interface $ZodDateInternals<T = unknown> extends $ZodTypeInternals<Date, T> {
|
|
1497
|
+
def: $ZodDateDef;
|
|
1498
|
+
isst: $ZodIssueInvalidType;
|
|
1499
|
+
bag: LoosePartial<{
|
|
1500
|
+
minimum: Date;
|
|
1501
|
+
maximum: Date;
|
|
1502
|
+
format: string;
|
|
1503
|
+
}>;
|
|
1504
|
+
}
|
|
1505
|
+
interface $ZodDate<T = unknown> extends $ZodType {
|
|
1506
|
+
_zod: $ZodDateInternals<T>;
|
|
1507
|
+
}
|
|
1508
|
+
declare const $ZodDate: $constructor<$ZodDate>;
|
|
1509
|
+
interface $ZodArrayDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1510
|
+
type: "array";
|
|
1511
|
+
element: T;
|
|
1512
|
+
}
|
|
1513
|
+
interface $ZodArrayInternals<T extends SomeType = $ZodType> extends _$ZodTypeInternals {
|
|
1514
|
+
def: $ZodArrayDef<T>;
|
|
1515
|
+
isst: $ZodIssueInvalidType;
|
|
1516
|
+
output: output<T>[];
|
|
1517
|
+
input: input<T>[];
|
|
1518
|
+
}
|
|
1519
|
+
interface $ZodArray<T extends SomeType = $ZodType> extends $ZodType<any, any, $ZodArrayInternals<T>> {}
|
|
1520
|
+
declare const $ZodArray: $constructor<$ZodArray>;
|
|
1521
|
+
type OptionalOutSchema = {
|
|
1522
|
+
_zod: {
|
|
1523
|
+
optout: "optional";
|
|
1524
|
+
};
|
|
1525
|
+
};
|
|
1526
|
+
type OptionalInSchema = {
|
|
1527
|
+
_zod: {
|
|
1528
|
+
optin: "optional";
|
|
1529
|
+
};
|
|
1530
|
+
};
|
|
1531
|
+
type $InferObjectOutput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? IsAny<T[keyof T]> extends true ? Record<string, unknown> : Record<string, output<T[keyof T]>> : keyof (T & Extra) extends never ? Record<string, never> : Prettify<{ -readonly [k in keyof T as T[k] extends OptionalOutSchema ? never : k]: T[k]["_zod"]["output"] } & { -readonly [k in keyof T as T[k] extends OptionalOutSchema ? k : never]?: T[k]["_zod"]["output"] } & Extra>;
|
|
1532
|
+
type $InferObjectInput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? IsAny<T[keyof T]> extends true ? Record<string, unknown> : Record<string, input<T[keyof T]>> : keyof (T & Extra) extends never ? Record<string, never> : Prettify<{ -readonly [k in keyof T as T[k] extends OptionalInSchema ? never : k]: T[k]["_zod"]["input"] } & { -readonly [k in keyof T as T[k] extends OptionalInSchema ? k : never]?: T[k]["_zod"]["input"] } & Extra>;
|
|
1533
|
+
type $ZodObjectConfig = {
|
|
1534
|
+
out: Record<string, unknown>;
|
|
1535
|
+
in: Record<string, unknown>;
|
|
1536
|
+
};
|
|
1537
|
+
type $loose = {
|
|
1538
|
+
out: Record<string, unknown>;
|
|
1539
|
+
in: Record<string, unknown>;
|
|
1540
|
+
};
|
|
1541
|
+
type $strict = {
|
|
1542
|
+
out: {};
|
|
1543
|
+
in: {};
|
|
1544
|
+
};
|
|
1545
|
+
type $strip = {
|
|
1546
|
+
out: {};
|
|
1547
|
+
in: {};
|
|
1548
|
+
};
|
|
1549
|
+
type $catchall<T extends SomeType> = {
|
|
1550
|
+
out: {
|
|
1551
|
+
[k: string]: output<T>;
|
|
1552
|
+
};
|
|
1553
|
+
in: {
|
|
1554
|
+
[k: string]: input<T>;
|
|
1555
|
+
};
|
|
1556
|
+
};
|
|
1557
|
+
type $ZodShape = Readonly<{
|
|
1558
|
+
[k: string]: $ZodType;
|
|
1559
|
+
}>;
|
|
1560
|
+
interface $ZodObjectDef<Shape extends $ZodShape = $ZodShape> extends $ZodTypeDef {
|
|
1561
|
+
type: "object";
|
|
1562
|
+
shape: Shape;
|
|
1563
|
+
catchall?: $ZodType | undefined;
|
|
1564
|
+
}
|
|
1565
|
+
interface $ZodObjectInternals< /** @ts-ignore Cast variance */out Shape extends $ZodShape = $ZodShape, out Config extends $ZodObjectConfig = $ZodObjectConfig> extends _$ZodTypeInternals {
|
|
1566
|
+
def: $ZodObjectDef<Shape>;
|
|
1567
|
+
config: Config;
|
|
1568
|
+
isst: $ZodIssueInvalidType | $ZodIssueUnrecognizedKeys;
|
|
1569
|
+
propValues: PropValues;
|
|
1570
|
+
output: $InferObjectOutput<Shape, Config["out"]>;
|
|
1571
|
+
input: $InferObjectInput<Shape, Config["in"]>;
|
|
1572
|
+
optin?: "optional" | undefined;
|
|
1573
|
+
optout?: "optional" | undefined;
|
|
1574
|
+
}
|
|
1575
|
+
type $ZodLooseShape = Record<string, any>;
|
|
1576
|
+
interface $ZodObject< /** @ts-ignore Cast variance */out Shape extends Readonly<$ZodShape> = Readonly<$ZodShape>, out Params$1 extends $ZodObjectConfig = $ZodObjectConfig> extends $ZodType<any, any, $ZodObjectInternals<Shape, Params$1>> {}
|
|
1577
|
+
declare const $ZodObject: $constructor<$ZodObject>;
|
|
1578
|
+
type $InferUnionOutput<T extends SomeType> = T extends any ? output<T> : never;
|
|
1579
|
+
type $InferUnionInput<T extends SomeType> = T extends any ? input<T> : never;
|
|
1580
|
+
interface $ZodUnionDef<Options extends readonly SomeType[] = readonly $ZodType[]> extends $ZodTypeDef {
|
|
1581
|
+
type: "union";
|
|
1582
|
+
options: Options;
|
|
1583
|
+
inclusive?: boolean;
|
|
1584
|
+
}
|
|
1585
|
+
type IsOptionalIn<T extends SomeType> = T extends OptionalInSchema ? true : false;
|
|
1586
|
+
type IsOptionalOut<T extends SomeType> = T extends OptionalOutSchema ? true : false;
|
|
1587
|
+
interface $ZodUnionInternals<T extends readonly SomeType[] = readonly $ZodType[]> extends _$ZodTypeInternals {
|
|
1588
|
+
def: $ZodUnionDef<T>;
|
|
1589
|
+
isst: $ZodIssueInvalidUnion;
|
|
1590
|
+
pattern: T[number]["_zod"]["pattern"];
|
|
1591
|
+
values: T[number]["_zod"]["values"];
|
|
1592
|
+
output: $InferUnionOutput<T[number]>;
|
|
1593
|
+
input: $InferUnionInput<T[number]>;
|
|
1594
|
+
optin: IsOptionalIn<T[number]> extends false ? "optional" | undefined : "optional";
|
|
1595
|
+
optout: IsOptionalOut<T[number]> extends false ? "optional" | undefined : "optional";
|
|
1596
|
+
}
|
|
1597
|
+
interface $ZodUnion<T extends readonly SomeType[] = readonly $ZodType[]> extends $ZodType<any, any, $ZodUnionInternals<T>> {
|
|
1598
|
+
_zod: $ZodUnionInternals<T>;
|
|
1599
|
+
}
|
|
1600
|
+
declare const $ZodUnion: $constructor<$ZodUnion>;
|
|
1601
|
+
interface $ZodIntersectionDef<Left extends SomeType = $ZodType, Right extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1602
|
+
type: "intersection";
|
|
1603
|
+
left: Left;
|
|
1604
|
+
right: Right;
|
|
1605
|
+
}
|
|
1606
|
+
interface $ZodIntersectionInternals<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _$ZodTypeInternals {
|
|
1607
|
+
def: $ZodIntersectionDef<A, B>;
|
|
1608
|
+
isst: never;
|
|
1609
|
+
optin: A["_zod"]["optin"] | B["_zod"]["optin"];
|
|
1610
|
+
optout: A["_zod"]["optout"] | B["_zod"]["optout"];
|
|
1611
|
+
output: output<A> & output<B>;
|
|
1612
|
+
input: input<A> & input<B>;
|
|
1613
|
+
}
|
|
1614
|
+
interface $ZodIntersection<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodType {
|
|
1615
|
+
_zod: $ZodIntersectionInternals<A, B>;
|
|
1616
|
+
}
|
|
1617
|
+
declare const $ZodIntersection: $constructor<$ZodIntersection>;
|
|
1618
|
+
interface $ZodTupleDef<T extends TupleItems = readonly $ZodType[], Rest extends SomeType | null = $ZodType | null> extends $ZodTypeDef {
|
|
1619
|
+
type: "tuple";
|
|
1620
|
+
items: T;
|
|
1621
|
+
rest: Rest;
|
|
1622
|
+
}
|
|
1623
|
+
type $InferTupleInputType<T extends TupleItems, Rest extends SomeType | null> = [...TupleInputTypeWithOptionals<T>, ...(Rest extends SomeType ? input<Rest>[] : [])];
|
|
1624
|
+
type TupleInputTypeNoOptionals<T extends TupleItems> = { [k in keyof T]: input<T[k]> };
|
|
1625
|
+
type TupleInputTypeWithOptionals<T extends TupleItems> = T extends readonly [...infer Prefix extends SomeType[], infer Tail extends SomeType] ? Tail["_zod"]["optin"] extends "optional" ? [...TupleInputTypeWithOptionals<Prefix>, input<Tail>?] : TupleInputTypeNoOptionals<T> : [];
|
|
1626
|
+
type $InferTupleOutputType<T extends TupleItems, Rest extends SomeType | null> = [...TupleOutputTypeWithOptionals<T>, ...(Rest extends SomeType ? output<Rest>[] : [])];
|
|
1627
|
+
type TupleOutputTypeNoOptionals<T extends TupleItems> = { [k in keyof T]: output<T[k]> };
|
|
1628
|
+
type TupleOutputTypeWithOptionals<T extends TupleItems> = T extends readonly [...infer Prefix extends SomeType[], infer Tail extends SomeType] ? Tail["_zod"]["optout"] extends "optional" ? [...TupleOutputTypeWithOptionals<Prefix>, output<Tail>?] : TupleOutputTypeNoOptionals<T> : [];
|
|
1629
|
+
interface $ZodTupleInternals<T extends TupleItems = readonly $ZodType[], Rest extends SomeType | null = $ZodType | null> extends _$ZodTypeInternals {
|
|
1630
|
+
def: $ZodTupleDef<T, Rest>;
|
|
1631
|
+
isst: $ZodIssueInvalidType | $ZodIssueTooBig<unknown[]> | $ZodIssueTooSmall<unknown[]>;
|
|
1632
|
+
output: $InferTupleOutputType<T, Rest>;
|
|
1633
|
+
input: $InferTupleInputType<T, Rest>;
|
|
1634
|
+
}
|
|
1635
|
+
interface $ZodTuple<T extends TupleItems = readonly $ZodType[], Rest extends SomeType | null = $ZodType | null> extends $ZodType {
|
|
1636
|
+
_zod: $ZodTupleInternals<T, Rest>;
|
|
1637
|
+
}
|
|
1638
|
+
declare const $ZodTuple: $constructor<$ZodTuple>;
|
|
1639
|
+
type $ZodRecordKey = $ZodType<string | number | symbol, unknown>;
|
|
1640
|
+
interface $ZodRecordDef<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1641
|
+
type: "record";
|
|
1642
|
+
keyType: Key;
|
|
1643
|
+
valueType: Value;
|
|
1644
|
+
/** @default "strict" - errors on keys not matching keyType. "loose" passes through non-matching keys unchanged. */
|
|
1645
|
+
mode?: "strict" | "loose";
|
|
1646
|
+
}
|
|
1647
|
+
type $InferZodRecordOutput<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> = Key extends $partial ? Partial<Record<output<Key>, output<Value>>> : Record<output<Key>, output<Value>>;
|
|
1648
|
+
type $InferZodRecordInput<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> = Key extends $partial ? Partial<Record<input<Key> & PropertyKey, input<Value>>> : Record<input<Key> & PropertyKey, input<Value>>;
|
|
1649
|
+
interface $ZodRecordInternals<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodTypeInternals<$InferZodRecordOutput<Key, Value>, $InferZodRecordInput<Key, Value>> {
|
|
1650
|
+
def: $ZodRecordDef<Key, Value>;
|
|
1651
|
+
isst: $ZodIssueInvalidType | $ZodIssueInvalidKey<Record<PropertyKey, unknown>>;
|
|
1652
|
+
optin?: "optional" | undefined;
|
|
1653
|
+
optout?: "optional" | undefined;
|
|
1654
|
+
}
|
|
1655
|
+
type $partial = {
|
|
1656
|
+
"~~partial": true;
|
|
1657
|
+
};
|
|
1658
|
+
interface $ZodRecord<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodType {
|
|
1659
|
+
_zod: $ZodRecordInternals<Key, Value>;
|
|
1660
|
+
}
|
|
1661
|
+
declare const $ZodRecord: $constructor<$ZodRecord>;
|
|
1662
|
+
interface $ZodMapDef<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1663
|
+
type: "map";
|
|
1664
|
+
keyType: Key;
|
|
1665
|
+
valueType: Value;
|
|
1666
|
+
}
|
|
1667
|
+
interface $ZodMapInternals<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends $ZodTypeInternals<Map<output<Key>, output<Value>>, Map<input<Key>, input<Value>>> {
|
|
1668
|
+
def: $ZodMapDef<Key, Value>;
|
|
1669
|
+
isst: $ZodIssueInvalidType | $ZodIssueInvalidKey | $ZodIssueInvalidElement<unknown>;
|
|
1670
|
+
optin?: "optional" | undefined;
|
|
1671
|
+
optout?: "optional" | undefined;
|
|
1672
|
+
}
|
|
1673
|
+
interface $ZodMap<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends $ZodType {
|
|
1674
|
+
_zod: $ZodMapInternals<Key, Value>;
|
|
1675
|
+
}
|
|
1676
|
+
declare const $ZodMap: $constructor<$ZodMap>;
|
|
1677
|
+
interface $ZodSetDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1678
|
+
type: "set";
|
|
1679
|
+
valueType: T;
|
|
1680
|
+
}
|
|
1681
|
+
interface $ZodSetInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<Set<output<T>>, Set<input<T>>> {
|
|
1682
|
+
def: $ZodSetDef<T>;
|
|
1683
|
+
isst: $ZodIssueInvalidType;
|
|
1684
|
+
optin?: "optional" | undefined;
|
|
1685
|
+
optout?: "optional" | undefined;
|
|
1686
|
+
}
|
|
1687
|
+
interface $ZodSet<T extends SomeType = $ZodType> extends $ZodType {
|
|
1688
|
+
_zod: $ZodSetInternals<T>;
|
|
1689
|
+
}
|
|
1690
|
+
declare const $ZodSet: $constructor<$ZodSet>;
|
|
1691
|
+
type $InferEnumOutput<T extends EnumLike> = T[keyof T] & {};
|
|
1692
|
+
type $InferEnumInput<T extends EnumLike> = T[keyof T] & {};
|
|
1693
|
+
interface $ZodEnumDef<T extends EnumLike = EnumLike> extends $ZodTypeDef {
|
|
1694
|
+
type: "enum";
|
|
1695
|
+
entries: T;
|
|
1696
|
+
}
|
|
1697
|
+
interface $ZodEnumInternals< /** @ts-ignore Cast variance */out T extends EnumLike = EnumLike> extends $ZodTypeInternals<$InferEnumOutput<T>, $InferEnumInput<T>> {
|
|
1698
|
+
def: $ZodEnumDef<T>;
|
|
1699
|
+
/** @deprecated Internal API, use with caution (not deprecated) */
|
|
1700
|
+
values: PrimitiveSet;
|
|
1701
|
+
/** @deprecated Internal API, use with caution (not deprecated) */
|
|
1702
|
+
pattern: RegExp;
|
|
1703
|
+
isst: $ZodIssueInvalidValue;
|
|
1704
|
+
}
|
|
1705
|
+
interface $ZodEnum<T extends EnumLike = EnumLike> extends $ZodType {
|
|
1706
|
+
_zod: $ZodEnumInternals<T>;
|
|
1707
|
+
}
|
|
1708
|
+
declare const $ZodEnum: $constructor<$ZodEnum>;
|
|
1709
|
+
interface $ZodLiteralDef<T extends Literal> extends $ZodTypeDef {
|
|
1710
|
+
type: "literal";
|
|
1711
|
+
values: T[];
|
|
1712
|
+
}
|
|
1713
|
+
interface $ZodLiteralInternals<T extends Literal = Literal> extends $ZodTypeInternals<T, T> {
|
|
1714
|
+
def: $ZodLiteralDef<T>;
|
|
1715
|
+
values: Set<T>;
|
|
1716
|
+
pattern: RegExp;
|
|
1717
|
+
isst: $ZodIssueInvalidValue;
|
|
1718
|
+
}
|
|
1719
|
+
interface $ZodLiteral<T extends Literal = Literal> extends $ZodType {
|
|
1720
|
+
_zod: $ZodLiteralInternals<T>;
|
|
1721
|
+
}
|
|
1722
|
+
declare const $ZodLiteral: $constructor<$ZodLiteral>;
|
|
1723
|
+
type _File = typeof globalThis extends {
|
|
1724
|
+
File: infer F extends new (...args: any[]) => any;
|
|
1725
|
+
} ? InstanceType<F> : {};
|
|
1726
|
+
/** Do not reference this directly. */
|
|
1727
|
+
interface File extends _File {
|
|
1728
|
+
readonly type: string;
|
|
1729
|
+
readonly size: number;
|
|
1730
|
+
}
|
|
1731
|
+
interface $ZodFileDef extends $ZodTypeDef {
|
|
1732
|
+
type: "file";
|
|
1733
|
+
}
|
|
1734
|
+
interface $ZodFileInternals extends $ZodTypeInternals<File, File> {
|
|
1735
|
+
def: $ZodFileDef;
|
|
1736
|
+
isst: $ZodIssueInvalidType;
|
|
1737
|
+
bag: LoosePartial<{
|
|
1738
|
+
minimum: number;
|
|
1739
|
+
maximum: number;
|
|
1740
|
+
mime: MimeTypes[];
|
|
1741
|
+
}>;
|
|
1742
|
+
}
|
|
1743
|
+
interface $ZodFile extends $ZodType {
|
|
1744
|
+
_zod: $ZodFileInternals;
|
|
1745
|
+
}
|
|
1746
|
+
declare const $ZodFile: $constructor<$ZodFile>;
|
|
1747
|
+
interface $ZodTransformDef extends $ZodTypeDef {
|
|
1748
|
+
type: "transform";
|
|
1749
|
+
transform: (input: unknown, payload: ParsePayload<unknown>) => MaybeAsync<unknown>;
|
|
1750
|
+
}
|
|
1751
|
+
interface $ZodTransformInternals<O = unknown, I = unknown> extends $ZodTypeInternals<O, I> {
|
|
1752
|
+
def: $ZodTransformDef;
|
|
1753
|
+
isst: never;
|
|
1754
|
+
}
|
|
1755
|
+
interface $ZodTransform<O = unknown, I = unknown> extends $ZodType {
|
|
1756
|
+
_zod: $ZodTransformInternals<O, I>;
|
|
1757
|
+
}
|
|
1758
|
+
declare const $ZodTransform: $constructor<$ZodTransform>;
|
|
1759
|
+
interface $ZodOptionalDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1760
|
+
type: "optional";
|
|
1761
|
+
innerType: T;
|
|
1762
|
+
}
|
|
1763
|
+
interface $ZodOptionalInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T> | undefined, input<T> | undefined> {
|
|
1764
|
+
def: $ZodOptionalDef<T>;
|
|
1765
|
+
optin: "optional";
|
|
1766
|
+
optout: "optional";
|
|
1767
|
+
isst: never;
|
|
1768
|
+
values: T["_zod"]["values"];
|
|
1769
|
+
pattern: T["_zod"]["pattern"];
|
|
1770
|
+
}
|
|
1771
|
+
interface $ZodOptional<T extends SomeType = $ZodType> extends $ZodType {
|
|
1772
|
+
_zod: $ZodOptionalInternals<T>;
|
|
1773
|
+
}
|
|
1774
|
+
declare const $ZodOptional: $constructor<$ZodOptional>;
|
|
1775
|
+
interface $ZodExactOptionalDef<T extends SomeType = $ZodType> extends $ZodOptionalDef<T> {}
|
|
1776
|
+
interface $ZodExactOptionalInternals<T extends SomeType = $ZodType> extends $ZodOptionalInternals<T> {
|
|
1777
|
+
def: $ZodExactOptionalDef<T>;
|
|
1778
|
+
output: output<T>;
|
|
1779
|
+
input: input<T>;
|
|
1780
|
+
}
|
|
1781
|
+
interface $ZodExactOptional<T extends SomeType = $ZodType> extends $ZodType {
|
|
1782
|
+
_zod: $ZodExactOptionalInternals<T>;
|
|
1783
|
+
}
|
|
1784
|
+
declare const $ZodExactOptional: $constructor<$ZodExactOptional>;
|
|
1785
|
+
interface $ZodNullableDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1786
|
+
type: "nullable";
|
|
1787
|
+
innerType: T;
|
|
1788
|
+
}
|
|
1789
|
+
interface $ZodNullableInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T> | null, input<T> | null> {
|
|
1790
|
+
def: $ZodNullableDef<T>;
|
|
1791
|
+
optin: T["_zod"]["optin"];
|
|
1792
|
+
optout: T["_zod"]["optout"];
|
|
1793
|
+
isst: never;
|
|
1794
|
+
values: T["_zod"]["values"];
|
|
1795
|
+
pattern: T["_zod"]["pattern"];
|
|
1796
|
+
}
|
|
1797
|
+
interface $ZodNullable<T extends SomeType = $ZodType> extends $ZodType {
|
|
1798
|
+
_zod: $ZodNullableInternals<T>;
|
|
1799
|
+
}
|
|
1800
|
+
declare const $ZodNullable: $constructor<$ZodNullable>;
|
|
1801
|
+
interface $ZodDefaultDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1802
|
+
type: "default";
|
|
1803
|
+
innerType: T;
|
|
1804
|
+
/** The default value. May be a getter. */
|
|
1805
|
+
defaultValue: NoUndefined<output<T>>;
|
|
1806
|
+
}
|
|
1807
|
+
interface $ZodDefaultInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, input<T> | undefined> {
|
|
1808
|
+
def: $ZodDefaultDef<T>;
|
|
1809
|
+
optin: "optional";
|
|
1810
|
+
optout?: "optional" | undefined;
|
|
1811
|
+
isst: never;
|
|
1812
|
+
values: T["_zod"]["values"];
|
|
1813
|
+
}
|
|
1814
|
+
interface $ZodDefault<T extends SomeType = $ZodType> extends $ZodType {
|
|
1815
|
+
_zod: $ZodDefaultInternals<T>;
|
|
1816
|
+
}
|
|
1817
|
+
declare const $ZodDefault: $constructor<$ZodDefault>;
|
|
1818
|
+
interface $ZodPrefaultDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1819
|
+
type: "prefault";
|
|
1820
|
+
innerType: T;
|
|
1821
|
+
/** The default value. May be a getter. */
|
|
1822
|
+
defaultValue: input<T>;
|
|
1823
|
+
}
|
|
1824
|
+
interface $ZodPrefaultInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, input<T> | undefined> {
|
|
1825
|
+
def: $ZodPrefaultDef<T>;
|
|
1826
|
+
optin: "optional";
|
|
1827
|
+
optout?: "optional" | undefined;
|
|
1828
|
+
isst: never;
|
|
1829
|
+
values: T["_zod"]["values"];
|
|
1830
|
+
}
|
|
1831
|
+
interface $ZodPrefault<T extends SomeType = $ZodType> extends $ZodType {
|
|
1832
|
+
_zod: $ZodPrefaultInternals<T>;
|
|
1833
|
+
}
|
|
1834
|
+
declare const $ZodPrefault: $constructor<$ZodPrefault>;
|
|
1835
|
+
interface $ZodNonOptionalDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1836
|
+
type: "nonoptional";
|
|
1837
|
+
innerType: T;
|
|
1838
|
+
}
|
|
1839
|
+
interface $ZodNonOptionalInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, NoUndefined<input<T>>> {
|
|
1840
|
+
def: $ZodNonOptionalDef<T>;
|
|
1841
|
+
isst: $ZodIssueInvalidType;
|
|
1842
|
+
values: T["_zod"]["values"];
|
|
1843
|
+
optin: "optional" | undefined;
|
|
1844
|
+
optout: "optional" | undefined;
|
|
1845
|
+
}
|
|
1846
|
+
interface $ZodNonOptional<T extends SomeType = $ZodType> extends $ZodType {
|
|
1847
|
+
_zod: $ZodNonOptionalInternals<T>;
|
|
1848
|
+
}
|
|
1849
|
+
declare const $ZodNonOptional: $constructor<$ZodNonOptional>;
|
|
1850
|
+
interface $ZodSuccessDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1851
|
+
type: "success";
|
|
1852
|
+
innerType: T;
|
|
1853
|
+
}
|
|
1854
|
+
interface $ZodSuccessInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<boolean, input<T>> {
|
|
1855
|
+
def: $ZodSuccessDef<T>;
|
|
1856
|
+
isst: never;
|
|
1857
|
+
optin: T["_zod"]["optin"];
|
|
1858
|
+
optout: "optional" | undefined;
|
|
1859
|
+
}
|
|
1860
|
+
interface $ZodSuccess<T extends SomeType = $ZodType> extends $ZodType {
|
|
1861
|
+
_zod: $ZodSuccessInternals<T>;
|
|
1862
|
+
}
|
|
1863
|
+
declare const $ZodSuccess: $constructor<$ZodSuccess>;
|
|
1864
|
+
interface $ZodCatchCtx extends ParsePayload {
|
|
1865
|
+
/** @deprecated Use `ctx.issues` */
|
|
1866
|
+
error: {
|
|
1867
|
+
issues: $ZodIssue[];
|
|
1868
|
+
};
|
|
1869
|
+
/** @deprecated Use `ctx.value` */
|
|
1870
|
+
input: unknown;
|
|
1871
|
+
}
|
|
1872
|
+
interface $ZodCatchDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1873
|
+
type: "catch";
|
|
1874
|
+
innerType: T;
|
|
1875
|
+
catchValue: (ctx: $ZodCatchCtx) => unknown;
|
|
1876
|
+
}
|
|
1877
|
+
interface $ZodCatchInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T>, input<T>> {
|
|
1878
|
+
def: $ZodCatchDef<T>;
|
|
1879
|
+
optin: T["_zod"]["optin"];
|
|
1880
|
+
optout: T["_zod"]["optout"];
|
|
1881
|
+
isst: never;
|
|
1882
|
+
values: T["_zod"]["values"];
|
|
1883
|
+
}
|
|
1884
|
+
interface $ZodCatch<T extends SomeType = $ZodType> extends $ZodType {
|
|
1885
|
+
_zod: $ZodCatchInternals<T>;
|
|
1886
|
+
}
|
|
1887
|
+
declare const $ZodCatch: $constructor<$ZodCatch>;
|
|
1888
|
+
interface $ZodNaNDef extends $ZodTypeDef {
|
|
1889
|
+
type: "nan";
|
|
1890
|
+
}
|
|
1891
|
+
interface $ZodNaNInternals extends $ZodTypeInternals<number, number> {
|
|
1892
|
+
def: $ZodNaNDef;
|
|
1893
|
+
isst: $ZodIssueInvalidType;
|
|
1894
|
+
}
|
|
1895
|
+
interface $ZodNaN extends $ZodType {
|
|
1896
|
+
_zod: $ZodNaNInternals;
|
|
1897
|
+
}
|
|
1898
|
+
declare const $ZodNaN: $constructor<$ZodNaN>;
|
|
1899
|
+
interface $ZodPipeDef<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1900
|
+
type: "pipe";
|
|
1901
|
+
in: A;
|
|
1902
|
+
out: B;
|
|
1903
|
+
/** Only defined inside $ZodCodec instances. */
|
|
1904
|
+
transform?: (value: output<A>, payload: ParsePayload<output<A>>) => MaybeAsync<input<B>>;
|
|
1905
|
+
/** Only defined inside $ZodCodec instances. */
|
|
1906
|
+
reverseTransform?: (value: input<B>, payload: ParsePayload<input<B>>) => MaybeAsync<output<A>>;
|
|
1907
|
+
}
|
|
1908
|
+
interface $ZodPipeInternals<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodTypeInternals<output<B>, input<A>> {
|
|
1909
|
+
def: $ZodPipeDef<A, B>;
|
|
1910
|
+
isst: never;
|
|
1911
|
+
values: A["_zod"]["values"];
|
|
1912
|
+
optin: A["_zod"]["optin"];
|
|
1913
|
+
optout: B["_zod"]["optout"];
|
|
1914
|
+
propValues: A["_zod"]["propValues"];
|
|
1915
|
+
}
|
|
1916
|
+
interface $ZodPipe<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodType {
|
|
1917
|
+
_zod: $ZodPipeInternals<A, B>;
|
|
1918
|
+
}
|
|
1919
|
+
declare const $ZodPipe: $constructor<$ZodPipe>;
|
|
1920
|
+
interface $ZodReadonlyDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1921
|
+
type: "readonly";
|
|
1922
|
+
innerType: T;
|
|
1923
|
+
}
|
|
1924
|
+
interface $ZodReadonlyInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<MakeReadonly<output<T>>, MakeReadonly<input<T>>> {
|
|
1925
|
+
def: $ZodReadonlyDef<T>;
|
|
1926
|
+
optin: T["_zod"]["optin"];
|
|
1927
|
+
optout: T["_zod"]["optout"];
|
|
1928
|
+
isst: never;
|
|
1929
|
+
propValues: T["_zod"]["propValues"];
|
|
1930
|
+
values: T["_zod"]["values"];
|
|
1931
|
+
}
|
|
1932
|
+
interface $ZodReadonly<T extends SomeType = $ZodType> extends $ZodType {
|
|
1933
|
+
_zod: $ZodReadonlyInternals<T>;
|
|
1934
|
+
}
|
|
1935
|
+
declare const $ZodReadonly: $constructor<$ZodReadonly>;
|
|
1936
|
+
interface $ZodTemplateLiteralDef extends $ZodTypeDef {
|
|
1937
|
+
type: "template_literal";
|
|
1938
|
+
parts: $ZodTemplateLiteralPart[];
|
|
1939
|
+
format?: string | undefined;
|
|
1940
|
+
}
|
|
1941
|
+
interface $ZodTemplateLiteralInternals<Template extends string = string> extends $ZodTypeInternals<Template, Template> {
|
|
1942
|
+
pattern: RegExp;
|
|
1943
|
+
def: $ZodTemplateLiteralDef;
|
|
1944
|
+
isst: $ZodIssueInvalidType;
|
|
1945
|
+
}
|
|
1946
|
+
interface $ZodTemplateLiteral<Template extends string = string> extends $ZodType {
|
|
1947
|
+
_zod: $ZodTemplateLiteralInternals<Template>;
|
|
1948
|
+
}
|
|
1949
|
+
type LiteralPart = Exclude<Literal, symbol>;
|
|
1950
|
+
interface SchemaPartInternals extends $ZodTypeInternals<LiteralPart, LiteralPart> {
|
|
1951
|
+
pattern: RegExp;
|
|
1952
|
+
}
|
|
1953
|
+
interface SchemaPart extends $ZodType {
|
|
1954
|
+
_zod: SchemaPartInternals;
|
|
1955
|
+
}
|
|
1956
|
+
type $ZodTemplateLiteralPart = LiteralPart | SchemaPart;
|
|
1957
|
+
declare const $ZodTemplateLiteral: $constructor<$ZodTemplateLiteral>;
|
|
1958
|
+
type $ZodFunctionArgs = $ZodType<unknown[], unknown[]>;
|
|
1959
|
+
type $ZodFunctionIn = $ZodFunctionArgs;
|
|
1960
|
+
type $ZodFunctionOut = $ZodType;
|
|
1961
|
+
type $InferInnerFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : output<Args>) => input<Returns>;
|
|
1962
|
+
type $InferInnerFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : output<Args>) => MaybeAsync<input<Returns>>;
|
|
1963
|
+
type $InferOuterFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : input<Args>) => output<Returns>;
|
|
1964
|
+
type $InferOuterFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : input<Args>) => Promise<output<Returns>>;
|
|
1965
|
+
interface $ZodFunctionDef<In extends $ZodFunctionIn = $ZodFunctionIn, Out extends $ZodFunctionOut = $ZodFunctionOut> extends $ZodTypeDef {
|
|
1966
|
+
type: "function";
|
|
1967
|
+
input: In;
|
|
1968
|
+
output: Out;
|
|
1969
|
+
}
|
|
1970
|
+
interface $ZodFunctionInternals<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> extends $ZodTypeInternals<$InferOuterFunctionType<Args, Returns>, $InferInnerFunctionType<Args, Returns>> {
|
|
1971
|
+
def: $ZodFunctionDef<Args, Returns>;
|
|
1972
|
+
isst: $ZodIssueInvalidType;
|
|
1973
|
+
}
|
|
1974
|
+
interface $ZodFunction<Args extends $ZodFunctionIn = $ZodFunctionIn, Returns extends $ZodFunctionOut = $ZodFunctionOut> extends $ZodType<any, any, $ZodFunctionInternals<Args, Returns>> {
|
|
1975
|
+
/** @deprecated */
|
|
1976
|
+
_def: $ZodFunctionDef<Args, Returns>;
|
|
1977
|
+
_input: $InferInnerFunctionType<Args, Returns>;
|
|
1978
|
+
_output: $InferOuterFunctionType<Args, Returns>;
|
|
1979
|
+
implement<F extends $InferInnerFunctionType<Args, Returns>>(func: F): (...args: Parameters<this["_output"]>) => ReturnType<F> extends ReturnType<this["_output"]> ? ReturnType<F> : ReturnType<this["_output"]>;
|
|
1980
|
+
implementAsync<F extends $InferInnerFunctionTypeAsync<Args, Returns>>(func: F): F extends $InferOuterFunctionTypeAsync<Args, Returns> ? F : $InferOuterFunctionTypeAsync<Args, Returns>;
|
|
1981
|
+
input<const Items extends TupleItems, const Rest extends $ZodFunctionOut = $ZodFunctionOut>(args: Items, rest?: Rest): $ZodFunction<$ZodTuple<Items, Rest>, Returns>;
|
|
1982
|
+
input<NewArgs extends $ZodFunctionIn>(args: NewArgs): $ZodFunction<NewArgs, Returns>;
|
|
1983
|
+
input(...args: any[]): $ZodFunction<any, Returns>;
|
|
1984
|
+
output<NewReturns extends $ZodType>(output: NewReturns): $ZodFunction<Args, NewReturns>;
|
|
1985
|
+
}
|
|
1986
|
+
declare const $ZodFunction: $constructor<$ZodFunction>;
|
|
1987
|
+
interface $ZodPromiseDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1988
|
+
type: "promise";
|
|
1989
|
+
innerType: T;
|
|
1990
|
+
}
|
|
1991
|
+
interface $ZodPromiseInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<Promise<output<T>>, MaybeAsync<input<T>>> {
|
|
1992
|
+
def: $ZodPromiseDef<T>;
|
|
1993
|
+
isst: never;
|
|
1994
|
+
}
|
|
1995
|
+
interface $ZodPromise<T extends SomeType = $ZodType> extends $ZodType {
|
|
1996
|
+
_zod: $ZodPromiseInternals<T>;
|
|
1997
|
+
}
|
|
1998
|
+
declare const $ZodPromise: $constructor<$ZodPromise>;
|
|
1999
|
+
interface $ZodLazyDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
2000
|
+
type: "lazy";
|
|
2001
|
+
getter: () => T;
|
|
2002
|
+
}
|
|
2003
|
+
interface $ZodLazyInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T>, input<T>> {
|
|
2004
|
+
def: $ZodLazyDef<T>;
|
|
2005
|
+
isst: never;
|
|
2006
|
+
/** Auto-cached way to retrieve the inner schema */
|
|
2007
|
+
innerType: T;
|
|
2008
|
+
pattern: T["_zod"]["pattern"];
|
|
2009
|
+
propValues: T["_zod"]["propValues"];
|
|
2010
|
+
optin: T["_zod"]["optin"];
|
|
2011
|
+
optout: T["_zod"]["optout"];
|
|
2012
|
+
}
|
|
2013
|
+
interface $ZodLazy<T extends SomeType = $ZodType> extends $ZodType {
|
|
2014
|
+
_zod: $ZodLazyInternals<T>;
|
|
2015
|
+
}
|
|
2016
|
+
declare const $ZodLazy: $constructor<$ZodLazy>;
|
|
2017
|
+
interface $ZodCustomDef<O = unknown> extends $ZodTypeDef, $ZodCheckDef {
|
|
2018
|
+
type: "custom";
|
|
2019
|
+
check: "custom";
|
|
2020
|
+
path?: PropertyKey[] | undefined;
|
|
2021
|
+
error?: $ZodErrorMap | undefined;
|
|
2022
|
+
params?: Record<string, any> | undefined;
|
|
2023
|
+
fn: (arg: O) => unknown;
|
|
2024
|
+
}
|
|
2025
|
+
interface $ZodCustomInternals<O = unknown, I = unknown> extends $ZodTypeInternals<O, I>, $ZodCheckInternals<O> {
|
|
2026
|
+
def: $ZodCustomDef;
|
|
2027
|
+
issc: $ZodIssue;
|
|
2028
|
+
isst: never;
|
|
2029
|
+
bag: LoosePartial<{
|
|
2030
|
+
Class: typeof Class;
|
|
2031
|
+
}>;
|
|
2032
|
+
}
|
|
2033
|
+
interface $ZodCustom<O = unknown, I = unknown> extends $ZodType {
|
|
2034
|
+
_zod: $ZodCustomInternals<O, I>;
|
|
2035
|
+
}
|
|
2036
|
+
declare const $ZodCustom: $constructor<$ZodCustom>;
|
|
2037
|
+
type $ZodTypes = $ZodString | $ZodNumber | $ZodBigInt | $ZodBoolean | $ZodDate | $ZodSymbol | $ZodUndefined | $ZodNullable | $ZodNull | $ZodAny | $ZodUnknown | $ZodNever | $ZodVoid | $ZodArray | $ZodObject | $ZodUnion | $ZodIntersection | $ZodTuple | $ZodRecord | $ZodMap | $ZodSet | $ZodLiteral | $ZodEnum | $ZodFunction | $ZodPromise | $ZodLazy | $ZodOptional | $ZodDefault | $ZodPrefault | $ZodTemplateLiteral | $ZodCustom | $ZodTransform | $ZodNonOptional | $ZodReadonly | $ZodNaN | $ZodPipe | $ZodSuccess | $ZodCatch | $ZodFile;
|
|
2038
|
+
//#endregion
|
|
2039
|
+
//#region ../../node_modules/zod/v4/core/checks.d.cts
|
|
2040
|
+
interface $ZodCheckDef {
|
|
2041
|
+
check: string;
|
|
2042
|
+
error?: $ZodErrorMap<never> | undefined;
|
|
2043
|
+
/** If true, no later checks will be executed if this check fails. Default `false`. */
|
|
2044
|
+
abort?: boolean | undefined;
|
|
2045
|
+
/** If provided, this check will only be executed if the function returns `true`. Defaults to `payload => z.util.isAborted(payload)`. */
|
|
2046
|
+
when?: ((payload: ParsePayload) => boolean) | undefined;
|
|
2047
|
+
}
|
|
2048
|
+
interface $ZodCheckInternals<T> {
|
|
2049
|
+
def: $ZodCheckDef;
|
|
2050
|
+
/** The set of issues this check might throw. */
|
|
2051
|
+
issc?: $ZodIssueBase;
|
|
2052
|
+
check(payload: ParsePayload<T>): MaybeAsync<void>;
|
|
2053
|
+
onattach: ((schema: $ZodType) => void)[];
|
|
2054
|
+
}
|
|
2055
|
+
interface $ZodCheck<in T = never> {
|
|
2056
|
+
_zod: $ZodCheckInternals<T>;
|
|
2057
|
+
}
|
|
2058
|
+
declare const $ZodCheck: $constructor<$ZodCheck<any>>;
|
|
2059
|
+
interface $ZodCheckLessThanDef extends $ZodCheckDef {
|
|
2060
|
+
check: "less_than";
|
|
2061
|
+
value: Numeric;
|
|
2062
|
+
inclusive: boolean;
|
|
2063
|
+
}
|
|
2064
|
+
interface $ZodCheckLessThanInternals<T extends Numeric = Numeric> extends $ZodCheckInternals<T> {
|
|
2065
|
+
def: $ZodCheckLessThanDef;
|
|
2066
|
+
issc: $ZodIssueTooBig<T>;
|
|
2067
|
+
}
|
|
2068
|
+
interface $ZodCheckLessThan<T extends Numeric = Numeric> extends $ZodCheck<T> {
|
|
2069
|
+
_zod: $ZodCheckLessThanInternals<T>;
|
|
2070
|
+
}
|
|
2071
|
+
declare const $ZodCheckLessThan: $constructor<$ZodCheckLessThan>;
|
|
2072
|
+
interface $ZodCheckGreaterThanDef extends $ZodCheckDef {
|
|
2073
|
+
check: "greater_than";
|
|
2074
|
+
value: Numeric;
|
|
2075
|
+
inclusive: boolean;
|
|
2076
|
+
}
|
|
2077
|
+
interface $ZodCheckGreaterThanInternals<T extends Numeric = Numeric> extends $ZodCheckInternals<T> {
|
|
2078
|
+
def: $ZodCheckGreaterThanDef;
|
|
2079
|
+
issc: $ZodIssueTooSmall<T>;
|
|
2080
|
+
}
|
|
2081
|
+
interface $ZodCheckGreaterThan<T extends Numeric = Numeric> extends $ZodCheck<T> {
|
|
2082
|
+
_zod: $ZodCheckGreaterThanInternals<T>;
|
|
2083
|
+
}
|
|
2084
|
+
declare const $ZodCheckGreaterThan: $constructor<$ZodCheckGreaterThan>;
|
|
2085
|
+
interface $ZodCheckMultipleOfDef<T extends number | bigint = number | bigint> extends $ZodCheckDef {
|
|
2086
|
+
check: "multiple_of";
|
|
2087
|
+
value: T;
|
|
2088
|
+
}
|
|
2089
|
+
interface $ZodCheckMultipleOfInternals<T extends number | bigint = number | bigint> extends $ZodCheckInternals<T> {
|
|
2090
|
+
def: $ZodCheckMultipleOfDef<T>;
|
|
2091
|
+
issc: $ZodIssueNotMultipleOf;
|
|
2092
|
+
}
|
|
2093
|
+
interface $ZodCheckMultipleOf<T extends number | bigint = number | bigint> extends $ZodCheck<T> {
|
|
2094
|
+
_zod: $ZodCheckMultipleOfInternals<T>;
|
|
2095
|
+
}
|
|
2096
|
+
declare const $ZodCheckMultipleOf: $constructor<$ZodCheckMultipleOf<number | bigint>>;
|
|
2097
|
+
type $ZodNumberFormats = "int32" | "uint32" | "float32" | "float64" | "safeint";
|
|
2098
|
+
interface $ZodCheckNumberFormatDef extends $ZodCheckDef {
|
|
2099
|
+
check: "number_format";
|
|
2100
|
+
format: $ZodNumberFormats;
|
|
2101
|
+
}
|
|
2102
|
+
interface $ZodCheckNumberFormatInternals extends $ZodCheckInternals<number> {
|
|
2103
|
+
def: $ZodCheckNumberFormatDef;
|
|
2104
|
+
issc: $ZodIssueInvalidType | $ZodIssueTooBig<"number"> | $ZodIssueTooSmall<"number">;
|
|
2105
|
+
}
|
|
2106
|
+
interface $ZodCheckNumberFormat extends $ZodCheck<number> {
|
|
2107
|
+
_zod: $ZodCheckNumberFormatInternals;
|
|
2108
|
+
}
|
|
2109
|
+
declare const $ZodCheckNumberFormat: $constructor<$ZodCheckNumberFormat>;
|
|
2110
|
+
interface $ZodCheckMaxLengthDef extends $ZodCheckDef {
|
|
2111
|
+
check: "max_length";
|
|
2112
|
+
maximum: number;
|
|
2113
|
+
}
|
|
2114
|
+
interface $ZodCheckMaxLengthInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
|
|
2115
|
+
def: $ZodCheckMaxLengthDef;
|
|
2116
|
+
issc: $ZodIssueTooBig<T>;
|
|
2117
|
+
}
|
|
2118
|
+
interface $ZodCheckMaxLength<T extends HasLength = HasLength> extends $ZodCheck<T> {
|
|
2119
|
+
_zod: $ZodCheckMaxLengthInternals<T>;
|
|
2120
|
+
}
|
|
2121
|
+
declare const $ZodCheckMaxLength: $constructor<$ZodCheckMaxLength>;
|
|
2122
|
+
interface $ZodCheckMinLengthDef extends $ZodCheckDef {
|
|
2123
|
+
check: "min_length";
|
|
2124
|
+
minimum: number;
|
|
2125
|
+
}
|
|
2126
|
+
interface $ZodCheckMinLengthInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
|
|
2127
|
+
def: $ZodCheckMinLengthDef;
|
|
2128
|
+
issc: $ZodIssueTooSmall<T>;
|
|
2129
|
+
}
|
|
2130
|
+
interface $ZodCheckMinLength<T extends HasLength = HasLength> extends $ZodCheck<T> {
|
|
2131
|
+
_zod: $ZodCheckMinLengthInternals<T>;
|
|
2132
|
+
}
|
|
2133
|
+
declare const $ZodCheckMinLength: $constructor<$ZodCheckMinLength>;
|
|
2134
|
+
interface $ZodCheckLengthEqualsDef extends $ZodCheckDef {
|
|
2135
|
+
check: "length_equals";
|
|
2136
|
+
length: number;
|
|
2137
|
+
}
|
|
2138
|
+
interface $ZodCheckLengthEqualsInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
|
|
2139
|
+
def: $ZodCheckLengthEqualsDef;
|
|
2140
|
+
issc: $ZodIssueTooBig<T> | $ZodIssueTooSmall<T>;
|
|
2141
|
+
}
|
|
2142
|
+
interface $ZodCheckLengthEquals<T extends HasLength = HasLength> extends $ZodCheck<T> {
|
|
2143
|
+
_zod: $ZodCheckLengthEqualsInternals<T>;
|
|
2144
|
+
}
|
|
2145
|
+
declare const $ZodCheckLengthEquals: $constructor<$ZodCheckLengthEquals>;
|
|
2146
|
+
type $ZodStringFormats = "email" | "url" | "emoji" | "uuid" | "guid" | "nanoid" | "cuid" | "cuid2" | "ulid" | "xid" | "ksuid" | "datetime" | "date" | "time" | "duration" | "ipv4" | "ipv6" | "cidrv4" | "cidrv6" | "base64" | "base64url" | "json_string" | "e164" | "lowercase" | "uppercase" | "regex" | "jwt" | "starts_with" | "ends_with" | "includes";
|
|
2147
|
+
interface $ZodCheckStringFormatDef<Format extends string = string> extends $ZodCheckDef {
|
|
2148
|
+
check: "string_format";
|
|
2149
|
+
format: Format;
|
|
2150
|
+
pattern?: RegExp | undefined;
|
|
2151
|
+
}
|
|
2152
|
+
interface $ZodCheckStringFormatInternals extends $ZodCheckInternals<string> {
|
|
2153
|
+
def: $ZodCheckStringFormatDef;
|
|
2154
|
+
issc: $ZodIssueInvalidStringFormat;
|
|
2155
|
+
}
|
|
2156
|
+
interface $ZodCheckRegexDef extends $ZodCheckStringFormatDef {
|
|
2157
|
+
format: "regex";
|
|
2158
|
+
pattern: RegExp;
|
|
2159
|
+
}
|
|
2160
|
+
interface $ZodCheckRegexInternals extends $ZodCheckInternals<string> {
|
|
2161
|
+
def: $ZodCheckRegexDef;
|
|
2162
|
+
issc: $ZodIssueInvalidStringFormat;
|
|
2163
|
+
}
|
|
2164
|
+
interface $ZodCheckRegex extends $ZodCheck<string> {
|
|
2165
|
+
_zod: $ZodCheckRegexInternals;
|
|
2166
|
+
}
|
|
2167
|
+
declare const $ZodCheckRegex: $constructor<$ZodCheckRegex>;
|
|
2168
|
+
interface $ZodCheckLowerCaseDef extends $ZodCheckStringFormatDef<"lowercase"> {}
|
|
2169
|
+
interface $ZodCheckLowerCaseInternals extends $ZodCheckInternals<string> {
|
|
2170
|
+
def: $ZodCheckLowerCaseDef;
|
|
2171
|
+
issc: $ZodIssueInvalidStringFormat;
|
|
2172
|
+
}
|
|
2173
|
+
interface $ZodCheckLowerCase extends $ZodCheck<string> {
|
|
2174
|
+
_zod: $ZodCheckLowerCaseInternals;
|
|
2175
|
+
}
|
|
2176
|
+
declare const $ZodCheckLowerCase: $constructor<$ZodCheckLowerCase>;
|
|
2177
|
+
interface $ZodCheckUpperCaseDef extends $ZodCheckStringFormatDef<"uppercase"> {}
|
|
2178
|
+
interface $ZodCheckUpperCaseInternals extends $ZodCheckInternals<string> {
|
|
2179
|
+
def: $ZodCheckUpperCaseDef;
|
|
2180
|
+
issc: $ZodIssueInvalidStringFormat;
|
|
2181
|
+
}
|
|
2182
|
+
interface $ZodCheckUpperCase extends $ZodCheck<string> {
|
|
2183
|
+
_zod: $ZodCheckUpperCaseInternals;
|
|
2184
|
+
}
|
|
2185
|
+
declare const $ZodCheckUpperCase: $constructor<$ZodCheckUpperCase>;
|
|
2186
|
+
interface $ZodCheckIncludesDef extends $ZodCheckStringFormatDef<"includes"> {
|
|
2187
|
+
includes: string;
|
|
2188
|
+
position?: number | undefined;
|
|
2189
|
+
}
|
|
2190
|
+
interface $ZodCheckIncludesInternals extends $ZodCheckInternals<string> {
|
|
2191
|
+
def: $ZodCheckIncludesDef;
|
|
2192
|
+
issc: $ZodIssueInvalidStringFormat;
|
|
2193
|
+
}
|
|
2194
|
+
interface $ZodCheckIncludes extends $ZodCheck<string> {
|
|
2195
|
+
_zod: $ZodCheckIncludesInternals;
|
|
2196
|
+
}
|
|
2197
|
+
declare const $ZodCheckIncludes: $constructor<$ZodCheckIncludes>;
|
|
2198
|
+
interface $ZodCheckStartsWithDef extends $ZodCheckStringFormatDef<"starts_with"> {
|
|
2199
|
+
prefix: string;
|
|
2200
|
+
}
|
|
2201
|
+
interface $ZodCheckStartsWithInternals extends $ZodCheckInternals<string> {
|
|
2202
|
+
def: $ZodCheckStartsWithDef;
|
|
2203
|
+
issc: $ZodIssueInvalidStringFormat;
|
|
2204
|
+
}
|
|
2205
|
+
interface $ZodCheckStartsWith extends $ZodCheck<string> {
|
|
2206
|
+
_zod: $ZodCheckStartsWithInternals;
|
|
2207
|
+
}
|
|
2208
|
+
declare const $ZodCheckStartsWith: $constructor<$ZodCheckStartsWith>;
|
|
2209
|
+
interface $ZodCheckEndsWithDef extends $ZodCheckStringFormatDef<"ends_with"> {
|
|
2210
|
+
suffix: string;
|
|
2211
|
+
}
|
|
2212
|
+
interface $ZodCheckEndsWithInternals extends $ZodCheckInternals<string> {
|
|
2213
|
+
def: $ZodCheckEndsWithDef;
|
|
2214
|
+
issc: $ZodIssueInvalidStringFormat;
|
|
2215
|
+
}
|
|
2216
|
+
interface $ZodCheckEndsWith extends $ZodCheckInternals<string> {
|
|
2217
|
+
_zod: $ZodCheckEndsWithInternals;
|
|
2218
|
+
}
|
|
2219
|
+
declare const $ZodCheckEndsWith: $constructor<$ZodCheckEndsWith>;
|
|
2220
|
+
//#endregion
|
|
2221
|
+
//#region ../../node_modules/zod/v4/core/errors.d.cts
|
|
2222
|
+
interface $ZodIssueBase {
|
|
2223
|
+
readonly code?: string;
|
|
2224
|
+
readonly input?: unknown;
|
|
2225
|
+
readonly path: PropertyKey[];
|
|
2226
|
+
readonly message: string;
|
|
2227
|
+
}
|
|
2228
|
+
type $ZodInvalidTypeExpected = "string" | "number" | "int" | "boolean" | "bigint" | "symbol" | "undefined" | "null" | "never" | "void" | "date" | "array" | "object" | "tuple" | "record" | "map" | "set" | "file" | "nonoptional" | "nan" | "function" | (string & {});
|
|
2229
|
+
interface $ZodIssueInvalidType<Input = unknown> extends $ZodIssueBase {
|
|
2230
|
+
readonly code: "invalid_type";
|
|
2231
|
+
readonly expected: $ZodInvalidTypeExpected;
|
|
2232
|
+
readonly input?: Input;
|
|
2233
|
+
}
|
|
2234
|
+
interface $ZodIssueTooBig<Input = unknown> extends $ZodIssueBase {
|
|
2235
|
+
readonly code: "too_big";
|
|
2236
|
+
readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
|
|
2237
|
+
readonly maximum: number | bigint;
|
|
2238
|
+
readonly inclusive?: boolean;
|
|
2239
|
+
readonly exact?: boolean;
|
|
2240
|
+
readonly input?: Input;
|
|
2241
|
+
}
|
|
2242
|
+
interface $ZodIssueTooSmall<Input = unknown> extends $ZodIssueBase {
|
|
2243
|
+
readonly code: "too_small";
|
|
2244
|
+
readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
|
|
2245
|
+
readonly minimum: number | bigint;
|
|
2246
|
+
/** True if the allowable range includes the minimum */
|
|
2247
|
+
readonly inclusive?: boolean;
|
|
2248
|
+
/** True if the allowed value is fixed (e.g.` z.length(5)`), not a range (`z.minLength(5)`) */
|
|
2249
|
+
readonly exact?: boolean;
|
|
2250
|
+
readonly input?: Input;
|
|
2251
|
+
}
|
|
2252
|
+
interface $ZodIssueInvalidStringFormat extends $ZodIssueBase {
|
|
2253
|
+
readonly code: "invalid_format";
|
|
2254
|
+
readonly format: $ZodStringFormats | (string & {});
|
|
2255
|
+
readonly pattern?: string;
|
|
2256
|
+
readonly input?: string;
|
|
2257
|
+
}
|
|
2258
|
+
interface $ZodIssueNotMultipleOf<Input extends number | bigint = number | bigint> extends $ZodIssueBase {
|
|
2259
|
+
readonly code: "not_multiple_of";
|
|
2260
|
+
readonly divisor: number;
|
|
2261
|
+
readonly input?: Input;
|
|
2262
|
+
}
|
|
2263
|
+
interface $ZodIssueUnrecognizedKeys extends $ZodIssueBase {
|
|
2264
|
+
readonly code: "unrecognized_keys";
|
|
2265
|
+
readonly keys: string[];
|
|
2266
|
+
readonly input?: Record<string, unknown>;
|
|
2267
|
+
}
|
|
2268
|
+
interface $ZodIssueInvalidUnionNoMatch extends $ZodIssueBase {
|
|
2269
|
+
readonly code: "invalid_union";
|
|
2270
|
+
readonly errors: $ZodIssue[][];
|
|
2271
|
+
readonly input?: unknown;
|
|
2272
|
+
readonly discriminator?: string | undefined;
|
|
2273
|
+
readonly inclusive?: true;
|
|
2274
|
+
}
|
|
2275
|
+
interface $ZodIssueInvalidUnionMultipleMatch extends $ZodIssueBase {
|
|
2276
|
+
readonly code: "invalid_union";
|
|
2277
|
+
readonly errors: [];
|
|
2278
|
+
readonly input?: unknown;
|
|
2279
|
+
readonly discriminator?: string | undefined;
|
|
2280
|
+
readonly inclusive: false;
|
|
2281
|
+
}
|
|
2282
|
+
type $ZodIssueInvalidUnion = $ZodIssueInvalidUnionNoMatch | $ZodIssueInvalidUnionMultipleMatch;
|
|
2283
|
+
interface $ZodIssueInvalidKey<Input = unknown> extends $ZodIssueBase {
|
|
2284
|
+
readonly code: "invalid_key";
|
|
2285
|
+
readonly origin: "map" | "record";
|
|
2286
|
+
readonly issues: $ZodIssue[];
|
|
2287
|
+
readonly input?: Input;
|
|
2288
|
+
}
|
|
2289
|
+
interface $ZodIssueInvalidElement<Input = unknown> extends $ZodIssueBase {
|
|
2290
|
+
readonly code: "invalid_element";
|
|
2291
|
+
readonly origin: "map" | "set";
|
|
2292
|
+
readonly key: unknown;
|
|
2293
|
+
readonly issues: $ZodIssue[];
|
|
2294
|
+
readonly input?: Input;
|
|
2295
|
+
}
|
|
2296
|
+
interface $ZodIssueInvalidValue<Input = unknown> extends $ZodIssueBase {
|
|
2297
|
+
readonly code: "invalid_value";
|
|
2298
|
+
readonly values: Primitive[];
|
|
2299
|
+
readonly input?: Input;
|
|
2300
|
+
}
|
|
2301
|
+
interface $ZodIssueCustom extends $ZodIssueBase {
|
|
2302
|
+
readonly code: "custom";
|
|
2303
|
+
readonly params?: Record<string, any> | undefined;
|
|
2304
|
+
readonly input?: unknown;
|
|
2305
|
+
}
|
|
2306
|
+
type $ZodIssue = $ZodIssueInvalidType | $ZodIssueTooBig | $ZodIssueTooSmall | $ZodIssueInvalidStringFormat | $ZodIssueNotMultipleOf | $ZodIssueUnrecognizedKeys | $ZodIssueInvalidUnion | $ZodIssueInvalidKey | $ZodIssueInvalidElement | $ZodIssueInvalidValue | $ZodIssueCustom;
|
|
2307
|
+
type $ZodInternalIssue<T extends $ZodIssueBase = $ZodIssue> = T extends any ? RawIssue$1<T> : never;
|
|
2308
|
+
type RawIssue$1<T extends $ZodIssueBase> = T extends any ? Flatten<MakePartial<T, "message" | "path"> & {
|
|
2309
|
+
/** The input data */readonly input: unknown; /** The schema or check that originated this issue. */
|
|
2310
|
+
readonly inst?: $ZodType | $ZodCheck; /** If `true`, Zod will continue executing checks/refinements after this issue. */
|
|
2311
|
+
readonly continue?: boolean | undefined;
|
|
2312
|
+
} & Record<string, unknown>> : never;
|
|
2313
|
+
type $ZodRawIssue<T extends $ZodIssueBase = $ZodIssue> = $ZodInternalIssue<T>;
|
|
2314
|
+
interface $ZodErrorMap<T extends $ZodIssueBase = $ZodIssue> {
|
|
2315
|
+
(issue: $ZodRawIssue<T>): {
|
|
2316
|
+
message: string;
|
|
2317
|
+
} | string | undefined | null;
|
|
2318
|
+
}
|
|
2319
|
+
interface $ZodError<T = unknown> extends Error {
|
|
2320
|
+
type: T;
|
|
2321
|
+
issues: $ZodIssue[];
|
|
2322
|
+
_zod: {
|
|
2323
|
+
output: T;
|
|
2324
|
+
def: $ZodIssue[];
|
|
2325
|
+
};
|
|
2326
|
+
stack?: string;
|
|
2327
|
+
name: string;
|
|
2328
|
+
}
|
|
2329
|
+
declare const $ZodError: $constructor<$ZodError>;
|
|
2330
|
+
type $ZodFlattenedError<T, U = string> = _FlattenedError<T, U>;
|
|
2331
|
+
type _FlattenedError<T, U = string> = {
|
|
2332
|
+
formErrors: U[];
|
|
2333
|
+
fieldErrors: { [P in keyof T]?: U[] };
|
|
2334
|
+
};
|
|
2335
|
+
type _ZodFormattedError<T, U = string> = T extends [any, ...any[]] ? { [K in keyof T]?: $ZodFormattedError<T[K], U> } : T extends any[] ? {
|
|
2336
|
+
[k: number]: $ZodFormattedError<T[number], U>;
|
|
2337
|
+
} : T extends object ? Flatten<{ [K in keyof T]?: $ZodFormattedError<T[K], U> }> : any;
|
|
2338
|
+
type $ZodFormattedError<T, U = string> = {
|
|
2339
|
+
_errors: U[];
|
|
2340
|
+
} & Flatten<_ZodFormattedError<T, U>>;
|
|
2341
|
+
//#endregion
|
|
2342
|
+
//#region ../../node_modules/zod/v4/core/core.d.cts
|
|
2343
|
+
type ZodTrait = {
|
|
2344
|
+
_zod: {
|
|
2345
|
+
def: any;
|
|
2346
|
+
[k: string]: any;
|
|
2347
|
+
};
|
|
2348
|
+
};
|
|
2349
|
+
interface $constructor<T extends ZodTrait, D = T["_zod"]["def"]> {
|
|
2350
|
+
new (def: D): T;
|
|
2351
|
+
init(inst: T, def: D): asserts inst is T;
|
|
2352
|
+
}
|
|
2353
|
+
declare function $constructor<T extends ZodTrait, D = T["_zod"]["def"]>(name: string, initializer: (inst: T, def: D) => void, params?: {
|
|
2354
|
+
Parent?: typeof Class;
|
|
2355
|
+
}): $constructor<T, D>;
|
|
2356
|
+
declare const $brand: unique symbol;
|
|
2357
|
+
type $brand<T extends string | number | symbol = string | number | symbol> = {
|
|
2358
|
+
[$brand]: { [k in T]: true };
|
|
2359
|
+
};
|
|
2360
|
+
type $ZodBranded<T extends SomeType, Brand extends string | number | symbol, Dir extends "in" | "out" | "inout" = "out"> = T & (Dir extends "inout" ? {
|
|
2361
|
+
_zod: {
|
|
2362
|
+
input: input<T> & $brand<Brand>;
|
|
2363
|
+
output: output<T> & $brand<Brand>;
|
|
2364
|
+
};
|
|
2365
|
+
} : Dir extends "in" ? {
|
|
2366
|
+
_zod: {
|
|
2367
|
+
input: input<T> & $brand<Brand>;
|
|
2368
|
+
};
|
|
2369
|
+
} : {
|
|
2370
|
+
_zod: {
|
|
2371
|
+
output: output<T> & $brand<Brand>;
|
|
2372
|
+
};
|
|
2373
|
+
});
|
|
2374
|
+
type input<T> = T extends {
|
|
2375
|
+
_zod: {
|
|
2376
|
+
input: any;
|
|
2377
|
+
};
|
|
2378
|
+
} ? T["_zod"]["input"] : unknown;
|
|
2379
|
+
type output<T> = T extends {
|
|
2380
|
+
_zod: {
|
|
2381
|
+
output: any;
|
|
2382
|
+
};
|
|
2383
|
+
} ? T["_zod"]["output"] : unknown;
|
|
2384
|
+
//#endregion
|
|
2385
|
+
//#region ../../node_modules/zod/v4/core/api.d.cts
|
|
2386
|
+
type Params<T extends $ZodType | $ZodCheck, IssueTypes extends $ZodIssueBase, OmitKeys extends keyof T["_zod"]["def"] = never> = Flatten<Partial<EmptyToNever<Omit<T["_zod"]["def"], OmitKeys> & ([IssueTypes] extends [never] ? {} : {
|
|
2387
|
+
error?: string | $ZodErrorMap<IssueTypes> | undefined; /** @deprecated This parameter is deprecated. Use `error` instead. */
|
|
2388
|
+
message?: string | undefined;
|
|
2389
|
+
})>>>;
|
|
2390
|
+
type TypeParams<T extends $ZodType = $ZodType & {
|
|
2391
|
+
_isst: never;
|
|
2392
|
+
}, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "checks" | "error"> = never> = Params<T, NonNullable<T["_zod"]["isst"]>, "type" | "checks" | "error" | AlsoOmit>;
|
|
2393
|
+
type CheckParams<T extends $ZodCheck = $ZodCheck, // & { _issc: never },
|
|
2394
|
+
AlsoOmit extends Exclude<keyof T["_zod"]["def"], "check" | "error"> = never> = Params<T, NonNullable<T["_zod"]["issc"]>, "check" | "error" | AlsoOmit>;
|
|
2395
|
+
type CheckStringFormatParams<T extends $ZodStringFormat = $ZodStringFormat, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "coerce" | "checks" | "error" | "check" | "format"> = never> = Params<T, NonNullable<T["_zod"]["issc"]>, "type" | "coerce" | "checks" | "error" | "check" | "format" | AlsoOmit>;
|
|
2396
|
+
type CheckTypeParams<T extends $ZodType & $ZodCheck = $ZodType & $ZodCheck, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "checks" | "error" | "check"> = never> = Params<T, NonNullable<T["_zod"]["isst"] | T["_zod"]["issc"]>, "type" | "checks" | "error" | "check" | AlsoOmit>;
|
|
2397
|
+
type $ZodCheckEmailParams = CheckStringFormatParams<$ZodEmail, "when">;
|
|
2398
|
+
type $ZodCheckGUIDParams = CheckStringFormatParams<$ZodGUID, "pattern" | "when">;
|
|
2399
|
+
type $ZodCheckUUIDParams = CheckStringFormatParams<$ZodUUID, "pattern" | "when">;
|
|
2400
|
+
type $ZodCheckURLParams = CheckStringFormatParams<$ZodURL, "when">;
|
|
2401
|
+
type $ZodCheckEmojiParams = CheckStringFormatParams<$ZodEmoji, "when">;
|
|
2402
|
+
type $ZodCheckNanoIDParams = CheckStringFormatParams<$ZodNanoID, "when">;
|
|
2403
|
+
type $ZodCheckCUIDParams = CheckStringFormatParams<$ZodCUID, "when">;
|
|
2404
|
+
type $ZodCheckCUID2Params = CheckStringFormatParams<$ZodCUID2, "when">;
|
|
2405
|
+
type $ZodCheckULIDParams = CheckStringFormatParams<$ZodULID, "when">;
|
|
2406
|
+
type $ZodCheckXIDParams = CheckStringFormatParams<$ZodXID, "when">;
|
|
2407
|
+
type $ZodCheckKSUIDParams = CheckStringFormatParams<$ZodKSUID, "when">;
|
|
2408
|
+
type $ZodCheckIPv4Params = CheckStringFormatParams<$ZodIPv4, "pattern" | "when" | "version">;
|
|
2409
|
+
type $ZodCheckIPv6Params = CheckStringFormatParams<$ZodIPv6, "pattern" | "when" | "version">;
|
|
2410
|
+
type $ZodCheckCIDRv4Params = CheckStringFormatParams<$ZodCIDRv4, "pattern" | "when">;
|
|
2411
|
+
type $ZodCheckCIDRv6Params = CheckStringFormatParams<$ZodCIDRv6, "pattern" | "when">;
|
|
2412
|
+
type $ZodCheckBase64Params = CheckStringFormatParams<$ZodBase64, "pattern" | "when">;
|
|
2413
|
+
type $ZodCheckBase64URLParams = CheckStringFormatParams<$ZodBase64URL, "pattern" | "when">;
|
|
2414
|
+
type $ZodCheckE164Params = CheckStringFormatParams<$ZodE164, "when">;
|
|
2415
|
+
type $ZodCheckJWTParams = CheckStringFormatParams<$ZodJWT, "pattern" | "when">;
|
|
2416
|
+
type $ZodCheckISODateTimeParams = CheckStringFormatParams<$ZodISODateTime, "pattern" | "when">;
|
|
2417
|
+
type $ZodCheckISODateParams = CheckStringFormatParams<$ZodISODate, "pattern" | "when">;
|
|
2418
|
+
type $ZodCheckISOTimeParams = CheckStringFormatParams<$ZodISOTime, "pattern" | "when">;
|
|
2419
|
+
type $ZodCheckISODurationParams = CheckStringFormatParams<$ZodISODuration, "when">;
|
|
2420
|
+
type $ZodCheckNumberFormatParams = CheckParams<$ZodCheckNumberFormat, "format" | "when">;
|
|
2421
|
+
type $ZodCheckLessThanParams = CheckParams<$ZodCheckLessThan, "inclusive" | "value" | "when">;
|
|
2422
|
+
type $ZodCheckGreaterThanParams = CheckParams<$ZodCheckGreaterThan, "inclusive" | "value" | "when">;
|
|
2423
|
+
type $ZodCheckMultipleOfParams = CheckParams<$ZodCheckMultipleOf, "value" | "when">;
|
|
2424
|
+
type $ZodCheckMaxLengthParams = CheckParams<$ZodCheckMaxLength, "maximum" | "when">;
|
|
2425
|
+
type $ZodCheckMinLengthParams = CheckParams<$ZodCheckMinLength, "minimum" | "when">;
|
|
2426
|
+
type $ZodCheckLengthEqualsParams = CheckParams<$ZodCheckLengthEquals, "length" | "when">;
|
|
2427
|
+
type $ZodCheckRegexParams = CheckParams<$ZodCheckRegex, "format" | "pattern" | "when">;
|
|
2428
|
+
type $ZodCheckLowerCaseParams = CheckParams<$ZodCheckLowerCase, "format" | "when">;
|
|
2429
|
+
type $ZodCheckUpperCaseParams = CheckParams<$ZodCheckUpperCase, "format" | "when">;
|
|
2430
|
+
type $ZodCheckIncludesParams = CheckParams<$ZodCheckIncludes, "includes" | "format" | "when" | "pattern">;
|
|
2431
|
+
type $ZodCheckStartsWithParams = CheckParams<$ZodCheckStartsWith, "prefix" | "format" | "when" | "pattern">;
|
|
2432
|
+
type $ZodCheckEndsWithParams = CheckParams<$ZodCheckEndsWith, "suffix" | "format" | "pattern" | "when">;
|
|
2433
|
+
type $ZodEnumParams = TypeParams<$ZodEnum, "entries">;
|
|
2434
|
+
type $ZodNonOptionalParams = TypeParams<$ZodNonOptional, "innerType">;
|
|
2435
|
+
type $ZodCustomParams = CheckTypeParams<$ZodCustom, "fn">;
|
|
2436
|
+
type $ZodSuperRefineIssue<T extends $ZodIssueBase = $ZodIssue> = T extends any ? RawIssue<T> : never;
|
|
2437
|
+
type RawIssue<T extends $ZodIssueBase> = T extends any ? Flatten<MakePartial<T, "message" | "path"> & {
|
|
2438
|
+
/** The schema or check that originated this issue. */readonly inst?: $ZodType | $ZodCheck; /** If `true`, Zod will execute subsequent checks/refinements instead of immediately aborting */
|
|
2439
|
+
readonly continue?: boolean | undefined;
|
|
2440
|
+
} & Record<string, unknown>> : never;
|
|
2441
|
+
interface $RefinementCtx<T = unknown> extends ParsePayload<T> {
|
|
2442
|
+
addIssue(arg: string | $ZodSuperRefineIssue): void;
|
|
2443
|
+
}
|
|
2444
|
+
//#endregion
|
|
2445
|
+
//#region ../../node_modules/zod/v4/classic/errors.d.cts
|
|
2446
|
+
/** An Error-like class used to store Zod validation issues. */
|
|
2447
|
+
interface ZodError<T = unknown> extends $ZodError<T> {
|
|
2448
|
+
/** @deprecated Use the `z.treeifyError(err)` function instead. */
|
|
2449
|
+
format(): $ZodFormattedError<T>;
|
|
2450
|
+
format<U>(mapper: (issue: $ZodIssue) => U): $ZodFormattedError<T, U>;
|
|
2451
|
+
/** @deprecated Use the `z.treeifyError(err)` function instead. */
|
|
2452
|
+
flatten(): $ZodFlattenedError<T>;
|
|
2453
|
+
flatten<U>(mapper: (issue: $ZodIssue) => U): $ZodFlattenedError<T, U>;
|
|
2454
|
+
/** @deprecated Push directly to `.issues` instead. */
|
|
2455
|
+
addIssue(issue: $ZodIssue): void;
|
|
2456
|
+
/** @deprecated Push directly to `.issues` instead. */
|
|
2457
|
+
addIssues(issues: $ZodIssue[]): void;
|
|
2458
|
+
/** @deprecated Check `err.issues.length === 0` instead. */
|
|
2459
|
+
isEmpty: boolean;
|
|
2460
|
+
}
|
|
2461
|
+
declare const ZodError: $constructor<ZodError>;
|
|
2462
|
+
//#endregion
|
|
2463
|
+
//#region ../../node_modules/zod/v4/classic/parse.d.cts
|
|
2464
|
+
type ZodSafeParseResult<T> = ZodSafeParseSuccess<T> | ZodSafeParseError<T>;
|
|
2465
|
+
type ZodSafeParseSuccess<T> = {
|
|
2466
|
+
success: true;
|
|
2467
|
+
data: T;
|
|
2468
|
+
error?: never;
|
|
2469
|
+
};
|
|
2470
|
+
type ZodSafeParseError<T> = {
|
|
2471
|
+
success: false;
|
|
2472
|
+
data?: never;
|
|
2473
|
+
error: ZodError<T>;
|
|
2474
|
+
};
|
|
2475
|
+
//#endregion
|
|
2476
|
+
//#region ../../node_modules/zod/v4/classic/schemas.d.cts
|
|
2477
|
+
type ZodStandardSchemaWithJSON<T> = StandardSchemaWithJSONProps<input<T>, output<T>>;
|
|
2478
|
+
interface ZodType<out Output = unknown, out Input = unknown, out Internals extends $ZodTypeInternals<Output, Input> = $ZodTypeInternals<Output, Input>> extends $ZodType<Output, Input, Internals> {
|
|
2479
|
+
def: Internals["def"];
|
|
2480
|
+
type: Internals["def"]["type"];
|
|
2481
|
+
/** @deprecated Use `.def` instead. */
|
|
2482
|
+
_def: Internals["def"];
|
|
2483
|
+
/** @deprecated Use `z.output<typeof schema>` instead. */
|
|
2484
|
+
_output: Internals["output"];
|
|
2485
|
+
/** @deprecated Use `z.input<typeof schema>` instead. */
|
|
2486
|
+
_input: Internals["input"];
|
|
2487
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2488
|
+
/** Converts this schema to a JSON Schema representation. */
|
|
2489
|
+
toJSONSchema(params?: ToJSONSchemaParams): ZodStandardJSONSchemaPayload<this>;
|
|
2490
|
+
check(...checks: (CheckFn<output<this>> | $ZodCheck<output<this>>)[]): this;
|
|
2491
|
+
with(...checks: (CheckFn<output<this>> | $ZodCheck<output<this>>)[]): this;
|
|
2492
|
+
clone(def?: Internals["def"], params?: {
|
|
2493
|
+
parent: boolean;
|
|
2494
|
+
}): this;
|
|
2495
|
+
register<R extends $ZodRegistry>(registry: R, ...meta: this extends R["_schema"] ? undefined extends R["_meta"] ? [$replace<R["_meta"], this>?] : [$replace<R["_meta"], this>] : ["Incompatible schema"]): this;
|
|
2496
|
+
brand<T extends PropertyKey = PropertyKey, Dir extends "in" | "out" | "inout" = "out">(value?: T): PropertyKey extends T ? this : $ZodBranded<this, T, Dir>;
|
|
2497
|
+
parse(data: unknown, params?: ParseContext<$ZodIssue>): output<this>;
|
|
2498
|
+
safeParse(data: unknown, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<output<this>>;
|
|
2499
|
+
parseAsync(data: unknown, params?: ParseContext<$ZodIssue>): Promise<output<this>>;
|
|
2500
|
+
safeParseAsync(data: unknown, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<output<this>>>;
|
|
2501
|
+
spa: (data: unknown, params?: ParseContext<$ZodIssue>) => Promise<ZodSafeParseResult<output<this>>>;
|
|
2502
|
+
encode(data: output<this>, params?: ParseContext<$ZodIssue>): input<this>;
|
|
2503
|
+
decode(data: input<this>, params?: ParseContext<$ZodIssue>): output<this>;
|
|
2504
|
+
encodeAsync(data: output<this>, params?: ParseContext<$ZodIssue>): Promise<input<this>>;
|
|
2505
|
+
decodeAsync(data: input<this>, params?: ParseContext<$ZodIssue>): Promise<output<this>>;
|
|
2506
|
+
safeEncode(data: output<this>, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<input<this>>;
|
|
2507
|
+
safeDecode(data: input<this>, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<output<this>>;
|
|
2508
|
+
safeEncodeAsync(data: output<this>, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<input<this>>>;
|
|
2509
|
+
safeDecodeAsync(data: input<this>, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<output<this>>>;
|
|
2510
|
+
refine<Ch extends (arg: output<this>) => unknown | Promise<unknown>>(check: Ch, params?: string | $ZodCustomParams): Ch extends ((arg: any) => arg is infer R) ? this & ZodType<R, input<this>> : this;
|
|
2511
|
+
superRefine(refinement: (arg: output<this>, ctx: $RefinementCtx<output<this>>) => void | Promise<void>): this;
|
|
2512
|
+
overwrite(fn: (x: output<this>) => output<this>): this;
|
|
2513
|
+
optional(): ZodOptional<this>;
|
|
2514
|
+
exactOptional(): ZodExactOptional<this>;
|
|
2515
|
+
nonoptional(params?: string | $ZodNonOptionalParams): ZodNonOptional<this>;
|
|
2516
|
+
nullable(): ZodNullable<this>;
|
|
2517
|
+
nullish(): ZodOptional<ZodNullable<this>>;
|
|
2518
|
+
default(def: NoUndefined<output<this>>): ZodDefault<this>;
|
|
2519
|
+
default(def: () => NoUndefined<output<this>>): ZodDefault<this>;
|
|
2520
|
+
prefault(def: () => input<this>): ZodPrefault<this>;
|
|
2521
|
+
prefault(def: input<this>): ZodPrefault<this>;
|
|
2522
|
+
array(): ZodArray<this>;
|
|
2523
|
+
or<T extends SomeType>(option: T): ZodUnion<[this, T]>;
|
|
2524
|
+
and<T extends SomeType>(incoming: T): ZodIntersection<this, T>;
|
|
2525
|
+
transform<NewOut>(transform: (arg: output<this>, ctx: $RefinementCtx<output<this>>) => NewOut | Promise<NewOut>): ZodPipe<this, ZodTransform<Awaited<NewOut>, output<this>>>;
|
|
2526
|
+
catch(def: output<this>): ZodCatch<this>;
|
|
2527
|
+
catch(def: (ctx: $ZodCatchCtx) => output<this>): ZodCatch<this>;
|
|
2528
|
+
pipe<T extends $ZodType<any, output<this>>>(target: T | $ZodType<any, output<this>>): ZodPipe<this, T>;
|
|
2529
|
+
readonly(): ZodReadonly<this>;
|
|
2530
|
+
/** Returns a new instance that has been registered in `z.globalRegistry` with the specified description */
|
|
2531
|
+
describe(description: string): this;
|
|
2532
|
+
description?: string;
|
|
2533
|
+
/** Returns the metadata associated with this instance in `z.globalRegistry` */
|
|
2534
|
+
meta(): $replace<GlobalMeta, this> | undefined;
|
|
2535
|
+
/** Returns a new instance that has been registered in `z.globalRegistry` with the specified metadata */
|
|
2536
|
+
meta(data: $replace<GlobalMeta, this>): this;
|
|
2537
|
+
/** @deprecated Try safe-parsing `undefined` (this is what `isOptional` does internally):
|
|
2538
|
+
*
|
|
2539
|
+
* ```ts
|
|
2540
|
+
* const schema = z.string().optional();
|
|
2541
|
+
* const isOptional = schema.safeParse(undefined).success; // true
|
|
2542
|
+
* ```
|
|
2543
|
+
*/
|
|
2544
|
+
isOptional(): boolean;
|
|
2545
|
+
/**
|
|
2546
|
+
* @deprecated Try safe-parsing `null` (this is what `isNullable` does internally):
|
|
2547
|
+
*
|
|
2548
|
+
* ```ts
|
|
2549
|
+
* const schema = z.string().nullable();
|
|
2550
|
+
* const isNullable = schema.safeParse(null).success; // true
|
|
2551
|
+
* ```
|
|
2552
|
+
*/
|
|
2553
|
+
isNullable(): boolean;
|
|
2554
|
+
apply<T>(fn: (schema: this) => T): T;
|
|
2555
|
+
}
|
|
2556
|
+
interface _ZodType<out Internals extends $ZodTypeInternals = $ZodTypeInternals> extends ZodType<any, any, Internals> {}
|
|
2557
|
+
declare const ZodType: $constructor<ZodType>;
|
|
2558
|
+
interface _ZodString<T extends $ZodStringInternals<unknown> = $ZodStringInternals<unknown>> extends _ZodType<T> {
|
|
2559
|
+
format: string | null;
|
|
2560
|
+
minLength: number | null;
|
|
2561
|
+
maxLength: number | null;
|
|
2562
|
+
regex(regex: RegExp, params?: string | $ZodCheckRegexParams): this;
|
|
2563
|
+
includes(value: string, params?: string | $ZodCheckIncludesParams): this;
|
|
2564
|
+
startsWith(value: string, params?: string | $ZodCheckStartsWithParams): this;
|
|
2565
|
+
endsWith(value: string, params?: string | $ZodCheckEndsWithParams): this;
|
|
2566
|
+
min(minLength: number, params?: string | $ZodCheckMinLengthParams): this;
|
|
2567
|
+
max(maxLength: number, params?: string | $ZodCheckMaxLengthParams): this;
|
|
2568
|
+
length(len: number, params?: string | $ZodCheckLengthEqualsParams): this;
|
|
2569
|
+
nonempty(params?: string | $ZodCheckMinLengthParams): this;
|
|
2570
|
+
lowercase(params?: string | $ZodCheckLowerCaseParams): this;
|
|
2571
|
+
uppercase(params?: string | $ZodCheckUpperCaseParams): this;
|
|
2572
|
+
trim(): this;
|
|
2573
|
+
normalize(form?: "NFC" | "NFD" | "NFKC" | "NFKD" | (string & {})): this;
|
|
2574
|
+
toLowerCase(): this;
|
|
2575
|
+
toUpperCase(): this;
|
|
2576
|
+
slugify(): this;
|
|
2577
|
+
}
|
|
2578
|
+
/** @internal */
|
|
2579
|
+
declare const _ZodString: $constructor<_ZodString>;
|
|
2580
|
+
interface ZodString extends _ZodString<$ZodStringInternals<string>> {
|
|
2581
|
+
/** @deprecated Use `z.email()` instead. */
|
|
2582
|
+
email(params?: string | $ZodCheckEmailParams): this;
|
|
2583
|
+
/** @deprecated Use `z.url()` instead. */
|
|
2584
|
+
url(params?: string | $ZodCheckURLParams): this;
|
|
2585
|
+
/** @deprecated Use `z.jwt()` instead. */
|
|
2586
|
+
jwt(params?: string | $ZodCheckJWTParams): this;
|
|
2587
|
+
/** @deprecated Use `z.emoji()` instead. */
|
|
2588
|
+
emoji(params?: string | $ZodCheckEmojiParams): this;
|
|
2589
|
+
/** @deprecated Use `z.guid()` instead. */
|
|
2590
|
+
guid(params?: string | $ZodCheckGUIDParams): this;
|
|
2591
|
+
/** @deprecated Use `z.uuid()` instead. */
|
|
2592
|
+
uuid(params?: string | $ZodCheckUUIDParams): this;
|
|
2593
|
+
/** @deprecated Use `z.uuid()` instead. */
|
|
2594
|
+
uuidv4(params?: string | $ZodCheckUUIDParams): this;
|
|
2595
|
+
/** @deprecated Use `z.uuid()` instead. */
|
|
2596
|
+
uuidv6(params?: string | $ZodCheckUUIDParams): this;
|
|
2597
|
+
/** @deprecated Use `z.uuid()` instead. */
|
|
2598
|
+
uuidv7(params?: string | $ZodCheckUUIDParams): this;
|
|
2599
|
+
/** @deprecated Use `z.nanoid()` instead. */
|
|
2600
|
+
nanoid(params?: string | $ZodCheckNanoIDParams): this;
|
|
2601
|
+
/** @deprecated Use `z.guid()` instead. */
|
|
2602
|
+
guid(params?: string | $ZodCheckGUIDParams): this;
|
|
2603
|
+
/** @deprecated Use `z.cuid()` instead. */
|
|
2604
|
+
cuid(params?: string | $ZodCheckCUIDParams): this;
|
|
2605
|
+
/** @deprecated Use `z.cuid2()` instead. */
|
|
2606
|
+
cuid2(params?: string | $ZodCheckCUID2Params): this;
|
|
2607
|
+
/** @deprecated Use `z.ulid()` instead. */
|
|
2608
|
+
ulid(params?: string | $ZodCheckULIDParams): this;
|
|
2609
|
+
/** @deprecated Use `z.base64()` instead. */
|
|
2610
|
+
base64(params?: string | $ZodCheckBase64Params): this;
|
|
2611
|
+
/** @deprecated Use `z.base64url()` instead. */
|
|
2612
|
+
base64url(params?: string | $ZodCheckBase64URLParams): this;
|
|
2613
|
+
/** @deprecated Use `z.xid()` instead. */
|
|
2614
|
+
xid(params?: string | $ZodCheckXIDParams): this;
|
|
2615
|
+
/** @deprecated Use `z.ksuid()` instead. */
|
|
2616
|
+
ksuid(params?: string | $ZodCheckKSUIDParams): this;
|
|
2617
|
+
/** @deprecated Use `z.ipv4()` instead. */
|
|
2618
|
+
ipv4(params?: string | $ZodCheckIPv4Params): this;
|
|
2619
|
+
/** @deprecated Use `z.ipv6()` instead. */
|
|
2620
|
+
ipv6(params?: string | $ZodCheckIPv6Params): this;
|
|
2621
|
+
/** @deprecated Use `z.cidrv4()` instead. */
|
|
2622
|
+
cidrv4(params?: string | $ZodCheckCIDRv4Params): this;
|
|
2623
|
+
/** @deprecated Use `z.cidrv6()` instead. */
|
|
2624
|
+
cidrv6(params?: string | $ZodCheckCIDRv6Params): this;
|
|
2625
|
+
/** @deprecated Use `z.e164()` instead. */
|
|
2626
|
+
e164(params?: string | $ZodCheckE164Params): this;
|
|
2627
|
+
/** @deprecated Use `z.iso.datetime()` instead. */
|
|
2628
|
+
datetime(params?: string | $ZodCheckISODateTimeParams): this;
|
|
2629
|
+
/** @deprecated Use `z.iso.date()` instead. */
|
|
2630
|
+
date(params?: string | $ZodCheckISODateParams): this;
|
|
2631
|
+
/** @deprecated Use `z.iso.time()` instead. */
|
|
2632
|
+
time(params?: string | $ZodCheckISOTimeParams): this;
|
|
2633
|
+
/** @deprecated Use `z.iso.duration()` instead. */
|
|
2634
|
+
duration(params?: string | $ZodCheckISODurationParams): this;
|
|
2635
|
+
}
|
|
2636
|
+
declare const ZodString: $constructor<ZodString>;
|
|
2637
|
+
interface _ZodNumber<Internals extends $ZodNumberInternals = $ZodNumberInternals> extends _ZodType<Internals> {
|
|
2638
|
+
gt(value: number, params?: string | $ZodCheckGreaterThanParams): this;
|
|
2639
|
+
/** Identical to .min() */
|
|
2640
|
+
gte(value: number, params?: string | $ZodCheckGreaterThanParams): this;
|
|
2641
|
+
min(value: number, params?: string | $ZodCheckGreaterThanParams): this;
|
|
2642
|
+
lt(value: number, params?: string | $ZodCheckLessThanParams): this;
|
|
2643
|
+
/** Identical to .max() */
|
|
2644
|
+
lte(value: number, params?: string | $ZodCheckLessThanParams): this;
|
|
2645
|
+
max(value: number, params?: string | $ZodCheckLessThanParams): this;
|
|
2646
|
+
/** Consider `z.int()` instead. This API is considered *legacy*; it will never be removed but a better alternative exists. */
|
|
2647
|
+
int(params?: string | $ZodCheckNumberFormatParams): this;
|
|
2648
|
+
/** @deprecated This is now identical to `.int()`. Only numbers in the safe integer range are accepted. */
|
|
2649
|
+
safe(params?: string | $ZodCheckNumberFormatParams): this;
|
|
2650
|
+
positive(params?: string | $ZodCheckGreaterThanParams): this;
|
|
2651
|
+
nonnegative(params?: string | $ZodCheckGreaterThanParams): this;
|
|
2652
|
+
negative(params?: string | $ZodCheckLessThanParams): this;
|
|
2653
|
+
nonpositive(params?: string | $ZodCheckLessThanParams): this;
|
|
2654
|
+
multipleOf(value: number, params?: string | $ZodCheckMultipleOfParams): this;
|
|
2655
|
+
/** @deprecated Use `.multipleOf()` instead. */
|
|
2656
|
+
step(value: number, params?: string | $ZodCheckMultipleOfParams): this;
|
|
2657
|
+
/** @deprecated In v4 and later, z.number() does not allow infinite values by default. This is a no-op. */
|
|
2658
|
+
finite(params?: unknown): this;
|
|
2659
|
+
minValue: number | null;
|
|
2660
|
+
maxValue: number | null;
|
|
2661
|
+
/** @deprecated Check the `format` property instead. */
|
|
2662
|
+
isInt: boolean;
|
|
2663
|
+
/** @deprecated Number schemas no longer accept infinite values, so this always returns `true`. */
|
|
2664
|
+
isFinite: boolean;
|
|
2665
|
+
format: string | null;
|
|
2666
|
+
}
|
|
2667
|
+
interface ZodNumber extends _ZodNumber<$ZodNumberInternals<number>> {}
|
|
2668
|
+
declare const ZodNumber: $constructor<ZodNumber>;
|
|
2669
|
+
interface _ZodBoolean<T extends $ZodBooleanInternals = $ZodBooleanInternals> extends _ZodType<T> {}
|
|
2670
|
+
interface ZodBoolean extends _ZodBoolean<$ZodBooleanInternals<boolean>> {}
|
|
2671
|
+
declare const ZodBoolean: $constructor<ZodBoolean>;
|
|
2672
|
+
interface ZodArray<T extends SomeType = $ZodType> extends _ZodType<$ZodArrayInternals<T>>, $ZodArray<T> {
|
|
2673
|
+
element: T;
|
|
2674
|
+
min(minLength: number, params?: string | $ZodCheckMinLengthParams): this;
|
|
2675
|
+
nonempty(params?: string | $ZodCheckMinLengthParams): this;
|
|
2676
|
+
max(maxLength: number, params?: string | $ZodCheckMaxLengthParams): this;
|
|
2677
|
+
length(len: number, params?: string | $ZodCheckLengthEqualsParams): this;
|
|
2678
|
+
unwrap(): T;
|
|
2679
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2680
|
+
}
|
|
2681
|
+
declare const ZodArray: $constructor<ZodArray>;
|
|
2682
|
+
type SafeExtendShape<Base extends $ZodShape, Ext extends $ZodLooseShape> = { [K in keyof Ext]: K extends keyof Base ? output<Ext[K]> extends output<Base[K]> ? input<Ext[K]> extends input<Base[K]> ? Ext[K] : never : never : Ext[K] };
|
|
2683
|
+
interface ZodObject< /** @ts-ignore Cast variance */out Shape extends $ZodShape = $ZodLooseShape, out Config extends $ZodObjectConfig = $strip> extends _ZodType<$ZodObjectInternals<Shape, Config>>, $ZodObject<Shape, Config> {
|
|
2684
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2685
|
+
shape: Shape;
|
|
2686
|
+
keyof(): ZodEnum<ToEnum<keyof Shape & string>>;
|
|
2687
|
+
/** Define a schema to validate all unrecognized keys. This overrides the existing strict/loose behavior. */
|
|
2688
|
+
catchall<T extends SomeType>(schema: T): ZodObject<Shape, $catchall<T>>;
|
|
2689
|
+
/** @deprecated Use `z.looseObject()` or `.loose()` instead. */
|
|
2690
|
+
passthrough(): ZodObject<Shape, $loose>;
|
|
2691
|
+
/** Consider `z.looseObject(A.shape)` instead */
|
|
2692
|
+
loose(): ZodObject<Shape, $loose>;
|
|
2693
|
+
/** Consider `z.strictObject(A.shape)` instead */
|
|
2694
|
+
strict(): ZodObject<Shape, $strict>;
|
|
2695
|
+
/** This is the default behavior. This method call is likely unnecessary. */
|
|
2696
|
+
strip(): ZodObject<Shape, $strip>;
|
|
2697
|
+
extend<U extends $ZodLooseShape>(shape: U): ZodObject<Extend<Shape, U>, Config>;
|
|
2698
|
+
safeExtend<U extends $ZodLooseShape>(shape: SafeExtendShape<Shape, U> & Partial<Record<keyof Shape, SomeType>>): ZodObject<Extend<Shape, U>, Config>;
|
|
2699
|
+
/**
|
|
2700
|
+
* @deprecated Use [`A.extend(B.shape)`](https://zod.dev/api?id=extend) instead.
|
|
2701
|
+
*/
|
|
2702
|
+
merge<U extends ZodObject>(other: U): ZodObject<Extend<Shape, U["shape"]>, U["_zod"]["config"]>;
|
|
2703
|
+
pick<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<Flatten<Pick<Shape, Extract<keyof Shape, keyof M>>>, Config>;
|
|
2704
|
+
omit<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<Flatten<Omit<Shape, Extract<keyof Shape, keyof M>>>, Config>;
|
|
2705
|
+
partial(): ZodObject<{ [k in keyof Shape]: ZodOptional<Shape[k]> }, Config>;
|
|
2706
|
+
partial<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<{ [k in keyof Shape]: k extends keyof M ? ZodOptional<Shape[k]> : Shape[k] }, Config>;
|
|
2707
|
+
required(): ZodObject<{ [k in keyof Shape]: ZodNonOptional<Shape[k]> }, Config>;
|
|
2708
|
+
required<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<{ [k in keyof Shape]: k extends keyof M ? ZodNonOptional<Shape[k]> : Shape[k] }, Config>;
|
|
2709
|
+
}
|
|
2710
|
+
declare const ZodObject: $constructor<ZodObject>;
|
|
2711
|
+
interface ZodUnion<T extends readonly SomeType[] = readonly $ZodType[]> extends _ZodType<$ZodUnionInternals<T>>, $ZodUnion<T> {
|
|
2712
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2713
|
+
options: T;
|
|
2714
|
+
}
|
|
2715
|
+
declare const ZodUnion: $constructor<ZodUnion>;
|
|
2716
|
+
interface ZodIntersection<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _ZodType<$ZodIntersectionInternals<A, B>>, $ZodIntersection<A, B> {
|
|
2717
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2718
|
+
}
|
|
2719
|
+
declare const ZodIntersection: $constructor<ZodIntersection>;
|
|
2720
|
+
interface ZodEnum< /** @ts-ignore Cast variance */out T extends EnumLike = EnumLike> extends _ZodType<$ZodEnumInternals<T>>, $ZodEnum<T> {
|
|
2721
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2722
|
+
enum: T;
|
|
2723
|
+
options: Array<T[keyof T]>;
|
|
2724
|
+
extract<const U extends readonly (keyof T)[]>(values: U, params?: string | $ZodEnumParams): ZodEnum<Flatten<Pick<T, U[number]>>>;
|
|
2725
|
+
exclude<const U extends readonly (keyof T)[]>(values: U, params?: string | $ZodEnumParams): ZodEnum<Flatten<Omit<T, U[number]>>>;
|
|
2726
|
+
}
|
|
2727
|
+
declare const ZodEnum: $constructor<ZodEnum>;
|
|
2728
|
+
interface ZodTransform<O = unknown, I = unknown> extends _ZodType<$ZodTransformInternals<O, I>>, $ZodTransform<O, I> {
|
|
2729
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2730
|
+
}
|
|
2731
|
+
declare const ZodTransform: $constructor<ZodTransform>;
|
|
2732
|
+
interface ZodOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodOptionalInternals<T>>, $ZodOptional<T> {
|
|
2733
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2734
|
+
unwrap(): T;
|
|
2735
|
+
}
|
|
2736
|
+
declare const ZodOptional: $constructor<ZodOptional>;
|
|
2737
|
+
interface ZodExactOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodExactOptionalInternals<T>>, $ZodExactOptional<T> {
|
|
2738
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2739
|
+
unwrap(): T;
|
|
2740
|
+
}
|
|
2741
|
+
declare const ZodExactOptional: $constructor<ZodExactOptional>;
|
|
2742
|
+
interface ZodNullable<T extends SomeType = $ZodType> extends _ZodType<$ZodNullableInternals<T>>, $ZodNullable<T> {
|
|
2743
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2744
|
+
unwrap(): T;
|
|
2745
|
+
}
|
|
2746
|
+
declare const ZodNullable: $constructor<ZodNullable>;
|
|
2747
|
+
interface ZodDefault<T extends SomeType = $ZodType> extends _ZodType<$ZodDefaultInternals<T>>, $ZodDefault<T> {
|
|
2748
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2749
|
+
unwrap(): T;
|
|
2750
|
+
/** @deprecated Use `.unwrap()` instead. */
|
|
2751
|
+
removeDefault(): T;
|
|
2752
|
+
}
|
|
2753
|
+
declare const ZodDefault: $constructor<ZodDefault>;
|
|
2754
|
+
interface ZodPrefault<T extends SomeType = $ZodType> extends _ZodType<$ZodPrefaultInternals<T>>, $ZodPrefault<T> {
|
|
2755
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2756
|
+
unwrap(): T;
|
|
2757
|
+
}
|
|
2758
|
+
declare const ZodPrefault: $constructor<ZodPrefault>;
|
|
2759
|
+
interface ZodNonOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodNonOptionalInternals<T>>, $ZodNonOptional<T> {
|
|
2760
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2761
|
+
unwrap(): T;
|
|
2762
|
+
}
|
|
2763
|
+
declare const ZodNonOptional: $constructor<ZodNonOptional>;
|
|
2764
|
+
interface ZodCatch<T extends SomeType = $ZodType> extends _ZodType<$ZodCatchInternals<T>>, $ZodCatch<T> {
|
|
2765
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2766
|
+
unwrap(): T;
|
|
2767
|
+
/** @deprecated Use `.unwrap()` instead. */
|
|
2768
|
+
removeCatch(): T;
|
|
2769
|
+
}
|
|
2770
|
+
declare const ZodCatch: $constructor<ZodCatch>;
|
|
2771
|
+
interface ZodPipe<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _ZodType<$ZodPipeInternals<A, B>>, $ZodPipe<A, B> {
|
|
2772
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2773
|
+
in: A;
|
|
2774
|
+
out: B;
|
|
2775
|
+
}
|
|
2776
|
+
declare const ZodPipe: $constructor<ZodPipe>;
|
|
2777
|
+
interface ZodReadonly<T extends SomeType = $ZodType> extends _ZodType<$ZodReadonlyInternals<T>>, $ZodReadonly<T> {
|
|
2778
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2779
|
+
unwrap(): T;
|
|
2780
|
+
}
|
|
2781
|
+
declare const ZodReadonly: $constructor<ZodReadonly>;
|
|
2782
|
+
//#endregion
|
|
8
2783
|
//#region src/schemas/screen-options.d.ts
|
|
9
|
-
declare const ScreenOptionsSchema:
|
|
10
|
-
name:
|
|
11
|
-
icon:
|
|
12
|
-
badgeCount:
|
|
13
|
-
hidden:
|
|
14
|
-
static:
|
|
15
|
-
},
|
|
16
|
-
type ScreenOptions =
|
|
2784
|
+
declare const ScreenOptionsSchema: ZodObject<{
|
|
2785
|
+
name: ZodString;
|
|
2786
|
+
icon: ZodOptional<ZodString>;
|
|
2787
|
+
badgeCount: ZodOptional<ZodNumber>;
|
|
2788
|
+
hidden: ZodDefault<ZodOptional<ZodBoolean>>;
|
|
2789
|
+
static: ZodDefault<ZodOptional<ZodBoolean>>;
|
|
2790
|
+
}, $strip>;
|
|
2791
|
+
type ScreenOptions = output<typeof ScreenOptionsSchema>;
|
|
17
2792
|
//#endregion
|
|
18
2793
|
//#region src/schemas/logger-options.d.ts
|
|
19
|
-
declare const LoggerOptionsSchema:
|
|
20
|
-
screen:
|
|
21
|
-
name:
|
|
22
|
-
icon:
|
|
23
|
-
badgeCount:
|
|
24
|
-
hidden:
|
|
25
|
-
static:
|
|
26
|
-
},
|
|
27
|
-
context:
|
|
28
|
-
enabledLevels:
|
|
2794
|
+
declare const LoggerOptionsSchema: ZodObject<{
|
|
2795
|
+
screen: ZodDefault<ZodOptional<ZodUnion<[ZodObject<{
|
|
2796
|
+
name: ZodString;
|
|
2797
|
+
icon: ZodOptional<ZodString>;
|
|
2798
|
+
badgeCount: ZodOptional<ZodNumber>;
|
|
2799
|
+
hidden: ZodDefault<ZodOptional<ZodBoolean>>;
|
|
2800
|
+
static: ZodDefault<ZodOptional<ZodBoolean>>;
|
|
2801
|
+
}, $strip>, ZodString]>>>;
|
|
2802
|
+
context: ZodOptional<ZodString>;
|
|
2803
|
+
enabledLevels: ZodDefault<ZodArray<ZodEnum<{
|
|
29
2804
|
verbose: "verbose";
|
|
30
2805
|
debug: "debug";
|
|
31
2806
|
log: "log";
|
|
@@ -33,20 +2808,20 @@ declare const LoggerOptionsSchema: z.ZodObject<{
|
|
|
33
2808
|
error: "error";
|
|
34
2809
|
fatal: "fatal";
|
|
35
2810
|
}>>>;
|
|
36
|
-
},
|
|
37
|
-
type LoggerOptions =
|
|
2811
|
+
}, $strip>;
|
|
2812
|
+
type LoggerOptions = output<typeof LoggerOptionsSchema>;
|
|
38
2813
|
//#endregion
|
|
39
2814
|
//#region src/schemas/prompt-options.d.ts
|
|
40
|
-
declare const PromptOptionsSchema:
|
|
41
|
-
screen:
|
|
42
|
-
name:
|
|
43
|
-
icon:
|
|
44
|
-
badgeCount:
|
|
45
|
-
hidden:
|
|
46
|
-
static:
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
type PromptOptions =
|
|
2815
|
+
declare const PromptOptionsSchema: ZodObject<{
|
|
2816
|
+
screen: ZodDefault<ZodOptional<ZodUnion<[ZodObject<{
|
|
2817
|
+
name: ZodString;
|
|
2818
|
+
icon: ZodOptional<ZodString>;
|
|
2819
|
+
badgeCount: ZodOptional<ZodNumber>;
|
|
2820
|
+
hidden: ZodDefault<ZodOptional<ZodBoolean>>;
|
|
2821
|
+
static: ZodDefault<ZodOptional<ZodBoolean>>;
|
|
2822
|
+
}, $strip>, ZodString]>>>;
|
|
2823
|
+
}, $strip>;
|
|
2824
|
+
type PromptOptions = output<typeof PromptOptionsSchema>;
|
|
50
2825
|
//#endregion
|
|
51
2826
|
//#region src/services/logger.d.ts
|
|
52
2827
|
declare class ScreenLoggerInstance implements LoggerService {
|
|
@@ -69,30 +2844,30 @@ declare class ScreenLoggerInstance implements LoggerService {
|
|
|
69
2844
|
diff(path: string, diffContent: string, view?: 'unified' | 'split'): this;
|
|
70
2845
|
fileError(path: string, content: string, errorLines: number[], startLine?: number): this;
|
|
71
2846
|
/**
|
|
72
|
-
|
|
73
|
-
|
|
2847
|
+
* Sonner-like promise handling
|
|
2848
|
+
*/
|
|
74
2849
|
promise<T>(promise: Promise<T>, options: PromiseOptions<T>): Promise<T>;
|
|
75
2850
|
/**
|
|
76
|
-
|
|
77
|
-
|
|
2851
|
+
* Create a loading message with manual resolution
|
|
2852
|
+
*/
|
|
78
2853
|
loading(message: string): LoadingHandle;
|
|
79
2854
|
/**
|
|
80
|
-
|
|
81
|
-
|
|
2855
|
+
* Create a progress bar with manual updates
|
|
2856
|
+
*/
|
|
82
2857
|
progress(label: string, options: {
|
|
83
2858
|
total: number;
|
|
84
2859
|
}): ProgressHandle;
|
|
85
2860
|
/**
|
|
86
|
-
|
|
87
|
-
|
|
2861
|
+
* Start a collapsible log group
|
|
2862
|
+
*/
|
|
88
2863
|
group(label: string): this;
|
|
89
2864
|
/**
|
|
90
|
-
|
|
91
|
-
|
|
2865
|
+
* End the current log group
|
|
2866
|
+
*/
|
|
92
2867
|
groupEnd(): this;
|
|
93
2868
|
/**
|
|
94
|
-
|
|
95
|
-
|
|
2869
|
+
* Display tabular data
|
|
2870
|
+
*/
|
|
96
2871
|
table(data: Record<string, unknown>[], options?: {
|
|
97
2872
|
title?: string;
|
|
98
2873
|
}): this;
|
|
@@ -248,21 +3023,6 @@ declare const PROMPT_COLORS: {
|
|
|
248
3023
|
};
|
|
249
3024
|
//#endregion
|
|
250
3025
|
//#region src/utils/colors/helpers.d.ts
|
|
251
|
-
/**
|
|
252
|
-
* Creates a tinted (subtle) version of a color by setting alpha.
|
|
253
|
-
*
|
|
254
|
-
* @param color - The base color (hex string or RGBA)
|
|
255
|
-
* @param alpha - Target alpha value (0-1), default 0.08 for subtle tinting
|
|
256
|
-
* @returns New RGBA with adjusted alpha
|
|
257
|
-
*/
|
|
258
|
-
declare function createTintedColor(color: string | RGBA, alpha?: number): RGBA;
|
|
259
|
-
/**
|
|
260
|
-
* Creates a more prominent version of a color for borders.
|
|
261
|
-
*
|
|
262
|
-
* @param color - The base color
|
|
263
|
-
* @param alpha - Target alpha, default 1.0 for solid borders
|
|
264
|
-
*/
|
|
265
|
-
declare function createBorderColor(color: string | RGBA, alpha?: number): RGBA;
|
|
266
3026
|
/**
|
|
267
3027
|
* Gets colors for a specific log level.
|
|
268
3028
|
*
|
|
@@ -292,6 +3052,11 @@ declare function resolveFiletype(filePath: string): string | undefined;
|
|
|
292
3052
|
declare function getFileName(filePath: string): string;
|
|
293
3053
|
//#endregion
|
|
294
3054
|
//#region src/utils/stdout-printer.d.ts
|
|
3055
|
+
/**
|
|
3056
|
+
* Print a single message to stdout with optional screen name prefix.
|
|
3057
|
+
* Used for immediate output in stdout mode (when OpenTUI is not active).
|
|
3058
|
+
*/
|
|
3059
|
+
declare function printSingleMessage(message: MessageData, screenName?: string, isError?: boolean): void;
|
|
295
3060
|
/**
|
|
296
3061
|
* Print all messages to stdout (or stderr if isError)
|
|
297
3062
|
*/
|
|
@@ -307,8 +3072,26 @@ declare function formatObject(obj: unknown, depth?: number, currentDepth?: numbe
|
|
|
307
3072
|
*/
|
|
308
3073
|
declare function captureTrace(offset?: number): string;
|
|
309
3074
|
//#endregion
|
|
3075
|
+
//#region src/utils/runtime.d.ts
|
|
3076
|
+
/**
|
|
3077
|
+
* Detect if running in Bun environment (OpenTUI is not supported in Bun)
|
|
3078
|
+
*/
|
|
3079
|
+
declare function isBunRuntime(): boolean;
|
|
3080
|
+
/**
|
|
3081
|
+
* Dynamic import that bypasses bundler static analysis.
|
|
3082
|
+
* Uses Function constructor to prevent bundlers from resolving the import at build time.
|
|
3083
|
+
*/
|
|
3084
|
+
declare function dynamicImport<T = unknown>(modulePath: string): Promise<T>;
|
|
3085
|
+
//#endregion
|
|
3086
|
+
//#region src/utils/prompt.d.ts
|
|
3087
|
+
/**
|
|
3088
|
+
* Get the default value for a prompt based on its type.
|
|
3089
|
+
* Used for resolving prompts when no interaction is possible.
|
|
3090
|
+
*/
|
|
3091
|
+
declare function getPromptDefaultValue(prompt: PromptData): string | boolean | string[];
|
|
3092
|
+
//#endregion
|
|
310
3093
|
//#region src/services/screen.d.ts
|
|
311
|
-
declare class ScreenInstance {
|
|
3094
|
+
declare class ScreenInstance extends EventEmitter<ScreenEventMap> {
|
|
312
3095
|
private id;
|
|
313
3096
|
private name;
|
|
314
3097
|
private icon?;
|
|
@@ -317,7 +3100,6 @@ declare class ScreenInstance {
|
|
|
317
3100
|
private hidden;
|
|
318
3101
|
private messages;
|
|
319
3102
|
private manager;
|
|
320
|
-
private changeListeners;
|
|
321
3103
|
private printFn;
|
|
322
3104
|
private hasPrinted;
|
|
323
3105
|
private version;
|
|
@@ -327,12 +3109,12 @@ declare class ScreenInstance {
|
|
|
327
3109
|
incrementVersion(): void;
|
|
328
3110
|
getVersion(): number;
|
|
329
3111
|
/**
|
|
330
|
-
|
|
331
|
-
|
|
3112
|
+
* Internal: Set the manager reference
|
|
3113
|
+
*/
|
|
332
3114
|
_setManager(manager: ScreenManagerInstance): void;
|
|
333
3115
|
/**
|
|
334
|
-
|
|
335
|
-
|
|
3116
|
+
* Internal: Set the print function for stdout output
|
|
3117
|
+
*/
|
|
336
3118
|
_setPrintFn(fn: (messages: MessageData[], name: string, isError: boolean) => void): void;
|
|
337
3119
|
getId(): string;
|
|
338
3120
|
getName(): string;
|
|
@@ -345,251 +3127,303 @@ declare class ScreenInstance {
|
|
|
345
3127
|
hide(): this;
|
|
346
3128
|
getStatus(): ScreenStatus;
|
|
347
3129
|
/**
|
|
348
|
-
|
|
349
|
-
|
|
3130
|
+
* Check if a log level is enabled globally via the ScreenManager.
|
|
3131
|
+
* Returns true if no manager is set or if the level is allowed.
|
|
3132
|
+
*/
|
|
3133
|
+
isLogLevelEnabled(level: LogLevel): boolean;
|
|
3134
|
+
/**
|
|
3135
|
+
* Set screen status. When success/fail and not in TUI mode, prints to stdout/stderr
|
|
3136
|
+
*/
|
|
350
3137
|
setStatus(status: ScreenStatus): this;
|
|
351
3138
|
/**
|
|
352
|
-
|
|
353
|
-
|
|
3139
|
+
* Check if this screen is complete (success or fail)
|
|
3140
|
+
*/
|
|
354
3141
|
isComplete(): boolean;
|
|
355
3142
|
/**
|
|
356
|
-
|
|
357
|
-
|
|
3143
|
+
* Check if this screen has been printed to console.
|
|
3144
|
+
* Static screens in non-TUI modes are considered printed as they print incrementally.
|
|
3145
|
+
*/
|
|
358
3146
|
hasPrintedToConsole(): boolean;
|
|
359
3147
|
/**
|
|
360
|
-
|
|
361
|
-
|
|
3148
|
+
* Force print to console (called when TUI unbinds)
|
|
3149
|
+
*/
|
|
362
3150
|
_flushToConsole(force?: boolean): void;
|
|
363
3151
|
/**
|
|
364
|
-
|
|
365
|
-
|
|
3152
|
+
* Get all messages for rendering
|
|
3153
|
+
*/
|
|
366
3154
|
getMessages(): MessageData[];
|
|
367
3155
|
/**
|
|
368
|
-
|
|
369
|
-
|
|
3156
|
+
* Add a message to the screen (internal use by Logger)
|
|
3157
|
+
*/
|
|
370
3158
|
addMessage(message: MessageData): void;
|
|
371
3159
|
/**
|
|
372
|
-
|
|
373
|
-
|
|
3160
|
+
* Update a loading message (internal use by Logger)
|
|
3161
|
+
*/
|
|
374
3162
|
updateMessage(id: string, updates: Partial<LoadingMessageData>): void;
|
|
375
3163
|
/**
|
|
376
|
-
|
|
377
|
-
|
|
3164
|
+
* Update a progress message (internal use by Logger)
|
|
3165
|
+
*/
|
|
378
3166
|
updateProgressMessage(id: string, updates: Partial<ProgressMessageData>): void;
|
|
379
3167
|
/**
|
|
380
|
-
|
|
381
|
-
|
|
3168
|
+
* Clear all messages
|
|
3169
|
+
*/
|
|
382
3170
|
clear(): this;
|
|
383
3171
|
/**
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
3172
|
+
* Add a prompt to the queue (internal use by Prompt class)
|
|
3173
|
+
* Returns a promise that resolves when the user responds
|
|
3174
|
+
*/
|
|
387
3175
|
_addPrompt(prompt: PromptData): Promise<string | boolean | string[]>;
|
|
388
3176
|
/**
|
|
389
|
-
|
|
390
|
-
|
|
3177
|
+
* Resolve a prompt with its default value
|
|
3178
|
+
*/
|
|
391
3179
|
private resolvePromptWithDefault;
|
|
392
3180
|
/**
|
|
393
|
-
|
|
394
|
-
|
|
3181
|
+
* Get the currently active prompt (for rendering)
|
|
3182
|
+
*/
|
|
395
3183
|
getActivePrompt(): PromptData | null;
|
|
396
3184
|
/**
|
|
397
|
-
|
|
398
|
-
|
|
3185
|
+
* Check if this screen has an active prompt
|
|
3186
|
+
*/
|
|
399
3187
|
hasActivePrompt(): boolean;
|
|
400
3188
|
/**
|
|
401
|
-
|
|
402
|
-
|
|
3189
|
+
* Update prompt selection (for keyboard navigation)
|
|
3190
|
+
*/
|
|
403
3191
|
updatePromptSelection(index: number): void;
|
|
404
3192
|
/**
|
|
405
|
-
|
|
406
|
-
|
|
3193
|
+
* Navigate prompt selection up
|
|
3194
|
+
*/
|
|
407
3195
|
promptNavigateUp(): void;
|
|
408
3196
|
/**
|
|
409
|
-
|
|
410
|
-
|
|
3197
|
+
* Navigate prompt selection down
|
|
3198
|
+
*/
|
|
411
3199
|
promptNavigateDown(): void;
|
|
412
3200
|
/**
|
|
413
|
-
|
|
414
|
-
|
|
3201
|
+
* Toggle left/right for confirm prompts
|
|
3202
|
+
*/
|
|
415
3203
|
promptNavigateLeft(): void;
|
|
416
3204
|
promptNavigateRight(): void;
|
|
417
3205
|
/**
|
|
418
|
-
|
|
419
|
-
|
|
3206
|
+
* Toggle selection for multiChoice prompts
|
|
3207
|
+
*/
|
|
420
3208
|
promptToggleSelection(): void;
|
|
421
3209
|
/**
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
3210
|
+
* Enter input mode for choice prompts (if current selection allows input)
|
|
3211
|
+
* or for input prompts (always)
|
|
3212
|
+
*/
|
|
425
3213
|
promptEnterInputMode(): boolean;
|
|
426
3214
|
/**
|
|
427
|
-
|
|
428
|
-
|
|
3215
|
+
* Exit input mode for choice prompts
|
|
3216
|
+
*/
|
|
429
3217
|
promptExitInputMode(): void;
|
|
430
3218
|
/**
|
|
431
|
-
|
|
432
|
-
|
|
3219
|
+
* Check if prompt is in input mode
|
|
3220
|
+
*/
|
|
433
3221
|
isPromptInInputMode(): boolean;
|
|
434
3222
|
/**
|
|
435
|
-
|
|
436
|
-
|
|
3223
|
+
* Update input value for choice prompts
|
|
3224
|
+
*/
|
|
437
3225
|
promptUpdateInput(value: string): void;
|
|
438
3226
|
/**
|
|
439
|
-
|
|
440
|
-
|
|
3227
|
+
* Append character to input
|
|
3228
|
+
*/
|
|
441
3229
|
promptAppendInput(char: string): void;
|
|
442
3230
|
/**
|
|
443
|
-
|
|
444
|
-
|
|
3231
|
+
* Delete last character from input
|
|
3232
|
+
*/
|
|
445
3233
|
promptDeleteLastChar(): void;
|
|
446
3234
|
/**
|
|
447
|
-
|
|
448
|
-
|
|
3235
|
+
* Check if multiChoice prompt can be submitted (meets minSelect requirement)
|
|
3236
|
+
*/
|
|
449
3237
|
canSubmitPrompt(): boolean;
|
|
450
3238
|
/**
|
|
451
|
-
|
|
452
|
-
|
|
3239
|
+
* Submit the current prompt selection
|
|
3240
|
+
*/
|
|
453
3241
|
promptSubmit(): void;
|
|
454
3242
|
/**
|
|
455
|
-
|
|
456
|
-
|
|
3243
|
+
* Activate the next prompt in the queue
|
|
3244
|
+
*/
|
|
457
3245
|
private activateNextPrompt;
|
|
458
3246
|
/**
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
private notifyChange;
|
|
3247
|
+
* Print a single message immediately to stdout (for static screens in stdout mode)
|
|
3248
|
+
*/
|
|
3249
|
+
private printSingleMessageToConsole;
|
|
463
3250
|
/**
|
|
464
|
-
|
|
465
|
-
|
|
3251
|
+
* Print all messages to stdout/stderr with ANSI colors
|
|
3252
|
+
*/
|
|
466
3253
|
private printToConsole;
|
|
467
3254
|
}
|
|
468
3255
|
//#endregion
|
|
469
3256
|
//#region src/services/screen_manager.d.ts
|
|
470
|
-
declare class ScreenManagerInstance implements OnServiceDestroy {
|
|
3257
|
+
declare class ScreenManagerInstance extends EventEmitter<ScreenManagerEventMap> implements OnServiceDestroy {
|
|
471
3258
|
private screens;
|
|
472
3259
|
private screenOrder;
|
|
473
3260
|
private activeScreenId;
|
|
474
3261
|
private renderer;
|
|
475
3262
|
private root;
|
|
476
3263
|
private adapter;
|
|
477
|
-
private
|
|
478
|
-
private
|
|
3264
|
+
private container;
|
|
3265
|
+
private mode;
|
|
3266
|
+
private readlinePromptService;
|
|
479
3267
|
private bindOptions;
|
|
480
3268
|
private autoCloseTimer;
|
|
481
3269
|
private theme;
|
|
3270
|
+
private globalLogLevels;
|
|
482
3271
|
focusArea: FocusArea;
|
|
483
3272
|
selectedIndex: number;
|
|
3273
|
+
constructor();
|
|
484
3274
|
/**
|
|
485
|
-
|
|
486
|
-
|
|
3275
|
+
* Create a new screen and return it
|
|
3276
|
+
*/
|
|
487
3277
|
createScreen(options: ScreenOptions): ScreenInstance;
|
|
488
3278
|
getScreenByName(name: string): ScreenInstance | undefined;
|
|
489
3279
|
/**
|
|
490
|
-
|
|
491
|
-
|
|
3280
|
+
* Remove a screen dynamically
|
|
3281
|
+
*/
|
|
492
3282
|
removeScreen(screen: ScreenInstance): void;
|
|
493
3283
|
/**
|
|
494
|
-
|
|
495
|
-
|
|
3284
|
+
* Non-blocking bind - starts TUI rendering in background
|
|
3285
|
+
*/
|
|
496
3286
|
bind(options?: BindOptions): Promise<void>;
|
|
497
3287
|
/**
|
|
498
|
-
|
|
499
|
-
|
|
3288
|
+
* Get the current render mode
|
|
3289
|
+
*/
|
|
3290
|
+
getRenderMode(): RenderMode;
|
|
3291
|
+
/**
|
|
3292
|
+
* Check if TUI is interactive (any mode except UNBOUND).
|
|
3293
|
+
* In interactive modes, prompts can be handled via readline or TUI.
|
|
3294
|
+
*/
|
|
3295
|
+
isInteractive(): boolean;
|
|
3296
|
+
/**
|
|
3297
|
+
* Check if TUI rendering is active (TUI_ACTIVE mode).
|
|
3298
|
+
* When true, screens are rendered in the TUI and not printed to stdout.
|
|
3299
|
+
*/
|
|
3300
|
+
hasTuiRenderer(): boolean;
|
|
3301
|
+
/**
|
|
3302
|
+
* Handle a prompt via readline (for stdout modes)
|
|
3303
|
+
*/
|
|
3304
|
+
handleReadlinePrompt(prompt: PromptData): Promise<string | boolean | string[]>;
|
|
3305
|
+
/**
|
|
3306
|
+
* Get the configured theme
|
|
3307
|
+
*/
|
|
500
3308
|
getTheme(): Theme | undefined;
|
|
3309
|
+
/**
|
|
3310
|
+
* Setup global configuration for the screen manager.
|
|
3311
|
+
* Can be called before or after bind() to configure theme and log levels.
|
|
3312
|
+
*/
|
|
3313
|
+
setup(options: SetupOptions): void;
|
|
3314
|
+
/**
|
|
3315
|
+
* Check if a log level is enabled globally.
|
|
3316
|
+
* Returns true if no global filter is set, or if the level is in the allowed set.
|
|
3317
|
+
*/
|
|
3318
|
+
isLogLevelEnabled(level: LogLevel): boolean;
|
|
3319
|
+
/**
|
|
3320
|
+
* Get the current global log levels filter.
|
|
3321
|
+
* Returns null if no filter is set (all levels allowed).
|
|
3322
|
+
*/
|
|
3323
|
+
getGlobalLogLevels(): LogLevel[] | null;
|
|
501
3324
|
onServiceDestroy(): void;
|
|
502
3325
|
/**
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
3326
|
+
* Stop TUI rendering and cleanup
|
|
3327
|
+
* Flushes screens to stdout/stderr based on mode
|
|
3328
|
+
*/
|
|
506
3329
|
unbind(): void;
|
|
507
3330
|
/**
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
private
|
|
3331
|
+
* Flush screens on exit based on the mode we're exiting from
|
|
3332
|
+
*/
|
|
3333
|
+
private flushScreensOnExit;
|
|
511
3334
|
/**
|
|
512
|
-
|
|
513
|
-
|
|
3335
|
+
* Flush any remaining non-hidden screens that haven't been printed.
|
|
3336
|
+
* Called on destroy even in UNBOUND mode to handle forgotten completions.
|
|
3337
|
+
*/
|
|
3338
|
+
private flushRemainingScreens;
|
|
3339
|
+
/**
|
|
3340
|
+
* Check if TUI is currently bound
|
|
3341
|
+
* @deprecated Use isInteractive() instead
|
|
3342
|
+
*/
|
|
514
3343
|
isTuiBound(): boolean;
|
|
515
3344
|
/**
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
3345
|
+
* Check if TUI rendering is active (has renderer or self-rendering adapter).
|
|
3346
|
+
* @deprecated Use hasTuiRenderer() instead
|
|
3347
|
+
*/
|
|
3348
|
+
isTuiRendererActive(): boolean;
|
|
3349
|
+
/**
|
|
3350
|
+
* Check if OpenTUI rendering is active (has renderer).
|
|
3351
|
+
* @deprecated Use hasTuiRenderer() instead
|
|
3352
|
+
*/
|
|
3353
|
+
isOpenTUIActive(): boolean;
|
|
3354
|
+
/**
|
|
3355
|
+
* Called by Screen when a prompt becomes active
|
|
3356
|
+
* Focuses the screen and switches to content area
|
|
3357
|
+
*/
|
|
519
3358
|
onScreenPromptActivated(screen: ScreenInstance): void;
|
|
520
3359
|
/**
|
|
521
|
-
|
|
522
|
-
|
|
3360
|
+
* Check if any screen has an active prompt
|
|
3361
|
+
*/
|
|
523
3362
|
hasActivePrompt(): boolean;
|
|
524
3363
|
/**
|
|
525
|
-
|
|
526
|
-
|
|
3364
|
+
* Get the screen with an active prompt (if any)
|
|
3365
|
+
*/
|
|
527
3366
|
getScreenWithActivePrompt(): ScreenInstance | null;
|
|
528
3367
|
/**
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
3368
|
+
* Called by Screen when visibility changes
|
|
3369
|
+
* Handles switching active screen if needed
|
|
3370
|
+
*/
|
|
532
3371
|
onScreenVisibilityChanged(screen: ScreenInstance): void;
|
|
533
3372
|
/**
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
3373
|
+
* Called by Screen when status becomes success/fail
|
|
3374
|
+
* Moves completed screens to end of sidebar list
|
|
3375
|
+
*/
|
|
537
3376
|
onScreenCompleted(screen: ScreenInstance): void;
|
|
538
3377
|
/**
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
3378
|
+
* Check if all screens are successful (or only static) and start auto-close timer if enabled.
|
|
3379
|
+
* Static screens are ignored in this calculation.
|
|
3380
|
+
* If there are only static screens, the timer will trigger after the delay with no new activity.
|
|
3381
|
+
*/
|
|
543
3382
|
private checkAutoClose;
|
|
544
3383
|
/**
|
|
545
|
-
|
|
546
|
-
|
|
3384
|
+
* Get visible screens in display order (excludes hidden screens)
|
|
3385
|
+
*/
|
|
547
3386
|
getScreens(): ScreenInstance[];
|
|
548
3387
|
/**
|
|
549
|
-
|
|
550
|
-
|
|
3388
|
+
* Get all screens in display order (includes hidden screens)
|
|
3389
|
+
*/
|
|
551
3390
|
getAllScreens(): ScreenInstance[];
|
|
552
3391
|
/**
|
|
553
|
-
|
|
554
|
-
|
|
3392
|
+
* Get the active screen
|
|
3393
|
+
*/
|
|
555
3394
|
getActiveScreen(): ScreenInstance | null;
|
|
556
3395
|
/**
|
|
557
|
-
|
|
558
|
-
|
|
3396
|
+
* Set the active screen
|
|
3397
|
+
*/
|
|
559
3398
|
setActiveScreen(screen: ScreenInstance): void;
|
|
560
3399
|
/**
|
|
561
|
-
|
|
562
|
-
|
|
3400
|
+
* Get bind options
|
|
3401
|
+
*/
|
|
563
3402
|
getBindOptions(): BindOptions;
|
|
564
3403
|
/**
|
|
565
|
-
|
|
566
|
-
|
|
3404
|
+
* Set focus area (sidebar or content)
|
|
3405
|
+
*/
|
|
567
3406
|
setFocusArea(area: FocusArea): void;
|
|
568
3407
|
/**
|
|
569
|
-
|
|
570
|
-
|
|
3408
|
+
* Set selected index in sidebar
|
|
3409
|
+
*/
|
|
571
3410
|
setSelectedIndex(index: number): void;
|
|
572
3411
|
/**
|
|
573
|
-
|
|
574
|
-
|
|
3412
|
+
* Navigate sidebar up
|
|
3413
|
+
*/
|
|
575
3414
|
navigateUp(): void;
|
|
576
3415
|
/**
|
|
577
|
-
|
|
578
|
-
|
|
3416
|
+
* Navigate sidebar down
|
|
3417
|
+
*/
|
|
579
3418
|
navigateDown(): void;
|
|
580
3419
|
/**
|
|
581
|
-
|
|
582
|
-
|
|
3420
|
+
* Select the currently highlighted screen
|
|
3421
|
+
*/
|
|
583
3422
|
selectCurrent(): void;
|
|
584
3423
|
/**
|
|
585
|
-
|
|
586
|
-
|
|
3424
|
+
* Toggle focus between sidebar and content
|
|
3425
|
+
*/
|
|
587
3426
|
toggleFocus(): void;
|
|
588
|
-
/**
|
|
589
|
-
* Register a change listener for re-renders
|
|
590
|
-
*/
|
|
591
|
-
onChange(listener: () => void): () => void;
|
|
592
|
-
private notifyChange;
|
|
593
3427
|
private render;
|
|
594
3428
|
}
|
|
595
3429
|
//#endregion
|
|
@@ -602,88 +3436,166 @@ declare class PromptInstance {
|
|
|
602
3436
|
private screen;
|
|
603
3437
|
constructor(options: PromptOptions);
|
|
604
3438
|
/**
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
3439
|
+
* Display a choice prompt and wait for user selection.
|
|
3440
|
+
* Returns the selected value (or input text if an input option was selected).
|
|
3441
|
+
*/
|
|
608
3442
|
choice(options: ChoiceOptions): Promise<string>;
|
|
609
3443
|
/**
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
3444
|
+
* Display a confirmation prompt and wait for user response.
|
|
3445
|
+
* Returns true for confirm, false for cancel.
|
|
3446
|
+
*/
|
|
613
3447
|
confirm(options: ConfirmOptions): Promise<boolean>;
|
|
614
3448
|
/**
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
3449
|
+
* Display a text input prompt and wait for user input.
|
|
3450
|
+
* Returns the entered text.
|
|
3451
|
+
*/
|
|
618
3452
|
input(options: InputOptions): Promise<string>;
|
|
619
3453
|
/**
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
3454
|
+
* Display a multi-select choice prompt.
|
|
3455
|
+
* Returns an array of selected values.
|
|
3456
|
+
*/
|
|
623
3457
|
multiChoice(options: MultiChoiceOptions): Promise<string[]>;
|
|
624
3458
|
}
|
|
625
3459
|
//#endregion
|
|
3460
|
+
//#region src/services/readline_prompt.d.ts
|
|
3461
|
+
/**
|
|
3462
|
+
* Readline-based prompt service for stdout mode.
|
|
3463
|
+
* Provides basic interactive prompts when TUI adapter is not available.
|
|
3464
|
+
*/
|
|
3465
|
+
declare class ReadlinePromptService {
|
|
3466
|
+
private rl;
|
|
3467
|
+
private promptQueue;
|
|
3468
|
+
private isProcessing;
|
|
3469
|
+
private ensureInterface;
|
|
3470
|
+
/**
|
|
3471
|
+
* Handle a prompt interactively via readline.
|
|
3472
|
+
* Prompts are queued and processed sequentially.
|
|
3473
|
+
*/
|
|
3474
|
+
handlePrompt(prompt: PromptData): Promise<string | boolean | string[]>;
|
|
3475
|
+
private processQueue;
|
|
3476
|
+
private processPrompt;
|
|
3477
|
+
private handleChoice;
|
|
3478
|
+
private handleConfirm;
|
|
3479
|
+
private handleInput;
|
|
3480
|
+
private handleMultiChoice;
|
|
3481
|
+
/**
|
|
3482
|
+
* Cleanup readline interface
|
|
3483
|
+
*/
|
|
3484
|
+
destroy(): void;
|
|
3485
|
+
}
|
|
3486
|
+
//#endregion
|
|
626
3487
|
//#region src/tokens/screen.d.ts
|
|
627
|
-
declare const Screen: InjectionToken<ScreenInstance,
|
|
628
|
-
name:
|
|
629
|
-
icon:
|
|
630
|
-
badgeCount:
|
|
631
|
-
hidden:
|
|
632
|
-
static:
|
|
633
|
-
},
|
|
3488
|
+
declare const Screen: InjectionToken<ScreenInstance, ZodObject<{
|
|
3489
|
+
name: ZodString;
|
|
3490
|
+
icon: ZodOptional<ZodString>;
|
|
3491
|
+
badgeCount: ZodOptional<ZodNumber>;
|
|
3492
|
+
hidden: ZodDefault<ZodOptional<ZodBoolean>>;
|
|
3493
|
+
static: ZodDefault<ZodOptional<ZodBoolean>>;
|
|
3494
|
+
}, $strip>, true>;
|
|
634
3495
|
//#endregion
|
|
635
3496
|
//#region src/tokens/logger.d.ts
|
|
636
|
-
declare const ScreenLogger: InjectionToken<ScreenLoggerInstance,
|
|
637
|
-
screen:
|
|
638
|
-
name:
|
|
639
|
-
icon:
|
|
640
|
-
badgeCount:
|
|
641
|
-
hidden:
|
|
642
|
-
static:
|
|
643
|
-
},
|
|
644
|
-
context:
|
|
645
|
-
enabledLevels:
|
|
646
|
-
log: "log";
|
|
3497
|
+
declare const ScreenLogger: InjectionToken<ScreenLoggerInstance, ZodObject<{
|
|
3498
|
+
screen: ZodDefault<ZodOptional<ZodUnion<[ZodObject<{
|
|
3499
|
+
name: ZodString;
|
|
3500
|
+
icon: ZodOptional<ZodString>;
|
|
3501
|
+
badgeCount: ZodOptional<ZodNumber>;
|
|
3502
|
+
hidden: ZodDefault<ZodOptional<ZodBoolean>>;
|
|
3503
|
+
static: ZodDefault<ZodOptional<ZodBoolean>>;
|
|
3504
|
+
}, $strip>, ZodString]>>>;
|
|
3505
|
+
context: ZodOptional<ZodString>;
|
|
3506
|
+
enabledLevels: ZodDefault<ZodArray<ZodEnum<{
|
|
647
3507
|
verbose: "verbose";
|
|
648
3508
|
debug: "debug";
|
|
3509
|
+
log: "log";
|
|
649
3510
|
warn: "warn";
|
|
650
3511
|
error: "error";
|
|
651
3512
|
fatal: "fatal";
|
|
652
3513
|
}>>>;
|
|
653
|
-
},
|
|
3514
|
+
}, $strip>, true>;
|
|
654
3515
|
/**
|
|
655
3516
|
* Isomorphic logger token for shared logger between TUI and Server.
|
|
656
3517
|
* This token is used to inject the logger instance into the application.
|
|
657
3518
|
*/
|
|
658
|
-
declare const IsomorphicLogger: InjectionToken<IsomorphicLoggerInterface,
|
|
659
|
-
screen:
|
|
660
|
-
name:
|
|
661
|
-
icon:
|
|
662
|
-
badgeCount:
|
|
663
|
-
hidden:
|
|
664
|
-
static:
|
|
665
|
-
},
|
|
666
|
-
context:
|
|
667
|
-
enabledLevels:
|
|
668
|
-
log: "log";
|
|
3519
|
+
declare const IsomorphicLogger: InjectionToken<IsomorphicLoggerInterface, ZodObject<{
|
|
3520
|
+
screen: ZodDefault<ZodOptional<ZodUnion<[ZodObject<{
|
|
3521
|
+
name: ZodString;
|
|
3522
|
+
icon: ZodOptional<ZodString>;
|
|
3523
|
+
badgeCount: ZodOptional<ZodNumber>;
|
|
3524
|
+
hidden: ZodDefault<ZodOptional<ZodBoolean>>;
|
|
3525
|
+
static: ZodDefault<ZodOptional<ZodBoolean>>;
|
|
3526
|
+
}, $strip>, ZodString]>>>;
|
|
3527
|
+
context: ZodOptional<ZodString>;
|
|
3528
|
+
enabledLevels: ZodDefault<ZodArray<ZodEnum<{
|
|
669
3529
|
verbose: "verbose";
|
|
670
3530
|
debug: "debug";
|
|
3531
|
+
log: "log";
|
|
671
3532
|
warn: "warn";
|
|
672
3533
|
error: "error";
|
|
673
3534
|
fatal: "fatal";
|
|
674
3535
|
}>>>;
|
|
675
|
-
},
|
|
3536
|
+
}, $strip>, true>;
|
|
676
3537
|
//#endregion
|
|
677
3538
|
//#region src/tokens/prompt.d.ts
|
|
678
|
-
declare const Prompt: InjectionToken<PromptInstance,
|
|
679
|
-
screen:
|
|
680
|
-
name:
|
|
681
|
-
icon:
|
|
682
|
-
badgeCount:
|
|
683
|
-
hidden:
|
|
684
|
-
static:
|
|
685
|
-
},
|
|
686
|
-
},
|
|
3539
|
+
declare const Prompt: InjectionToken<PromptInstance, ZodObject<{
|
|
3540
|
+
screen: ZodDefault<ZodOptional<ZodUnion<[ZodObject<{
|
|
3541
|
+
name: ZodString;
|
|
3542
|
+
icon: ZodOptional<ZodString>;
|
|
3543
|
+
badgeCount: ZodOptional<ZodNumber>;
|
|
3544
|
+
hidden: ZodDefault<ZodOptional<ZodBoolean>>;
|
|
3545
|
+
static: ZodDefault<ZodOptional<ZodBoolean>>;
|
|
3546
|
+
}, $strip>, ZodString]>>>;
|
|
3547
|
+
}, $strip>, true>;
|
|
3548
|
+
//#endregion
|
|
3549
|
+
//#region src/adapters/interface.d.ts
|
|
3550
|
+
/**
|
|
3551
|
+
* Root instance returned by adapter's createRoot method.
|
|
3552
|
+
* Abstracts the framework-specific root implementation.
|
|
3553
|
+
*/
|
|
3554
|
+
interface AdapterRoot {
|
|
3555
|
+
/**
|
|
3556
|
+
* Render an element to the root.
|
|
3557
|
+
* @param element - Framework-specific element to render
|
|
3558
|
+
*/
|
|
3559
|
+
render(element: unknown): void;
|
|
3560
|
+
/**
|
|
3561
|
+
* Unmount and cleanup the root.
|
|
3562
|
+
*/
|
|
3563
|
+
unmount(): void;
|
|
3564
|
+
}
|
|
3565
|
+
/**
|
|
3566
|
+
* Props passed to the adapter's internal bridge component.
|
|
3567
|
+
* The manager type is kept generic to avoid circular imports.
|
|
3568
|
+
*/
|
|
3569
|
+
interface AdapterRenderProps {
|
|
3570
|
+
manager: unknown;
|
|
3571
|
+
theme?: Theme;
|
|
3572
|
+
}
|
|
3573
|
+
/**
|
|
3574
|
+
* Abstract interface for rendering adapters.
|
|
3575
|
+
* Implementations provide framework-specific rendering capabilities.
|
|
3576
|
+
*/
|
|
3577
|
+
interface AdapterInterface {
|
|
3578
|
+
/**
|
|
3579
|
+
* Whether this adapter handles its own rendering without requiring
|
|
3580
|
+
* the ScreenManager to create an OpenTUI CliRenderer.
|
|
3581
|
+
* When true, createRoot() will be called without a renderer argument.
|
|
3582
|
+
* @default false
|
|
3583
|
+
*/
|
|
3584
|
+
readonly handlesOwnRenderer?: boolean;
|
|
3585
|
+
/**
|
|
3586
|
+
* Create a root instance for rendering.
|
|
3587
|
+
* @param renderer - CLI renderer from @opentui/core (undefined if handlesOwnRenderer is true)
|
|
3588
|
+
* @returns Root instance with render/unmount methods, or a Promise that resolves to one
|
|
3589
|
+
*/
|
|
3590
|
+
createRoot(renderer?: CliRenderer): AdapterRoot | Promise<AdapterRoot>;
|
|
3591
|
+
/**
|
|
3592
|
+
* Render the adapter's internal bridge component to the root.
|
|
3593
|
+
* The adapter owns its bridge component - no component is passed in.
|
|
3594
|
+
* @param root - Root instance created by createRoot
|
|
3595
|
+
* @param props - Props to pass to the bridge component
|
|
3596
|
+
*/
|
|
3597
|
+
renderToRoot(root: AdapterRoot, props: AdapterRenderProps): void;
|
|
3598
|
+
}
|
|
687
3599
|
//#endregion
|
|
688
3600
|
//#region src/tokens/adapter.d.ts
|
|
689
3601
|
/**
|
|
@@ -716,7 +3628,17 @@ declare class ScreenFactory {
|
|
|
716
3628
|
declare function overrideConsoleLogger(hidden?: boolean): ClassTypeWithInstance<LoggerService>;
|
|
717
3629
|
//#endregion
|
|
718
3630
|
//#region src/overrides/missing-adapter.override.d.ts
|
|
3631
|
+
/**
|
|
3632
|
+
* Fallback adapter that is used when no TUI adapter is registered.
|
|
3633
|
+
* The `isMissingAdapter` marker allows ScreenManager to detect this
|
|
3634
|
+
* and gracefully fall back to stdout mode instead of throwing.
|
|
3635
|
+
*/
|
|
719
3636
|
declare class MissingAdapterOverride implements AdapterInterface {
|
|
3637
|
+
/**
|
|
3638
|
+
* Marker property to identify this as the missing adapter fallback.
|
|
3639
|
+
* Used by ScreenManager.bind() to detect and handle graceful fallback.
|
|
3640
|
+
*/
|
|
3641
|
+
readonly isMissingAdapter = true;
|
|
720
3642
|
createRoot(): AdapterRoot;
|
|
721
3643
|
renderToRoot(): void;
|
|
722
3644
|
}
|
|
@@ -772,53 +3694,53 @@ declare class KeyboardManager {
|
|
|
772
3694
|
private disabled;
|
|
773
3695
|
constructor(config?: KeyBindingsConfig);
|
|
774
3696
|
/**
|
|
775
|
-
|
|
776
|
-
|
|
3697
|
+
* Add bindings to the manager.
|
|
3698
|
+
*/
|
|
777
3699
|
addBindings(bindings: KeyBinding[]): void;
|
|
778
3700
|
/**
|
|
779
|
-
|
|
780
|
-
|
|
3701
|
+
* Remove a binding by key name.
|
|
3702
|
+
*/
|
|
781
3703
|
removeBinding(key: string): void;
|
|
782
3704
|
/**
|
|
783
|
-
|
|
784
|
-
|
|
3705
|
+
* Disable a key (prevents it from being matched).
|
|
3706
|
+
*/
|
|
785
3707
|
disableKey(key: string): void;
|
|
786
3708
|
/**
|
|
787
|
-
|
|
788
|
-
|
|
3709
|
+
* Enable a previously disabled key.
|
|
3710
|
+
*/
|
|
789
3711
|
enableKey(key: string): void;
|
|
790
3712
|
/**
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
3713
|
+
* Handle a key event, dispatching to the appropriate handler.
|
|
3714
|
+
* Returns true if a handler consumed the event.
|
|
3715
|
+
*/
|
|
794
3716
|
handleKey(key: KeyEvent, context: KeyboardContext): boolean;
|
|
795
3717
|
/**
|
|
796
|
-
|
|
797
|
-
|
|
3718
|
+
* Get all bindings for display in help overlay.
|
|
3719
|
+
*/
|
|
798
3720
|
getBindingsForHelp(): KeyBinding[];
|
|
799
3721
|
/**
|
|
800
|
-
|
|
801
|
-
|
|
3722
|
+
* Get bindings grouped by category.
|
|
3723
|
+
*/
|
|
802
3724
|
getBindingsByCategory(): Record<KeyBindingCategory, KeyBinding[]>;
|
|
803
3725
|
/**
|
|
804
|
-
|
|
805
|
-
|
|
3726
|
+
* Find a matching binding for the given key and context.
|
|
3727
|
+
*/
|
|
806
3728
|
private findMatchingBinding;
|
|
807
3729
|
/**
|
|
808
|
-
|
|
809
|
-
|
|
3730
|
+
* Check if a key event matches a binding's key specification.
|
|
3731
|
+
*/
|
|
810
3732
|
private keyMatches;
|
|
811
3733
|
/**
|
|
812
|
-
|
|
813
|
-
|
|
3734
|
+
* Check if context matches a binding's condition.
|
|
3735
|
+
*/
|
|
814
3736
|
private conditionMatches;
|
|
815
3737
|
/**
|
|
816
|
-
|
|
817
|
-
|
|
3738
|
+
* Check if a binding is disabled.
|
|
3739
|
+
*/
|
|
818
3740
|
private isDisabled;
|
|
819
3741
|
/**
|
|
820
|
-
|
|
821
|
-
|
|
3742
|
+
* Sort bindings by priority (higher first).
|
|
3743
|
+
*/
|
|
822
3744
|
private sortBindings;
|
|
823
3745
|
}
|
|
824
3746
|
/**
|
|
@@ -857,18 +3779,18 @@ declare function handlePrintableInput(key: KeyEvent, context: KeyboardContext, h
|
|
|
857
3779
|
*/
|
|
858
3780
|
declare class FilterEngine {
|
|
859
3781
|
/**
|
|
860
|
-
|
|
861
|
-
|
|
3782
|
+
* Apply filter to messages array.
|
|
3783
|
+
*/
|
|
862
3784
|
static filterMessages(messages: MessageData[], filter: FilterState): MessageData[];
|
|
863
3785
|
/**
|
|
864
|
-
|
|
865
|
-
|
|
3786
|
+
* Check if a message matches the search query.
|
|
3787
|
+
*/
|
|
866
3788
|
private static messageMatchesSearch;
|
|
867
3789
|
/**
|
|
868
|
-
|
|
869
|
-
|
|
3790
|
+
* Count messages by log level.
|
|
3791
|
+
*/
|
|
870
3792
|
static countByLevel(messages: MessageData[]): LevelCounts;
|
|
871
3793
|
}
|
|
872
3794
|
//#endregion
|
|
873
|
-
export { ALL_LOG_LEVELS, Adapter, AdapterInterface, AdapterRenderProps, AdapterRoot, BaseMessage, BasePromptData, BindOptions, BindingHandlers, COMMON_FILETYPES, ChoiceOption, ChoiceOptions, ChoicePromptData, ConfirmOptions, ConfirmPromptData, DEFAULT_LOG_LEVEL_COLORS, DeepPartial, DiffMessageData, ERROR_HIGHLIGHT_COLORS, ErrorHighlightTheme, FILE_COLORS, FileErrorMessageData, FileLogBaseProps, FileLogDiffProps, FileLogFullProps, FileLogMode, FileLogPartialProps, FileLogProps, FileMessageData, FileTheme, FilterEngine, FilterState, FilterTheme, FocusArea, GROUP_COLORS, GroupMessageData, GroupTheme, HEADER_COLORS, HeaderTheme, HelpTheme, InputOptions, InputPromptData, IsomorphicLogger, IsomorphicLoggerFactory, IsomorphicLoggerInterface, KeyBinding, KeyBindingCategory, KeyBindingCondition, KeyBindingsConfig, KeyEvent, KeyHandler, KeyboardContext, KeyboardManager, LevelCounts, LoadingHandle, LoadingMessageData, LogLevelColorMap, LogLevelColors, LogLevelTheme, LogMessageData, LogMessageProps, LogMessageVariant, LoggerContextValue, LoggerOptions, LoggerOptionsSchema, MessageData, MessageType, MissingAdapterOverride, MultiChoiceOptions, MultiChoicePromptData, PROGRESS_COLORS, PROMPT_COLORS, PartialTheme, ProgressHandle, ProgressMessageData, ProgressTheme, PromiseOptions, Prompt, PromptData, PromptInstance, PromptOptions, PromptOptionsSchema, PromptTheme, SEPARATOR_COLORS, SIDEBAR_COLORS, STATUS_INDICATORS, Screen, ScreenDefinition, ScreenFactory, ScreenInstance, ScreenLogger, ScreenLoggerInstance, ScreenManager, ScreenManagerInstance, ScreenManagerProps, ScreenOptions, ScreenOptionsSchema, ScreenProps, ScreenStatus, SemanticColors, SeparatorTheme, SidebarTheme, StatusIndicator, StatusIndicatorsTheme, TABLE_COLORS, TableMessageData, TableTheme, Theme, ThemePreset, VARIANT_COLORS, VariantColorMap, captureTrace,
|
|
3795
|
+
export { ALL_LOG_LEVELS, Adapter, AdapterInterface, AdapterRenderProps, AdapterRoot, BaseMessage, BasePromptData, BindOptions, BindingHandlers, COMMON_FILETYPES, CONTENT_MANAGER_EVENTS, ChoiceOption, ChoiceOptions, ChoicePromptData, ConfirmOptions, ConfirmPromptData, DEFAULT_LOG_LEVEL_COLORS, DeepPartial, DiffMessageData, ERROR_HIGHLIGHT_COLORS, ErrorHighlightTheme, FILE_COLORS, FileErrorMessageData, FileLogBaseProps, FileLogDiffProps, FileLogFullProps, FileLogMode, FileLogPartialProps, FileLogProps, FileMessageData, FileTheme, FilterEngine, FilterState, FilterTheme, FocusArea, GROUP_COLORS, GroupMessageData, GroupTheme, HEADER_COLORS, HeaderTheme, HelpTheme, InputOptions, InputPromptData, IsomorphicLogger, IsomorphicLoggerFactory, IsomorphicLoggerInterface, KeyBinding, KeyBindingCategory, KeyBindingCondition, KeyBindingsConfig, KeyEvent, KeyHandler, KeyboardContext, KeyboardManager, LevelCounts, LoadingHandle, LoadingMessageData, LogLevelColorMap, LogLevelColors, LogLevelTheme, LogMessageData, LogMessageProps, LogMessageVariant, LoggerContextValue, LoggerOptions, LoggerOptionsSchema, MANAGER_EVENTS, MessageData, MessageType, MissingAdapterOverride, MultiChoiceOptions, MultiChoicePromptData, PROGRESS_COLORS, PROMPT_COLORS, PartialTheme, ProgressHandle, ProgressMessageData, ProgressTheme, PromiseOptions, Prompt, PromptData, PromptInstance, PromptOptions, PromptOptionsSchema, PromptTheme, ReadlinePromptService, RenderMode, SCREEN_EVENTS, SEPARATOR_COLORS, SIDEBAR_COLORS, SIDEBAR_EVENTS, STATUS_INDICATORS, Screen, ScreenDefinition, ScreenEventMap, ScreenEventType, ScreenFactory, ScreenInstance, ScreenLogger, ScreenLoggerInstance, ScreenManager, ScreenManagerEventMap, ScreenManagerEventType, ScreenManagerInstance, ScreenManagerProps, ScreenOptions, ScreenOptionsSchema, ScreenProps, ScreenStatus, SemanticColors, SeparatorTheme, SetupOptions, SidebarTheme, StatusIndicator, StatusIndicatorsTheme, TABLE_COLORS, TableMessageData, TableTheme, Theme, ThemePreset, VARIANT_COLORS, VariantColorMap, captureTrace, createDefaultBindings, createDefaultFilterState, createTheme, createThemeFrom, darkTheme, dynamicImport, formatKeyBinding, formatObject, getFileName, getLogLevelColors, getPromptDefaultValue, getThemePreset, handlePrintableInput, hasActiveFilter, highContrastTheme, isBunRuntime, lightTheme, mergeThemes, overrideConsoleLogger, printMessagesToStdout, printSingleMessage, resolveFiletype, resolveTheme };
|
|
874
3796
|
//# sourceMappingURL=index.d.cts.map
|