@types/rison
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Installation

npm install --save @types/rison

Summary

This package contains type definitions for rison (https://github.com/Nanonid/rison).

Details

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

export = rison;
export as namespace rison;
declare const rison: IRison;

interface IRison {
    /**
     * Rison-encodes a javascript structure.
     * @param obj Object to encode.
     * @returns {} Encoded string.
     */
    encode(obj: any): string;

    /**
     * Rison-encodes a javascript object without surrounding parens (O-Rison).
     * @param obj Object to encode.
     * @returns {} Encoded string.
     */
    encode_object<T>(obj: T): string;

    /**
     * Rison-encodes a javascript array without surrounding parens (A-Rison).
     * @param obj Object to encode.
     * @returns {} Encoded string.
     */
    encode_array<T>(arr: T[]): string;

    /**
     * Rison-encodes and then url-escapes a javascript structure.
     * @param obj Object to encode.
     * @returns {} Encoded string.
     */
    encode_uri(obj: any): string;

    /**
     * Parses a Rison string into a javascript structure.
     * @param encoded Encoded string.
     * @returns {} Resulting array or object.
     */
    decode<T>(encoded: string): T;

    /**
     * Parses a O-Rison string into a javascript object.
     * @param encoded Encoded string.
     * @returns {} Resulting object.
     */
    decode_object<T>(encoded: string): T;

    /**
     * Parses a A-Rison string into a javascript array.
     * @param encoded Encoded string.
     * @returns {} Resulting array.
     */
    decode_array<T>(encoded: string): T[];
}

Additional Details

  • Last updated: Mon, 14 Oct 2024 18:09:31 GMT
  • Dependencies: none

Credits

These definitions were written by Andrei Kurosh.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/rison

Weekly Downloads

44,533

Version

0.1.0

License

MIT

Unpacked Size

5.36 kB

Total Files

5

Last publish

Collaborators

  • types