@thumbmarkjs/thumbmarkjs 0.14.8 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +0 -0
- package/dist/thumbmark.cjs.js +1 -1
- package/dist/thumbmark.cjs.js.map +1 -1
- package/dist/thumbmark.esm.d.ts +2 -1
- package/dist/thumbmark.esm.js +1 -1
- package/dist/thumbmark.esm.js.map +1 -1
- package/dist/thumbmark.umd.js +1 -1
- package/dist/thumbmark.umd.js.map +1 -1
- package/dist/types/components/audio/audio.d.ts +1 -0
- package/dist/types/components/canvas/canvas.d.ts +2 -0
- package/dist/types/components/fonts/fonts.d.ts +2 -0
- package/dist/types/components/hardware/hardware.d.ts +1 -0
- package/dist/types/components/index.d.ts +16 -0
- package/dist/types/components/locales/locales.d.ts +1 -0
- package/dist/types/components/math/math.d.ts +1 -0
- package/dist/types/components/permissions/permissions.d.ts +2 -0
- package/dist/types/components/plugins/plugins.d.ts +2 -0
- package/dist/types/components/screen/screen.d.ts +1 -0
- package/dist/types/components/system/browser.d.ts +6 -0
- package/dist/types/components/system/system.d.ts +1 -0
- package/dist/types/components/webgl/webgl.d.ts +1 -0
- package/dist/types/factory.d.ts +30 -0
- package/dist/types/fingerprint/functions.d.ts +10 -0
- package/dist/types/fingerprint/options.d.ts +11 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/utils/commonPixels.d.ts +1 -0
- package/dist/types/utils/ephemeralIFrame.d.ts +4 -0
- package/dist/types/utils/getMostFrequent.d.ts +5 -0
- package/dist/types/utils/hash.d.ts +5 -0
- package/dist/types/utils/imageDataToDataURL.d.ts +1 -0
- package/dist/types/utils/raceAll.d.ts +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Does anyone have a cleaner way of doing this?
|
|
3
|
+
* I want to import all the components in this folder
|
|
4
|
+
* Feels a little dumb I'm doing this manually.
|
|
5
|
+
*/
|
|
6
|
+
import './audio/audio';
|
|
7
|
+
import './canvas/canvas';
|
|
8
|
+
import './fonts/fonts';
|
|
9
|
+
import './hardware/hardware';
|
|
10
|
+
import './locales/locales';
|
|
11
|
+
import './permissions/permissions';
|
|
12
|
+
import './plugins/plugins';
|
|
13
|
+
import './screen/screen';
|
|
14
|
+
import './system/system';
|
|
15
|
+
import './webgl/webgl';
|
|
16
|
+
import './math/math';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is used to create the includeComponent function as well as the interfaces each of the
|
|
3
|
+
* fingerprint components must implement.
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export interface componentInterface {
|
|
7
|
+
[key: string]: string | string[] | number | boolean | componentInterface;
|
|
8
|
+
}
|
|
9
|
+
export interface componentFunctionInterface {
|
|
10
|
+
(): Promise<componentInterface>;
|
|
11
|
+
}
|
|
12
|
+
export declare const components: {
|
|
13
|
+
[name: string]: componentFunctionInterface;
|
|
14
|
+
};
|
|
15
|
+
export declare const timeoutInstance: componentInterface;
|
|
16
|
+
/**
|
|
17
|
+
* includeComponent is the function each component function needs to call in order for the component to be included
|
|
18
|
+
* in the fingerprint.
|
|
19
|
+
* @param {string} name - the name identifier of the component
|
|
20
|
+
* @param {componentFunctionInterface} creationFunction - the function that implements the component
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
export declare const includeComponent: (name: string, creationFunction: componentFunctionInterface) => void;
|
|
24
|
+
/**
|
|
25
|
+
* The function turns the map of component functions to a map of Promises when called
|
|
26
|
+
* @returns {[name: string]: <Promise>componentInterface}
|
|
27
|
+
*/
|
|
28
|
+
export declare const getComponentPromises: () => {
|
|
29
|
+
[k: string]: Promise<componentInterface>;
|
|
30
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { componentInterface } from '../factory';
|
|
2
|
+
export declare function getFingerprintData(): Promise<componentInterface>;
|
|
3
|
+
export declare function getFingerprint(includeData?: false): Promise<string>;
|
|
4
|
+
export declare function getFingerprint(includeData: true): Promise<{
|
|
5
|
+
hash: string;
|
|
6
|
+
data: componentInterface;
|
|
7
|
+
}>;
|
|
8
|
+
export declare function getFingerprintPerformance(): Promise<{
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface optionsInterface {
|
|
2
|
+
exclude?: string[];
|
|
3
|
+
include?: string[];
|
|
4
|
+
webgl_runs?: number;
|
|
5
|
+
canvas_runs?: number;
|
|
6
|
+
permissions_to_check?: PermissionName[];
|
|
7
|
+
retries?: number;
|
|
8
|
+
timeout?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare let options: optionsInterface;
|
|
11
|
+
export declare function setOption<K extends keyof optionsInterface>(key: K, value: optionsInterface[K]): void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { getFingerprint, getFingerprintData, getFingerprintPerformance } from './fingerprint/functions';
|
|
2
|
+
import { setOption } from './fingerprint/options';
|
|
3
|
+
import './components';
|
|
4
|
+
declare function getVersion(): string;
|
|
5
|
+
export { setOption, getVersion, getFingerprint, getFingerprintData, getFingerprintPerformance };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getCommonPixels(images: ImageData[], width: number, height: number): ImageData;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function imageDataToDataURL(imageData: ImageData): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type DelayedPromise<T> = Promise<T>;
|
|
2
|
+
export declare function delay<T>(t: number, val: T): DelayedPromise<T>;
|
|
3
|
+
export interface RaceResult<T> {
|
|
4
|
+
value: T;
|
|
5
|
+
elapsed?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function raceAllPerformance<T>(promises: Promise<T>[], timeoutTime: number, timeoutVal: T): Promise<RaceResult<T>[]>;
|
|
8
|
+
export declare function raceAll<T>(promises: Promise<T>[], timeoutTime: number, timeoutVal: T): Promise<(T | undefined)[]>;
|
|
9
|
+
export {};
|