This repository was archived by the owner on May 7, 2024. It is now read-only.
  
  
  - 
                Notifications
    
You must be signed in to change notification settings  - Fork 5
 
fix: window is not defined in worker contexts #59
          
     Merged
      
      
    
  
     Merged
                    Changes from 6 commits
      Commits
    
    
            Show all changes
          
          
            10 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      4d27f14
              
                feat: resolve serviceWorker error
              
              
                SgtPooki 2759692
              
                fix: type errors after using globalThis.WebTransport
              
              
                SgtPooki c1acecf
              
                fix(lint): use boolean directly
              
              
                SgtPooki 02d35aa
              
                feat: move types to global.d.ts and update
              
              
                SgtPooki 417932a
              
                chore: remove types from index.ts
              
              
                SgtPooki 3275d49
              
                fix: lint
              
              
                SgtPooki c99eeee
              
                fix: use types from @fails-component/webtransport
              
              
                SgtPooki 5306c0c
              
                chore: revert tsconfig updates
              
              
                SgtPooki 4817919
              
                chore: add npm script to test on webworkers
              
              
                achingbrain 72d200e
              
                chore: simplify
              
              
                achingbrain File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| 
     | 
||
| interface WebTransportConfig { | ||
| serverCertificateHashes?: Array<{ algorithm: string, value: Uint8Array }> | ||
| } | ||
| /** | ||
| * @see https://developer.mozilla.org/en-US/docs/Web/API/WebTransportBidirectionalStream | ||
| */ | ||
| interface WebTransportBidirectionalStream { | ||
| readable: ReadableStream | ||
| writable: WritableStream | ||
| } | ||
| /** | ||
| * @see https://developer.mozilla.org/en-US/docs/Web/API/WebTransport | ||
| */ | ||
| interface GlobalThisWebTransport extends EventTarget { | ||
| closed: Promise<any> | ||
| datagrams: Duplex<Uint8ArrayList, Uint8ArrayList | Uint8Array> | ||
| incomingBidirectionalStreams: ReadableStream<WebTransportBidirectionalStream> | ||
| incomingUnidirectionalStreams: ReadableStream | ||
| ready: Promise<any> | ||
| close: (options?: { closeCode: number, reason: string }) => void | ||
| createBidirectionalStream: () => Promise<Duplex<Uint8ArrayList, Uint8ArrayList | Uint8Array>> | ||
| createUnidirectionalStream: () => Promise<Stream> | ||
| } | ||
| // eslint-disable-next-line no-var, @typescript-eslint/no-unused-vars | ||
| var WebTransport: new (url: string, config: WebTransportConfig) => GlobalThisWebTransport | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
              
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.