UNPKG

@thumbmarkjs/thumbmarkjs

Version:

![GitHub package.json dynamic](https://img.shields.io/github/package-json/version/ilkkapeltola/thumbmarkjs) ![NPM Version](https://img.shields.io/npm/v/@thumbmarkjs/thumbmarkjs) ![NPM Downloads](https://img.shields.io/npm/dm/%40thumbmarkjs%2Fthumbmarkjs

45 lines (41 loc) 1.6 kB
/** * This file is used to create the includeComponent function as well as the interfaces each of the * fingerprint components must implement. * */ interface componentInterface { [key: string]: string | string[] | number | boolean | componentInterface; } interface componentFunctionInterface { (): Promise<componentInterface>; } /** * includeComponent is the function each component function needs to call in order for the component to be included * in the fingerprint. * @param {string} name - the name identifier of the component * @param {componentFunctionInterface} creationFunction - the function that implements the component * @returns */ declare const includeComponent: (name: string, creationFunction: componentFunctionInterface) => void; declare function getVersion(): string; declare function getFingerprintData(): Promise<componentInterface>; declare function getFingerprint(includeData?: false): Promise<string>; declare function getFingerprint(includeData: true): Promise<{ hash: string; data: componentInterface; }>; declare function getFingerprintPerformance(): Promise<{ [key: string]: any; }>; interface optionsInterface { exclude: string[]; include: string[]; webgl_runs?: number; canvas_runs?: number; permissions_to_check?: PermissionName[]; retries?: number; timeout: number; logging: boolean; } declare function setOption<K extends keyof optionsInterface>(key: K, value: optionsInterface[K]): void; export { getFingerprint, getFingerprintData, getFingerprintPerformance, getVersion, includeComponent, setOption };