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

3.0.2 • Public • Published

Installation

npm install --save @types/eff-diceware-passphrase

Summary

This package contains type definitions for eff-diceware-passphrase (https://github.com/emilbayes/eff-diceware-passphrase).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/eff-diceware-passphrase.

index.d.ts

export = generatePassphrase;

/**
 * Generate a list of `count` words, randomly shuffled and without replacement.
 *
 * @example
 * import generatePassphrase = require('eff-diceware-passphrase')
 *
 * generatePassphrase(8) // List of 8 words
 */
declare function generatePassphrase(count: number): string[];

declare namespace generatePassphrase {
    /**
     * Sorted array of all words in the Diceware list.
     */
    const words: readonly string[];
    /**
     * Convenience function for generating a password with at least `mimimum` bits of entropy.
     *
     * @example
     * import generatePassphrase = require('eff-diceware-passphrase')
     *
     * generatePassphrase.entropy(100) // List of words with at least 100 bits of entropy
     */
    function entropy(minimum: number): string[];
    /**
     * Like `Array.prototype.indexOf`.
     *
     * @returns The index in `generatePassphrase.words` or `-1` if not found.
     */
    function indexOf(word: string): number;
    /**
     * Like `Array.prototype.includes`.
     *
     * @returns `true` if part of `generatePassphrase.words` or `false` if not found.
     */
    function includes(word: string): boolean;
    /**
     * Can be used to slice the list for eg. autocomplete.
     *
     * @returns The index of the first occurrence of the `prefix`, or the end of the wordlist if no prefixes match.
     */
    function indexOfPrefix(prefix: string): number;
}

Additional Details

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

Credits

These definitions were written by BendingBender.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/eff-diceware-passphrase

Weekly Downloads

1

Version

3.0.2

License

MIT

Unpacked Size

5.55 kB

Total Files

5

Last publish

Collaborators

  • types