<!--

@license Apache-2.0

Copyright (c) 2025 The Stdlib Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

-->

# dtypeChars

> List of ndarray data type single letter character abbreviations.

<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->

<section class="intro">

</section>

<!-- /.intro -->

<!-- Package usage documentation. -->

<section class="usage">

## Usage

```javascript
var dtypeChars = require( '@stdlib/ndarray/base/dtype-chars' );
```

#### dtypeChars( \[kind] )

Returns a list of ndarray data type single letter character abbreviations.

```javascript
var out = dtypeChars();
// e.g., returns [ 'r', 'j', 'c', 'z', ... ]
```

When not provided a data type "kind", the function returns an array containing the single letter character abbreviations for all supported ndarray [data types][@stdlib/ndarray/dtypes]. To return the subset of data type single letter character abbreviations belonging to a specified data type kind, provide a `kind` argument.

```javascript
var out = dtypeChars( 'floating_point' );
// returns [...]
```

The function supports the following data type kinds:

-   `floating_point`: floating-point data types.
-   `real_floating_point`: real-valued floating-point data types.
-   `complex_floating_point`: complex-valued floating-point data types.
-   `boolean`: boolean data types.
-   `integer`: integer data types.
-   `signed_integer`: signed integer data types.
-   `unsigned_integer`: unsigned integer data types.
-   `real`: real-valued data types.
-   `numeric`: numeric data types.
-   `typed`: typed data types.
-   `integer_index`: integer index data types.
-   `boolean_index`: boolean index data types.
-   `mask_index`: mask index data types.
-   `typed_index`: typed index data types.
-   `index`: index data types.
-   `all`: all data types.

Additionally, the function supports extending the "kinds" listed above by appending an `_and_generic` suffix to the kind name (e.g., `real_and_generic`).

```javascript
var out = dtypeChars( 'floating_point_and_generic' );
// returns [...]
```

</section>

<!-- /.usage -->

<!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="notes">

</section>

<!-- /.notes -->

<!-- Package usage examples. -->

<section class="examples">

## Examples

<!-- eslint no-undef: "error" -->

```javascript
var contains = require( '@stdlib/array/base/assert/contains' ).factory;
var dtypeChars = require( '@stdlib/ndarray/base/dtype-chars' );

var isdtypeChar = contains( dtypeChars() );

var bool = isdtypeChar( 'd' );
// returns true

bool = isdtypeChar( 'k' );
// returns true

bool = isdtypeChar( 'b' );
// returns true

bool = isdtypeChar( '~' );
// returns false
```

</section>

<!-- /.examples -->

<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="references">

</section>

<!-- /.references -->

<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->

<section class="related">

</section>

<!-- /.related -->

<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="links">

[@stdlib/ndarray/dtypes]: https://github.com/stdlib-js/ndarray/tree/main/dtypes

</section>

<!-- /.links -->
