akashm103 commented on issue #360:
URL: https://github.com/apache/couchdb-nano/issues/360#issuecomment-3406799136

   Thanks for checking — the behaviour you demonstrated (the JS example works) 
matches what I see: `findAsStream` exists at runtime in `[email protected]`. The 
problem I hit is **TypeScript**: `tsc` complains that property `findAsStream` 
is not declared on `DocumentScope<unknown>`.
   
   Repro (minimal):
   1. package.json:
   ```json
   {
     "type": "module",
     "dependencies": { "nano": "^11.0.2" },
     "devDependencies": { "@types/node": "^24.7.2" }
   }
   ```
   
   2. tsconfig.json
   
   ```json
   {
     "compilerOptions": {
       "target": "ESNext",
       "module": "ESNext",
       "moduleResolution": "node",
       "esModuleInterop": true,
       "allowSyntheticDefaultImports": true,
       "strict": true,
       "outDir": "dist"
     }
   }
   ```
   3. ts file (tsTest.ts):
   ```ts
   import Nano from 'nano';
   const nano = Nano(process.env.COUCH_URL);
   
   const db = nano.use('cities');
   db.findAsStream({ selector: { country: 'US' } }).pipe(process.stdout);
   ```
   
   after running `tsc` in console:
   `tsTest.ts:7:8 - error TS2339: Property 'findAsStream' does not exist on 
type 'DocumentScope<unknown>'.` 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to