Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/livereload

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/livereload

TypeScript definitions for node-livereload

  • 0.9.2
  • ts3.9
  • ts4.0
  • ts4.1
  • ts4.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9.8K
decreased by-3.51%
Maintainers
1
Weekly downloads
 
Created
Source

Installation

npm install --save @types/livereload

Summary

This package contains type definitions for node-livereload (https://github.com/napcs/node-livereload).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/livereload.

index.d.ts

// Type definitions for node-livereload 0.9
// Project: https://github.com/napcs/node-livereload
// Definitions by: Hector Osuna <https://github.com/FanGoH/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

import { Server as WebSocketServer, WebSocket } from 'ws';
import { Server as httpServer } from 'http';
import { Server as httpsServer, ServerOptions } from 'https';
import { EventEmitter } from 'events';
import { FSWatcher } from 'fs';

export interface ServerConfig {
    /** Protocol Version defaults to "7" */
    version?: string | undefined;
    /** Sets server port number: Defaults to 35729 */
    port?: number | undefined;

    /** File Extensions to watch */
    exts?: string[] | undefined;

    extraExts?: string[] | undefined;

    /** Extensions to not watch */
    exclusions?: RegExp[] | undefined;
    applyCSSLive?: boolean | undefined;
    applyImgLive?: boolean | undefined;
    originalPath?: string | undefined;
    overrideURL?: string | undefined;
    usePolling?: boolean | undefined;
    server?: httpServer | httpsServer | undefined;

    /** ms to delay browser refresh */
    delay?: number | undefined;

    /** Logs debug messages to console */
    debug?: boolean | undefined;
}

/** Create Server Parameters */
export interface CreateServerConfig extends ServerConfig {
    https?: ServerOptions | undefined;
    server?: httpServer | httpsServer | undefined;
    noListen?: boolean | undefined;
}

/** Live Reload Server object, provides main functionality */
export class LiveReloadServer extends EventEmitter {
    config: ServerConfig;
    watcher: FSWatcher;
    server: WebSocketServer;
    constructor(config?: ServerConfig);

    listen(callback?: () => void): void;
    onError(err: Error): void;
    onConnection(socket?: WebSocket): void;
    onClose(socket?: WebSocket): void;

    /** Specify path(s) to watch */
    watch(paths: string | string[]): void;
    filterRefresh(filepath: string): void;
    refresh(filepath: string): void;
    alert(message: string): void;
    sendAllClients(data: string): void;
    close(): void;
    debug(message: string): void;
}

export {};

export function createServer(config?: CreateServerConfig, callback?: () => void): LiveReloadServer;

Additional Details

  • Last updated: Thu, 24 Mar 2022 01:31:47 GMT
  • Dependencies: @types/ws
  • Global values: none

Credits

These definitions were written by Hector Osuna.

FAQs

Package last updated on 24 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc