Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

defineRunStore.md

34 lines827 Bytes

1---
2id: defineRunStore
3title: defineRunStore
4---
5​
6```ts
7function defineRunStore<T>(store): T;
8```
9​
10Defined in: [packages/ai/src/activities/chat/middleware/run-store.ts:299](https://github.com/TanStack/ai/blob/main/packages/ai/src/activities/chat/middleware/run-store.ts#L299)
11​
12Type a [RunStore](../interfaces/RunStore.md) implementation inline: pass the object and get
13autocomplete plus contract checking with no separate annotation. Mirrors
14`defineLock` / `defineSandboxInstanceStore`.
15​
16The generic return preserves the argument's own type, so an optional method
17the implementation actually provides stays known-present on the result
18instead of collapsing back to `| undefined` on the interface.
19​
20## Type Parameters
21​
22### T
23​
24`T` *extends* [`RunStore`](../interfaces/RunStore.md)
25​
26## Parameters
27​
28### store
29​
30`T`
31​
32## Returns
33​
34`T`