Merge pull request #18047 from huhuanming/react-native-keep-awake

Add react-native-keep-awake
This commit is contained in:
Ryan Cavanaugh
2017-07-14 00:20:27 -07:00
committed by GitHub
4 changed files with 62 additions and 0 deletions
+12
View 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>
);
}
}
@@ -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"
]
}
@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}