Add types for react-native-huawei-protected-apps (#29664)

This commit is contained in:
Christian Chown
2018-10-11 22:25:22 +01:00
committed by Andy
parent 8baf389b69
commit 7b99141476
4 changed files with 56 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
// Type definitions for react-native-huawei-protected-apps 0.0
// Project: https://github.com/pgengoux/react-native-huawei-protected-apps
// Definitions by: Christian Chown <https://github.com/christianchown>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.9
export interface HuaweiProtectedAppsConfig {
title: string;
text: string;
doNotShowAgainText: string;
positiveText: string;
negativeText: string;
}
declare let HuaweiProtectedApps: {
AlertIfHuaweiDevice(config: HuaweiProtectedAppsConfig): void;
};
export default HuaweiProtectedApps;

View File

@@ -0,0 +1,12 @@
import * as React from "react";
import HuaweiProtectedApps from "react-native-huawei-protected-apps";
const config = {
title: "Huawei Protected Apps",
text: "This app requires to be enabled in 'Protected Apps' in order to receive push notifcations",
doNotShowAgainText: "Do not show again",
positiveText: "PROTECTED APPS",
negativeText: "CANCEL"
};
HuaweiProtectedApps.AlertIfHuaweiDevice(config);

View File

@@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"jsx": "react-native",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"react-native-huawei-protected-apps-tests.tsx"
]
}

View File

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