Skip to content

[RFC]: improve type declarations for @stdlib/ndarray/array #1088

Open
@kgryte

Description

@kgryte

Description

This RFC proposes improving the TypeScript type declarations for @stdlib/ndarray/array. Currently, type declarations do not account for dtype information.

Ideally, we'd improve declarations such that

  • based on a provided dtype option value, we return an ndarray of the corresponding type (e.g., if dtype = 'float64', then return a float64ndarray, etc).
  • when not provided a dtype option value, we use the buffer argument/option to infer a corresponding output ndarray dtype.

Supporting the above is likely to require extensive use of function overloads in a manner to what we've done elsewhere in the project when a dtype can effect output results.

Related Issues

No.

Questions

No.

Other

No.

Checklist

  • I have read and understood the Code of Conduct.
  • Searched for existing issues and pull requests.
  • The issue name begins with RFC:.

Metadata

Metadata

Labels

AcceptedRFC feature request which has been accepted.EnhancementIssue or pull request for enhancing existing functionality.RFCRequest for comments. Feature requests and proposed changes.TypeScriptIssue involves or relates to TypeScript.difficulty: 2May require some initial design or R&D, but should be straightforward to resolve and/or implement.priority: HighHigh priority concern or feature request.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions