Skip to content

Commit

Permalink
Extract type of IPlatform.Transports
Browse files Browse the repository at this point in the history
Preparation for #1394 (making transports tree-shakable).
  • Loading branch information
lawrence-forooghian committed Nov 8, 2023
1 parent bb3ce5c commit 37a2841
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/common/lib/transport/connectionmanager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2167,3 +2167,5 @@ class ConnectionManager extends EventEmitter {
}

export default ConnectionManager;

export type TransportInitialiser = (connectionManager: typeof ConnectionManager) => typeof Transport;
5 changes: 2 additions & 3 deletions src/common/platform.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { IPlatformConfig } from './types/IPlatformConfig';
import { IHttp } from './types/http';
import ConnectionManager from './lib/transport/connectionmanager';
import { TransportInitialiser } from './lib/transport/connectionmanager';
import IDefaults from './types/IDefaults';
import IWebStorage from './types/IWebStorage';
import IBufferUtils from './types/IBufferUtils';
import Transport from './lib/transport/transport';
import * as WebBufferUtils from '../platform/web/lib/util/bufferutils';
import * as NodeBufferUtils from '../platform/nodejs/lib/util/bufferutils';
import { IUntypedCryptoStatic } from '../common/types/ICryptoStatic';
Expand All @@ -30,7 +29,7 @@ export default class Platform {
*/
static Crypto: IUntypedCryptoStatic | null;
static Http: typeof IHttp;
static Transports: Array<(connectionManager: typeof ConnectionManager) => typeof Transport>;
static Transports: TransportInitialiser[];
static Defaults: IDefaults;
static WebStorage: IWebStorage | null;
}

0 comments on commit 37a2841

Please sign in to comment.