Commit 168d495
committed
feat(ai): allow provider-specific numeric fields on UsageTotals.costDetails
The JSDoc promised "loosely typed" costDetails to accommodate provider
divergence (BYOK upstream costs, cache discounts, per-tier rates) but
the declared shape only allowed two OpenRouter-specific keys, so any
other adapter would have been forced to `as any`-cast to report its
own breakdown. Add a numeric index signature so additional keys are
type-legal without a cast, matching the documented intent.
Picked up in CodeRabbit review of TanStack#469.1 parent 08840ac commit 168d495
1 file changed
Lines changed: 10 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
803 | 803 | | |
804 | 804 | | |
805 | 805 | | |
806 | | - | |
807 | | - | |
808 | | - | |
809 | | - | |
810 | | - | |
811 | | - | |
812 | 806 | | |
813 | 807 | | |
814 | 808 | | |
| |||
829 | 823 | | |
830 | 824 | | |
831 | 825 | | |
832 | | - | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
833 | 829 | | |
834 | 830 | | |
835 | 831 | | |
836 | 832 | | |
| 833 | + | |
837 | 834 | | |
838 | 835 | | |
839 | 836 | | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
840 | 843 | | |
841 | 844 | | |
842 | 845 | | |
| |||
0 commit comments