mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Added convert-string (#35047)
* Updated react-native-dotenv Updated react-native-dotenv * Fixed errors fixed linting error * Added Convert String Added type definitions for convert string * Fixed Errors Fixed linting errors. * Fixed bugs Fixed bugs with incorrect exports. * Fixed test error Fixed error thrown my azure devops. * Updated after code review Updated tsconfig to change noImplicitAny to false. * Updated tsconfig Updated tsconfig. * Added Changess * Removed changes to react-native-dotenv Removed changes from dot-env. * react-native-dotenv This library should not be updated, this is on the wrong branch.
This commit is contained in:
committed by
Wesley Wigham
parent
af02c4bcb1
commit
0abde3e92b
7
types/convert-string/convert-string-tests.ts
Normal file
7
types/convert-string/convert-string-tests.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { convertString } from "convert-string";
|
||||
|
||||
const utf8Bytes = convertString.UTF8.stringToBytes("Test ♥");
|
||||
const utf8Message = convertString.UTF8.bytesToString(utf8Bytes);
|
||||
|
||||
const bytes = convertString.stringToBytes("Hello");
|
||||
const message = convertString.bytesToString(bytes);
|
||||
14
types/convert-string/index.d.ts
vendored
Normal file
14
types/convert-string/index.d.ts
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
// Type definitions for convert-string 0.1
|
||||
// Project: https://github.com/baz/foo (Does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.)
|
||||
// Definitions by: Haseeb Majid <https://github.com/hmajid2301>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export namespace convertString {
|
||||
function stringToBytes(str: string): number[];
|
||||
function bytesToString(bytes: number[]): string;
|
||||
|
||||
namespace UTF8 {
|
||||
function stringToBytes(str: string): number[];
|
||||
function bytesToString(bytes: number[]): string;
|
||||
}
|
||||
}
|
||||
16
types/convert-string/tsconfig.json
Normal file
16
types/convert-string/tsconfig.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": ["index.d.ts", "convert-string-tests.ts"]
|
||||
}
|
||||
1
types/convert-string/tslint.json
Normal file
1
types/convert-string/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user