Skip to content

Cannot upgrade due to TS1183: An implementation cannot be declared in ambient contexts. #32

@MichaelBitard

Description

@MichaelBitard

I am trying to upgrade from 3.1.0 to the latest, but it does not work.

If I try the next version (3.2.0) the build fail with a bunch of

node_modules/stream-chain/src/typed-streams.d.ts:9:22 - error TS1183: An implementation cannot be declared in ambient contexts.                                                                     
                                                                                                                                                                                                    
9   __streamTypeR(): R {                                                                                                                                                                            
                       ~                                                                                                                                                                            
                                                                                                                                                                                                    
node_modules/stream-chain/src/typed-streams.d.ts:12:22 - error TS1183: An implementation cannot be declared in ambient contexts.                                                                    
                                                                                                                                                                                                    
12   __streamTypeW(): W {
                        ~                                                                         
                                                 
node_modules/stream-chain/src/typed-streams.d.ts:21:22 - error TS1183: An implementation cannot be declared in ambient contexts.

21   __streamTypeR(): R {  
                        ~
                                                 
node_modules/stream-chain/src/typed-streams.d.ts:30:22 - error TS1183: An implementation cannot be declared in ambient contexts.
                                                 
30   __streamTypeR(): R {                                                                         
                        ~                                                                         
                                                 
node_modules/stream-chain/src/typed-streams.d.ts:33:22 - error TS1183: An implementation cannot be declared in ambient contexts.
                                                 
33   __streamTypeW(): W {                                                                         
                        ~           
                                                                                                  
node_modules/stream-chain/src/typed-streams.d.ts:42:22 - error TS1183: An implementation cannot be declared in ambient contexts.
                                                 
42   __streamTypeW(): W {                  
          

From what I understand, these .d.ts files should not have implementations specs in it, but only be empty.

I can make the PR if that's ok, but maybe I'm missing something

It should look like this:

export declare class TypedTransform<W = any, R = W> extends Transform {
  __streamTypeR(): R
  __streamTypeW(): W
}

instead of

export declare class TypedTransform<W = any, R = W> extends Transform {
  __streamTypeR(): R {
    return null as R;
  }
  __streamTypeW(): W {
    return null as W;
  }
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingconfirmedConfirmed bug/behavior/feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions