fix: preserve typed runtime env casts · openclaw/openclaw@1776840
steipete
·
2026-04-28
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -5,7 +5,7 @@ type RuntimeEnvOptions = {
|
5 | 5 | throwOnExit?: boolean; |
6 | 6 | }; |
7 | 7 | |
8 | | -type TypedRuntimeEnvOptions<TRuntime extends OutputRuntimeEnv> = RuntimeEnvOptions & { |
| 8 | +type TypedRuntimeEnvOptions<TRuntime> = RuntimeEnvOptions & { |
9 | 9 | readonly __runtimeShape?: (runtime: TRuntime) => void; |
10 | 10 | }; |
11 | 11 | |
@@ -24,7 +24,7 @@ export function createRuntimeEnv(options?: RuntimeEnvOptions): OutputRuntimeEnv
|
24 | 24 | }; |
25 | 25 | } |
26 | 26 | |
27 | | -export function createTypedRuntimeEnv<TRuntime extends OutputRuntimeEnv>( |
| 27 | +export function createTypedRuntimeEnv<TRuntime>( |
28 | 28 | options?: TypedRuntimeEnvOptions<TRuntime>, |
29 | 29 | ): TRuntime { |
30 | 30 | return createRuntimeEnv(options) as TRuntime; |
@@ -34,7 +34,7 @@ export function createNonExitingRuntimeEnv(): OutputRuntimeEnv {
|
34 | 34 | return createRuntimeEnv({ throwOnExit: false }); |
35 | 35 | } |
36 | 36 | |
37 | | -export function createNonExitingTypedRuntimeEnv<TRuntime extends OutputRuntimeEnv>( |
| 37 | +export function createNonExitingTypedRuntimeEnv<TRuntime>( |
38 | 38 | runtimeShape?: (runtime: TRuntime) => void, |
39 | 39 | ): TRuntime { |
40 | 40 | return createTypedRuntimeEnv<TRuntime>({ throwOnExit: false, __runtimeShape: runtimeShape }); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。