refactor(infra): hide utility option types

This commit is contained in:
Vincent Koc
2026-06-17 12:26:37 +08:00
parent a0a0e5e4cb
commit e098eb735f
6 changed files with 9 additions and 9 deletions

View File

@@ -17,12 +17,12 @@ export function resolveTimezone(value: string): string | undefined {
}
}
export type FormatTimestampOptions = {
type FormatTimestampOptions = {
/** Include seconds in the output. Default: false */
displaySeconds?: boolean;
};
export type FormatZonedTimestampOptions = FormatTimestampOptions & {
type FormatZonedTimestampOptions = FormatTimestampOptions & {
/** IANA timezone string (e.g., 'America/New_York'). Default: system timezone */
timeZone?: string;
};

View File

@@ -8,7 +8,7 @@
* - `formatRelativeTimestamp(epochMs)` — format an epoch timestamp relative to now (handles future)
*/
export type FormatTimeAgoOptions = {
type FormatTimeAgoOptions = {
/** Append "ago" suffix. Default: true. When false, returns bare unit: "5m", "2h" */
suffix?: boolean;
/** Return value for invalid/null/negative input. Default: "unknown" */
@@ -51,7 +51,7 @@ export function formatTimeAgo(
return suffix ? `${days}d ago` : `${days}d`;
}
export type FormatRelativeTimestampOptions = {
type FormatRelativeTimestampOptions = {
/** If true, fall back to short date (e.g. "Oct 5") for timestamps >7 days. Default: false */
dateFallback?: boolean;
/** IANA timezone for date fallback display */

View File

@@ -108,7 +108,7 @@ type GuardedFetchInternalOptions = GuardedFetchOptions & {
useEnvProxyForEligibleUrls?: boolean;
};
export type GuardedFetchConfiguredLocalOriginOptions = GuardedFetchOptions & {
type GuardedFetchConfiguredLocalOriginOptions = GuardedFetchOptions & {
configuredLocalOriginBaseUrl: string;
};

View File

@@ -6,7 +6,7 @@ import type { ManagedProxyTlsOptions } from "./proxy-tls.js";
export type ActiveManagedProxyUrl = Readonly<URL>;
/** Managed proxy loopback behavior shared by gateway and child-process fetch paths. */
export type ActiveManagedProxyLoopbackMode = NonNullable<NonNullable<ProxyConfig>["loopbackMode"]>;
type ActiveManagedProxyLoopbackMode = NonNullable<NonNullable<ProxyConfig>["loopbackMode"]>;
/** Ref-counted active proxy handle; callers must stop it when their proxy scope ends. */
export type ActiveManagedProxyRegistration = {
@@ -17,7 +17,7 @@ export type ActiveManagedProxyRegistration = {
};
/** Registration metadata for managed proxy URLs and their TLS trust material. */
export type RegisterActiveManagedProxyOptions = {
type RegisterActiveManagedProxyOptions = {
loopbackMode?: ActiveManagedProxyLoopbackMode;
proxyTls?: ManagedProxyTlsOptions;
};

View File

@@ -10,7 +10,7 @@ import {
type ManagedProxyTlsOptions,
} from "./proxy-tls.js";
export type ManagedEnvHttpProxyAgentOptions = ConstructorParameters<typeof EnvHttpProxyAgent>[0];
type ManagedEnvHttpProxyAgentOptions = ConstructorParameters<typeof EnvHttpProxyAgent>[0];
function readProxyTlsRecord(options: object | undefined): Record<string, unknown> | undefined {
if (!options || !("proxyTls" in options)) {

View File

@@ -7,7 +7,7 @@ import {
} from "@openclaw/proxyline";
import type { ProxyConfig } from "../../../config/zod-schema.proxy.js";
export type ProxyLoopbackMode = NonNullable<NonNullable<ProxyConfig>["loopbackMode"]>;
type ProxyLoopbackMode = NonNullable<NonNullable<ProxyConfig>["loopbackMode"]>;
import { isLoopbackIpAddress } from "@openclaw/net-policy/ip";
import { logInfo, logWarn } from "../../../logger.js";
import { forceResetGlobalDispatcher } from "../undici-global-dispatcher.js";