mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 21:10:23 +00:00
Merge pull request #14449 from lith-light-g/master
Add type definitions for cookie-signature
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
import * as cookie from "cookie-signature";
|
||||
|
||||
let val = cookie.sign('hello', 'tobiiscool');
|
||||
|
||||
val = cookie.sign('hello', 'tobiiscool');
|
||||
cookie.unsign(val, 'tobiiscool');
|
||||
cookie.unsign(val, 'luna');
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
// Type definitions for cookie-signature 1.0
|
||||
// Project: https://github.com/tj/node-cookie-signature
|
||||
// Definitions by: François Nguyen <https://github.com/lith-light-g>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* Sign the given `val` with `secret`.
|
||||
* @param {string} val
|
||||
* @param {string} secret
|
||||
* @return {string}
|
||||
*/
|
||||
export function sign(value: string, secret: string): string;
|
||||
|
||||
/**
|
||||
* Unsign and decode the given `val` with `secret`,
|
||||
* returning `false` if the signature is invalid.
|
||||
* @param {string} val
|
||||
* @param {string} secret
|
||||
* @return {string|boolean}
|
||||
*/
|
||||
export function unsign(value: string, secret: string): string | boolean;
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"cookie-signature-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
Reference in New Issue
Block a user