[detect-it] Add typings (#16074)

* Added definition for detect-hover

* Added definition for detect-passive-events

* Added definition for detect-pointer

* Added definition for detect-touch-events

* Added definition for detect-it

* Deleted unnecessary package.json
This commit is contained in:
Thomas Tilkema
2017-04-24 17:07:54 +02:00
committed by Andy
parent 24b56d44ab
commit 931b3306e5
20 changed files with 225 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
import detectHover from 'detect-hover';
detectHover.update();

16
types/detect-hover/index.d.ts vendored Normal file
View File

@@ -0,0 +1,16 @@
// Type definitions for detect-hover 1.0
// Project: https://github.com/rafrex/detect-hover#readme
// Definitions by: Thomas Tilkema <https://github.com/thomastilkema>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface detectHover {
anyHover: boolean;
anyNone: boolean;
hover: boolean;
none: boolean;
update(): void;
}
declare const detectHover: detectHover;
export default detectHover;

View File

@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"detect-hover-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

View File

@@ -0,0 +1,3 @@
import detectIt from 'detect-it';
detectIt.update();

33
types/detect-it/index.d.ts vendored Normal file
View File

@@ -0,0 +1,33 @@
// Type definitions for detect-it 2.1
// Project: https://github.com/rafrex/detect-it#readme
// Definitions by: Thomas Tilkema <https://github.com/thomastilkema>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import detectHover from 'detect-hover';
import detectPassiveEvents from 'detect-passive-events';
import detectPointer from 'detect-pointer';
import detectTouchEvents from 'detect-touch-events';
interface detectIt {
deviceType: 'hybrid' | 'mouseOnly' | 'touchOnly';
hasMouse: boolean;
hasTouch: boolean;
maxTouchPoints: number;
passiveEvents: boolean;
primaryHover: 'hover' | 'none';
primaryPointer: 'coarse' | 'fine' | 'none';
state: state;
update(): void;
}
interface state {
detectHover: detectHover;
detectPassiveEvents: detectPassiveEvents;
detectPointer: detectPointer;
detectTouchEvents: detectTouchEvents;
}
declare const detectIt: detectIt;
export default detectIt;

View File

@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"detect-it-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

View File

@@ -0,0 +1,3 @@
import detectPassiveEvents from 'detect-passive-events';
detectPassiveEvents.update();

13
types/detect-passive-events/index.d.ts vendored Normal file
View File

@@ -0,0 +1,13 @@
// Type definitions for detect-passive-events 1.0
// Project: https://github.com/rafrex/detect-passive-events#readme
// Definitions by: Thomas Tilkema <https://github.com/thomastilkema>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface detectPassiveEvents {
hasSupport: boolean;
update(): void;
}
declare const detectPassiveEvents: detectPassiveEvents;
export default detectPassiveEvents;

View File

@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"detect-passive-events-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

View File

@@ -0,0 +1,3 @@
import detectPointer from 'detect-pointer';
detectPointer.update();

19
types/detect-pointer/index.d.ts vendored Normal file
View File

@@ -0,0 +1,19 @@
// Type definitions for detect-pointer 1.0
// Project: https://github.com/rafrex/detect-pointer#readme
// Definitions by: Thomas Tilkema <https://github.com/thomastilkema>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface detectPointer {
anyCoarse: boolean;
anyFine: boolean;
anyNone: boolean;
coarse: boolean;
fine: boolean;
none: boolean;
update(): void;
}
declare const detectPointer: detectPointer;
export default detectPointer;

View File

@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"detect-pointer-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

View File

@@ -0,0 +1,3 @@
import detectTouchEvents from 'detect-touch-events';
detectTouchEvents.update();

14
types/detect-touch-events/index.d.ts vendored Normal file
View File

@@ -0,0 +1,14 @@
// Type definitions for detect-touch-events 1.0
// Project: https://github.com/rafrex/detect-touch-events#readme
// Definitions by: Thomas Tilkema <https://github.com/thomastilkema>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface detectTouchEvents {
hasApi: boolean;
maxTouchPoints: number;
update(): void;
}
declare const detectTouchEvents: detectTouchEvents;
export default detectTouchEvents;

View File

@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"detect-touch-events-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }