index.d.ts 1.1 KB

123456789101112131415161718192021222324252627
  1. /// <reference types="node" />
  2. /// <reference types="node" />
  3. import type { WithRequired } from '@apollo/utils.withrequired';
  4. import { type IncomingMessage, type ServerResponse } from 'http';
  5. import type { ListenOptions } from 'net';
  6. import type { ApolloServer } from '../ApolloServer.js';
  7. import type { BaseContext, ContextFunction } from '../externalTypes/index.js';
  8. export interface StandaloneServerContextFunctionArgument {
  9. req: IncomingMessage;
  10. res: ServerResponse;
  11. }
  12. export interface StartStandaloneServerOptions<TContext extends BaseContext> {
  13. context?: ContextFunction<[
  14. StandaloneServerContextFunctionArgument
  15. ], TContext>;
  16. }
  17. export declare function startStandaloneServer(server: ApolloServer<BaseContext>, options?: StartStandaloneServerOptions<BaseContext> & {
  18. listen?: ListenOptions;
  19. }): Promise<{
  20. url: string;
  21. }>;
  22. export declare function startStandaloneServer<TContext extends BaseContext>(server: ApolloServer<TContext>, options: WithRequired<StartStandaloneServerOptions<TContext>, 'context'> & {
  23. listen?: ListenOptions;
  24. }): Promise<{
  25. url: string;
  26. }>;
  27. //# sourceMappingURL=index.d.ts.map