@thumbmarkjs/thumbmarkjs 0.14.8 → 0.15.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.
Files changed (32) hide show
  1. package/LICENSE +0 -0
  2. package/dist/thumbmark.cjs.js +1 -1
  3. package/dist/thumbmark.cjs.js.map +1 -1
  4. package/dist/thumbmark.esm.d.ts +2 -1
  5. package/dist/thumbmark.esm.js +1 -1
  6. package/dist/thumbmark.esm.js.map +1 -1
  7. package/dist/thumbmark.umd.js +1 -1
  8. package/dist/thumbmark.umd.js.map +1 -1
  9. package/dist/types/components/audio/audio.d.ts +1 -0
  10. package/dist/types/components/canvas/canvas.d.ts +2 -0
  11. package/dist/types/components/fonts/fonts.d.ts +2 -0
  12. package/dist/types/components/hardware/hardware.d.ts +1 -0
  13. package/dist/types/components/index.d.ts +16 -0
  14. package/dist/types/components/locales/locales.d.ts +1 -0
  15. package/dist/types/components/math/math.d.ts +1 -0
  16. package/dist/types/components/permissions/permissions.d.ts +2 -0
  17. package/dist/types/components/plugins/plugins.d.ts +2 -0
  18. package/dist/types/components/screen/screen.d.ts +1 -0
  19. package/dist/types/components/system/browser.d.ts +6 -0
  20. package/dist/types/components/system/system.d.ts +1 -0
  21. package/dist/types/components/webgl/webgl.d.ts +1 -0
  22. package/dist/types/factory.d.ts +30 -0
  23. package/dist/types/fingerprint/functions.d.ts +10 -0
  24. package/dist/types/fingerprint/options.d.ts +11 -0
  25. package/dist/types/index.d.ts +5 -0
  26. package/dist/types/utils/commonPixels.d.ts +1 -0
  27. package/dist/types/utils/ephemeralIFrame.d.ts +4 -0
  28. package/dist/types/utils/getMostFrequent.d.ts +5 -0
  29. package/dist/types/utils/hash.d.ts +1 -0
  30. package/dist/types/utils/imageDataToDataURL.d.ts +1 -0
  31. package/dist/types/utils/raceAll.d.ts +9 -0
  32. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ interface BrowserResult {
2
+ name: string;
3
+ version: string;
4
+ }
5
+ export declare function getBrowser(): BrowserResult;
6
+ 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,4 @@
1
+ export declare function ephemeralIFrame(callback: ({ iframe }: {
2
+ iframe: Document;
3
+ }) => void): Promise<any>;
4
+ export declare function wait<T = void>(durationMs: number, resolveWith?: T): Promise<T>;
@@ -0,0 +1,5 @@
1
+ export declare function mostFrequentValuesInArrayOfDictionaries(arr: {
2
+ [key: string]: any;
3
+ }[], keys: string[]): {
4
+ [key: string]: any;
5
+ };
@@ -0,0 +1 @@
1
+ export declare function hash(key: string, seed?: number): string;
@@ -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 {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thumbmarkjs/thumbmarkjs",
3
- "version": "0.14.8",
3
+ "version": "0.15.0",
4
4
  "description": "",
5
5
  "main": "./dist/thumbmark.cjs.js",
6
6
  "module": "./dist/thumbmark.esm.js",