mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[caniuse-api] Add initial types for caniuse-api
This commit is contained in:
parent
9491811758
commit
1e315508b2
17
types/caniuse-api/caniuse-api-tests.ts
Normal file
17
types/caniuse-api/caniuse-api-tests.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import * as caniuse from "caniuse-api";
|
||||
|
||||
caniuse.features; // $ExpectType string[]
|
||||
|
||||
caniuse.getSupport(""); // $ExpectType BrowserSupport
|
||||
|
||||
caniuse.isSupported("", ""); // $ExpectType boolean
|
||||
caniuse.isSupported("", [""]); // $ExpectType boolean
|
||||
|
||||
caniuse.find(""); // $ExpectType string[]
|
||||
|
||||
caniuse.getLatestStableBrowsers(); // $ExpectType string[]
|
||||
|
||||
caniuse.setBrowserScope(""); // $ExpectType void
|
||||
caniuse.setBrowserScope([""]); // $ExpectType void
|
||||
|
||||
caniuse.getBrowserScope(); // $ExpectType string[]
|
||||
32
types/caniuse-api/index.d.ts
vendored
Normal file
32
types/caniuse-api/index.d.ts
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
// Type definitions for caniuse-api 3.0
|
||||
// Project: https://github.com/nyalab/caniuse-api#readme
|
||||
// Definitions by: Dave Cardwell <https://github.com/davecardwell>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export const features: string[];
|
||||
|
||||
export interface BrowserSupport {
|
||||
[browser: string]: {
|
||||
y?: number;
|
||||
n?: number;
|
||||
a?: number;
|
||||
x?: number;
|
||||
};
|
||||
}
|
||||
|
||||
export function getSupport(feature: string): BrowserSupport;
|
||||
|
||||
export function isSupported(
|
||||
feature: string,
|
||||
browsers: string | ReadonlyArray<string>
|
||||
): boolean;
|
||||
|
||||
export function find(query: string): string[];
|
||||
|
||||
export function getLatestStableBrowsers(): string[];
|
||||
|
||||
export function setBrowserScope(
|
||||
browserscope: string | ReadonlyArray<string>
|
||||
): void;
|
||||
|
||||
export function getBrowserScope(): string[];
|
||||
16
types/caniuse-api/tsconfig.json
Normal file
16
types/caniuse-api/tsconfig.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": ["index.d.ts", "caniuse-api-tests.ts"]
|
||||
}
|
||||
1
types/caniuse-api/tslint.json
Normal file
1
types/caniuse-api/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user