matrix-react-sdk
Version:
SDK for matrix.org using React
14 lines (13 loc) • 699 B
TypeScript
import { ZxcvbnResult } from "@zxcvbn-ts/core";
import { MatrixClient } from "matrix-js-sdk/src/matrix";
/**
* Wrapper around zxcvbn password strength estimation
* Include this only from async components: it pulls in zxcvbn
* (obviously) which is large.
*
* @param {string} password Password to score
* @param matrixClient the client of the logged-in user, if any
* @param userInputs additional strings such as the user's name which should be considered a bad password component
* @returns {object} Score result with `score` and `feedback` properties
*/
export declare function scorePassword(matrixClient: MatrixClient | null, password: string, userInputs?: string[]): ZxcvbnResult | null;