-
Notifications
You must be signed in to change notification settings - Fork 301
Description
RequestInfo is defined in the TypeScript library as follows:
- https://github.com/microsoft/TypeScript/blob/7849342c7cb5045d4549739ae9234e9abac76da1/lib/lib.dom.d.ts#L18725
- https://github.com/node-fetch/node-fetch/blob/136a5f143329f383594fd5510dcd893cc91c93aa/%40types/index.d.ts#L118
Please check my question on StackOverFlow for more info: https://stackoverflow.com/questions/68970860/typescript-using-predefined-names-for-custom-class-names.
The following prompts a Duplicate Identifier error :
class RequestInfo{}
However, adding the export keyword export class RequestInfo removes the error. I learnt from the TS community that reusing a built-in name is not recommended.
Additionally, use HTTPContext or MiddlewareContext which would be the conventional term for the purpose of this class. Examples: GraphRequestContext in Graph dot net core,
RequestContext -> https://github.com/microsoftgraph/msgraph-sdk-design/blob/master/middleware/RequestContext.md,
HTTPContext - https://docs.microsoft.com/en-us/dotnet/api/system.web.httpcontext?view=netframework-4.8