Add react-native-keep-awake

This commit is contained in:
huhuanming
2017-07-14 10:32:40 +08:00
parent 3d3aff6ed3
commit 8a9ddad8e4
4 changed files with 62 additions and 0 deletions

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;

View File

@@ -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>
);
}
}

View 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"
]
}

View File

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