mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-01 19:45:48 +08:00
Add react-native-keep-awake
This commit is contained in:
12
types/react-native-keep-awake/index.d.ts
vendored
Normal file
12
types/react-native-keep-awake/index.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
// Type definitions for react-native-keep-awake 2.0
|
||||
// Project: https://github.com/corbt/react-native-keep-awake
|
||||
// Definitions by: huhuanming <https://github.com/huhuanming>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as React from 'react';
|
||||
declare class KeepAwake extends React.Component<{ children?: JSX.Element }> {
|
||||
static activate(): void;
|
||||
static deactivate(): void;
|
||||
}
|
||||
export default KeepAwake;
|
||||
@@ -0,0 +1,24 @@
|
||||
import * as React from 'react';
|
||||
import { View } from 'react-native';
|
||||
import KeepAwake from 'react-native-keep-awake';
|
||||
|
||||
KeepAwake.activate();
|
||||
KeepAwake.deactivate();
|
||||
|
||||
class TestComponent extends React.Component<{}, {}> {
|
||||
render() {
|
||||
return (
|
||||
<KeepAwake />
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class TestChildernComponent extends React.Component<{}, {}> {
|
||||
render() {
|
||||
return (
|
||||
<KeepAwake>
|
||||
<View />
|
||||
</KeepAwake>
|
||||
);
|
||||
}
|
||||
}
|
||||
23
types/react-native-keep-awake/tsconfig.json
Normal file
23
types/react-native-keep-awake/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"jsx": "react"
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"react-native-keep-awake-tests.tsx"
|
||||
]
|
||||
}
|
||||
3
types/react-native-keep-awake/tslint.json
Normal file
3
types/react-native-keep-awake/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user