session-flash 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.d.ts +21 -14
  2. package/package.json +1 -1
package/lib/index.d.ts CHANGED
@@ -1,18 +1,25 @@
1
+ import type { RequestHandler } from "express";
2
+ import "express-serve-static-core";
1
3
 
2
- declare namespace Express {
3
- export interface Request {
4
- flash(): { [key: string]: string[] };
5
- flash(message: string): string[];
6
- flash(type: string, message: string[] | string): number;
7
- flash(type: string, format: string, ...args: any[]): number;
8
- }
4
+ /* Express Request augmentation */
5
+ declare module "express-serve-static-core" {
6
+ interface Request {
7
+ flash(): { [key: string]: string[] };
8
+ flash(type: string): string[];
9
+ flash(type: string, message: string | string[]): number;
10
+ flash(type: string, format: string, ...args: unknown[]): number;
11
+ }
9
12
  }
10
13
 
14
+ /* session-flash module declaration */
11
15
  declare module "session-flash" {
12
- import express = require("express");
13
- interface IConnectFlashOptions {
14
- unsafe?: boolean | undefined;
15
- }
16
- function e(options?: IConnectFlashOptions): express.RequestHandler;
17
- export = e;
18
- }
16
+ interface SessionFlashOptions {
17
+ unsafe?: boolean;
18
+ }
19
+
20
+ function sessionFlash(
21
+ options?: SessionFlashOptions
22
+ ): RequestHandler;
23
+
24
+ export = sessionFlash;
25
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "session-flash",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Flash message middleware for express.",
5
5
  "main": "./lib/index.cjs",
6
6
  "module": "./lib/index.mjs",