mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-13 08:57:26 +08:00
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
// Type definitions for Hashids.js 1.x
|
|
// Project: https://github.com/ivanakimov/hashids.node.js
|
|
// Definitions by: Paulo Cesar <https://github.com/pocesar/>
|
|
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
|
|
|
/// <reference path="../node/node.d.ts" />
|
|
|
|
declare module Hashids {
|
|
|
|
export interface IHashids {
|
|
new(salt: string, minHashLength?: number, alphabet?: string): IHashids;
|
|
version: string;
|
|
minAlphabetLength: number;
|
|
sepDiv: number;
|
|
guardDiv: number;
|
|
errorAlphabetLength: string;
|
|
errorAlphabetSpace: string;
|
|
alphabet: string[];
|
|
seps: string;
|
|
minHashLength: number;
|
|
salt: string;
|
|
decode(hash: string): number[];
|
|
encode(arg: number): string;
|
|
encode(arg: number[]): string;
|
|
encode(...args: number[]): string;
|
|
encodeHex(str: string): string;
|
|
decodeHex(hash: string): string;
|
|
hash(input: number, alphabet: string): string;
|
|
unhash(input: string[], alphabet: string): number;
|
|
}
|
|
}
|
|
|
|
declare module 'hashids' {
|
|
var hashids: Hashids.IHashids;
|
|
export = hashids;
|
|
} |