Socket
Socket
Sign inDemoInstall

@types/serve-index

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/serve-index - npm Package Compare versions

Comparing version 1.7.30 to 1.9.0

25

serve-index/index.d.ts

@@ -1,17 +0,16 @@

// Type definitions for serve-index v1.7.2
// 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
// TypeScript Version: 2.3
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;
import * as express from 'express';
import * as fs from 'fs';
declare namespace serveIndex {
interface File {
name: string;
stat: fs.Stats;
stat: Stats;
}

@@ -22,5 +21,5 @@

displayIcons: boolean;
fileList: Array<File>;
fileList: File[];
name: string;
stat: fs.Stats;
stat: Stats;
path: string;

@@ -31,10 +30,10 @@ style: string;

type templateCallback = (error: Error, htmlString?: string) => void;
type TemplateCallback = (error: Error | null, htmlString?: string) => void;
interface Options {
filter?: (filename: string, index: number, files: Array<File>, dir: string) => boolean;
filter?: (filename: string, index: number, files: File[], dir: string) => boolean;
hidden?: boolean;
icons?: boolean;
stylesheet?: string;
template?: string | ((locals: Locals, callback: templateCallback) => void);
template?: string | ((locals: Locals, callback: TemplateCallback) => void);
view?: string;

@@ -44,4 +43,2 @@ }

declare function serveIndex(path: string, options?: serveIndex.Options): express.Handler;
export = serveIndex;
{
"name": "@types/serve-index",
"version": "1.7.30",
"version": "1.9.0",
"description": "TypeScript definitions for serve-index",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/serve-index",
"license": "MIT",

@@ -14,3 +15,3 @@ "contributors": [

"main": "",
"types": "index",
"types": "index.d.ts",
"repository": {

@@ -25,4 +26,4 @@ "type": "git",

},
"typesPublisherContentHash": "826c2ec1d6fa09b26585a666bf4618057d20b4a39898774cd98ff2461802555a",
"typeScriptVersion": "2.3"
"typesPublisherContentHash": "75cbc7fa57423a54f457411271de6fb41de255d445abba3a1d6c8843395b8219",
"typeScriptVersion": "3.6"
}

@@ -8,10 +8,55 @@ # Installation

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/serve-index
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/serve-index.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/serve-index/index.d.ts)
````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
Additional Details
* Last updated: Mon, 19 Aug 2019 00:51:18 GMT
* Dependencies: @types/express
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;
hidden?: boolean;
icons?: boolean;
stylesheet?: string;
template?: string | ((locals: Locals, callback: TemplateCallback) => void);
view?: string;
}
}
export = serveIndex;
````
### Additional Details
* Last updated: Wed, 23 Jun 2021 21:01:20 GMT
* Dependencies: [@types/express](https://npmjs.com/package/@types/express)
* Global values: none
# Credits
These definitions were written by Tanguy Krotoff <https://github.com/tkrotoff>.
These definitions were written by [Tanguy Krotoff](https://github.com/tkrotoff).

Sorry, the diff of this file is not supported yet

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