cap-js/cds-types

Create dedicated type for `headers` parameter in `services.d.ts`

daogrady opened this issue · 0 comments

headers appears to be a recurring parameter type throughout the services definition. The expected type is related to general HTTP headers, although apparently has different format. The IncomingHttpHeaders type from node:http contains the definitions for regular HTTP headers. Reusing that type would give us a nice, strict typing, consistency (currently we have a mix of object and {}), and code completion:

Screenshot 2024-01-08 at 07 45 01

Originally posted by @daogrady in #9 (comment)