Add Types for package react-native-base64 (#47127)

Co-authored-by: evan <evanjin@toons.kr>
This commit is contained in:
EvanJin 2020-08-30 17:58:54 +09:00 committed by GitHub
parent 537d3c1655
commit c10f5e1dbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 38 additions and 0 deletions

12
types/react-native-base64/index.d.ts vendored Normal file
View File

@ -0,0 +1,12 @@
// Type definitions for react-native-base64 0.1
// Project: https://github.com/eranbo/react-native-base64#readme
// Definitions by: seongjoojin <https://github.com/seongjoojin>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface Base64 {
encode: (input: string) => string;
decode: (input: string) => string;
}
declare const base64: Base64;
export = base64;

View File

@ -0,0 +1,4 @@
import base64 from 'react-native-base64';
base64.encode('Some string to encode to base64');
base64.decode('SW4gbXkgZXllcywgaW5kaXNwb3NlZA0KSW4gZGlzZ3Vpc2VzIG5vIG9uZSBrbm93cw0KUklQIEND==');

View File

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

View File

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