refactor(infra): hide utility option types · openclaw/openclaw@e098eb7
vincentkoc
·
2026-06-17
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -17,12 +17,12 @@ export function resolveTimezone(value: string): string | undefined {
|
17 | 17 | } |
18 | 18 | } |
19 | 19 | |
20 | | -export type FormatTimestampOptions = { |
| 20 | +type FormatTimestampOptions = { |
21 | 21 | /** Include seconds in the output. Default: false */ |
22 | 22 | displaySeconds?: boolean; |
23 | 23 | }; |
24 | 24 | |
25 | | -export type FormatZonedTimestampOptions = FormatTimestampOptions & { |
| 25 | +type FormatZonedTimestampOptions = FormatTimestampOptions & { |
26 | 26 | /** IANA timezone string (e.g., 'America/New_York'). Default: system timezone */ |
27 | 27 | timeZone?: string; |
28 | 28 | }; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -8,7 +8,7 @@
|
8 | 8 | * - `formatRelativeTimestamp(epochMs)` — format an epoch timestamp relative to now (handles future) |
9 | 9 | */ |
10 | 10 | |
11 | | -export type FormatTimeAgoOptions = { |
| 11 | +type FormatTimeAgoOptions = { |
12 | 12 | /** Append "ago" suffix. Default: true. When false, returns bare unit: "5m", "2h" */ |
13 | 13 | suffix?: boolean; |
14 | 14 | /** Return value for invalid/null/negative input. Default: "unknown" */ |
@@ -51,7 +51,7 @@ export function formatTimeAgo(
|
51 | 51 | return suffix ? `${days}d ago` : `${days}d`; |
52 | 52 | } |
53 | 53 | |
54 | | -export type FormatRelativeTimestampOptions = { |
| 54 | +type FormatRelativeTimestampOptions = { |
55 | 55 | /** If true, fall back to short date (e.g. "Oct 5") for timestamps >7 days. Default: false */ |
56 | 56 | dateFallback?: boolean; |
57 | 57 | /** IANA timezone for date fallback display */ |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -108,7 +108,7 @@ type GuardedFetchInternalOptions = GuardedFetchOptions & {
|
108 | 108 | useEnvProxyForEligibleUrls?: boolean; |
109 | 109 | }; |
110 | 110 | |
111 | | -export type GuardedFetchConfiguredLocalOriginOptions = GuardedFetchOptions & { |
| 111 | +type GuardedFetchConfiguredLocalOriginOptions = GuardedFetchOptions & { |
112 | 112 | configuredLocalOriginBaseUrl: string; |
113 | 113 | }; |
114 | 114 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -6,7 +6,7 @@ import type { ManagedProxyTlsOptions } from "./proxy-tls.js";
|
6 | 6 | export type ActiveManagedProxyUrl = Readonly<URL>; |
7 | 7 | |
8 | 8 | /** Managed proxy loopback behavior shared by gateway and child-process fetch paths. */ |
9 | | -export type ActiveManagedProxyLoopbackMode = NonNullable<NonNullable<ProxyConfig>["loopbackMode"]>; |
| 9 | +type ActiveManagedProxyLoopbackMode = NonNullable<NonNullable<ProxyConfig>["loopbackMode"]>; |
10 | 10 | |
11 | 11 | /** Ref-counted active proxy handle; callers must stop it when their proxy scope ends. */ |
12 | 12 | export type ActiveManagedProxyRegistration = { |
@@ -17,7 +17,7 @@ export type ActiveManagedProxyRegistration = {
|
17 | 17 | }; |
18 | 18 | |
19 | 19 | /** Registration metadata for managed proxy URLs and their TLS trust material. */ |
20 | | -export type RegisterActiveManagedProxyOptions = { |
| 20 | +type RegisterActiveManagedProxyOptions = { |
21 | 21 | loopbackMode?: ActiveManagedProxyLoopbackMode; |
22 | 22 | proxyTls?: ManagedProxyTlsOptions; |
23 | 23 | }; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -10,7 +10,7 @@ import {
|
10 | 10 | type ManagedProxyTlsOptions, |
11 | 11 | } from "./proxy-tls.js"; |
12 | 12 | |
13 | | -export type ManagedEnvHttpProxyAgentOptions = ConstructorParameters<typeof EnvHttpProxyAgent>[0]; |
| 13 | +type ManagedEnvHttpProxyAgentOptions = ConstructorParameters<typeof EnvHttpProxyAgent>[0]; |
14 | 14 | |
15 | 15 | function readProxyTlsRecord(options: object | undefined): Record<string, unknown> | undefined { |
16 | 16 | if (!options || !("proxyTls" in options)) { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -7,7 +7,7 @@ import {
|
7 | 7 | } from "@openclaw/proxyline"; |
8 | 8 | import type { ProxyConfig } from "../../../config/zod-schema.proxy.js"; |
9 | 9 | |
10 | | -export type ProxyLoopbackMode = NonNullable<NonNullable<ProxyConfig>["loopbackMode"]>; |
| 10 | +type ProxyLoopbackMode = NonNullable<NonNullable<ProxyConfig>["loopbackMode"]>; |
11 | 11 | import { isLoopbackIpAddress } from "@openclaw/net-policy/ip"; |
12 | 12 | import { logInfo, logWarn } from "../../../logger.js"; |
13 | 13 | import { forceResetGlobalDispatcher } from "../undici-global-dispatcher.js"; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。