mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
Add types for direction (#41512)
This commit is contained in:
parent
bd90367295
commit
d3c0fd9415
5
types/direction/direction-tests.ts
Normal file
5
types/direction/direction-tests.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import direction = require('direction');
|
||||
|
||||
direction('anglais'); // $ExpectType Direction
|
||||
direction('بسيطة'); // $ExpectType Direction
|
||||
direction('?'); // $ExpectType Direction
|
||||
21
types/direction/index.d.ts
vendored
Normal file
21
types/direction/index.d.ts
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
// Type definitions for direction 1.0
|
||||
// Project: https://github.com/wooorm/direction#readme
|
||||
// Definitions by: Andrey Romanov <https://github.com/andrew--r>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace direction {
|
||||
type Direction = 'ltr' | 'rtl' | 'neutral';
|
||||
}
|
||||
|
||||
/**
|
||||
* Detect direction: left-to-right, right-to-left, or neutral.
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* direction('anglais') // => 'ltr'
|
||||
* direction('بسيطة') // => 'rtl'
|
||||
* direction('?') // => 'neutral'
|
||||
* ```
|
||||
*/
|
||||
declare function direction(value: string): direction.Direction;
|
||||
export = direction;
|
||||
23
types/direction/tsconfig.json
Normal file
23
types/direction/tsconfig.json
Normal file
@ -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",
|
||||
"direction-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/direction/tslint.json
Normal file
1
types/direction/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user