UNPKG

1.36 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
4 * This code may only be used under the BSD style license found at
5 * http://polymer.github.io/LICENSE.txt
6 * The complete set of authors may be found at
7 * http://polymer.github.io/AUTHORS.txt
8 * The complete set of contributors may be found at
9 * http://polymer.github.io/CONTRIBUTORS.txt
10 * Code distributed by Google as part of the polymer project is also
11 * subject to an additional IP rights grant found at
12 * http://polymer.github.io/PATENTS.txt
13 */
14import { UAParser } from 'ua-parser-js';
15/**
16 * A feature supported by a web browser.
17 */
18export declare type BrowserCapability = 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'push' | 'serviceworker' | 'modules';
19export declare type UserAgentPredicate = (ua: InstanceType<typeof UAParser>) => boolean;
20/**
21 * Return the set of capabilities for a user agent string.
22 */
23export declare function browserCapabilities(userAgent: string): Set<BrowserCapability>;
24/**
25 * Parse a "x.y.z" version string of any length into integer parts. Returns -1
26 * for a part that doesn't parse.
27 */
28export declare function parseVersion(version: string | undefined): number[];
29/**
30 * Return whether `version` is at least as high as `atLeast`.
31 */
32export declare function versionAtLeast(atLeast: number[], version: number[]): boolean;