mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Add browser-or-node types (#41910)
This commit is contained in:
13
types/browser-or-node/browser-or-node-tests.ts
Normal file
13
types/browser-or-node/browser-or-node-tests.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { isBrowser, isWebWorker, isNode } from 'browser-or-node';
|
||||
|
||||
if (isBrowser) {
|
||||
console.log('isBrowser');
|
||||
}
|
||||
|
||||
if (isWebWorker) {
|
||||
console.log('isBrowser');
|
||||
}
|
||||
|
||||
if (isNode) {
|
||||
console.log('isBrowser');
|
||||
}
|
||||
9
types/browser-or-node/index.d.ts
vendored
Normal file
9
types/browser-or-node/index.d.ts
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
// Type definitions for browser-or-node 1.2
|
||||
// Project: https://github.com/flexdinesh/browser-or-node
|
||||
// Definitions by: Jussi Kinnula <https://github.com/jussikinnula>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
export const isBrowser: boolean;
|
||||
export const isWebWorker: boolean;
|
||||
export const isNode: boolean;
|
||||
24
types/browser-or-node/tsconfig.json
Normal file
24
types/browser-or-node/tsconfig.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"browser-or-node-tests.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
3
types/browser-or-node/tslint.json
Normal file
3
types/browser-or-node/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user