caniuse-support
Version:
Query the caniuse offline database for feature support.
29 lines (28 loc) • 985 B
TypeScript
/**
* @license
* Copyright (C) 2016 Chi Vinh Le and contributors.
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
import { Browser } from "./browser";
export interface Support {
level: "unknown" | "none" | "partial" | "full";
needPrefix: boolean;
notes: number[];
}
/**
* Query the caniuse database for feature support.
*
* @param {String} feature see full list https://github.com/Fyrd/caniuse/tree/master/features-json.
* @param {{id: string; version: string}} browser
*/
export declare function getSupport(feature: string, browser: Browser): Support;
/**
* Get matching browser version index of the caniuse db.
* Will return last known version index if target version > any known versions.
* Returns an empty string if target version < any known versions.
*
* @param {{id: string; version: string}} browser
*/
export declare function getVersionIndex(browser: Browser): string;