mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 13:00:19 +00:00
fast-chunk-string: initial definition (#40207)
This commit is contained in:
committed by
Nathan Shively-Sanders
parent
acdd3d40c6
commit
7221daab35
@@ -0,0 +1,19 @@
|
||||
import fastChunkString = require("fast-chunk-string");
|
||||
|
||||
// $ExpectType string[]
|
||||
fastChunkString("AABBCC", { size: 2 });
|
||||
|
||||
// $ExpectType string[]
|
||||
fastChunkString("😀😃😄😁", { size: 2, unicodeAware: false });
|
||||
|
||||
// $ExpectType string[]
|
||||
fastChunkString("😀😃😄😁", { size: 2, unicodeAware: true });
|
||||
|
||||
// $ExpectError
|
||||
fastChunkString("missing options");
|
||||
|
||||
// $ExpectError
|
||||
fastChunkString("missing size", { unicodeAware: false });
|
||||
|
||||
// $ExpectError
|
||||
fastChunkString(null, { size: 2 });
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
// Type definitions for fast-chunk-string 1.0
|
||||
// Project: https://github.com/vladgolubev/fast-chunk-string#readme
|
||||
// Definitions by: Junxiao Shi <https://github.com/yoursunny>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface Options {
|
||||
size: number;
|
||||
unicodeAware?: boolean;
|
||||
}
|
||||
|
||||
declare function fastChunkString(str: string, options: Options): string[];
|
||||
|
||||
export = fastChunkString;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"fast-chunk-string-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user