fp.d.ts 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634
  1. /**
  2. * FingerprintJS v4.6.2 - Copyright (c) FingerprintJS, Inc, 2025 (https://fingerprint.com)
  3. *
  4. * Licensed under Business Source License 1.1 https://mariadb.com/bsl11/
  5. * Licensor: FingerprintJS, Inc.
  6. * Licensed Work: FingerprintJS browser fingerprinting library
  7. * Additional Use Grant: None
  8. * Change Date: Four years from first release for the specific version.
  9. * Change License: MIT, text at https://opensource.org/license/mit/ with the following copyright notice:
  10. * Copyright 2015-present FingerprintJS, Inc.
  11. */
  12. type MaybePromise<T> = Promise<T> | T;
  13. /**
  14. * A functions that returns data with entropy to identify visitor.
  15. *
  16. * See https://github.com/fingerprintjs/fingerprintjs/blob/master/contributing.md#how-to-add-an-entropy-source
  17. * to learn how entropy source works and how to make your own.
  18. */
  19. type Source<TOptions, TValue> = (options: TOptions) => MaybePromise<TValue | (() => MaybePromise<TValue>)>;
  20. /**
  21. * Generic dictionary of unknown sources
  22. */
  23. type UnknownSources<TOptions> = Record<string, Source<TOptions, unknown>>;
  24. /**
  25. * Converts an entropy source type into the component type
  26. */
  27. type SourceValue<TSource extends Source<any, any>> = TSource extends Source<any, infer T> ? T : never;
  28. /**
  29. * Result of getting entropy data from a source
  30. */
  31. type Component<T> = ({
  32. value: T;
  33. } | {
  34. error: unknown;
  35. }) & {
  36. duration: number;
  37. };
  38. /**
  39. * Generic dictionary of unknown components
  40. */
  41. type UnknownComponents = Record<string, Component<unknown>>;
  42. /**
  43. * Converts an entropy source list type to a corresponding component list type.
  44. *
  45. * Warning for package users:
  46. * This type is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
  47. */
  48. type SourcesToComponents<TSources extends UnknownSources<any>> = {
  49. [K in keyof TSources]: Component<SourceValue<TSources[K]>>;
  50. };
  51. /**
  52. * Loads the given entropy sources. Returns a function that collects the entropy components.
  53. *
  54. * The result is returned synchronously in order to allow start getting the components
  55. * before the sources are loaded completely.
  56. *
  57. * Warning for package users:
  58. * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
  59. */
  60. declare function loadSources<TSourceOptions, TSources extends UnknownSources<TSourceOptions>, TExclude extends string>(sources: TSources, sourceOptions: TSourceOptions, excludeSources: readonly TExclude[], loopReleaseInterval?: number): () => Promise<Omit<SourcesToComponents<TSources>, TExclude>>;
  61. /**
  62. * Modifies an entropy source by transforming its returned value with the given function.
  63. * Keeps the source properties: sync/async, 1/2 stages.
  64. *
  65. * Warning for package users:
  66. * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
  67. */
  68. declare function transformSource<TOptions, TValueBefore, TValueAfter>(source: Source<TOptions, TValueBefore>, transformValue: (value: TValueBefore) => TValueAfter): Source<TOptions, TValueAfter>;
  69. /**
  70. * A deep description: https://fingerprint.com/blog/audio-fingerprinting/
  71. * Inspired by and based on https://github.com/cozylife/audio-fingerprint
  72. *
  73. * A version of the entropy source with stabilization to make it suitable for static fingerprinting.
  74. * Audio signal is noised in private mode of Safari 17, so audio fingerprinting is skipped in Safari 17.
  75. */
  76. declare function getAudioFingerprint(): number | (() => Promise<number>);
  77. /**
  78. * A version of the entropy source without stabilization.
  79. *
  80. * Warning for package users:
  81. * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
  82. */
  83. declare function getUnstableAudioFingerprint(): number | (() => Promise<number>);
  84. declare function getFonts(): Promise<string[]>;
  85. type PluginMimeTypeData = {
  86. type: string;
  87. suffixes: string;
  88. };
  89. type PluginData = {
  90. name: string;
  91. description: string;
  92. mimeTypes: PluginMimeTypeData[];
  93. };
  94. declare function getPlugins(): PluginData[] | undefined;
  95. interface CanvasFingerprint {
  96. winding: boolean;
  97. geometry: string;
  98. text: string;
  99. }
  100. /**
  101. * @see https://www.browserleaks.com/canvas#how-does-it-work
  102. *
  103. * A version of the entropy source with stabilization to make it suitable for static fingerprinting.
  104. * Canvas image is noised in private mode of Safari 17, so image rendering is skipped in Safari 17.
  105. */
  106. declare function getCanvasFingerprint(): CanvasFingerprint;
  107. /**
  108. * A version of the entropy source without stabilization.
  109. *
  110. * Warning for package users:
  111. * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
  112. */
  113. declare function getUnstableCanvasFingerprint(skipImages?: boolean): CanvasFingerprint;
  114. type TouchSupport = {
  115. maxTouchPoints: number;
  116. /** The success or failure of creating a TouchEvent */
  117. touchEvent: boolean;
  118. /** The availability of the "ontouchstart" property */
  119. touchStart: boolean;
  120. };
  121. /**
  122. * This is a crude and primitive touch screen detection. It's not possible to currently reliably detect the availability
  123. * of a touch screen with a JS, without actually subscribing to a touch event.
  124. *
  125. * @see http://www.stucox.com/blog/you-cant-detect-a-touchscreen/
  126. * @see https://github.com/Modernizr/Modernizr/issues/548
  127. */
  128. declare function getTouchSupport(): TouchSupport;
  129. declare function getOsCpu(): string | undefined;
  130. declare function getLanguages(): string[][];
  131. declare function getColorDepth(): number;
  132. declare function getDeviceMemory(): number | undefined;
  133. type ScreenResolution = [number | null, number | null];
  134. /**
  135. * A version of the entropy source with stabilization to make it suitable for static fingerprinting.
  136. * The window resolution is always the document size in private mode of Safari 17,
  137. * so the window resolution is not used in Safari 17.
  138. */
  139. declare function getScreenResolution(): ScreenResolution | undefined;
  140. /**
  141. * A version of the entropy source without stabilization.
  142. *
  143. * Warning for package users:
  144. * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
  145. */
  146. declare function getUnstableScreenResolution(): ScreenResolution;
  147. /**
  148. * The order matches the CSS side order: top, right, bottom, left.
  149. *
  150. * @ignore Named array elements aren't used because of multiple TypeScript compatibility complaints from users
  151. */
  152. type FrameSize = [number | null, number | null, number | null, number | null];
  153. /**
  154. * A version of the entropy source without stabilization.
  155. *
  156. * Warning for package users:
  157. * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
  158. */
  159. declare function getUnstableScreenFrame(): () => Promise<FrameSize>;
  160. /**
  161. * A version of the entropy source with stabilization to make it suitable for static fingerprinting.
  162. *
  163. * Sometimes the available screen resolution changes a bit, e.g. 1900x1440 → 1900x1439. A possible reason: macOS Dock
  164. * shrinks to fit more icons when there is too little space. The rounding is used to mitigate the difference.
  165. *
  166. * The frame width is always 0 in private mode of Safari 17, so the frame is not used in Safari 17.
  167. */
  168. declare function getScreenFrame(): () => Promise<FrameSize | undefined>;
  169. declare function getHardwareConcurrency(): number | undefined;
  170. declare function getTimezone(): string;
  171. declare function getSessionStorage(): boolean;
  172. declare function getLocalStorage(): boolean;
  173. declare function getIndexedDB(): boolean | undefined;
  174. declare function getOpenDatabase(): boolean;
  175. declare function getCpuClass(): string | undefined;
  176. declare function getPlatform(): string;
  177. declare function getVendor(): string;
  178. /**
  179. * Checks for browser-specific (not engine specific) global variables to tell browsers with the same engine apart.
  180. * Only somewhat popular browsers are considered.
  181. */
  182. declare function getVendorFlavors(): string[];
  183. /**
  184. * navigator.cookieEnabled cannot detect custom or nuanced cookie blocking configurations. For example, when blocking
  185. * cookies via the Advanced Privacy Settings in IE9, it always returns true. And there have been issues in the past with
  186. * site-specific exceptions. Don't rely on it.
  187. *
  188. * @see https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cookies.js Taken from here
  189. */
  190. declare function areCookiesEnabled(): boolean;
  191. type Options$1 = {
  192. debug?: boolean;
  193. };
  194. /**
  195. * The order of the returned array means nothing (it's always sorted alphabetically).
  196. *
  197. * Notice that the source is slightly unstable.
  198. * Safari provides a 2-taps way to disable all content blockers on a page temporarily.
  199. * Also content blockers can be disabled permanently for a domain, but it requires 4 taps.
  200. * So empty array shouldn't be treated as "no blockers", it should be treated as "no signal".
  201. * If you are a website owner, don't make your visitors want to disable content blockers.
  202. */
  203. declare function getDomBlockers({ debug }?: Options$1): Promise<string[] | undefined>;
  204. type ColorGamut = 'srgb' | 'p3' | 'rec2020';
  205. /**
  206. * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/color-gamut
  207. */
  208. declare function getColorGamut(): ColorGamut | undefined;
  209. /**
  210. * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/inverted-colors
  211. */
  212. declare function areColorsInverted(): boolean | undefined;
  213. /**
  214. * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/forced-colors
  215. */
  216. declare function areColorsForced(): boolean | undefined;
  217. /**
  218. * If the display is monochrome (e.g. black&white), the value will be ≥0 and will mean the number of bits per pixel.
  219. * If the display is not monochrome, the returned value will be 0.
  220. * If the browser doesn't support this feature, the returned value will be undefined.
  221. *
  222. * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/monochrome
  223. */
  224. declare function getMonochromeDepth(): number | undefined;
  225. /**
  226. * @see https://www.w3.org/TR/mediaqueries-5/#prefers-contrast
  227. * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-contrast
  228. */
  229. declare function getContrastPreference(): number | undefined;
  230. /**
  231. * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion
  232. */
  233. declare function isMotionReduced(): boolean | undefined;
  234. /**
  235. * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-transparency
  236. */
  237. declare function isTransparencyReduced(): boolean | undefined;
  238. /**
  239. * @see https://www.w3.org/TR/mediaqueries-5/#dynamic-range
  240. */
  241. declare function isHDR(): boolean | undefined;
  242. /**
  243. * @see https://gitlab.torproject.org/legacy/trac/-/issues/13018
  244. * @see https://bugzilla.mozilla.org/show_bug.cgi?id=531915
  245. */
  246. declare function getMathFingerprint(): Record<string, number>;
  247. /**
  248. * The result is a dictionary of the width of the text samples.
  249. * Heights aren't included because they give no extra entropy and are unstable.
  250. *
  251. * The result is very stable in IE 11, Edge 18 and Safari 14.
  252. * The result changes when the OS pixel density changes in Chromium 87. The real pixel density is required to solve,
  253. * but seems like it's impossible: https://stackoverflow.com/q/1713771/1118709.
  254. * The "min" and the "mono" (only on Windows) value may change when the page is zoomed in Firefox 87.
  255. */
  256. declare function getFontPreferences(): Promise<Record<string, number>>;
  257. declare function isPdfViewerEnabled(): boolean | undefined;
  258. /**
  259. * Unlike most other architectures, on x86/x86-64 when floating-point instructions
  260. * have no NaN arguments, but produce NaN output, the output NaN has sign bit set.
  261. * We use it to distinguish x86/x86-64 from other architectures, by doing subtraction
  262. * of two infinities (must produce NaN per IEEE 754 standard).
  263. *
  264. * See https://codebrowser.bddppq.com/pytorch/pytorch/third_party/XNNPACK/src/init.c.html#79
  265. */
  266. declare function getArchitecture(): number;
  267. /**
  268. * The return type is a union instead of the enum, because it's too challenging to embed the const enum into another
  269. * project. Turning it into a union is a simple and an elegant solution.
  270. */
  271. declare function getApplePayState(): 0 | 1 | -1 | -2 | -3;
  272. /**
  273. * Checks whether the Safari's Privacy Preserving Ad Measurement setting is on.
  274. * The setting is on when the value is not undefined.
  275. * A.k.a. private click measurement, privacy-preserving ad attribution.
  276. *
  277. * Unfortunately, it doesn't work in mobile Safari.
  278. * Probably, it will start working in mobile Safari or stop working in desktop Safari later.
  279. * We've found no way to detect the setting state in mobile Safari. Help wanted.
  280. *
  281. * @see https://webkit.org/blog/11529/introducing-private-click-measurement-pcm/
  282. * @see https://developer.apple.com/videos/play/wwdc2021/10033
  283. */
  284. declare function getPrivateClickMeasurement(): string | undefined;
  285. /**
  286. * WebGL basic features
  287. */
  288. type WebGlBasicsPayload = {
  289. version: string;
  290. vendor: string;
  291. vendorUnmasked: string;
  292. renderer: string;
  293. rendererUnmasked: string;
  294. shadingLanguageVersion: string;
  295. };
  296. /**
  297. * WebGL extended features
  298. */
  299. type WebGlExtensionsPayload = {
  300. contextAttributes: string[];
  301. parameters: string[];
  302. shaderPrecisions: string[];
  303. extensions: string[] | null;
  304. extensionParameters: string[];
  305. unsupportedExtensions: string[];
  306. };
  307. type CanvasContext = WebGLRenderingContext & {
  308. readonly canvas: HTMLCanvasElement;
  309. };
  310. type Options = {
  311. cache: {
  312. webgl?: {
  313. context: CanvasContext | undefined;
  314. };
  315. };
  316. };
  317. /** WebGl context is not available */
  318. declare const STATUS_NO_GL_CONTEXT = -1;
  319. /** WebGL context `getParameter` method is not a function */
  320. declare const STATUS_GET_PARAMETER_NOT_A_FUNCTION = -2;
  321. type SpecialStatus = typeof STATUS_NO_GL_CONTEXT | typeof STATUS_GET_PARAMETER_NOT_A_FUNCTION;
  322. /**
  323. * Gets the basic and simple WebGL parameters
  324. */
  325. declare function getWebGlBasics({ cache }: Options): WebGlBasicsPayload | SpecialStatus;
  326. /**
  327. * Gets the advanced and massive WebGL parameters and extensions
  328. */
  329. declare function getWebGlExtensions({ cache }: Options): WebGlExtensionsPayload | SpecialStatus;
  330. /**
  331. * This function usually takes the most time to execute in all the sources, therefore we cache its result.
  332. *
  333. * Warning for package users:
  334. * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
  335. */
  336. declare function getWebGLContext(cache: Options['cache']): CanvasContext | undefined;
  337. declare function getAudioContextBaseLatency(): number;
  338. /**
  339. * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/resolvedOptions
  340. *
  341. * The return type is a union instead of a const enum due to the difficulty of embedding const enums in other projects.
  342. * This makes integration simpler and more elegant.
  343. */
  344. declare function getDateTimeLocale(): string | -1 | -2 | -3;
  345. /**
  346. * The list of entropy sources used to make visitor identifiers.
  347. *
  348. * This value isn't restricted by Semantic Versioning, i.e. it may be changed without bumping minor or major version of
  349. * this package.
  350. *
  351. * Note: Rollup and Webpack are smart enough to remove unused properties of this object during tree-shaking, so there is
  352. * no need to export the sources individually.
  353. */
  354. declare const sources: {
  355. fonts: typeof getFonts;
  356. domBlockers: typeof getDomBlockers;
  357. fontPreferences: typeof getFontPreferences;
  358. audio: typeof getAudioFingerprint;
  359. screenFrame: typeof getScreenFrame;
  360. canvas: typeof getCanvasFingerprint;
  361. osCpu: typeof getOsCpu;
  362. languages: typeof getLanguages;
  363. colorDepth: typeof getColorDepth;
  364. deviceMemory: typeof getDeviceMemory;
  365. screenResolution: typeof getScreenResolution;
  366. hardwareConcurrency: typeof getHardwareConcurrency;
  367. timezone: typeof getTimezone;
  368. sessionStorage: typeof getSessionStorage;
  369. localStorage: typeof getLocalStorage;
  370. indexedDB: typeof getIndexedDB;
  371. openDatabase: typeof getOpenDatabase;
  372. cpuClass: typeof getCpuClass;
  373. platform: typeof getPlatform;
  374. plugins: typeof getPlugins;
  375. touchSupport: typeof getTouchSupport;
  376. vendor: typeof getVendor;
  377. vendorFlavors: typeof getVendorFlavors;
  378. cookiesEnabled: typeof areCookiesEnabled;
  379. colorGamut: typeof getColorGamut;
  380. invertedColors: typeof areColorsInverted;
  381. forcedColors: typeof areColorsForced;
  382. monochrome: typeof getMonochromeDepth;
  383. contrast: typeof getContrastPreference;
  384. reducedMotion: typeof isMotionReduced;
  385. reducedTransparency: typeof isTransparencyReduced;
  386. hdr: typeof isHDR;
  387. math: typeof getMathFingerprint;
  388. pdfViewerEnabled: typeof isPdfViewerEnabled;
  389. architecture: typeof getArchitecture;
  390. applePay: typeof getApplePayState;
  391. privateClickMeasurement: typeof getPrivateClickMeasurement;
  392. audioBaseLatency: typeof getAudioContextBaseLatency;
  393. dateTimeLocale: typeof getDateTimeLocale;
  394. webGlBasics: typeof getWebGlBasics;
  395. webGlExtensions: typeof getWebGlExtensions;
  396. };
  397. /**
  398. * List of components from the built-in entropy sources.
  399. *
  400. * Warning! This type is out of Semantic Versioning, i.e. may have incompatible changes within a major version. If you
  401. * want to avoid breaking changes, use `UnknownComponents` instead that is more generic but guarantees backward
  402. * compatibility within a major version. This is because browsers change constantly and therefore entropy sources have
  403. * to change too.
  404. */
  405. type BuiltinComponents = SourcesToComponents<typeof sources>;
  406. interface Confidence {
  407. /**
  408. * A number between 0 and 1 that tells how much the agent is sure about the visitor identifier.
  409. * The higher the number, the higher the chance of the visitor identifier to be true.
  410. */
  411. score: number;
  412. /**
  413. * Additional details about the score as a human-readable text
  414. */
  415. comment?: string;
  416. }
  417. /**
  418. * Options for Fingerprint class loading
  419. */
  420. interface LoadOptions {
  421. /**
  422. * When browser doesn't support `requestIdleCallback` a `setTimeout` will be used. This number is only for Safari and
  423. * old Edge, because Chrome/Blink based browsers support `requestIdleCallback`. The value is in milliseconds.
  424. * @default 50
  425. */
  426. delayFallback?: number;
  427. /**
  428. * Whether to print debug messages to the console.
  429. * Required to ease investigations of problems.
  430. */
  431. debug?: boolean;
  432. }
  433. /**
  434. * Options for getting visitor identifier
  435. */
  436. interface GetOptions {
  437. /**
  438. * Whether to print debug messages to the console.
  439. *
  440. * @deprecated Use the `debug` option of `load()` instead
  441. */
  442. debug?: boolean;
  443. }
  444. /**
  445. * Result of getting a visitor identifier
  446. */
  447. interface GetResult {
  448. /**
  449. * The visitor identifier
  450. */
  451. visitorId: string;
  452. /**
  453. * A confidence score that tells how much the agent is sure about the visitor identifier
  454. */
  455. confidence: Confidence;
  456. /**
  457. * List of components that has formed the visitor identifier.
  458. *
  459. * Warning! The type of this property is specific but out of Semantic Versioning, i.e. may have incompatible changes
  460. * within a major version. If you want to avoid breaking changes, treat the property as having type
  461. * `UnknownComponents` that is more generic but guarantees backward compatibility within a major version.
  462. */
  463. components: BuiltinComponents;
  464. /**
  465. * The fingerprinting algorithm version
  466. *
  467. * @see https://github.com/fingerprintjs/fingerprintjs#version-policy For more details
  468. */
  469. version: string;
  470. }
  471. /**
  472. * Agent object that can get visitor identifier
  473. */
  474. interface Agent {
  475. /**
  476. * Gets the visitor identifier
  477. */
  478. get(options?: Readonly<GetOptions>): Promise<GetResult>;
  479. }
  480. declare function componentsToDebugString(components: UnknownComponents): string;
  481. declare function hashComponents(components: UnknownComponents): string;
  482. /**
  483. * A delay is required to ensure consistent entropy components.
  484. * See https://github.com/fingerprintjs/fingerprintjs/issues/254
  485. * and https://github.com/fingerprintjs/fingerprintjs/issues/307
  486. * and https://github.com/fingerprintjs/fingerprintjs/commit/945633e7c5f67ae38eb0fea37349712f0e669b18
  487. */
  488. declare function prepareForSources(delayFallback?: number): Promise<void>;
  489. /**
  490. * Builds an instance of Agent and waits a delay required for a proper operation.
  491. */
  492. declare function load(options?: Readonly<LoadOptions>): Promise<Agent>;
  493. /**
  494. * Given a string and an optional seed as an int, returns a 128 bit
  495. * hash using the x64 flavor of MurmurHash3, as an unsigned hex.
  496. * All internal functions mutates passed value to achieve minimal memory allocations and GC load
  497. *
  498. * Benchmark https://jsbench.me/p4lkpaoabi/1
  499. */
  500. declare function x64hash128(input: string, seed?: number): string;
  501. /**
  502. * Checks whether the browser is based on Trident (the Internet Explorer engine) without using user-agent.
  503. *
  504. * Warning for package users:
  505. * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
  506. */
  507. declare function isTrident(): boolean;
  508. /**
  509. * Checks whether the browser is based on EdgeHTML (the pre-Chromium Edge engine) without using user-agent.
  510. *
  511. * Warning for package users:
  512. * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
  513. */
  514. declare function isEdgeHTML(): boolean;
  515. /**
  516. * Checks whether the browser is based on Chromium without using user-agent.
  517. *
  518. * Warning for package users:
  519. * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
  520. */
  521. declare function isChromium(): boolean;
  522. /**
  523. * Checks whether the browser is based on mobile or desktop Safari without using user-agent.
  524. * All iOS browsers use WebKit (the Safari engine).
  525. *
  526. * Warning for package users:
  527. * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
  528. */
  529. declare function isWebKit(): boolean;
  530. /**
  531. * Checks whether this WebKit browser is a desktop browser.
  532. * It doesn't check that the browser is based on WebKit, there is a separate function for this.
  533. *
  534. * Warning for package users:
  535. * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
  536. */
  537. declare function isDesktopWebKit(): boolean;
  538. /**
  539. * Checks whether the browser is based on Gecko (Firefox engine) without using user-agent.
  540. *
  541. * Warning for package users:
  542. * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
  543. */
  544. declare function isGecko(): boolean;
  545. /**
  546. * Warning for package users:
  547. * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
  548. */
  549. declare function getFullscreenElement(): Element | null;
  550. /**
  551. * Checks whether the device runs on Android without using user-agent.
  552. *
  553. * Warning for package users:
  554. * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
  555. */
  556. declare function isAndroid(): boolean;
  557. /**
  558. * Checks whether the browser is Samsung Internet without using user-agent.
  559. * It doesn't check that the browser is based on Chromium, please use `isChromium` before using this function.
  560. *
  561. * Warning for package users:
  562. * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
  563. */
  564. declare function isSamsungInternet(): boolean;
  565. /**
  566. * Creates and keeps an invisible iframe while the given function runs.
  567. * The given function is called when the iframe is loaded and has a body.
  568. * The iframe allows to measure DOM sizes inside itself.
  569. *
  570. * Notice: passing an initial HTML code doesn't work in IE.
  571. *
  572. * Warning for package users:
  573. * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
  574. */
  575. declare function withIframe<T>(action: (iframe: HTMLIFrameElement, iWindow: typeof window) => MaybePromise<T>, initialHtml?: string, domPollInterval?: number): Promise<T>;
  576. declare const _default: {
  577. load: typeof load;
  578. hashComponents: typeof hashComponents;
  579. componentsToDebugString: typeof componentsToDebugString;
  580. };
  581. /** Not documented, out of Semantic Versioning, usage is at your own risk */
  582. declare const murmurX64Hash128: typeof x64hash128;
  583. export { Agent, BuiltinComponents, Component, Confidence, GetOptions, GetResult, LoadOptions, Source, SourcesToComponents, UnknownComponents, UnknownSources, componentsToDebugString, _default as default, getFullscreenElement, getUnstableAudioFingerprint, getUnstableCanvasFingerprint, getUnstableScreenFrame, getUnstableScreenResolution, getWebGLContext, hashComponents, isAndroid, isChromium, isDesktopWebKit, isEdgeHTML, isGecko, isSamsungInternet, isTrident, isWebKit, load, loadSources, murmurX64Hash128, prepareForSources, sources, transformSource, withIframe };