Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/cookie_js

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/cookie_js

TypeScript definitions for cookie_js

  • 1.2.4
  • ts4.5
  • ts4.6
  • ts4.7
  • ts4.8
  • ts4.9
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • ts5.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.7K
increased by8.22%
Maintainers
1
Weekly downloads
 
Created
Source

Installation

npm install --save @types/cookie_js

Summary

This package contains type definitions for cookie_js (https://github.com/florian/cookie.js).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cookie_js.

index.d.ts

declare module "cookie_js" {
    export = cookie;
}

/**
 * https://github.com/DefinitelyTyped/DefinitelyTyped/pull/16025#issuecomment-295784660
 */
declare module "cookiejs" {
    export = cookie;
}

declare function cookie(key: string, fallback?: string): string;
declare function cookie(keys: string[], fallback?: string): string;

interface UtilStatic {
    isArray: (value: any) => boolean;
    isObject: (value: any) => boolean;
    toArray: (...args: any[]) => any[];
    getKeys: (value: {}) => any[];
    encode: (value: string) => string;
    decode: (value: string) => string;
    retrieve: (x: string, y: string) => string;
}

interface Options {
    expires: number | string | Date;
    domain: string;
    path: string;
    secure: boolean;
}

declare namespace cookie {
    /**
     * Create a cookie. The value will automatically be escaped.
     */
    export function set(key: string, value: string, options?: any): void;
    /**
     * Set several cookies at once
     */
    export function set(obj: any, options?: any): void;
    /**
     * Remove cookies
     */
    export function remove(key: string): void;
    export function remove(keys: string[]): void;
    export function remove(...args: string[]): void;
    /**
     * Remove cookies that were set with custom options (e.g. specifing domain or path)
     */
    export function removeSpecific(key: string, options?: any): void;
    export function removeSpecific(keys: string[], options?: any): void;
    /**
     * Remove all cookies
     */
    export function empty(): void;
    /**
     * Retrieve the value of the cookie
     */
    export function get(key: string, fallback?: string): string;
    /**
     * Retrieve values of several cookies
     */
    export function get(keys: string[], fallback?: string): any;
    /**
     * Get all currently saved cookies
     */
    export function all(): any;
    /**
     * Test if cookies are enabled
     */
    export function enabled(): boolean;
    /**
     * Utility methods
     */
    export var utils: UtilStatic;
    /**
     * Set default options
     */
    export var defaults: Options;
}

Additional Details

  • Last updated: Mon, 06 Nov 2023 22:41:05 GMT
  • Dependencies: none

Credits

These definitions were written by slawiko.

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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