cloudflare / cloudflare/agents
Allow proper types for agent props
- Dominant language
- TypeScript
- Stars
- 5.6k
- Forks
- 711
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 53
Description
**Describe the bug**
The generic types for `Agent` enforces `Record` as bound for `Props`. This Record type requires subtypes to define an index signature for type `string`, which prevents using interfaces with well-defined properties.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
While the type could still *default* to `Record`, it should allow using proper interfaces that have no index signature.
**Screenshots**
This is the error reported by Typescript on a `getAgentsByName` call passing `{ props: config }` as third argument:
**Version:**
0.17.3
**Additional context**
Contributor guide
Assessment
This issue has not been assessed yet.