DefinitelyTyped/types/direction/index.d.ts
2020-01-10 16:38:25 -08:00

22 lines
600 B
TypeScript

// 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;