const clientSessionOptions: ClientSessionOptions = { maxDeflateDynamicTableSize: 0, maxReservedRemoteStreams: 0, maxSendHeaderBlockLength: 0, paddingStrategy: 0, peerMaxConcurrentStreams: 0, selectPadding: (frameLen: number, maxFrameLen: number) => 0, settings }; // tslint:disable-next-line prefer-object-spread (ts2.1 feature) const secureClientSessionOptions: SecureClientSessionOptions = Object.assign({}, clientSessionOptions); secureClientSessionOptions.ca = ''; const onConnectHandler = (session: Http2Session, socket: Socket) => {}; const serverHttp2Session: ServerHttp2Session = {} as any; serverHttp2Session.altsvc('', ''); serverHttp2Session.altsvc('', 0); serverHttp2Session.altsvc('', new URL('')); serverHttp2Session.altsvc('', { origin: '' }); serverHttp2Session.altsvc('', { origin: 0 }); serverHttp2Session.altsvc('', { origin: new URL('') }); let clientHttp2Session: ClientHttp2Session; clientHttp2Session = connect(''); clientHttp2Session = connect('', onConnectHandler); clientHttp2Session = connect('', clientSessionOptions); clientHttp2Session = connect('', clientSessionOptions, onConnectHandler); clientHttp2Session = connect('', secureClientSessionOptions);
const clientSessionOptions: ClientSessionOptions = { maxDeflateDynamicTableSize: 0, maxReservedRemoteStreams: 0, maxSendHeaderBlockLength: 0, paddingStrategy: 0, peerMaxConcurrentStreams: 0, selectPadding: (frameLen: number, maxFrameLen: number) => 0, settings }; // tslint:disable-next-line prefer-object-spread (ts2.1 feature) const secureClientSessionOptions: SecureClientSessionOptions = Object.assign({}, clientSessionOptions); secureClientSessionOptions.ca = ''; const onConnectHandler = (session: Http2Session, socket: Socket) => {}; const serverHttp2Session: ServerHttp2Session = {} as any; serverHttp2Session.altsvc('', ''); serverHttp2Session.altsvc('', 0); serverHttp2Session.altsvc('', new URL('')); serverHttp2Session.altsvc('', { origin: '' }); serverHttp2Session.altsvc('', { origin: 0 }); serverHttp2Session.altsvc('', { origin: new URL('') }); serverHttp2Session.origin('https://example.com', new URL(''), { origin: 'https://foo.com' }); let clientHttp2Session: ClientHttp2Session; clientHttp2Session = connect(''); clientHttp2Session = connect('', onConnectHandler); clientHttp2Session = connect('', clientSessionOptions); clientHttp2Session = connect('', clientSessionOptions, onConnectHandler);