@types/serve-index
TypeScript definitions for serve-index
Last updated 7 years ago by types .
MIT · Repository · Original npm · Tarball · package.json
$ gnpm install @types/serve-index 
SYNC missed versions from official npm registry.

Installation

npm install --save @types/serve-index

Summary

This package contains type definitions for serve-index (https://github.com/expressjs/serve-index).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/serve-index.

index.d.ts

// Type definitions for serve-index 1.9
// Project: https://github.com/expressjs/serve-index
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

import { Handler } from 'express';
import { Stats } from 'fs';

/** Serves pages that contain directory listings for a given path. */
declare function serveIndex(path: string, options?: serveIndex.Options): Handler;

declare namespace serveIndex {
    interface File {
        name: string;
        stat: Stats;
    }

    interface Locals {
        directory: string;
        displayIcons: boolean;
        fileList: File[];
        name: string;
        stat: Stats;
        path: string;
        style: string;
        viewName: string;
    }

    type TemplateCallback = (error: Error | null, htmlString?: string) => void;

    interface Options {
        filter?: ((filename: string, index: number, files: File[], dir: string) => boolean) | undefined;
        hidden?: boolean | undefined;
        icons?: boolean | undefined;
        stylesheet?: string | undefined;
        template?: string | ((locals: Locals, callback: TemplateCallback) => void) | undefined;
        view?: string | undefined;
    }
}

export = serveIndex;

Additional Details

  • Last updated: Tue, 06 Jul 2021 16:34:37 GMT
  • Dependencies: @types/express
  • Global values: none

Credits

These definitions were written by Tanguy Krotoff.

Current Tags

  • 1.9.1                                ...           latest (3 years ago)
  • 1.7.28                                ...           ts2.0 (8 years ago)
  • 1.7.28                                ...           ts2.1 (8 years ago)
  • 1.7.29                                ...           ts2.2 (7 years ago)
  • 1.7.30                                ...           ts2.3 (5 years ago)
  • 1.7.30                                ...           ts2.4 (5 years ago)
  • 1.7.30                                ...           ts2.5 (5 years ago)
  • 1.7.30                                ...           ts2.6 (5 years ago)
  • 1.7.30                                ...           ts2.7 (5 years ago)
  • 1.7.30                                ...           ts2.8 (5 years ago)
  • 1.7.30                                ...           ts2.9 (5 years ago)
  • 1.7.30                                ...           ts3.0 (5 years ago)
  • 1.7.30                                ...           ts3.1 (5 years ago)
  • 1.7.30                                ...           ts3.2 (5 years ago)
  • 1.7.30                                ...           ts3.3 (5 years ago)
  • 1.7.30                                ...           ts3.4 (5 years ago)
  • 1.7.30                                ...           ts3.5 (5 years ago)
  • 1.9.1                                ...           ts3.6 (3 years ago)
  • 1.9.1                                ...           ts3.7 (3 years ago)
  • 1.9.1                                ...           ts3.8 (3 years ago)
  • 1.9.1                                ...           ts3.9 (3 years ago)
  • 1.9.1                                ...           ts4.0 (3 years ago)
  • 1.9.1                                ...           ts4.1 (3 years ago)
  • 1.9.1                                ...           ts4.2 (3 years ago)
  • 1.9.1                                ...           ts4.3 (3 years ago)
  • 1.9.1                                ...           ts4.4 (3 years ago)
  • 1.9.1                                ...           ts4.5 (3 years ago)
  • 1.9.1                                ...           ts4.6 (3 years ago)
  • 1.9.1                                ...           ts4.7 (3 years ago)
  • 1.9.1                                ...           ts4.8 (3 years ago)
  • 1.9.1                                ...           ts4.9 (3 years ago)
  • 1.9.1                                ...           ts5.0 (3 years ago)
  • 1.9.1                                ...           ts5.1 (3 years ago)

15 Versions

  • 1.9.1                                ...           3 years ago
  • 1.9.0                                ...           3 years ago
  • 1.7.30                                ...           5 years ago
  • 1.7.29                                ...           7 years ago
  • 1.7.28                                ...           8 years ago
  • 1.7.27                                ...           8 years ago
  • 1.7.26-alpha                                ...           8 years ago
  • 1.7.25-alpha                                ...           8 years ago
  • 1.7.24-alpha                                ...           8 years ago
  • 1.7.23-alpha                                ...           8 years ago
  • 1.7.22-alpha                                ...           8 years ago
  • 1.7.21-alpha                                ...           9 years ago
  • 1.7.20-alpha                                ...           9 years ago
  • 1.7.15-alpha                                ...           9 years ago
  • 1.7.14-alpha                                ...           9 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |