index.d.ts 5.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /// <reference types="node" />
  2. import { ClientDuplexStream, ClientReadableStream, ClientUnaryCall, ClientWritableStream, ServiceError } from './call';
  3. import { CallCredentials, OAuth2Client } from './call-credentials';
  4. import { StatusObject } from './call-interface';
  5. import { Channel, ChannelImplementation } from './channel';
  6. import { CompressionAlgorithms } from './compression-algorithms';
  7. import { ConnectivityState } from './connectivity-state';
  8. import { ChannelCredentials, VerifyOptions } from './channel-credentials';
  9. import { CallOptions, Client, ClientOptions, CallInvocationTransformer, CallProperties, UnaryCallback } from './client';
  10. import { LogVerbosity, Status, Propagate } from './constants';
  11. import { Deserialize, loadPackageDefinition, makeClientConstructor, MethodDefinition, Serialize, ServiceDefinition } from './make-client';
  12. import { Metadata, MetadataOptions, MetadataValue } from './metadata';
  13. import { ConnectionInjector, Server, ServerOptions, UntypedHandleCall, UntypedServiceImplementation } from './server';
  14. import { KeyCertPair, ServerCredentials } from './server-credentials';
  15. import { StatusBuilder } from './status-builder';
  16. import { handleBidiStreamingCall, handleServerStreamingCall, handleClientStreamingCall, handleUnaryCall, sendUnaryData, ServerUnaryCall, ServerReadableStream, ServerWritableStream, ServerDuplexStream, ServerErrorResponse } from './server-call';
  17. export { OAuth2Client };
  18. /**** Client Credentials ****/
  19. export declare const credentials: {
  20. /**
  21. * Combine a ChannelCredentials with any number of CallCredentials into a
  22. * single ChannelCredentials object.
  23. * @param channelCredentials The ChannelCredentials object.
  24. * @param callCredentials Any number of CallCredentials objects.
  25. * @return The resulting ChannelCredentials object.
  26. */
  27. combineChannelCredentials: (channelCredentials: ChannelCredentials, ...callCredentials: CallCredentials[]) => ChannelCredentials;
  28. /**
  29. * Combine any number of CallCredentials into a single CallCredentials
  30. * object.
  31. * @param first The first CallCredentials object.
  32. * @param additional Any number of additional CallCredentials objects.
  33. * @return The resulting CallCredentials object.
  34. */
  35. combineCallCredentials: (first: CallCredentials, ...additional: CallCredentials[]) => CallCredentials;
  36. createInsecure: typeof ChannelCredentials.createInsecure;
  37. createSsl: typeof ChannelCredentials.createSsl;
  38. createFromSecureContext: typeof ChannelCredentials.createFromSecureContext;
  39. createFromMetadataGenerator: typeof CallCredentials.createFromMetadataGenerator;
  40. createFromGoogleCredential: typeof CallCredentials.createFromGoogleCredential;
  41. createEmpty: typeof CallCredentials.createEmpty;
  42. };
  43. /**** Metadata ****/
  44. export { Metadata, MetadataOptions, MetadataValue };
  45. /**** Constants ****/
  46. export { LogVerbosity as logVerbosity, Status as status, ConnectivityState as connectivityState, Propagate as propagate, CompressionAlgorithms as compressionAlgorithms, };
  47. /**** Client ****/
  48. export { Client, ClientOptions, loadPackageDefinition, makeClientConstructor, makeClientConstructor as makeGenericClientConstructor, CallProperties, CallInvocationTransformer, ChannelImplementation as Channel, Channel as ChannelInterface, UnaryCallback as requestCallback, };
  49. /**
  50. * Close a Client object.
  51. * @param client The client to close.
  52. */
  53. export declare const closeClient: (client: Client) => void;
  54. export declare const waitForClientReady: (client: Client, deadline: Date | number, callback: (error?: Error) => void) => void;
  55. export { sendUnaryData, ChannelCredentials, CallCredentials, Deadline, Serialize as serialize, Deserialize as deserialize, ClientUnaryCall, ClientReadableStream, ClientWritableStream, ClientDuplexStream, CallOptions, MethodDefinition, StatusObject, ServiceError, ServerUnaryCall, ServerReadableStream, ServerWritableStream, ServerDuplexStream, ServerErrorResponse, ServiceDefinition, UntypedHandleCall, UntypedServiceImplementation, VerifyOptions, };
  56. /**** Server ****/
  57. export { handleBidiStreamingCall, handleServerStreamingCall, handleUnaryCall, handleClientStreamingCall, };
  58. export type Call = ClientUnaryCall | ClientReadableStream<any> | ClientWritableStream<any> | ClientDuplexStream<any, any>;
  59. /**** Unimplemented function stubs ****/
  60. export declare const loadObject: (value: any, options: any) => never;
  61. export declare const load: (filename: any, format: any, options: any) => never;
  62. export declare const setLogger: (logger: Partial<Console>) => void;
  63. export declare const setLogVerbosity: (verbosity: LogVerbosity) => void;
  64. export { ConnectionInjector, Server, ServerOptions };
  65. export { ServerCredentials };
  66. export { KeyCertPair };
  67. export declare const getClientChannel: (client: Client) => Channel;
  68. export { StatusBuilder };
  69. export { Listener, InterceptingListener } from './call-interface';
  70. export { Requester, ListenerBuilder, RequesterBuilder, Interceptor, InterceptorOptions, InterceptorProvider, InterceptingCall, InterceptorConfigurationError, NextCall, } from './client-interceptors';
  71. export { GrpcObject, ServiceClientConstructor, ProtobufTypeDefinition, } from './make-client';
  72. export { ChannelOptions } from './channel-options';
  73. export { getChannelzServiceDefinition, getChannelzHandlers } from './channelz';
  74. export { addAdminServicesToServer } from './admin';
  75. export { ServiceConfig, LoadBalancingConfig, MethodConfig, RetryPolicy, } from './service-config';
  76. export { ServerListener, FullServerListener, ServerListenerBuilder, Responder, FullResponder, ResponderBuilder, ServerInterceptingCallInterface, ServerInterceptingCall, ServerInterceptor, } from './server-interceptors';
  77. import * as experimental from './experimental';
  78. export { experimental };
  79. import { Deadline } from './deadline';