@thumbmarkjs/thumbmarkjs
Version:
   • 2.61 kB
TypeScript
/**
* This file is used to create the includeComponent function as well as the interfaces each of the
* fingerprint components must implement.
*
*/
import { optionsInterface } from './options';
import getAudio from "./components/audio";
import getCanvas from "./components/canvas";
import getFonts from "./components/fonts";
import getHardware from "./components/hardware";
import getLocales from "./components/locales";
import getMath from "./components/math";
import getPermissions from "./components/permissions";
import getPlugins from "./components/plugins";
import getScreen from "./components/screen";
import getSystem from "./components/system";
import getWebGL from "./components/webgl";
import getIntl from "./components/intl";
import getMediaDevices from "./components/mediaDevices";
import getWebRTC from "./components/webrtc";
import getMathML from "./components/mathml";
import getSpeech from "./components/speech";
/**
* @description key->function map of built-in components. Do not call the function here.
*/
export declare const tm_component_promises: {
audio: typeof getAudio;
canvas: typeof getCanvas;
fonts: typeof getFonts;
hardware: typeof getHardware;
locales: typeof getLocales;
math: typeof getMath;
permissions: typeof getPermissions;
plugins: typeof getPlugins;
screen: typeof getScreen;
system: typeof getSystem;
webgl: typeof getWebGL;
webrtc: typeof getWebRTC;
speech: typeof getSpeech;
};
/**
* @description key->function map of experimental components. Only resolved during logging.
*/
export declare const tm_experimental_component_promises: {
intl: typeof getIntl;
mathml: typeof getMathML;
mediadevices: typeof getMediaDevices;
};
export interface componentInterface {
[key: string]: string | string[] | number | boolean | componentInterface;
}
export interface componentFunctionInterface {
(options?: optionsInterface): Promise<componentInterface | null>;
}
export declare const customComponents: {
[name: string]: componentFunctionInterface | null;
};
export declare const timeoutInstance: componentInterface;
/**
* includeComponent is the function each custom 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 nothing
*/
export declare const includeComponent: (name: string, creationFunction: componentFunctionInterface, options?: optionsInterface) => void;