title: Property not found even when specified in deceleration file typescript
body: <p>When attempting to read a property from an express request object defined in the 'express-request-id' middleware and declared in a typescript declaration file it throws an error.</p>
  <p>My d.ts file has the following defined:</p>
  <p>(server.d.ts)</p>
  <pre><code>declare namespace Express {
      export interface Request {
          id: string
      }
  }
  
  </code></pre>
  <p>This should be correct. According to my research, the only way this would not work would be bad referencing of it. The way I am referencing it is through the <code>files</code> field in my tsconfig like so:</p>
  <pre><code>{
      &quot;compilerOptions&quot;: {
          &quot;strict&quot;: true,
          &quot;noImplicitAny&quot;: true,
          &quot;target&quot;: &quot;ESNext&quot;,
          &quot;watch&quot;: true,
          &quot;lib&quot;: [&quot;ESNext&quot;, &quot;ES7&quot;],
          &quot;types&quot;: [&quot;node&quot;],
          &quot;moduleResolution&quot;: &quot;node&quot;,
          &quot;baseUrl&quot;: &quot;./&quot;,
          &quot;esModuleInterop&quot;: true,
          &quot;allowSyntheticDefaultImports&quot;: true,
          &quot;emitDecoratorMetadata&quot;: true,
          &quot;experimentalDecorators&quot;: true,
          &quot;strictPropertyInitialization&quot;: false
      },
      &quot;compileOnSave&quot;: true,
  
      &quot;typeAcquisition&quot;: { &quot;enable&quot;: true },
  
      // referenced here.
      &quot;files&quot;: [&quot;./server.d.ts&quot;],
  
      // i have also tryed refrenceing it here and in a triple slash directive.
      &quot;include&quot;: [
          &quot;./*.ts&quot;,
          &quot;./server/**/*.ts&quot;,
          &quot;./shared/**/*.ts&quot;,
          &quot;./api/**/*.ts&quot;,
          &quot;./database/**/*.ts&quot;,
          &quot;./builders/**/*&quot;
      ]
  }
  </code></pre>
  <p>The pice of code that creates the error is the following:
  (server/middleware/reqTerminator.ts)</p>
  <pre><code>
  import { Request, Response, NextFunction } from 'express'
  
  // when testing triple slash directives they wore used here like the folowing:
  // /// &lt;reference types=&quot;../../server.d.ts&quot; /&gt;
  
  export const [completeRequest, middleware] = (() =&gt; {
      const connections = new Map&lt;string, NodeJS.Timeout&gt;()
  
      const completeRequest = async (request: Request, response: Response) =&gt; {
          const timeout = connections.get(request.id)
          if (timeout) clearTimeout(timeout)
          response.end()
          return connections.delete(request.id)
      }
  
      return [
          completeRequest,
          async (request: Request, response: Response, nextF: NextFunction) =&gt; {
              connections.set(
                  request.id,
                  setTimeout(() =&gt; {
                      completeRequest(request, response)
                  }, 2000),
              )
              nextF()
          },
      ]
  })()
  
  export default middleware
  </code></pre>
  <p>the error is:</p>
  <pre><code>⨯ Unable to compile TypeScript:
  server/middleware/reqTerminator.ts:7:43 - error TS2339: Property 'id' does not exist on type 'Request&lt;ParamsDictionary, any, any, ParsedQs&gt;'.
  
  7       const timeout = connections.get(request.id)
                                                  ~~
  server/middleware/reqTerminator.ts:10:37 - error TS2339: Property 'id' does not exist on type 'Request&lt;ParamsDictionary, any, any, ParsedQs&gt;'.
  
  10      return connections.delete(request.id)
                                            ~~
  server/middleware/reqTerminator.ts:17:13 - error TS2339: Property 'id' does not exist on type 'Request&lt;ParamsDictionary, any, any, ParsedQs&gt;'.
  
  17                      request.id,
  </code></pre>
  <p>It is being run with ts-node with the corresponding project.</p>