@types/gulp-connect

  • Version 5.0.9
  • Published
  • 5.39 kB
  • 1 dependency
  • MIT license

Install

npm i @types/gulp-connect
yarn add @types/gulp-connect
pnpm add @types/gulp-connect

Overview

TypeScript definitions for gulp-connect

Index

Functions

function reload

reload: () => any;
  • Reload all gulp-connect servers that have livereload enabled

function server

server: (
options?: ConnectAppOptions,
startedCallback?: () => unknown
) => ConnectAppOptions;
  • Create a gulp-connect server with the given options

function serverClose

serverClose: () => void;
  • Close all gulp-connect servers

Interfaces

interface ConnectAppOptions

interface ConnectAppOptions {}

    property debug

    debug?: boolean | undefined;
    • Whether or not to log debug messages. Defaults to false.

    property fallback

    fallback?: string | undefined;
    • File to serve if url results in a 404. Defaults to undefined

    property host

    host?: string | undefined;
    • Host to bind server to. Defaults to localhost.

    property https

    https?: boolean | https.ServerOptions | undefined;
    • Options to pass to http.createServer (or false to disable https). Defaults to false. When https is just set to true, then internally some defaults will be used.

    property index

    index?: boolean | string | string[] | undefined;
    • Value to pass into the serve-static's index option. See serve-static documentation for details. Defaults to true.

    property livereload

    livereload?: boolean | LiveReloadOptions | undefined;
    • Enable/disable livereload or set live reload options. Defaults to false.

    property middleware

    middleware?: MiddlewareFactory | undefined;
    • Middleware factory function which should return a list of connect handler functions . Defaults to () => [];

    property name

    name?: string | undefined;
    • The name of this server. Used in logs. Defaults to "Server".

    property port

    port?: number | undefined;
    • The connect webserver port. Defaults to 8080

    property root

    root?: string | string[] | undefined;
    • The root path. Defaults to directory with gulpfile

    property silent

    silent?: boolean | undefined;
    • Don't log any messages. Defaults to false.

    method serverInit

    serverInit: (server: http.Server | https.Server) => void;
    • A function to run custom initialization on the underlying http or https server

    interface LiveReloadOptions

    interface LiveReloadOptions {}

      property hostname

      hostname?: string | undefined;
      • Hostname to bind live reload server to

      property port

      port: number;
      • Port to run live reload server on. Defauls to 35729.

      Type Aliases

      type ConnectRouteHandler

      type ConnectRouteHandler = [string, connectModule.HandleFunction];
      • a list of [string, HandlerFunction] where the string is the path (i.e. route) that the handler function should be invoked for

      type MiddlewareFactory

      type MiddlewareFactory = (
      connect: typeof connectModule,
      options: ConnectAppOptions
      ) => Array<connectModule.HandleFunction | ConnectRouteHandler>;
      • Factory function that returns a list of middleware handlers to pass to a connect server's use function. The list contain normal Connect middleware handler functions or ConnectRoutHandlers

      Package Files (1)

      Dependencies (1)

      Dev Dependencies (0)

      No dev dependencies.

      Peer Dependencies (0)

      No peer dependencies.

      Badge

      To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

      You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/gulp-connect.

      • Markdown
        [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/gulp-connect)
      • HTML
        <a href="https://www.jsdocs.io/package/@types/gulp-connect"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>