/ live.thehmm.nl / back / node_modules / @types / serve-index /

[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[   ]LICENSE4 years ago1.1K 
[TXT]README.md4 years ago1.9Kd7c1522 post receive test [كارل مبارك]
[TXT]index.d.ts4 years ago1.2K 
[   ]package.json2 years ago1.7K 
README.md

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

Credits

These definitions were written by Tanguy Krotoff.

Apache/2.4.38 (Debian) Server at www.karls.computer Port 80