@ohos-ports/stdlib-process-read-stdin 0.0.0-stage → 0.2.3-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +177 -0
- package/NOTICE +1 -0
- package/README.md +242 -2
- package/SECURITY.md +5 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +7 -0
- package/docs/types/index.d.ts +108 -0
- package/lib/browser.js +66 -0
- package/lib/index.js +47 -0
- package/lib/main.js +159 -0
- package/node_modules/@stdlib/assert-has-node-buffer-support/LICENSE +177 -0
- package/node_modules/@stdlib/assert-has-node-buffer-support/NOTICE +1 -0
- package/node_modules/@stdlib/assert-has-node-buffer-support/README.md +187 -0
- package/node_modules/@stdlib/assert-has-node-buffer-support/SECURITY.md +5 -0
- package/node_modules/@stdlib/assert-has-node-buffer-support/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/assert-has-node-buffer-support/dist/index.js +7 -0
- package/node_modules/@stdlib/assert-has-node-buffer-support/dist/index.js.map +7 -0
- package/node_modules/@stdlib/assert-has-node-buffer-support/docs/types/index.d.ts +35 -0
- package/node_modules/@stdlib/assert-has-node-buffer-support/lib/buffer.js +28 -0
- package/node_modules/@stdlib/assert-has-node-buffer-support/lib/index.js +40 -0
- package/node_modules/@stdlib/assert-has-node-buffer-support/lib/main.js +68 -0
- package/node_modules/@stdlib/assert-has-node-buffer-support/package.json +76 -0
- package/node_modules/@stdlib/assert-has-own-property/LICENSE +177 -0
- package/node_modules/@stdlib/assert-has-own-property/NOTICE +1 -0
- package/node_modules/@stdlib/assert-has-own-property/README.md +263 -0
- package/node_modules/@stdlib/assert-has-own-property/SECURITY.md +5 -0
- package/node_modules/@stdlib/assert-has-own-property/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/assert-has-own-property/dist/index.js +5 -0
- package/node_modules/@stdlib/assert-has-own-property/dist/index.js.map +7 -0
- package/node_modules/@stdlib/assert-has-own-property/docs/types/index.d.ts +49 -0
- package/node_modules/@stdlib/assert-has-own-property/lib/index.js +47 -0
- package/node_modules/@stdlib/assert-has-own-property/lib/main.js +64 -0
- package/node_modules/@stdlib/assert-has-own-property/package.json +74 -0
- package/node_modules/@stdlib/assert-has-symbol-support/LICENSE +177 -0
- package/node_modules/@stdlib/assert-has-symbol-support/NOTICE +1 -0
- package/node_modules/@stdlib/assert-has-symbol-support/README.md +193 -0
- package/node_modules/@stdlib/assert-has-symbol-support/SECURITY.md +5 -0
- package/node_modules/@stdlib/assert-has-symbol-support/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/assert-has-symbol-support/dist/index.js +5 -0
- package/node_modules/@stdlib/assert-has-symbol-support/dist/index.js.map +7 -0
- package/node_modules/@stdlib/assert-has-symbol-support/docs/types/index.d.ts +35 -0
- package/node_modules/@stdlib/assert-has-symbol-support/lib/index.js +40 -0
- package/node_modules/@stdlib/assert-has-symbol-support/lib/main.js +42 -0
- package/node_modules/@stdlib/assert-has-symbol-support/package.json +73 -0
- package/node_modules/@stdlib/assert-has-tostringtag-support/LICENSE +177 -0
- package/node_modules/@stdlib/assert-has-tostringtag-support/NOTICE +1 -0
- package/node_modules/@stdlib/assert-has-tostringtag-support/README.md +187 -0
- package/node_modules/@stdlib/assert-has-tostringtag-support/SECURITY.md +5 -0
- package/node_modules/@stdlib/assert-has-tostringtag-support/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/assert-has-tostringtag-support/dist/index.js +5 -0
- package/node_modules/@stdlib/assert-has-tostringtag-support/dist/index.js.map +7 -0
- package/node_modules/@stdlib/assert-has-tostringtag-support/docs/types/index.d.ts +35 -0
- package/node_modules/@stdlib/assert-has-tostringtag-support/lib/index.js +40 -0
- package/node_modules/@stdlib/assert-has-tostringtag-support/lib/main.js +49 -0
- package/node_modules/@stdlib/assert-has-tostringtag-support/package.json +79 -0
- package/node_modules/@stdlib/assert-is-array/LICENSE +177 -0
- package/node_modules/@stdlib/assert-is-array/NOTICE +1 -0
- package/node_modules/@stdlib/assert-is-array/README.md +183 -0
- package/node_modules/@stdlib/assert-is-array/SECURITY.md +5 -0
- package/node_modules/@stdlib/assert-is-array/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/assert-is-array/dist/index.js +5 -0
- package/node_modules/@stdlib/assert-is-array/dist/index.js.map +7 -0
- package/node_modules/@stdlib/assert-is-array/docs/types/index.d.ts +40 -0
- package/node_modules/@stdlib/assert-is-array/lib/index.js +43 -0
- package/node_modules/@stdlib/assert-is-array/lib/main.js +63 -0
- package/node_modules/@stdlib/assert-is-array/package.json +72 -0
- package/node_modules/@stdlib/assert-is-boolean/LICENSE +177 -0
- package/node_modules/@stdlib/assert-is-boolean/NOTICE +1 -0
- package/node_modules/@stdlib/assert-is-boolean/README.md +228 -0
- package/node_modules/@stdlib/assert-is-boolean/SECURITY.md +5 -0
- package/node_modules/@stdlib/assert-is-boolean/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/assert-is-boolean/dist/index.js +13 -0
- package/node_modules/@stdlib/assert-is-boolean/dist/index.js.map +7 -0
- package/node_modules/@stdlib/assert-is-boolean/docs/types/index.d.ts +125 -0
- package/node_modules/@stdlib/assert-is-boolean/lib/index.js +73 -0
- package/node_modules/@stdlib/assert-is-boolean/lib/main.js +62 -0
- package/node_modules/@stdlib/assert-is-boolean/lib/object.js +68 -0
- package/node_modules/@stdlib/assert-is-boolean/lib/primitive.js +48 -0
- package/node_modules/@stdlib/assert-is-boolean/lib/tostring.js +27 -0
- package/node_modules/@stdlib/assert-is-boolean/lib/try2serialize.js +47 -0
- package/node_modules/@stdlib/assert-is-boolean/package.json +80 -0
- package/node_modules/@stdlib/assert-is-buffer/LICENSE +177 -0
- package/node_modules/@stdlib/assert-is-buffer/NOTICE +1 -0
- package/node_modules/@stdlib/assert-is-buffer/README.md +223 -0
- package/node_modules/@stdlib/assert-is-buffer/SECURITY.md +5 -0
- package/node_modules/@stdlib/assert-is-buffer/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/assert-is-buffer/dist/index.js +5 -0
- package/node_modules/@stdlib/assert-is-buffer/dist/index.js.map +7 -0
- package/node_modules/@stdlib/assert-is-buffer/docs/types/index.d.ts +50 -0
- package/node_modules/@stdlib/assert-is-buffer/lib/index.js +43 -0
- package/node_modules/@stdlib/assert-is-buffer/lib/main.js +70 -0
- package/node_modules/@stdlib/assert-is-buffer/package.json +73 -0
- package/node_modules/@stdlib/assert-is-function/LICENSE +177 -0
- package/node_modules/@stdlib/assert-is-function/NOTICE +1 -0
- package/node_modules/@stdlib/assert-is-function/README.md +192 -0
- package/node_modules/@stdlib/assert-is-function/SECURITY.md +5 -0
- package/node_modules/@stdlib/assert-is-function/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/assert-is-function/dist/index.js +5 -0
- package/node_modules/@stdlib/assert-is-function/dist/index.js.map +7 -0
- package/node_modules/@stdlib/assert-is-function/docs/types/index.d.ts +40 -0
- package/node_modules/@stdlib/assert-is-function/lib/index.js +44 -0
- package/node_modules/@stdlib/assert-is-function/lib/main.js +50 -0
- package/node_modules/@stdlib/assert-is-function/package.json +74 -0
- package/node_modules/@stdlib/assert-is-object-like/LICENSE +177 -0
- package/node_modules/@stdlib/assert-is-object-like/NOTICE +1 -0
- package/node_modules/@stdlib/assert-is-object-like/README.md +264 -0
- package/node_modules/@stdlib/assert-is-object-like/SECURITY.md +5 -0
- package/node_modules/@stdlib/assert-is-object-like/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/assert-is-object-like/dist/index.js +5 -0
- package/node_modules/@stdlib/assert-is-object-like/dist/index.js.map +7 -0
- package/node_modules/@stdlib/assert-is-object-like/docs/types/index.d.ts +48 -0
- package/node_modules/@stdlib/assert-is-object-like/lib/index.js +67 -0
- package/node_modules/@stdlib/assert-is-object-like/lib/main.js +49 -0
- package/node_modules/@stdlib/assert-is-object-like/package.json +79 -0
- package/node_modules/@stdlib/assert-is-string/LICENSE +177 -0
- package/node_modules/@stdlib/assert-is-string/NOTICE +1 -0
- package/node_modules/@stdlib/assert-is-string/README.md +224 -0
- package/node_modules/@stdlib/assert-is-string/SECURITY.md +5 -0
- package/node_modules/@stdlib/assert-is-string/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/assert-is-string/dist/index.js +13 -0
- package/node_modules/@stdlib/assert-is-string/dist/index.js.map +7 -0
- package/node_modules/@stdlib/assert-is-string/docs/types/index.d.ts +101 -0
- package/node_modules/@stdlib/assert-is-string/lib/index.js +73 -0
- package/node_modules/@stdlib/assert-is-string/lib/main.js +50 -0
- package/node_modules/@stdlib/assert-is-string/lib/object.js +65 -0
- package/node_modules/@stdlib/assert-is-string/lib/primitive.js +42 -0
- package/node_modules/@stdlib/assert-is-string/lib/try2valueof.js +47 -0
- package/node_modules/@stdlib/assert-is-string/lib/valueof.js +27 -0
- package/node_modules/@stdlib/assert-is-string/package.json +80 -0
- package/node_modules/@stdlib/assert-tools-array-function/LICENSE +177 -0
- package/node_modules/@stdlib/assert-tools-array-function/NOTICE +1 -0
- package/node_modules/@stdlib/assert-tools-array-function/README.md +216 -0
- package/node_modules/@stdlib/assert-tools-array-function/SECURITY.md +5 -0
- package/node_modules/@stdlib/assert-tools-array-function/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/assert-tools-array-function/dist/index.js +5 -0
- package/node_modules/@stdlib/assert-tools-array-function/dist/index.js.map +7 -0
- package/node_modules/@stdlib/assert-tools-array-function/docs/types/index.d.ts +61 -0
- package/node_modules/@stdlib/assert-tools-array-function/lib/index.js +49 -0
- package/node_modules/@stdlib/assert-tools-array-function/lib/main.js +85 -0
- package/node_modules/@stdlib/assert-tools-array-function/package.json +73 -0
- package/node_modules/@stdlib/boolean-ctor/LICENSE +177 -0
- package/node_modules/@stdlib/boolean-ctor/NOTICE +1 -0
- package/node_modules/@stdlib/boolean-ctor/README.md +264 -0
- package/node_modules/@stdlib/boolean-ctor/SECURITY.md +5 -0
- package/node_modules/@stdlib/boolean-ctor/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/boolean-ctor/dist/index.js +5 -0
- package/node_modules/@stdlib/boolean-ctor/dist/index.js.map +7 -0
- package/node_modules/@stdlib/boolean-ctor/docs/types/index.d.ts +52 -0
- package/node_modules/@stdlib/boolean-ctor/lib/index.js +52 -0
- package/node_modules/@stdlib/boolean-ctor/lib/main.js +51 -0
- package/node_modules/@stdlib/boolean-ctor/package.json +61 -0
- package/node_modules/@stdlib/buffer-ctor/LICENSE +177 -0
- package/node_modules/@stdlib/buffer-ctor/NOTICE +1 -0
- package/node_modules/@stdlib/buffer-ctor/README.md +273 -0
- package/node_modules/@stdlib/buffer-ctor/SECURITY.md +5 -0
- package/node_modules/@stdlib/buffer-ctor/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/buffer-ctor/dist/index.js +19 -0
- package/node_modules/@stdlib/buffer-ctor/dist/index.js.map +7 -0
- package/node_modules/@stdlib/buffer-ctor/docs/types/index.d.ts +37 -0
- package/node_modules/@stdlib/buffer-ctor/lib/index.js +52 -0
- package/node_modules/@stdlib/buffer-ctor/lib/main.js +28 -0
- package/node_modules/@stdlib/buffer-ctor/lib/polyfill.js +37 -0
- package/node_modules/@stdlib/buffer-ctor/package.json +66 -0
- package/node_modules/@stdlib/buffer-from-string/LICENSE +177 -0
- package/node_modules/@stdlib/buffer-from-string/NOTICE +1 -0
- package/node_modules/@stdlib/buffer-from-string/README.md +249 -0
- package/node_modules/@stdlib/buffer-from-string/SECURITY.md +5 -0
- package/node_modules/@stdlib/buffer-from-string/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/buffer-from-string/dist/index.js +19 -0
- package/node_modules/@stdlib/buffer-from-string/dist/index.js.map +7 -0
- package/node_modules/@stdlib/buffer-from-string/docs/types/index.d.ts +42 -0
- package/node_modules/@stdlib/buffer-from-string/lib/has_from.js +34 -0
- package/node_modules/@stdlib/buffer-from-string/lib/index.js +52 -0
- package/node_modules/@stdlib/buffer-from-string/lib/main.js +60 -0
- package/node_modules/@stdlib/buffer-from-string/lib/polyfill.js +60 -0
- package/node_modules/@stdlib/buffer-from-string/package.json +74 -0
- package/node_modules/@stdlib/error-tools-fmtprodmsg/LICENSE +177 -0
- package/node_modules/@stdlib/error-tools-fmtprodmsg/NOTICE +1 -0
- package/node_modules/@stdlib/error-tools-fmtprodmsg/README.md +182 -0
- package/node_modules/@stdlib/error-tools-fmtprodmsg/SECURITY.md +5 -0
- package/node_modules/@stdlib/error-tools-fmtprodmsg/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/error-tools-fmtprodmsg/dist/index.js +5 -0
- package/node_modules/@stdlib/error-tools-fmtprodmsg/dist/index.js.map +7 -0
- package/node_modules/@stdlib/error-tools-fmtprodmsg/docs/types/index.d.ts +39 -0
- package/node_modules/@stdlib/error-tools-fmtprodmsg/lib/index.js +40 -0
- package/node_modules/@stdlib/error-tools-fmtprodmsg/lib/main.js +48 -0
- package/node_modules/@stdlib/error-tools-fmtprodmsg/package.json +71 -0
- package/node_modules/@stdlib/regexp-function-name/LICENSE +177 -0
- package/node_modules/@stdlib/regexp-function-name/NOTICE +1 -0
- package/node_modules/@stdlib/regexp-function-name/README.md +215 -0
- package/node_modules/@stdlib/regexp-function-name/SECURITY.md +5 -0
- package/node_modules/@stdlib/regexp-function-name/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/regexp-function-name/dist/index.js +8 -0
- package/node_modules/@stdlib/regexp-function-name/dist/index.js.map +7 -0
- package/node_modules/@stdlib/regexp-function-name/docs/types/index.d.ts +74 -0
- package/node_modules/@stdlib/regexp-function-name/lib/index.js +61 -0
- package/node_modules/@stdlib/regexp-function-name/lib/main.js +54 -0
- package/node_modules/@stdlib/regexp-function-name/lib/regexp.js +60 -0
- package/node_modules/@stdlib/regexp-function-name/package.json +68 -0
- package/node_modules/@stdlib/streams-node-stdin/LICENSE +177 -0
- package/node_modules/@stdlib/streams-node-stdin/NOTICE +1 -0
- package/node_modules/@stdlib/streams-node-stdin/README.md +227 -0
- package/node_modules/@stdlib/streams-node-stdin/SECURITY.md +5 -0
- package/node_modules/@stdlib/streams-node-stdin/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/streams-node-stdin/dist/index.js +5 -0
- package/node_modules/@stdlib/streams-node-stdin/dist/index.js.map +7 -0
- package/node_modules/@stdlib/streams-node-stdin/docs/types/index.d.ts +31 -0
- package/node_modules/@stdlib/streams-node-stdin/lib/index.js +41 -0
- package/node_modules/@stdlib/streams-node-stdin/lib/main.js +28 -0
- package/node_modules/@stdlib/streams-node-stdin/package.json +65 -0
- package/node_modules/@stdlib/string-base-format-interpolate/LICENSE +177 -0
- package/node_modules/@stdlib/string-base-format-interpolate/NOTICE +1 -0
- package/node_modules/@stdlib/string-base-format-interpolate/README.md +219 -0
- package/node_modules/@stdlib/string-base-format-interpolate/SECURITY.md +5 -0
- package/node_modules/@stdlib/string-base-format-interpolate/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/string-base-format-interpolate/dist/index.js +17 -0
- package/node_modules/@stdlib/string-base-format-interpolate/dist/index.js.map +7 -0
- package/node_modules/@stdlib/string-base-format-interpolate/docs/types/index.d.ts +71 -0
- package/node_modules/@stdlib/string-base-format-interpolate/lib/format_double.js +103 -0
- package/node_modules/@stdlib/string-base-format-interpolate/lib/format_integer.js +115 -0
- package/node_modules/@stdlib/string-base-format-interpolate/lib/index.js +41 -0
- package/node_modules/@stdlib/string-base-format-interpolate/lib/is_number.js +46 -0
- package/node_modules/@stdlib/string-base-format-interpolate/lib/is_string.js +42 -0
- package/node_modules/@stdlib/string-base-format-interpolate/lib/main.js +243 -0
- package/node_modules/@stdlib/string-base-format-interpolate/lib/space_pad.js +65 -0
- package/node_modules/@stdlib/string-base-format-interpolate/lib/zero_pad.js +84 -0
- package/node_modules/@stdlib/string-base-format-interpolate/package.json +72 -0
- package/node_modules/@stdlib/string-base-format-tokenize/LICENSE +177 -0
- package/node_modules/@stdlib/string-base-format-tokenize/NOTICE +1 -0
- package/node_modules/@stdlib/string-base-format-tokenize/README.md +203 -0
- package/node_modules/@stdlib/string-base-format-tokenize/SECURITY.md +5 -0
- package/node_modules/@stdlib/string-base-format-tokenize/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/string-base-format-tokenize/dist/index.js +5 -0
- package/node_modules/@stdlib/string-base-format-tokenize/dist/index.js.map +7 -0
- package/node_modules/@stdlib/string-base-format-tokenize/docs/types/index.d.ts +68 -0
- package/node_modules/@stdlib/string-base-format-tokenize/lib/index.js +41 -0
- package/node_modules/@stdlib/string-base-format-tokenize/lib/main.js +95 -0
- package/node_modules/@stdlib/string-base-format-tokenize/package.json +70 -0
- package/node_modules/@stdlib/string-format/LICENSE +177 -0
- package/node_modules/@stdlib/string-format/NOTICE +1 -0
- package/node_modules/@stdlib/string-format/README.md +341 -0
- package/node_modules/@stdlib/string-format/SECURITY.md +5 -0
- package/node_modules/@stdlib/string-format/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/string-format/dist/index.js +7 -0
- package/node_modules/@stdlib/string-format/dist/index.js.map +7 -0
- package/node_modules/@stdlib/string-format/docs/types/index.d.ts +42 -0
- package/node_modules/@stdlib/string-format/lib/index.js +43 -0
- package/node_modules/@stdlib/string-format/lib/is_string.js +42 -0
- package/node_modules/@stdlib/string-format/lib/main.js +64 -0
- package/node_modules/@stdlib/string-format/package.json +73 -0
- package/node_modules/@stdlib/symbol-ctor/LICENSE +177 -0
- package/node_modules/@stdlib/symbol-ctor/NOTICE +1 -0
- package/node_modules/@stdlib/symbol-ctor/README.md +234 -0
- package/node_modules/@stdlib/symbol-ctor/SECURITY.md +5 -0
- package/node_modules/@stdlib/symbol-ctor/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/symbol-ctor/dist/index.js +5 -0
- package/node_modules/@stdlib/symbol-ctor/dist/index.js.map +7 -0
- package/node_modules/@stdlib/symbol-ctor/docs/types/index.d.ts +34 -0
- package/node_modules/@stdlib/symbol-ctor/lib/index.js +40 -0
- package/node_modules/@stdlib/symbol-ctor/lib/main.js +28 -0
- package/node_modules/@stdlib/symbol-ctor/package.json +63 -0
- package/node_modules/@stdlib/types/LICENSE +177 -0
- package/node_modules/@stdlib/types/NOTICE +1 -0
- package/node_modules/@stdlib/types/README.md +212 -0
- package/node_modules/@stdlib/types/SECURITY.md +5 -0
- package/node_modules/@stdlib/types/index.d.ts +3923 -0
- package/node_modules/@stdlib/types/lib/browser.js +28 -0
- package/node_modules/@stdlib/types/lib/index.js +39 -0
- package/node_modules/@stdlib/types/lib/main.js +40 -0
- package/node_modules/@stdlib/types/package.json +68 -0
- package/node_modules/@stdlib/types/test.ts +734 -0
- package/node_modules/@stdlib/utils-constructor-name/LICENSE +177 -0
- package/node_modules/@stdlib/utils-constructor-name/NOTICE +1 -0
- package/node_modules/@stdlib/utils-constructor-name/README.md +400 -0
- package/node_modules/@stdlib/utils-constructor-name/SECURITY.md +5 -0
- package/node_modules/@stdlib/utils-constructor-name/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/utils-constructor-name/dist/index.js +5 -0
- package/node_modules/@stdlib/utils-constructor-name/dist/index.js.map +7 -0
- package/node_modules/@stdlib/utils-constructor-name/docs/types/index.d.ts +52 -0
- package/node_modules/@stdlib/utils-constructor-name/lib/index.js +46 -0
- package/node_modules/@stdlib/utils-constructor-name/lib/main.js +80 -0
- package/node_modules/@stdlib/utils-constructor-name/package.json +77 -0
- package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/LICENSE +177 -0
- package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/NOTICE +1 -0
- package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/README.md +216 -0
- package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/SECURITY.md +5 -0
- package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/dist/index.js +31 -0
- package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/dist/index.js.map +7 -0
- package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/dist/main.js +58 -0
- package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/docs/types/index.d.ts +52 -0
- package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/lib/index.js +47 -0
- package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/lib/main.js +58 -0
- package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/package.json +93 -0
- package/node_modules/@stdlib/utils-define-property/LICENSE +177 -0
- package/node_modules/@stdlib/utils-define-property/NOTICE +1 -0
- package/node_modules/@stdlib/utils-define-property/README.md +228 -0
- package/node_modules/@stdlib/utils-define-property/SECURITY.md +5 -0
- package/node_modules/@stdlib/utils-define-property/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/utils-define-property/dist/index.js +36 -0
- package/node_modules/@stdlib/utils-define-property/dist/index.js.map +7 -0
- package/node_modules/@stdlib/utils-define-property/docs/types/index.d.ts +52 -0
- package/node_modules/@stdlib/utils-define-property/lib/builtin.js +61 -0
- package/node_modules/@stdlib/utils-define-property/lib/define_property.js +28 -0
- package/node_modules/@stdlib/utils-define-property/lib/has_define_property_support.js +51 -0
- package/node_modules/@stdlib/utils-define-property/lib/index.js +58 -0
- package/node_modules/@stdlib/utils-define-property/lib/polyfill.js +122 -0
- package/node_modules/@stdlib/utils-define-property/package.json +75 -0
- package/node_modules/@stdlib/utils-global/LICENSE +177 -0
- package/node_modules/@stdlib/utils-global/NOTICE +1 -0
- package/node_modules/@stdlib/utils-global/README.md +208 -0
- package/node_modules/@stdlib/utils-global/SECURITY.md +5 -0
- package/node_modules/@stdlib/utils-global/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/utils-global/dist/index.js +36 -0
- package/node_modules/@stdlib/utils-global/dist/index.js.map +7 -0
- package/node_modules/@stdlib/utils-global/docs/types/index.d.ts +40 -0
- package/node_modules/@stdlib/utils-global/lib/browser.js +79 -0
- package/node_modules/@stdlib/utils-global/lib/codegen.js +36 -0
- package/node_modules/@stdlib/utils-global/lib/global.js +28 -0
- package/node_modules/@stdlib/utils-global/lib/global_this.js +28 -0
- package/node_modules/@stdlib/utils-global/lib/index.js +40 -0
- package/node_modules/@stdlib/utils-global/lib/main.js +83 -0
- package/node_modules/@stdlib/utils-global/lib/self.js +28 -0
- package/node_modules/@stdlib/utils-global/lib/window.js +28 -0
- package/node_modules/@stdlib/utils-global/package.json +74 -0
- package/node_modules/@stdlib/utils-native-class/LICENSE +177 -0
- package/node_modules/@stdlib/utils-native-class/NOTICE +1 -0
- package/node_modules/@stdlib/utils-native-class/README.md +349 -0
- package/node_modules/@stdlib/utils-native-class/SECURITY.md +5 -0
- package/node_modules/@stdlib/utils-native-class/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/utils-native-class/dist/index.js +11 -0
- package/node_modules/@stdlib/utils-native-class/dist/index.js.map +7 -0
- package/node_modules/@stdlib/utils-native-class/docs/types/index.d.ts +51 -0
- package/node_modules/@stdlib/utils-native-class/lib/index.js +61 -0
- package/node_modules/@stdlib/utils-native-class/lib/main.js +56 -0
- package/node_modules/@stdlib/utils-native-class/lib/polyfill.js +81 -0
- package/node_modules/@stdlib/utils-native-class/lib/tostring.js +28 -0
- package/node_modules/@stdlib/utils-native-class/lib/tostringtag.js +33 -0
- package/node_modules/@stdlib/utils-native-class/package.json +84 -0
- package/node_modules/@stdlib/utils-next-tick/LICENSE +177 -0
- package/node_modules/@stdlib/utils-next-tick/NOTICE +1 -0
- package/node_modules/@stdlib/utils-next-tick/README.md +183 -0
- package/node_modules/@stdlib/utils-next-tick/SECURITY.md +5 -0
- package/node_modules/@stdlib/utils-next-tick/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/utils-next-tick/dist/index.js +5 -0
- package/node_modules/@stdlib/utils-next-tick/dist/index.js.map +7 -0
- package/node_modules/@stdlib/utils-next-tick/docs/types/index.d.ts +43 -0
- package/node_modules/@stdlib/utils-next-tick/lib/index.js +43 -0
- package/node_modules/@stdlib/utils-next-tick/lib/main.js +72 -0
- package/node_modules/@stdlib/utils-next-tick/package.json +77 -0
- package/node_modules/@stdlib/utils-type-of/LICENSE +177 -0
- package/node_modules/@stdlib/utils-type-of/NOTICE +1 -0
- package/node_modules/@stdlib/utils-type-of/README.md +366 -0
- package/node_modules/@stdlib/utils-type-of/SECURITY.md +5 -0
- package/node_modules/@stdlib/utils-type-of/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/utils-type-of/dist/index.js +15 -0
- package/node_modules/@stdlib/utils-type-of/dist/index.js.map +7 -0
- package/node_modules/@stdlib/utils-type-of/docs/types/index.d.ts +50 -0
- package/node_modules/@stdlib/utils-type-of/lib/check.js +55 -0
- package/node_modules/@stdlib/utils-type-of/lib/fixtures/nodelist.js +34 -0
- package/node_modules/@stdlib/utils-type-of/lib/fixtures/re.js +26 -0
- package/node_modules/@stdlib/utils-type-of/lib/fixtures/typedarray.js +26 -0
- package/node_modules/@stdlib/utils-type-of/lib/index.js +50 -0
- package/node_modules/@stdlib/utils-type-of/lib/main.js +76 -0
- package/node_modules/@stdlib/utils-type-of/lib/polyfill.js +41 -0
- package/node_modules/@stdlib/utils-type-of/package.json +72 -0
- package/package.json +108 -3
|
@@ -0,0 +1,3923 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @license Apache-2.0
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2019 The Stdlib Authors.
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/* eslint-disable max-lines */
|
|
20
|
+
|
|
21
|
+
// TypeScript Version: 4.1
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Module containing array definitions.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* import * as array from `@stdlib/types/array`;
|
|
28
|
+
*
|
|
29
|
+
* const x: array.ArrayLike<number> = [ 1, 2, 3 ];
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* import { ArrayLike } from `@stdlib/types/array`;
|
|
33
|
+
*
|
|
34
|
+
* const x: ArrayLike<number> = [ 1, 2, 3 ];
|
|
35
|
+
*/
|
|
36
|
+
declare module '@stdlib/types/array' {
|
|
37
|
+
import { ComplexLike, Complex64, Complex128 } from '@stdlib/types/complex';
|
|
38
|
+
import { Remap } from '@stdlib/types/utilities';
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Data type.
|
|
42
|
+
*/
|
|
43
|
+
type DataType = NumericDataType | BooleanDataType | 'generic'; // "all"
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Data type for real-valued typed arrays.
|
|
47
|
+
*/
|
|
48
|
+
type RealDataType = RealFloatingPointDataType | IntegerDataType; // "real"
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Data type for real-valued typed arrays.
|
|
52
|
+
*/
|
|
53
|
+
type RealAndGenericDataType = RealDataType | 'generic'; // "real_and_generic"
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Data type for floating-point typed arrays.
|
|
57
|
+
*/
|
|
58
|
+
type RealFloatingPointDataType = 'float64' | 'float32'; // "real_floating_point"
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Data type for floating-point typed arrays.
|
|
62
|
+
*/
|
|
63
|
+
type RealFloatingPointAndGenericDataType = RealFloatingPointDataType | 'generic'; // "real_floating_point_and_generic"
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Data type for integer typed arrays.
|
|
67
|
+
*/
|
|
68
|
+
type IntegerDataType = SignedIntegerDataType | UnsignedIntegerDataType; // "integer"
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Data type for integer typed arrays.
|
|
72
|
+
*/
|
|
73
|
+
type IntegerAndGenericDataType = IntegerDataType | 'generic'; // "integer_and_generic"
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Data type for signed integer typed arrays.
|
|
77
|
+
*/
|
|
78
|
+
type SignedIntegerDataType = 'int32' | 'int16' | 'int8'; // "signed_integer"
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Data type for signed integer typed arrays.
|
|
82
|
+
*/
|
|
83
|
+
type SignedIntegerAndGenericDataType = SignedIntegerDataType | 'generic'; // "signed_integer_and_generic"
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Data type for unsigned integer typed arrays.
|
|
87
|
+
*/
|
|
88
|
+
type UnsignedIntegerDataType = 'uint32' | 'uint16' | 'uint8' | 'uint8c'; // "unsigned_integer"
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Data type for unsigned integer typed arrays.
|
|
92
|
+
*/
|
|
93
|
+
type UnsignedIntegerAndGenericDataType = UnsignedIntegerDataType | 'generic'; // "unsigned_integer_and_generic"
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Data type for complex number typed arrays.
|
|
97
|
+
*/
|
|
98
|
+
type ComplexFloatingPointDataType = 'complex64' | 'complex128'; // "complex_floating_point"
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Data type for complex number typed arrays.
|
|
102
|
+
*/
|
|
103
|
+
type ComplexFloatingPointAndGenericDataType = ComplexFloatingPointDataType | 'generic'; // "complex_floating_point_and_generic"
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Data type for floating-point real or complex typed arrays.
|
|
107
|
+
*/
|
|
108
|
+
type FloatingPointDataType = RealFloatingPointDataType | ComplexFloatingPointDataType; // "floating_point"
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Data type for floating-point real or complex typed arrays.
|
|
112
|
+
*/
|
|
113
|
+
type FloatingPointAndGenericDataType = FloatingPointDataType | 'generic'; // "floating_point_and_generic"
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Data type for real-valued or complex number typed arrays.
|
|
117
|
+
*/
|
|
118
|
+
type NumericDataType = RealDataType | ComplexFloatingPointDataType; // "numeric"
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Data type for real-valued or complex number typed arrays.
|
|
122
|
+
*/
|
|
123
|
+
type NumericAndGenericDataType = NumericDataType | 'generic'; // "numeric_and_generic"
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Data type for boolean typed arrays.
|
|
127
|
+
*/
|
|
128
|
+
type BooleanDataType = 'bool'; // "boolean"
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Data type for boolean and generic arrays.
|
|
132
|
+
*/
|
|
133
|
+
type BooleanAndGenericDataType = BooleanDataType | 'generic'; // "boolean_and_generic"
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Data type for strictly typed arrays.
|
|
137
|
+
*/
|
|
138
|
+
type TypedDataType = RealDataType | ComplexFloatingPointDataType | BooleanDataType; // "typed"
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Data type for strictly typed and generic arrays.
|
|
142
|
+
*/
|
|
143
|
+
type TypedAndGenericDataType = TypedDataType | 'generic'; // "typed_and_generic"
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Strict data type "kinds".
|
|
147
|
+
*/
|
|
148
|
+
type StrictDataTypeKind = 'typed' | 'numeric' | 'real' | 'floating_point' | 'real_floating_point' | 'complex_floating_point' | 'integer' | 'signed_integer' | 'unsigned_integer' | 'boolean';
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Data type "kinds".
|
|
152
|
+
*/
|
|
153
|
+
type DataTypeKind = StrictDataTypeKind | 'all' | 'typed_and_generic' | 'numeric_and_generic' | 'real_and_generic' | 'floating_point_and_generic' | 'real_floating_point_and_generic' | 'complex_floating_point_and_generic' | 'integer_and_generic' | 'signed_integer_and_generic' | 'unsigned_integer_and_generic' | 'boolean_and_generic';
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* An array-like value.
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* const x: ArrayLike<number> = [ 1, 2, 3 ];
|
|
160
|
+
* const y: ArrayLike<number> = new Float64Array( 10 );
|
|
161
|
+
* const z: ArrayLike<string> = 'beep';
|
|
162
|
+
*/
|
|
163
|
+
interface ArrayLike<T> {
|
|
164
|
+
/**
|
|
165
|
+
* Numeric properties.
|
|
166
|
+
*/
|
|
167
|
+
[key: number]: T;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Number of elements.
|
|
171
|
+
*/
|
|
172
|
+
length: number;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* An array-like value which exposes accessors for getting and setting array elements.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* const xbuf: Array = [ 1, 2, 3 ];
|
|
180
|
+
* const x: AccessorArrayLike<number> = {
|
|
181
|
+
* 'length': 3,
|
|
182
|
+
* 'data': xbuf,
|
|
183
|
+
* 'get': ( i: number ): number => xbuf[ i ],
|
|
184
|
+
* 'set': ( value: number, i?: number ): void => {
|
|
185
|
+
* xbuf[ i || 0 ] = value;
|
|
186
|
+
* return;
|
|
187
|
+
* }
|
|
188
|
+
* };
|
|
189
|
+
*/
|
|
190
|
+
interface AccessorArrayLike<T> {
|
|
191
|
+
/**
|
|
192
|
+
* Properties.
|
|
193
|
+
*/
|
|
194
|
+
[key: string]: any; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Number of elements.
|
|
198
|
+
*/
|
|
199
|
+
length: number;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Returns an array element.
|
|
203
|
+
*
|
|
204
|
+
* @param i - element index
|
|
205
|
+
* @returns array element
|
|
206
|
+
*/
|
|
207
|
+
get( i: number ): T | void;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Sets an array element.
|
|
211
|
+
*
|
|
212
|
+
* @param value - value(s)
|
|
213
|
+
* @param i - element index at which to start writing values (default: 0)
|
|
214
|
+
*/
|
|
215
|
+
set( value: T, i?: number ): void;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* A one-dimensional array.
|
|
220
|
+
*
|
|
221
|
+
* @example
|
|
222
|
+
* const x: Array1D<number> = [ 1, 2, 3, 4 ];
|
|
223
|
+
*/
|
|
224
|
+
type Array1D<T> = Collection<T>;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* A two-dimensional nested array.
|
|
228
|
+
*
|
|
229
|
+
* ## Notes
|
|
230
|
+
*
|
|
231
|
+
* - All nested arrays should have the same length (i.e., no ragged arrays).
|
|
232
|
+
*
|
|
233
|
+
* @example
|
|
234
|
+
* const x: Array2D<number> = [ [ 1, 2 ], [ 3, 4 ] ];
|
|
235
|
+
*/
|
|
236
|
+
type Array2D<T> = Array<Array1D<T>>;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* A three-dimensional nested array.
|
|
240
|
+
*
|
|
241
|
+
* ## Notes
|
|
242
|
+
*
|
|
243
|
+
* - All nested array lengths should be consistent (i.e., no ragged arrays).
|
|
244
|
+
*
|
|
245
|
+
* @example
|
|
246
|
+
* const x: Array3D<number> = [ [ [ 1, 2 ], [ 3, 4 ] ] ];
|
|
247
|
+
*/
|
|
248
|
+
type Array3D<T> = Array<Array2D<T>>;
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* A four-dimensional nested array.
|
|
252
|
+
*
|
|
253
|
+
* ## Notes
|
|
254
|
+
*
|
|
255
|
+
* - All nested array lengths should be consistent (i.e., no ragged arrays).
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* const x: Array4D<number> = [ [ [ [ 1, 2 ], [ 3, 4 ] ] ] ];
|
|
259
|
+
*/
|
|
260
|
+
type Array4D<T> = Array<Array3D<T>>;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* A five-dimensional nested array.
|
|
264
|
+
*
|
|
265
|
+
* ## Notes
|
|
266
|
+
*
|
|
267
|
+
* - All nested array lengths should be consistent (i.e., no ragged arrays).
|
|
268
|
+
*
|
|
269
|
+
* @example
|
|
270
|
+
* const x: Array5D<number> = [ [ [ [ [ 1, 2 ], [ 3, 4 ] ] ] ] ];
|
|
271
|
+
*/
|
|
272
|
+
type Array5D<T> = Array<Array4D<T>>;
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* A six-dimensional nested array.
|
|
276
|
+
*
|
|
277
|
+
* ## Notes
|
|
278
|
+
*
|
|
279
|
+
* - All nested array lengths should be consistent (i.e., no ragged arrays).
|
|
280
|
+
*
|
|
281
|
+
* @example
|
|
282
|
+
* const x: Array6D<number> = [ [ [ [ [ [ 1, 2 ], [ 3, 4 ] ] ] ] ] ];
|
|
283
|
+
*/
|
|
284
|
+
type Array6D<T> = Array<Array5D<T>>;
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* A seven-dimensional nested array.
|
|
288
|
+
*
|
|
289
|
+
* ## Notes
|
|
290
|
+
*
|
|
291
|
+
* - All nested array lengths should be consistent (i.e., no ragged arrays).
|
|
292
|
+
*
|
|
293
|
+
* @example
|
|
294
|
+
* const x: Array7D<number> = [ [ [ [ [ [ [ 1, 2 ], [ 3, 4 ] ] ] ] ] ] ];
|
|
295
|
+
*/
|
|
296
|
+
type Array7D<T> = Array<Array6D<T>>;
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* An eight-dimensional nested array.
|
|
300
|
+
*
|
|
301
|
+
* ## Notes
|
|
302
|
+
*
|
|
303
|
+
* - All nested array lengths should be consistent (i.e., no ragged arrays).
|
|
304
|
+
*
|
|
305
|
+
* @example
|
|
306
|
+
* const x: Array8D<number> = [ [ [ [ [ [ [ [ 1, 2 ], [ 3, 4 ] ] ] ] ] ] ] ];
|
|
307
|
+
*/
|
|
308
|
+
type Array8D<T> = Array<Array7D<T>>;
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* A nine-dimensional nested array.
|
|
312
|
+
*
|
|
313
|
+
* ## Notes
|
|
314
|
+
*
|
|
315
|
+
* - All nested array lengths should be consistent (i.e., no ragged arrays).
|
|
316
|
+
*
|
|
317
|
+
* @example
|
|
318
|
+
* const x: Array9D<number> = [ [ [ [ [ [ [ [ [ 1, 2 ], [ 3, 4 ] ] ] ] ] ] ] ] ];
|
|
319
|
+
*/
|
|
320
|
+
type Array9D<T> = Array<Array8D<T>>;
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* A ten-dimensional nested array.
|
|
324
|
+
*
|
|
325
|
+
* ## Notes
|
|
326
|
+
*
|
|
327
|
+
* - All nested array lengths should be consistent (i.e., no ragged arrays).
|
|
328
|
+
*
|
|
329
|
+
* @example
|
|
330
|
+
* const x: Array10D<number> = [ [ [ [ [ [ [ [ [ [ 1, 2 ], [ 3, 4 ] ] ] ] ] ] ] ] ] ];
|
|
331
|
+
*/
|
|
332
|
+
type Array10D<T> = Array<Array9D<T>>;
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* A numeric array.
|
|
336
|
+
*
|
|
337
|
+
* @example
|
|
338
|
+
* const x: NumericArray = [ 1, 2, 3 ];
|
|
339
|
+
* const y: NumericArray = new Float64Array( 10 );
|
|
340
|
+
*/
|
|
341
|
+
type NumericArray = Array<number> | TypedArray;
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Any array.
|
|
345
|
+
*
|
|
346
|
+
* @example
|
|
347
|
+
* const x: AnyArray = [ 1, 2, 3 ];
|
|
348
|
+
* const y: AnyArray = new Float64Array( 10 );
|
|
349
|
+
*/
|
|
350
|
+
type AnyArray = Array<any> | RealOrComplexTypedArray | BooleanTypedArray; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* An array or typed array.
|
|
354
|
+
*
|
|
355
|
+
* @example
|
|
356
|
+
* const x: ArrayOrTypedArray = [ 1, 2, 3 ];
|
|
357
|
+
* const y: ArrayOrTypedArray = new Float64Array( 10 );
|
|
358
|
+
*/
|
|
359
|
+
type ArrayOrTypedArray = Array<any> | TypedArray; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* A typed array.
|
|
363
|
+
*
|
|
364
|
+
* ## Notes
|
|
365
|
+
*
|
|
366
|
+
* - This is a strict definition of a typed array. Namely, the type is limited to only built-in typed arrays.
|
|
367
|
+
*
|
|
368
|
+
* @example
|
|
369
|
+
* const x: TypedArray = new Float64Array( 10 );
|
|
370
|
+
* const y: TypedArray = new Uint32Array( 10 );
|
|
371
|
+
*/
|
|
372
|
+
type TypedArray = FloatTypedArray | IntegerTypedArray;
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* A real-valued typed array.
|
|
376
|
+
*
|
|
377
|
+
* @example
|
|
378
|
+
* const x: RealTypedArray = new Float64Array( 10 );
|
|
379
|
+
* const y: RealTypedArray = new Uint32Array( 10 );
|
|
380
|
+
*/
|
|
381
|
+
type RealTypedArray = TypedArray;
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* An integer typed array.
|
|
385
|
+
*
|
|
386
|
+
* @example
|
|
387
|
+
* const x: IntegerTypedArray = new Uint32Array( 10 );
|
|
388
|
+
* const y: IntegerTypedArray = new Int32Array( 10 );
|
|
389
|
+
*/
|
|
390
|
+
type IntegerTypedArray = SignedIntegerTypedArray | UnsignedIntegerTypedArray;
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* A signed integer typed array.
|
|
394
|
+
*
|
|
395
|
+
* @example
|
|
396
|
+
* const x: SignedIntegerTypedArray = new Int32Array( 10 );
|
|
397
|
+
*/
|
|
398
|
+
type SignedIntegerTypedArray = Int8Array | Int16Array | Int32Array;
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* An unsigned integer typed array.
|
|
402
|
+
*
|
|
403
|
+
* @example
|
|
404
|
+
* const x: UnsignedIntegerTypedArray = new Uint32Array( 10 );
|
|
405
|
+
*/
|
|
406
|
+
type UnsignedIntegerTypedArray = Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array;
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* A boolean typed array.
|
|
410
|
+
*
|
|
411
|
+
* @example
|
|
412
|
+
* const x: BooleanTypedArray = new BooleanArray( 10 );
|
|
413
|
+
*/
|
|
414
|
+
type BooleanTypedArray = BooleanArray;
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* A floating-point typed array.
|
|
418
|
+
*
|
|
419
|
+
* @example
|
|
420
|
+
* const x: FloatTypedArray = new Float64Array( 10 );
|
|
421
|
+
* const y: FloatTypedArray = new Float32Array( 10 );
|
|
422
|
+
*/
|
|
423
|
+
type FloatTypedArray = Float32Array | Float64Array;
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* A complex number typed array.
|
|
427
|
+
*
|
|
428
|
+
* @example
|
|
429
|
+
* const x: ComplexTypedArray = new Complex64Array( 10 );
|
|
430
|
+
*/
|
|
431
|
+
type ComplexTypedArray = Complex64Array | Complex128Array;
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* A real or complex array.
|
|
435
|
+
*
|
|
436
|
+
* @example
|
|
437
|
+
* const x: RealOrComplexArray = new Float64Array( 10 );
|
|
438
|
+
* const y: RealOrComplexArray = [ 1, 2, 3 ];
|
|
439
|
+
*/
|
|
440
|
+
type RealOrComplexArray = NumericArray | ComplexTypedArray;
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* A floating-point real or complex typed array.
|
|
444
|
+
*
|
|
445
|
+
* @example
|
|
446
|
+
* const x: FloatOrComplexTypedArray = new Float64Array( 10 );
|
|
447
|
+
*/
|
|
448
|
+
type FloatOrComplexTypedArray = FloatTypedArray | ComplexTypedArray;
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* A real or complex typed array.
|
|
452
|
+
*
|
|
453
|
+
* @example
|
|
454
|
+
* const x: RealOrComplexTypedArray = new Float64Array( 10 );
|
|
455
|
+
*/
|
|
456
|
+
type RealOrComplexTypedArray = RealTypedArray | ComplexTypedArray;
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* A boolean array-like value.
|
|
460
|
+
*
|
|
461
|
+
* @example
|
|
462
|
+
* const buf = new Uint8Array( 8 );
|
|
463
|
+
*
|
|
464
|
+
* const x: BooleanArrayLike = {
|
|
465
|
+
* 'byteLength': 8,
|
|
466
|
+
* 'byteOffset': 0,
|
|
467
|
+
* 'BYTES_PER_ELEMENT': 1,
|
|
468
|
+
* 'length': 8
|
|
469
|
+
* 'get': ( i: number ): boolean => {
|
|
470
|
+
* return Boolean( buf[ i ] );
|
|
471
|
+
* },
|
|
472
|
+
* 'set': ( value: boolean, i?: number ) => {
|
|
473
|
+
* i = ( i ) ? i : 0;
|
|
474
|
+
* buf[ i ] = ( value ) ? 1 : 0;
|
|
475
|
+
* }
|
|
476
|
+
* };
|
|
477
|
+
*/
|
|
478
|
+
interface BooleanArrayLike extends AccessorArrayLike<boolean> {
|
|
479
|
+
/**
|
|
480
|
+
* Length (in bytes) of the array.
|
|
481
|
+
*/
|
|
482
|
+
byteLength: number;
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.
|
|
486
|
+
*/
|
|
487
|
+
byteOffset: number;
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* Size (in bytes) of each array element.
|
|
491
|
+
*/
|
|
492
|
+
BYTES_PER_ELEMENT: number;
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* Number of array elements.
|
|
496
|
+
*/
|
|
497
|
+
length: number;
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Returns an array element.
|
|
501
|
+
*
|
|
502
|
+
* @param i - element index
|
|
503
|
+
* @returns array element
|
|
504
|
+
*/
|
|
505
|
+
get( i: number ): boolean | void;
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* Sets an array element.
|
|
509
|
+
*
|
|
510
|
+
* @param value - value(s)
|
|
511
|
+
* @param i - element index at which to start writing values (default: 0)
|
|
512
|
+
*/
|
|
513
|
+
set( value: ArrayLike<boolean> | BooleanArrayLike | boolean, i?: number ): void;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Boolean array.
|
|
518
|
+
*
|
|
519
|
+
* @example
|
|
520
|
+
* const buf = new Uint8Array( 8 );
|
|
521
|
+
*
|
|
522
|
+
* const z: Complex64Array = {
|
|
523
|
+
* 'byteLength': 8,
|
|
524
|
+
* 'byteOffset': 0,
|
|
525
|
+
* 'BYTES_PER_ELEMENT': 1,
|
|
526
|
+
* 'length': 8
|
|
527
|
+
* 'get': ( i: number ): boolean => {
|
|
528
|
+
* return Boolean( buf[ i ] );
|
|
529
|
+
* },
|
|
530
|
+
* 'set': ( value: boolean, i?: number ) => {
|
|
531
|
+
* i = ( i ) ? i : 0;
|
|
532
|
+
* buf[ i ] = ( value ) ? 1 : 0;
|
|
533
|
+
* }
|
|
534
|
+
* };
|
|
535
|
+
*/
|
|
536
|
+
interface BooleanArray extends BooleanArrayLike {
|
|
537
|
+
/**
|
|
538
|
+
* Returns an array element.
|
|
539
|
+
*
|
|
540
|
+
* @param i - element index
|
|
541
|
+
* @returns array element
|
|
542
|
+
*/
|
|
543
|
+
get( i: number ): boolean | void;
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* Sets an array element.
|
|
547
|
+
*
|
|
548
|
+
* @param value - value(s)
|
|
549
|
+
* @param i - element index at which to start writing values (default: 0)
|
|
550
|
+
*/
|
|
551
|
+
set( value: ArrayLike<boolean> | BooleanArray | boolean, i?: number ): void;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* A complex number array-like value.
|
|
556
|
+
*
|
|
557
|
+
* @example
|
|
558
|
+
* const buf = new Float64Array( 8 );
|
|
559
|
+
*
|
|
560
|
+
* const z: ComplexArrayLike = {
|
|
561
|
+
* 'byteLength': 64,
|
|
562
|
+
* 'byteOffset': 0,
|
|
563
|
+
* 'BYTES_PER_ELEMENT': 8,
|
|
564
|
+
* 'length': 8
|
|
565
|
+
* 'get': ( i: number ): obj.ComplexLike => {
|
|
566
|
+
* return {
|
|
567
|
+
* 're': i * 10,
|
|
568
|
+
* 'im': i * 10
|
|
569
|
+
* };
|
|
570
|
+
* },
|
|
571
|
+
* 'set': ( value: obj.ComplexLike, i?: number ) => {
|
|
572
|
+
* i = ( i ) ? i : 0;
|
|
573
|
+
* buf[ i ] = value.re;
|
|
574
|
+
* buf[ i + 1 ] = value.im;
|
|
575
|
+
* }
|
|
576
|
+
* };
|
|
577
|
+
*/
|
|
578
|
+
interface ComplexArrayLike extends AccessorArrayLike<ComplexLike> {
|
|
579
|
+
/**
|
|
580
|
+
* Length (in bytes) of the array.
|
|
581
|
+
*/
|
|
582
|
+
byteLength: number;
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.
|
|
586
|
+
*/
|
|
587
|
+
byteOffset: number;
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* Size (in bytes) of each array element.
|
|
591
|
+
*/
|
|
592
|
+
BYTES_PER_ELEMENT: number;
|
|
593
|
+
|
|
594
|
+
/**
|
|
595
|
+
* Number of array elements.
|
|
596
|
+
*/
|
|
597
|
+
length: number;
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* Returns an array element.
|
|
601
|
+
*
|
|
602
|
+
* @param i - element index
|
|
603
|
+
* @returns array element
|
|
604
|
+
*/
|
|
605
|
+
get( i: number ): ComplexLike | void;
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* Sets an array element.
|
|
609
|
+
*
|
|
610
|
+
* @param value - value(s)
|
|
611
|
+
* @param i - element index at which to start writing values (default: 0)
|
|
612
|
+
*/
|
|
613
|
+
set( value: ArrayLike<number | ComplexLike> | ComplexArrayLike | ComplexLike, i?: number ): void;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* 64-bit complex number array.
|
|
618
|
+
*
|
|
619
|
+
* @example
|
|
620
|
+
* const buf = new Float32Array( 8 );
|
|
621
|
+
*
|
|
622
|
+
* const z: Complex64Array = {
|
|
623
|
+
* 'byteLength': 32,
|
|
624
|
+
* 'byteOffset': 0,
|
|
625
|
+
* 'BYTES_PER_ELEMENT': 4,
|
|
626
|
+
* 'length': 8
|
|
627
|
+
* 'get': ( i: number ): obj.Complex64 => {
|
|
628
|
+
* return {
|
|
629
|
+
* 're': i * 10,
|
|
630
|
+
* 'im': i * 10,
|
|
631
|
+
* 'byteLength': 8,
|
|
632
|
+
* 'BYTES_PER_ELEMENT': 4
|
|
633
|
+
* };
|
|
634
|
+
* },
|
|
635
|
+
* 'set': ( value: obj.ComplexLike, i?: number ) => {
|
|
636
|
+
* i = ( i ) ? i : 0;
|
|
637
|
+
* buf[ i ] = value.re;
|
|
638
|
+
* buf[ i + 1 ] = value.im;
|
|
639
|
+
* }
|
|
640
|
+
* };
|
|
641
|
+
*/
|
|
642
|
+
interface Complex64Array extends ComplexArrayLike {
|
|
643
|
+
/**
|
|
644
|
+
* Returns an array element.
|
|
645
|
+
*
|
|
646
|
+
* @param i - element index
|
|
647
|
+
* @returns array element
|
|
648
|
+
*/
|
|
649
|
+
get( i: number ): Complex64 | void;
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* Sets an array element.
|
|
653
|
+
*
|
|
654
|
+
* @param value - value(s)
|
|
655
|
+
* @param i - element index at which to start writing values (default: 0)
|
|
656
|
+
*/
|
|
657
|
+
set( value: ArrayLike<number | ComplexLike> | Complex64Array | ComplexLike, i?: number ): void;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
/**
|
|
661
|
+
* 128-bit complex number array.
|
|
662
|
+
*
|
|
663
|
+
* @example
|
|
664
|
+
* const buf = new Float64Array( 8 );
|
|
665
|
+
*
|
|
666
|
+
* const z: Complex128Array = {
|
|
667
|
+
* 'byteLength': 64,
|
|
668
|
+
* 'byteOffset': 0,
|
|
669
|
+
* 'BYTES_PER_ELEMENT': 8,
|
|
670
|
+
* 'length': 8
|
|
671
|
+
* 'get': ( i: number ): obj.Complex128 => {
|
|
672
|
+
* return {
|
|
673
|
+
* 're': i * 10,
|
|
674
|
+
* 'im': i * 10,
|
|
675
|
+
* 'byteLength': 16,
|
|
676
|
+
* 'BYTES_PER_ELEMENT': 8
|
|
677
|
+
* };
|
|
678
|
+
* },
|
|
679
|
+
* 'set': ( value: obj.ComplexLike, i?: number ) => {
|
|
680
|
+
* i = ( i ) ? i : 0;
|
|
681
|
+
* buf[ i ] = value.re;
|
|
682
|
+
* buf[ i + 1 ] = value.im;
|
|
683
|
+
* }
|
|
684
|
+
* };
|
|
685
|
+
*/
|
|
686
|
+
interface Complex128Array extends ComplexArrayLike {
|
|
687
|
+
/**
|
|
688
|
+
* Returns an array element.
|
|
689
|
+
*
|
|
690
|
+
* @param i - element index
|
|
691
|
+
* @returns array element
|
|
692
|
+
*/
|
|
693
|
+
get( i: number ): Complex128 | void;
|
|
694
|
+
|
|
695
|
+
/**
|
|
696
|
+
* Sets an array element.
|
|
697
|
+
*
|
|
698
|
+
* @param value - value(s)
|
|
699
|
+
* @param i - element index at which to start writing values (default: 0)
|
|
700
|
+
*/
|
|
701
|
+
set( value: ArrayLike<number | ComplexLike> | Complex128Array | ComplexLike, i?: number ): void;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
/**
|
|
705
|
+
* A collection, which is defined as either an array, typed array, or an array-like object (excluding strings and functions).
|
|
706
|
+
*
|
|
707
|
+
* @example
|
|
708
|
+
* const x: Collection<number> = [ 1, 2, 3 ];
|
|
709
|
+
*/
|
|
710
|
+
type Collection<T = any> = Array<T> | TypedArray | ArrayLike<T>; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
711
|
+
|
|
712
|
+
/**
|
|
713
|
+
* Mapping of data types to array constructors.
|
|
714
|
+
*/
|
|
715
|
+
type DataTypeMap<T> = Remap<TypedDataTypeMap & { 'generic': Array<T> }>;
|
|
716
|
+
|
|
717
|
+
/**
|
|
718
|
+
* Mapping of strictly typed array data types to array constructors.
|
|
719
|
+
*/
|
|
720
|
+
type TypedDataTypeMap = Remap<NumericDataTypeMap & BooleanDataTypeMap>;
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* Mapping of numeric data types (real or complex) to array constructors.
|
|
724
|
+
*/
|
|
725
|
+
type NumericDataTypeMap = Remap<RealDataTypeMap & ComplexFloatingPointDataTypeMap>;
|
|
726
|
+
|
|
727
|
+
/**
|
|
728
|
+
* Mapping of numeric (real or complex) data types and the "generic" data type to array constructors.
|
|
729
|
+
*/
|
|
730
|
+
type NumericAndGenericDataTypeMap<T> = Remap<NumericDataTypeMap & { 'generic': Array<T> }>;
|
|
731
|
+
|
|
732
|
+
/**
|
|
733
|
+
* Mapping of data types for real-valued typed arrays to array constructors.
|
|
734
|
+
*/
|
|
735
|
+
type RealDataTypeMap = Remap<RealFloatingPointDataTypeMap & IntegerDataTypeMap>;
|
|
736
|
+
|
|
737
|
+
/**
|
|
738
|
+
* Mapping of data types for real-valued typed arrays and the "generic" data type to array constructors.
|
|
739
|
+
*/
|
|
740
|
+
type RealAndGenericDataTypeMap<T> = Remap<RealDataTypeMap & { 'generic': Array<T> }>;
|
|
741
|
+
|
|
742
|
+
/**
|
|
743
|
+
* Mapping of data types for complex number typed arrays to array constructors.
|
|
744
|
+
*/
|
|
745
|
+
type RealFloatingPointDataTypeMap = { // eslint-disable-line @typescript-eslint/consistent-type-definitions
|
|
746
|
+
'float64': Float64Array;
|
|
747
|
+
'float32': Float32Array;
|
|
748
|
+
};
|
|
749
|
+
|
|
750
|
+
/**
|
|
751
|
+
* Mapping of real floating point data types and the "generic" data type to array constructors.
|
|
752
|
+
*/
|
|
753
|
+
type RealFloatingPointAndGenericDataTypeMap<T> = Remap<RealFloatingPointDataTypeMap & { 'generic': Array<T> }>;
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* Mapping of data types for complex number typed arrays to array constructors.
|
|
757
|
+
*/
|
|
758
|
+
type ComplexFloatingPointDataTypeMap = { // eslint-disable-line @typescript-eslint/consistent-type-definitions
|
|
759
|
+
'complex64': Complex64Array;
|
|
760
|
+
'complex128': Complex128Array;
|
|
761
|
+
};
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* Mapping of complex floating point data types and the "generic" data type to array constructors.
|
|
765
|
+
*/
|
|
766
|
+
type ComplexFloatingPointAndGenericDataTypeMap<T> = Remap<ComplexFloatingPointDataTypeMap & { 'generic': Array<T> }>;
|
|
767
|
+
|
|
768
|
+
/**
|
|
769
|
+
* Mapping of data types for floating-point (real or complex) typed arrays to array constructors.
|
|
770
|
+
*/
|
|
771
|
+
type FloatingPointDataTypeMap = Remap<RealFloatingPointDataTypeMap & ComplexFloatingPointDataTypeMap>;
|
|
772
|
+
|
|
773
|
+
/**
|
|
774
|
+
* Mapping for floating point (real or complex) data types and the "generic" data type to array constructors.
|
|
775
|
+
*/
|
|
776
|
+
type FloatingPointAndGenericDataTypeMap<T> = Remap<FloatingPointDataTypeMap & { 'generic': Array<T> }>;
|
|
777
|
+
|
|
778
|
+
/**
|
|
779
|
+
* Mapping of integer data types to array constructors.
|
|
780
|
+
*/
|
|
781
|
+
type IntegerDataTypeMap = Remap<SignedIntegerDataTypeMap & UnsignedIntegerDataTypeMap>;
|
|
782
|
+
|
|
783
|
+
/**
|
|
784
|
+
* Mapping of integer data types and the "generic" data type to array constructors.
|
|
785
|
+
*/
|
|
786
|
+
type IntegerAndGenericDataTypeMap<T> = Remap<IntegerDataTypeMap & { 'generic': Array<T> }>;
|
|
787
|
+
|
|
788
|
+
/**
|
|
789
|
+
* Mapping of signed integer data types to array constructors.
|
|
790
|
+
*/
|
|
791
|
+
type SignedIntegerDataTypeMap = { // eslint-disable-line @typescript-eslint/consistent-type-definitions
|
|
792
|
+
'int32': Int32Array;
|
|
793
|
+
'int16': Int16Array;
|
|
794
|
+
'int8': Int8Array;
|
|
795
|
+
};
|
|
796
|
+
|
|
797
|
+
/**
|
|
798
|
+
* Mapping of signed integer data types and the "generic" data type to array constructors.
|
|
799
|
+
*/
|
|
800
|
+
type SignedIntegerAndGenericDataTypeMap<T> = Remap<SignedIntegerDataTypeMap & { 'generic': Array<T> }>;
|
|
801
|
+
|
|
802
|
+
/**
|
|
803
|
+
* Mapping of unsigned integer data types to array constructors.
|
|
804
|
+
*/
|
|
805
|
+
type UnsignedIntegerDataTypeMap = { // eslint-disable-line @typescript-eslint/consistent-type-definitions
|
|
806
|
+
'uint32': Uint32Array;
|
|
807
|
+
'uint16': Uint16Array;
|
|
808
|
+
'uint8': Uint8Array;
|
|
809
|
+
'uint8c': Uint8ClampedArray;
|
|
810
|
+
};
|
|
811
|
+
|
|
812
|
+
/**
|
|
813
|
+
* Mapping of unsigned integer data types and the "generic" data type to array constructors.
|
|
814
|
+
*/
|
|
815
|
+
type UnsignedIntegerAndGenericDataTypeMap<T> = Remap<UnsignedIntegerDataTypeMap & { 'generic': Array<T> }>;
|
|
816
|
+
|
|
817
|
+
/**
|
|
818
|
+
* Mapping of data types for boolean typed arrays to array constructors.
|
|
819
|
+
*/
|
|
820
|
+
type BooleanDataTypeMap = { // eslint-disable-line @typescript-eslint/consistent-type-definitions
|
|
821
|
+
'bool': BooleanArray;
|
|
822
|
+
};
|
|
823
|
+
|
|
824
|
+
/**
|
|
825
|
+
* Mapping of boolean data types and the "generic" data type to array constructors.
|
|
826
|
+
*/
|
|
827
|
+
type BooleanAndGenericDataTypeMap<T> = Remap<BooleanDataTypeMap & { 'generic': Array<T> }>;
|
|
828
|
+
|
|
829
|
+
/**
|
|
830
|
+
* Boolean index array.
|
|
831
|
+
*/
|
|
832
|
+
type GenericBooleanIndexArray = Collection<boolean> | AccessorArrayLike<boolean>;
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* Integer index array.
|
|
836
|
+
*/
|
|
837
|
+
type GenericIntegerIndexArray = Collection<number> | AccessorArrayLike<number>;
|
|
838
|
+
|
|
839
|
+
/**
|
|
840
|
+
* Generic index array.
|
|
841
|
+
*/
|
|
842
|
+
type GenericIndexArray = GenericBooleanIndexArray | GenericIntegerIndexArray;
|
|
843
|
+
|
|
844
|
+
/**
|
|
845
|
+
* Strictly typed index array.
|
|
846
|
+
*/
|
|
847
|
+
type TypedIndexArray = Uint8Array | BooleanArray | Int32Array;
|
|
848
|
+
|
|
849
|
+
/**
|
|
850
|
+
* Index array.
|
|
851
|
+
*/
|
|
852
|
+
type IndexArray = GenericIndexArray | TypedIndexArray;
|
|
853
|
+
|
|
854
|
+
/**
|
|
855
|
+
* Interface describing an array index object.
|
|
856
|
+
*/
|
|
857
|
+
interface BaseArrayIndex {
|
|
858
|
+
/**
|
|
859
|
+
* Read-only property returning the data associated with an array index object.
|
|
860
|
+
*/
|
|
861
|
+
data: IndexArray;
|
|
862
|
+
|
|
863
|
+
/**
|
|
864
|
+
* Read-only property returning the underlying index array data type.
|
|
865
|
+
*/
|
|
866
|
+
dtype: DataType | null;
|
|
867
|
+
|
|
868
|
+
/**
|
|
869
|
+
* Read-only property returning the unique identifier associated with an array index object.
|
|
870
|
+
*/
|
|
871
|
+
id: string;
|
|
872
|
+
|
|
873
|
+
/**
|
|
874
|
+
* Boolean indicating if an array index object is actively cached.
|
|
875
|
+
*/
|
|
876
|
+
isCached: boolean;
|
|
877
|
+
|
|
878
|
+
/**
|
|
879
|
+
* Read-only property returning the array index type.
|
|
880
|
+
*/
|
|
881
|
+
type: 'int' | 'bool' | 'mask';
|
|
882
|
+
|
|
883
|
+
/**
|
|
884
|
+
* Serializes an array index object to a string.
|
|
885
|
+
*
|
|
886
|
+
* @returns serialized string
|
|
887
|
+
*/
|
|
888
|
+
toString(): string;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
/**
|
|
892
|
+
* Interface describing a mask array index object.
|
|
893
|
+
*/
|
|
894
|
+
interface MaskArrayIndex extends BaseArrayIndex {
|
|
895
|
+
/**
|
|
896
|
+
* Read-only property returning the array index type.
|
|
897
|
+
*/
|
|
898
|
+
type: 'mask';
|
|
899
|
+
|
|
900
|
+
/**
|
|
901
|
+
* Read-only property returning the underlying index array data type.
|
|
902
|
+
*/
|
|
903
|
+
dtype: 'uint8';
|
|
904
|
+
|
|
905
|
+
/**
|
|
906
|
+
* Read-only property returning the underlying array data.
|
|
907
|
+
*/
|
|
908
|
+
data: Uint8Array;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
/**
|
|
912
|
+
* Interface describing a boolean array index object.
|
|
913
|
+
*/
|
|
914
|
+
interface BooleanArrayIndex extends BaseArrayIndex {
|
|
915
|
+
/**
|
|
916
|
+
* Read-only property returning the array index type.
|
|
917
|
+
*/
|
|
918
|
+
type: 'bool';
|
|
919
|
+
|
|
920
|
+
/**
|
|
921
|
+
* Read-only property returning the underlying index array data type.
|
|
922
|
+
*/
|
|
923
|
+
dtype: 'bool';
|
|
924
|
+
|
|
925
|
+
/**
|
|
926
|
+
* Read-only property returning the underlying array data.
|
|
927
|
+
*/
|
|
928
|
+
data: BooleanArray;
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
/**
|
|
932
|
+
* Interface describing an integer array index object.
|
|
933
|
+
*/
|
|
934
|
+
interface Int32ArrayIndex extends BaseArrayIndex {
|
|
935
|
+
/**
|
|
936
|
+
* Read-only property returning the array index type.
|
|
937
|
+
*/
|
|
938
|
+
type: 'int';
|
|
939
|
+
|
|
940
|
+
/**
|
|
941
|
+
* Read-only property returning the underlying index array data type.
|
|
942
|
+
*/
|
|
943
|
+
dtype: 'int32';
|
|
944
|
+
|
|
945
|
+
/**
|
|
946
|
+
* Read-only property returning the underlying array data.
|
|
947
|
+
*/
|
|
948
|
+
data: Int32Array;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
/**
|
|
952
|
+
* Interface describing a "generic" boolean array index object.
|
|
953
|
+
*/
|
|
954
|
+
interface GenericBooleanArrayIndex extends BaseArrayIndex {
|
|
955
|
+
/**
|
|
956
|
+
* Read-only property returning the array index type.
|
|
957
|
+
*/
|
|
958
|
+
type: 'bool';
|
|
959
|
+
|
|
960
|
+
/**
|
|
961
|
+
* Read-only property returning the underlying index array data type.
|
|
962
|
+
*/
|
|
963
|
+
dtype: 'generic';
|
|
964
|
+
|
|
965
|
+
/**
|
|
966
|
+
* Read-only property returning the underlying array data.
|
|
967
|
+
*/
|
|
968
|
+
data: GenericBooleanIndexArray;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
/**
|
|
972
|
+
* Interface describing a "generic" integer array index object.
|
|
973
|
+
*/
|
|
974
|
+
interface GenericIntegerArrayIndex extends BaseArrayIndex {
|
|
975
|
+
/**
|
|
976
|
+
* Read-only property returning the array index type.
|
|
977
|
+
*/
|
|
978
|
+
type: 'int';
|
|
979
|
+
|
|
980
|
+
/**
|
|
981
|
+
* Read-only property returning the underlying index array data type.
|
|
982
|
+
*/
|
|
983
|
+
dtype: 'generic';
|
|
984
|
+
|
|
985
|
+
/**
|
|
986
|
+
* Read-only property returning the underlying array data.
|
|
987
|
+
*/
|
|
988
|
+
data: GenericIntegerIndexArray;
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
/**
|
|
992
|
+
* Array index object.
|
|
993
|
+
*/
|
|
994
|
+
type ArrayIndex = MaskArrayIndex | BooleanArrayIndex | Int32ArrayIndex | GenericBooleanArrayIndex | GenericIntegerArrayIndex;
|
|
995
|
+
|
|
996
|
+
/**
|
|
997
|
+
* Interface describing an object containing index array data.
|
|
998
|
+
*/
|
|
999
|
+
interface BaseIndexArrayObject {
|
|
1000
|
+
/**
|
|
1001
|
+
* The underlying array associated with an index array.
|
|
1002
|
+
*/
|
|
1003
|
+
data: IndexArray;
|
|
1004
|
+
|
|
1005
|
+
/**
|
|
1006
|
+
* The type of index array.
|
|
1007
|
+
*/
|
|
1008
|
+
type: 'int' | 'bool' | 'mask';
|
|
1009
|
+
|
|
1010
|
+
/**
|
|
1011
|
+
* The data type of the underlying array.
|
|
1012
|
+
*/
|
|
1013
|
+
dtype: DataType | null;
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
/**
|
|
1017
|
+
* Interface describing an object containing mask index array data.
|
|
1018
|
+
*/
|
|
1019
|
+
interface MaskIndexArrayObject extends BaseIndexArrayObject {
|
|
1020
|
+
/**
|
|
1021
|
+
* The underlying array associated with an index array.
|
|
1022
|
+
*/
|
|
1023
|
+
data: Uint8Array;
|
|
1024
|
+
|
|
1025
|
+
/**
|
|
1026
|
+
* The type of index array.
|
|
1027
|
+
*/
|
|
1028
|
+
type: 'mask';
|
|
1029
|
+
|
|
1030
|
+
/**
|
|
1031
|
+
* The data type of the underlying array.
|
|
1032
|
+
*/
|
|
1033
|
+
dtype: 'uint8';
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
/**
|
|
1037
|
+
* Interface describing an object containing boolean index array data.
|
|
1038
|
+
*/
|
|
1039
|
+
interface BooleanIndexArrayObject extends BaseIndexArrayObject {
|
|
1040
|
+
/**
|
|
1041
|
+
* The underlying array associated with an index array.
|
|
1042
|
+
*/
|
|
1043
|
+
data: BooleanArray;
|
|
1044
|
+
|
|
1045
|
+
/**
|
|
1046
|
+
* The type of index array.
|
|
1047
|
+
*/
|
|
1048
|
+
type: 'bool';
|
|
1049
|
+
|
|
1050
|
+
/**
|
|
1051
|
+
* The data type of the underlying array.
|
|
1052
|
+
*/
|
|
1053
|
+
dtype: 'bool';
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
/**
|
|
1057
|
+
* Interface describing an object containing integer index array data.
|
|
1058
|
+
*/
|
|
1059
|
+
interface Int32IndexArrayObject extends BaseIndexArrayObject {
|
|
1060
|
+
/**
|
|
1061
|
+
* The underlying array associated with an index array.
|
|
1062
|
+
*/
|
|
1063
|
+
data: Int32Array;
|
|
1064
|
+
|
|
1065
|
+
/**
|
|
1066
|
+
* The type of index array.
|
|
1067
|
+
*/
|
|
1068
|
+
type: 'int';
|
|
1069
|
+
|
|
1070
|
+
/**
|
|
1071
|
+
* The data type of the underlying array.
|
|
1072
|
+
*/
|
|
1073
|
+
dtype: 'int32';
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
/**
|
|
1077
|
+
* Interface describing an object containing "generic" integer index array data.
|
|
1078
|
+
*/
|
|
1079
|
+
interface GenericIntegerIndexArrayObject extends BaseIndexArrayObject {
|
|
1080
|
+
/**
|
|
1081
|
+
* The underlying array associated with an index array.
|
|
1082
|
+
*/
|
|
1083
|
+
data: GenericIntegerIndexArray;
|
|
1084
|
+
|
|
1085
|
+
/**
|
|
1086
|
+
* The type of index array.
|
|
1087
|
+
*/
|
|
1088
|
+
type: 'int';
|
|
1089
|
+
|
|
1090
|
+
/**
|
|
1091
|
+
* The data type of the underlying array.
|
|
1092
|
+
*/
|
|
1093
|
+
dtype: 'generic';
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
/**
|
|
1097
|
+
* Interface describing an object containing "generic" boolean index array data.
|
|
1098
|
+
*/
|
|
1099
|
+
interface GenericBooleanIndexArrayObject extends BaseIndexArrayObject {
|
|
1100
|
+
/**
|
|
1101
|
+
* The underlying array associated with an index array.
|
|
1102
|
+
*/
|
|
1103
|
+
data: GenericBooleanIndexArray;
|
|
1104
|
+
|
|
1105
|
+
/**
|
|
1106
|
+
* The type of index array.
|
|
1107
|
+
*/
|
|
1108
|
+
type: 'bool';
|
|
1109
|
+
|
|
1110
|
+
/**
|
|
1111
|
+
* The data type of the underlying array.
|
|
1112
|
+
*/
|
|
1113
|
+
dtype: 'generic';
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
/**
|
|
1117
|
+
* Index array data object.
|
|
1118
|
+
*/
|
|
1119
|
+
type IndexArrayObject = MaskIndexArrayObject | BooleanIndexArrayObject | Int32IndexArrayObject | GenericBooleanIndexArrayObject | GenericIntegerIndexArrayObject;
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
/**
|
|
1123
|
+
* Module containing iterator definitions.
|
|
1124
|
+
*
|
|
1125
|
+
* @example
|
|
1126
|
+
* import * as iter from `@stdlib/types/iter`;
|
|
1127
|
+
*
|
|
1128
|
+
* const it: iter.Iterator = {
|
|
1129
|
+
* 'next': () => { return { 'value': 0, 'done': false }; }
|
|
1130
|
+
* };
|
|
1131
|
+
*
|
|
1132
|
+
* @example
|
|
1133
|
+
* import { Iterator } from `@stdlib/types/iter`;
|
|
1134
|
+
*
|
|
1135
|
+
* const it: Iterator = {
|
|
1136
|
+
* 'next': () => { return { 'value': 0, 'done': false }; }
|
|
1137
|
+
* };
|
|
1138
|
+
*/
|
|
1139
|
+
declare module '@stdlib/types/iter' {
|
|
1140
|
+
/**
|
|
1141
|
+
* Interface describing an iterator protocol-compliant object.
|
|
1142
|
+
*
|
|
1143
|
+
* @example
|
|
1144
|
+
* const it: Iterator = {
|
|
1145
|
+
* 'next': () => { return { 'value': 0, 'done': false }; }
|
|
1146
|
+
* };
|
|
1147
|
+
*/
|
|
1148
|
+
interface Iterator {
|
|
1149
|
+
/**
|
|
1150
|
+
* Returns an iterator protocol-compliant object containing the next iterated value (if one exists) and a boolean flag indicating whether the iterator is finished.
|
|
1151
|
+
*
|
|
1152
|
+
* @returns iterator protocol-compliant object
|
|
1153
|
+
*/
|
|
1154
|
+
next(): IteratorResult;
|
|
1155
|
+
|
|
1156
|
+
/**
|
|
1157
|
+
* Finishes an iterator.
|
|
1158
|
+
*
|
|
1159
|
+
* @param value - value to return
|
|
1160
|
+
* @returns iterator protocol-compliant object
|
|
1161
|
+
*/
|
|
1162
|
+
return?( value?: any ): IteratorResult; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
/**
|
|
1166
|
+
* Interface describing an iterable iterator protocol-compliant object.
|
|
1167
|
+
*
|
|
1168
|
+
* @example
|
|
1169
|
+
* const it: IterableIterator = {
|
|
1170
|
+
* 'next': () => { return { 'value': 0, 'done': false }; },
|
|
1171
|
+
* [Symbol.iterator]: () => { return this; }
|
|
1172
|
+
* };
|
|
1173
|
+
*/
|
|
1174
|
+
interface IterableIterator extends Iterator {
|
|
1175
|
+
/**
|
|
1176
|
+
* Returns a new iterable iterator.
|
|
1177
|
+
*
|
|
1178
|
+
* @returns iterable iterator
|
|
1179
|
+
*/
|
|
1180
|
+
[Symbol.iterator](): IterableIterator;
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
/**
|
|
1184
|
+
* Interface describing an iterator protocol-compliant results object.
|
|
1185
|
+
*
|
|
1186
|
+
* @example
|
|
1187
|
+
* const o: IteratorResult = {
|
|
1188
|
+
* 'value': 3.14,
|
|
1189
|
+
* 'done': false
|
|
1190
|
+
* };
|
|
1191
|
+
*/
|
|
1192
|
+
interface IteratorResult {
|
|
1193
|
+
/**
|
|
1194
|
+
* Iterated value (if one exists).
|
|
1195
|
+
*/
|
|
1196
|
+
value?: any; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
1197
|
+
|
|
1198
|
+
/**
|
|
1199
|
+
* Boolean flag indicating whether an iterator is finished.
|
|
1200
|
+
*/
|
|
1201
|
+
done: boolean;
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
/**
|
|
1205
|
+
* Interface describing an iterator protocol-compliant object.
|
|
1206
|
+
*
|
|
1207
|
+
* @example
|
|
1208
|
+
* const it: TypedIterator<number> = {
|
|
1209
|
+
* 'next': () => { return { 'value': 0, 'done': false }; }
|
|
1210
|
+
* };
|
|
1211
|
+
*/
|
|
1212
|
+
interface TypedIterator<T> {
|
|
1213
|
+
/**
|
|
1214
|
+
* Returns an iterator protocol-compliant object containing the next iterated value (if one exists) and a boolean flag indicating whether the iterator is finished.
|
|
1215
|
+
*
|
|
1216
|
+
* @returns iterator protocol-compliant object
|
|
1217
|
+
*/
|
|
1218
|
+
next(): TypedIteratorResult<T>;
|
|
1219
|
+
|
|
1220
|
+
/**
|
|
1221
|
+
* Finishes an iterator.
|
|
1222
|
+
*
|
|
1223
|
+
* @param value - value to return
|
|
1224
|
+
* @returns iterator protocol-compliant object
|
|
1225
|
+
*/
|
|
1226
|
+
return?( value?: T ): TypedIteratorResult<T>;
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
/**
|
|
1230
|
+
* Interface describing an iterable iterator protocol-compliant object.
|
|
1231
|
+
*
|
|
1232
|
+
* @example
|
|
1233
|
+
* const it: IterableIterator = {
|
|
1234
|
+
* 'next': () => { return { 'value': 0, 'done': false }; },
|
|
1235
|
+
* [Symbol.iterator]: () => { return this; }
|
|
1236
|
+
* };
|
|
1237
|
+
*/
|
|
1238
|
+
interface TypedIterableIterator<T> extends TypedIterator<T> {
|
|
1239
|
+
/**
|
|
1240
|
+
* Returns a new iterable iterator.
|
|
1241
|
+
*
|
|
1242
|
+
* @returns iterable iterator
|
|
1243
|
+
*/
|
|
1244
|
+
[Symbol.iterator](): TypedIterableIterator<T>;
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
/**
|
|
1248
|
+
* Interface describing an iterator protocol-compliant results object.
|
|
1249
|
+
*
|
|
1250
|
+
* @example
|
|
1251
|
+
* const o: TypedIteratorResult<number> = {
|
|
1252
|
+
* 'value': 3.14,
|
|
1253
|
+
* 'done': false
|
|
1254
|
+
* };
|
|
1255
|
+
*/
|
|
1256
|
+
interface TypedIteratorResult<T> {
|
|
1257
|
+
/**
|
|
1258
|
+
* Iterated value (if one exists).
|
|
1259
|
+
*/
|
|
1260
|
+
value?: T;
|
|
1261
|
+
|
|
1262
|
+
/**
|
|
1263
|
+
* Boolean flag indicating whether an iterator is finished.
|
|
1264
|
+
*/
|
|
1265
|
+
done: boolean;
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
/**
|
|
1270
|
+
* Module containing definitions for BLAS routines.
|
|
1271
|
+
*
|
|
1272
|
+
* @example
|
|
1273
|
+
* import * as blas from `@stdlib/types/blas`;
|
|
1274
|
+
*
|
|
1275
|
+
* const layout: blas.Layout = 'row-major';
|
|
1276
|
+
*/
|
|
1277
|
+
declare module '@stdlib/types/blas' {
|
|
1278
|
+
/**
|
|
1279
|
+
* Diagonal element type.
|
|
1280
|
+
*
|
|
1281
|
+
* ## Notes
|
|
1282
|
+
*
|
|
1283
|
+
* - **non-unit**: elements along a diagonal are **not** all equal to one.
|
|
1284
|
+
* - **unit**: elements along a diagonal are all equal to one.
|
|
1285
|
+
*/
|
|
1286
|
+
type DiagonalType = 'non-unit' | 'unit';
|
|
1287
|
+
|
|
1288
|
+
/**
|
|
1289
|
+
* Array memory layout.
|
|
1290
|
+
*
|
|
1291
|
+
* ## Notes
|
|
1292
|
+
*
|
|
1293
|
+
* - The array memory layout is either row-major (C-style) or column-major (Fortran-style).
|
|
1294
|
+
*/
|
|
1295
|
+
type Layout = 'row-major' | 'column-major';
|
|
1296
|
+
|
|
1297
|
+
/**
|
|
1298
|
+
* Matrix triangle.
|
|
1299
|
+
*
|
|
1300
|
+
* ## Notes
|
|
1301
|
+
*
|
|
1302
|
+
* - **upper**: upper triangular part of a matrix.
|
|
1303
|
+
* - **lower**: lower triangular part of a matrix.
|
|
1304
|
+
*/
|
|
1305
|
+
type MatrixTriangle = 'upper' | 'lower';
|
|
1306
|
+
|
|
1307
|
+
/**
|
|
1308
|
+
* Operation side.
|
|
1309
|
+
*
|
|
1310
|
+
* ## Notes
|
|
1311
|
+
*
|
|
1312
|
+
* - **left**: a triangular matrix is on the left side of a matrix-matrix operation (e.g., AX = B, where A is a triangular matrix).
|
|
1313
|
+
* - **right**: a triangular matrix is on the right side of a matrix-matrix operation (e.g., XA = B, where A is a triangular matrix).
|
|
1314
|
+
*/
|
|
1315
|
+
type OperationSide = 'left' | 'right';
|
|
1316
|
+
|
|
1317
|
+
/**
|
|
1318
|
+
* Transpose operations.
|
|
1319
|
+
*
|
|
1320
|
+
* ## Notes
|
|
1321
|
+
*
|
|
1322
|
+
* - **no-transpose**: no transposition.
|
|
1323
|
+
* - **transpose**: transposition.
|
|
1324
|
+
* - **conjugate-transpose**: conjugate transposition.
|
|
1325
|
+
*/
|
|
1326
|
+
type TransposeOperation = 'no-transpose' | 'transpose' | 'conjugate-transpose';
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
/**
|
|
1330
|
+
* Module containing ndarray definitions.
|
|
1331
|
+
*
|
|
1332
|
+
* @example
|
|
1333
|
+
* import * as ndarray from `@stdlib/types/ndarray`;
|
|
1334
|
+
*
|
|
1335
|
+
* const arr: ndarray.ndarray = {
|
|
1336
|
+
* 'byteLength': null,
|
|
1337
|
+
* 'BYTES_PER_ELEMENT': null,
|
|
1338
|
+
* 'data': [ 1, 2, 3 ],
|
|
1339
|
+
* 'dtype': 'generic',
|
|
1340
|
+
* 'flags': {
|
|
1341
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
1342
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
1343
|
+
* },
|
|
1344
|
+
* 'length': 3,
|
|
1345
|
+
* 'ndims': 1,
|
|
1346
|
+
* 'offset': 0,
|
|
1347
|
+
* 'order': 'row-major',
|
|
1348
|
+
* 'shape': [ 3 ],
|
|
1349
|
+
* 'strides': [ 1 ],
|
|
1350
|
+
* 'get': function get( i ) {
|
|
1351
|
+
* return this.data[ i ];
|
|
1352
|
+
* },
|
|
1353
|
+
* 'set': function set( i, v ) {
|
|
1354
|
+
* this.data[ i ] = v;
|
|
1355
|
+
* return this;
|
|
1356
|
+
* }
|
|
1357
|
+
* };
|
|
1358
|
+
*
|
|
1359
|
+
* @example
|
|
1360
|
+
* import { ndarray } from `@stdlib/types/ndarray`;
|
|
1361
|
+
*
|
|
1362
|
+
* const arr: ndarray = {
|
|
1363
|
+
* 'byteLength': null,
|
|
1364
|
+
* 'BYTES_PER_ELEMENT': null,
|
|
1365
|
+
* 'data': [ 1, 2, 3 ],
|
|
1366
|
+
* 'dtype': 'generic',
|
|
1367
|
+
* 'flags': {
|
|
1368
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
1369
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
1370
|
+
* },
|
|
1371
|
+
* 'length': 3,
|
|
1372
|
+
* 'ndims': 1,
|
|
1373
|
+
* 'offset': 0,
|
|
1374
|
+
* 'order': 'row-major',
|
|
1375
|
+
* 'shape': [ 3 ],
|
|
1376
|
+
* 'strides': [ 1 ],
|
|
1377
|
+
* 'get': function get( i ) {
|
|
1378
|
+
* return this.data[ i ];
|
|
1379
|
+
* },
|
|
1380
|
+
* 'set': function set( i, v ) {
|
|
1381
|
+
* this.data[ i ] = v;
|
|
1382
|
+
* return this;
|
|
1383
|
+
* }
|
|
1384
|
+
* };
|
|
1385
|
+
*/
|
|
1386
|
+
declare module '@stdlib/types/ndarray' {
|
|
1387
|
+
import { ArrayLike, AccessorArrayLike, BooleanArray, BooleanTypedArray, Collection, Complex128Array, Complex64Array, RealOrComplexTypedArray, FloatOrComplexTypedArray, RealTypedArray, ComplexTypedArray, IntegerTypedArray, FloatTypedArray, SignedIntegerTypedArray, UnsignedIntegerTypedArray } from '@stdlib/types/array';
|
|
1388
|
+
import { ComplexLike, Complex128, Complex64 } from '@stdlib/types/complex'; // eslint-disable-line no-duplicate-imports
|
|
1389
|
+
import { Layout } from '@stdlib/types/blas';
|
|
1390
|
+
|
|
1391
|
+
/**
|
|
1392
|
+
* Data type.
|
|
1393
|
+
*/
|
|
1394
|
+
type DataType = NumericDataType | BooleanDataType | 'binary' | 'generic'; // "all"
|
|
1395
|
+
|
|
1396
|
+
/**
|
|
1397
|
+
* Data type for real-valued ndarrays.
|
|
1398
|
+
*/
|
|
1399
|
+
type RealDataType = RealFloatingPointDataType | IntegerDataType; // "real"
|
|
1400
|
+
|
|
1401
|
+
/**
|
|
1402
|
+
* Data type for real-valued ndarrays.
|
|
1403
|
+
*/
|
|
1404
|
+
type RealAndGenericDataType = RealDataType | 'generic'; // "real_and_generic"
|
|
1405
|
+
|
|
1406
|
+
/**
|
|
1407
|
+
* Data type for floating-point ndarrays.
|
|
1408
|
+
*/
|
|
1409
|
+
type RealFloatingPointDataType = 'float64' | 'float32'; // "real_floating_point"
|
|
1410
|
+
|
|
1411
|
+
/**
|
|
1412
|
+
* Data type for floating-point ndarrays.
|
|
1413
|
+
*/
|
|
1414
|
+
type RealFloatingPointAndGenericDataType = RealFloatingPointDataType | 'generic'; // "real_floating_point_and_generic"
|
|
1415
|
+
|
|
1416
|
+
/**
|
|
1417
|
+
* Data type for integer ndarrays.
|
|
1418
|
+
*/
|
|
1419
|
+
type IntegerDataType = SignedIntegerDataType | UnsignedIntegerDataType; // "integer"
|
|
1420
|
+
|
|
1421
|
+
/**
|
|
1422
|
+
* Data type for integer ndarrays.
|
|
1423
|
+
*/
|
|
1424
|
+
type IntegerAndGenericDataType = IntegerDataType | 'generic'; // "integer_and_generic"
|
|
1425
|
+
|
|
1426
|
+
/**
|
|
1427
|
+
* Data type for signed integer ndarrays.
|
|
1428
|
+
*/
|
|
1429
|
+
type SignedIntegerDataType = 'int32' | 'int16' | 'int8'; // "signed_integer"
|
|
1430
|
+
|
|
1431
|
+
/**
|
|
1432
|
+
* Data type for signed integer ndarrays.
|
|
1433
|
+
*/
|
|
1434
|
+
type SignedIntegerAndGenericDataType = SignedIntegerDataType | 'generic'; // "signed_integer_and_generic"
|
|
1435
|
+
|
|
1436
|
+
/**
|
|
1437
|
+
* Data type for unsigned integer ndarrays.
|
|
1438
|
+
*/
|
|
1439
|
+
type UnsignedIntegerDataType = 'uint32' | 'uint16' | 'uint8' | 'uint8c'; // "unsigned_integer"
|
|
1440
|
+
|
|
1441
|
+
/**
|
|
1442
|
+
* Data type for unsigned integer ndarrays.
|
|
1443
|
+
*/
|
|
1444
|
+
type UnsignedIntegerAndGenericDataType = UnsignedIntegerDataType | 'generic'; // "unsigned_integer_and_generic"
|
|
1445
|
+
|
|
1446
|
+
/**
|
|
1447
|
+
* Data type for complex number ndarrays.
|
|
1448
|
+
*/
|
|
1449
|
+
type ComplexFloatingPointDataType = 'complex64' | 'complex128'; // "complex_floating_point"
|
|
1450
|
+
|
|
1451
|
+
/**
|
|
1452
|
+
* Data type for complex number ndarrays.
|
|
1453
|
+
*/
|
|
1454
|
+
type ComplexFloatingPointAndGenericDataType = ComplexFloatingPointDataType | 'generic'; // "complex_floating_point_and_generic"
|
|
1455
|
+
|
|
1456
|
+
/**
|
|
1457
|
+
* Data type for floating-point real or complex ndarrays.
|
|
1458
|
+
*/
|
|
1459
|
+
type FloatingPointDataType = RealFloatingPointDataType | ComplexFloatingPointDataType; // "floating_point"
|
|
1460
|
+
|
|
1461
|
+
/**
|
|
1462
|
+
* Data type for floating-point real or complex ndarrays.
|
|
1463
|
+
*/
|
|
1464
|
+
type FloatingPointAndGenericDataType = FloatingPointDataType | 'generic'; // "floating_point_and_generic"
|
|
1465
|
+
|
|
1466
|
+
/**
|
|
1467
|
+
* Data type for real-valued or complex number ndarrays.
|
|
1468
|
+
*/
|
|
1469
|
+
type NumericDataType = RealDataType | ComplexFloatingPointDataType; // "numeric"
|
|
1470
|
+
|
|
1471
|
+
/**
|
|
1472
|
+
* Data type for real-valued or complex number ndarrays.
|
|
1473
|
+
*/
|
|
1474
|
+
type NumericAndGenericDataType = NumericDataType | 'generic'; // "numeric_and_generic"
|
|
1475
|
+
|
|
1476
|
+
/**
|
|
1477
|
+
* Data type for boolean typed arrays.
|
|
1478
|
+
*/
|
|
1479
|
+
type BooleanDataType = 'bool'; // "boolean"
|
|
1480
|
+
|
|
1481
|
+
/**
|
|
1482
|
+
* Data type for boolean and generic ndarrays.
|
|
1483
|
+
*/
|
|
1484
|
+
type BooleanAndGenericDataType = BooleanDataType | 'generic'; // "boolean_and_generic"
|
|
1485
|
+
|
|
1486
|
+
/**
|
|
1487
|
+
* Data type for strictly "typed" ndarrays.
|
|
1488
|
+
*/
|
|
1489
|
+
type TypedDataType = NumericDataType | BooleanDataType; // "typed"
|
|
1490
|
+
|
|
1491
|
+
/**
|
|
1492
|
+
* Data type for strictly typed and generic ndarrays.
|
|
1493
|
+
*/
|
|
1494
|
+
type TypedAndGenericDataType = TypedDataType | 'generic'; // "typed_and_generic"
|
|
1495
|
+
|
|
1496
|
+
/**
|
|
1497
|
+
* Strict data type "kinds".
|
|
1498
|
+
*/
|
|
1499
|
+
type StrictDataTypeKind = 'typed' | 'numeric' | 'real' | 'floating_point' | 'real_floating_point' | 'complex_floating_point' | 'integer' | 'signed_integer' | 'unsigned_integer' | 'boolean';
|
|
1500
|
+
|
|
1501
|
+
/**
|
|
1502
|
+
* Data type "kinds".
|
|
1503
|
+
*/
|
|
1504
|
+
type DataTypeKind = StrictDataTypeKind | 'all' | 'typed_and_generic' | 'numeric_and_generic' | 'real_and_generic' | 'floating_point_and_generic' | 'real_floating_point_and_generic' | 'complex_floating_point_and_generic' | 'integer_and_generic' | 'signed_integer_and_generic' | 'unsigned_integer_and_generic' | 'boolean_and_generic';
|
|
1505
|
+
|
|
1506
|
+
/**
|
|
1507
|
+
* Output data type policy.
|
|
1508
|
+
*/
|
|
1509
|
+
type OutputPolicy = 'default' | 'same' | 'promoted' | 'boolean' | 'numeric' | 'real' | 'floating_point' | 'real_floating_point' | 'complex_floating_point' | 'integer' | 'signed_integer' | 'unsigned_integer';
|
|
1510
|
+
|
|
1511
|
+
/**
|
|
1512
|
+
* Array order.
|
|
1513
|
+
*
|
|
1514
|
+
* ## Notes
|
|
1515
|
+
*
|
|
1516
|
+
* - The array order is either row-major (C-style) or column-major (Fortran-style).
|
|
1517
|
+
*/
|
|
1518
|
+
type Order = Layout;
|
|
1519
|
+
|
|
1520
|
+
/**
|
|
1521
|
+
* Array index mode.
|
|
1522
|
+
*
|
|
1523
|
+
* ## Notes
|
|
1524
|
+
*
|
|
1525
|
+
* - The following index modes are supported:
|
|
1526
|
+
*
|
|
1527
|
+
* - **throw**: specifies that a function should throw an error when an index is outside a restricted interval.
|
|
1528
|
+
* - **normalize**: specifies that a function should normalize negative indices and throw an error when an index is outside a restricted interval.
|
|
1529
|
+
* - **wrap**: specifies that a function should wrap around an index using modulo arithmetic.
|
|
1530
|
+
* - **clamp**: specifies that a function should set an index less than zero to zero (minimum index) and set an index greater than a maximum index value to the maximum possible index.
|
|
1531
|
+
*/
|
|
1532
|
+
type Mode = 'throw' | 'normalize' | 'clamp' | 'wrap';
|
|
1533
|
+
|
|
1534
|
+
/**
|
|
1535
|
+
* Array shape.
|
|
1536
|
+
*
|
|
1537
|
+
* ## Notes
|
|
1538
|
+
*
|
|
1539
|
+
* - Each element of the array shape (i.e., dimension size) should be a nonnegative integer.
|
|
1540
|
+
*/
|
|
1541
|
+
type Shape = Collection<number>;
|
|
1542
|
+
|
|
1543
|
+
/**
|
|
1544
|
+
* Array shape for a zero-dimensional array.
|
|
1545
|
+
*
|
|
1546
|
+
* ## Notes
|
|
1547
|
+
*
|
|
1548
|
+
* - The array shape for a zero-dimensional array contains zero elements.
|
|
1549
|
+
*/
|
|
1550
|
+
type Shape0D = Collection<never>;
|
|
1551
|
+
|
|
1552
|
+
/**
|
|
1553
|
+
* Array shape for a one-dimensional array.
|
|
1554
|
+
*
|
|
1555
|
+
* ## Notes
|
|
1556
|
+
*
|
|
1557
|
+
* - The array shape for a one-dimensional array contains a single element and the element value (i.e., dimension size) should be a nonnegative integer.
|
|
1558
|
+
*/
|
|
1559
|
+
type Shape1D = Collection<number>;
|
|
1560
|
+
|
|
1561
|
+
/**
|
|
1562
|
+
* Array shape for a two-dimensional array.
|
|
1563
|
+
*
|
|
1564
|
+
* ## Notes
|
|
1565
|
+
*
|
|
1566
|
+
* - The array shape for a three-dimensional array contains two elements and each element (i.e., dimension size) should be a nonnegative integer.
|
|
1567
|
+
*/
|
|
1568
|
+
type Shape2D = Collection<number>;
|
|
1569
|
+
|
|
1570
|
+
/**
|
|
1571
|
+
* Array shape for a three-dimensional array.
|
|
1572
|
+
*
|
|
1573
|
+
* ## Notes
|
|
1574
|
+
*
|
|
1575
|
+
* - The array shape for a three-dimensional array contains three elements and each element (i.e., dimension size) should be a nonnegative integer.
|
|
1576
|
+
*/
|
|
1577
|
+
type Shape3D = Collection<number>;
|
|
1578
|
+
|
|
1579
|
+
/**
|
|
1580
|
+
* Array shape for a four-dimensional array.
|
|
1581
|
+
*
|
|
1582
|
+
* ## Notes
|
|
1583
|
+
*
|
|
1584
|
+
* - The array shape for a four-dimensional array contains four elements and each element (i.e., dimension size) should be a nonnegative integer.
|
|
1585
|
+
*/
|
|
1586
|
+
type Shape4D = Collection<number>;
|
|
1587
|
+
|
|
1588
|
+
/**
|
|
1589
|
+
* Array shape for a five-dimensional array.
|
|
1590
|
+
*
|
|
1591
|
+
* ## Notes
|
|
1592
|
+
*
|
|
1593
|
+
* - The array shape for a five-dimensional array contains five elements and each element (i.e., dimension size) should be a nonnegative integer.
|
|
1594
|
+
*/
|
|
1595
|
+
type Shape5D = Collection<number>;
|
|
1596
|
+
|
|
1597
|
+
/**
|
|
1598
|
+
* Array shape for a six-dimensional array.
|
|
1599
|
+
*
|
|
1600
|
+
* ## Notes
|
|
1601
|
+
*
|
|
1602
|
+
* - The array shape for a six-dimensional array contains six elements and each element (i.e., dimension size) should be a nonnegative integer.
|
|
1603
|
+
*/
|
|
1604
|
+
type Shape6D = Collection<number>;
|
|
1605
|
+
|
|
1606
|
+
/**
|
|
1607
|
+
* Array shape for a seven-dimensional array.
|
|
1608
|
+
*
|
|
1609
|
+
* ## Notes
|
|
1610
|
+
*
|
|
1611
|
+
* - The array shape for a seven-dimensional array contains seven elements and each element (i.e., dimension size) should be a nonnegative integer.
|
|
1612
|
+
*/
|
|
1613
|
+
type Shape7D = Collection<number>;
|
|
1614
|
+
|
|
1615
|
+
/**
|
|
1616
|
+
* Array shape for an eight-dimensional array.
|
|
1617
|
+
*
|
|
1618
|
+
* ## Notes
|
|
1619
|
+
*
|
|
1620
|
+
* - The array shape for an eight-dimensional array contains eight elements and each element (i.e., dimension size) should be a nonnegative integer.
|
|
1621
|
+
*/
|
|
1622
|
+
type Shape8D = Collection<number>;
|
|
1623
|
+
|
|
1624
|
+
/**
|
|
1625
|
+
* Array shape for a nine-dimensional array.
|
|
1626
|
+
*
|
|
1627
|
+
* ## Notes
|
|
1628
|
+
*
|
|
1629
|
+
* - The array shape for a nine-dimensional array contains nine elements and each element (i.e., dimension size) should be a nonnegative integer.
|
|
1630
|
+
*/
|
|
1631
|
+
type Shape9D = Collection<number>;
|
|
1632
|
+
|
|
1633
|
+
/**
|
|
1634
|
+
* Array shape for a ten-dimensional array.
|
|
1635
|
+
*
|
|
1636
|
+
* ## Notes
|
|
1637
|
+
*
|
|
1638
|
+
* - The array shape for a ten-dimensional array contains ten elements and each element (i.e., dimension size) should be a nonnegative integer.
|
|
1639
|
+
*/
|
|
1640
|
+
type Shape10D = Collection<number>;
|
|
1641
|
+
|
|
1642
|
+
/**
|
|
1643
|
+
* Array strides.
|
|
1644
|
+
*
|
|
1645
|
+
* ## Notes
|
|
1646
|
+
*
|
|
1647
|
+
* - Each stride (i.e., index increment along a respective dimension) should be an integer.
|
|
1648
|
+
*/
|
|
1649
|
+
type Strides = Collection<number>;
|
|
1650
|
+
|
|
1651
|
+
/**
|
|
1652
|
+
* Array strides for a zero-dimensional array.
|
|
1653
|
+
*
|
|
1654
|
+
* ## Notes
|
|
1655
|
+
*
|
|
1656
|
+
* - The strides array for a two-dimensional array contains a single element equal to zero.
|
|
1657
|
+
*/
|
|
1658
|
+
type Strides0D = Collection<number>;
|
|
1659
|
+
|
|
1660
|
+
/**
|
|
1661
|
+
* Array strides for a one-dimensional array.
|
|
1662
|
+
*
|
|
1663
|
+
* ## Notes
|
|
1664
|
+
*
|
|
1665
|
+
* - The strides array for a two-dimensional array containsgle element and the element value should be an integer.
|
|
1666
|
+
*/
|
|
1667
|
+
type Strides1D = Collection<number>;
|
|
1668
|
+
|
|
1669
|
+
/**
|
|
1670
|
+
* Array strides for a two-dimensional array.
|
|
1671
|
+
*
|
|
1672
|
+
* ## Notes
|
|
1673
|
+
*
|
|
1674
|
+
* - The strides array for a two-dimensional array contains two elements and each element should be an integer.
|
|
1675
|
+
*/
|
|
1676
|
+
type Strides2D = Collection<number>;
|
|
1677
|
+
|
|
1678
|
+
/**
|
|
1679
|
+
* Array strides for a three-dimensional array.
|
|
1680
|
+
*
|
|
1681
|
+
* ## Notes
|
|
1682
|
+
*
|
|
1683
|
+
* - The strides array for a three-dimensional array contains three elements and each element should be an integer.
|
|
1684
|
+
*/
|
|
1685
|
+
type Strides3D = Collection<number>;
|
|
1686
|
+
|
|
1687
|
+
/**
|
|
1688
|
+
* Array strides for a four-dimensional array.
|
|
1689
|
+
*
|
|
1690
|
+
* ## Notes
|
|
1691
|
+
*
|
|
1692
|
+
* - The strides array for a four-dimensional array contains four elements and each element should be an integer.
|
|
1693
|
+
*/
|
|
1694
|
+
type Strides4D = Collection<number>;
|
|
1695
|
+
|
|
1696
|
+
/**
|
|
1697
|
+
* Array strides for a five-dimensional array.
|
|
1698
|
+
*
|
|
1699
|
+
* ## Notes
|
|
1700
|
+
*
|
|
1701
|
+
* - The strides array for a five-dimensional array contains five elements and each element should be an integer.
|
|
1702
|
+
*/
|
|
1703
|
+
type Strides5D = Collection<number>;
|
|
1704
|
+
|
|
1705
|
+
/**
|
|
1706
|
+
* Array strides for a six-dimensional array.
|
|
1707
|
+
*
|
|
1708
|
+
* ## Notes
|
|
1709
|
+
*
|
|
1710
|
+
* - The strides array for a six-dimensional array contains six elements and each element should be an integer.
|
|
1711
|
+
*/
|
|
1712
|
+
type Strides6D = Collection<number>;
|
|
1713
|
+
|
|
1714
|
+
/**
|
|
1715
|
+
* Array strides for a seven-dimensional array.
|
|
1716
|
+
*
|
|
1717
|
+
* ## Notes
|
|
1718
|
+
*
|
|
1719
|
+
* - The strides array for a seven-dimensional array contains seven elements and each element should be an integer.
|
|
1720
|
+
*/
|
|
1721
|
+
type Strides7D = Collection<number>;
|
|
1722
|
+
|
|
1723
|
+
/**
|
|
1724
|
+
* Array strides for an eight-dimensional array.
|
|
1725
|
+
*
|
|
1726
|
+
* ## Notes
|
|
1727
|
+
*
|
|
1728
|
+
* - The strides array for an eight-dimensional array contains eight elements and each element should be an integer.
|
|
1729
|
+
*/
|
|
1730
|
+
type Strides8D = Collection<number>;
|
|
1731
|
+
|
|
1732
|
+
/**
|
|
1733
|
+
* Array strides for a nine-dimensional array.
|
|
1734
|
+
*
|
|
1735
|
+
* ## Notes
|
|
1736
|
+
*
|
|
1737
|
+
* - The strides array for a nine-dimensional array contains nine elements and each element should be an integer.
|
|
1738
|
+
*/
|
|
1739
|
+
type Strides9D = Collection<number>;
|
|
1740
|
+
|
|
1741
|
+
/**
|
|
1742
|
+
* Array strides for a ten-dimensional array.
|
|
1743
|
+
*
|
|
1744
|
+
* ## Notes
|
|
1745
|
+
*
|
|
1746
|
+
* - The strides array for a ten-dimensional array contains ten elements and each element should be an integer.
|
|
1747
|
+
*/
|
|
1748
|
+
type Strides10D = Collection<number>;
|
|
1749
|
+
|
|
1750
|
+
/**
|
|
1751
|
+
* Flags and other meta information (e.g., memory layout of the array).
|
|
1752
|
+
*/
|
|
1753
|
+
interface Flags<T = unknown> {
|
|
1754
|
+
/**
|
|
1755
|
+
* Properties.
|
|
1756
|
+
*/
|
|
1757
|
+
[key: string | symbol | number]: T | boolean | undefined;
|
|
1758
|
+
|
|
1759
|
+
/**
|
|
1760
|
+
* Boolean indicating if an array is row-major contiguous.
|
|
1761
|
+
*/
|
|
1762
|
+
ROW_MAJOR_CONTIGUOUS?: boolean;
|
|
1763
|
+
|
|
1764
|
+
/**
|
|
1765
|
+
* Boolean indicating if an array is column-major contiguous.
|
|
1766
|
+
*/
|
|
1767
|
+
COLUMN_MAJOR_CONTIGUOUS?: boolean;
|
|
1768
|
+
|
|
1769
|
+
/**
|
|
1770
|
+
* Boolean indicating if an array is read-only.
|
|
1771
|
+
*/
|
|
1772
|
+
READONLY?: boolean;
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
/**
|
|
1776
|
+
* Interface describing an ndarray.
|
|
1777
|
+
*
|
|
1778
|
+
* @example
|
|
1779
|
+
* const arr: ndarray = {
|
|
1780
|
+
* 'byteLength': null,
|
|
1781
|
+
* 'BYTES_PER_ELEMENT': null,
|
|
1782
|
+
* 'data': [ 1, 2, 3 ],
|
|
1783
|
+
* 'dtype': 'generic',
|
|
1784
|
+
* 'flags': {
|
|
1785
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
1786
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
1787
|
+
* },
|
|
1788
|
+
* 'length': 3,
|
|
1789
|
+
* 'ndims': 1,
|
|
1790
|
+
* 'offset': 0,
|
|
1791
|
+
* 'order': 'row-major',
|
|
1792
|
+
* 'shape': [ 3 ],
|
|
1793
|
+
* 'strides': [ 1 ],
|
|
1794
|
+
* 'get': function get( i ) {
|
|
1795
|
+
* return this.data[ i ];
|
|
1796
|
+
* },
|
|
1797
|
+
* 'set': function set( i, v ) {
|
|
1798
|
+
* this.data[ i ] = v;
|
|
1799
|
+
* return this;
|
|
1800
|
+
* }
|
|
1801
|
+
* };
|
|
1802
|
+
*/
|
|
1803
|
+
interface ndarray {
|
|
1804
|
+
/**
|
|
1805
|
+
* Size (in bytes) of the array (if known).
|
|
1806
|
+
*/
|
|
1807
|
+
byteLength: number | null;
|
|
1808
|
+
|
|
1809
|
+
/**
|
|
1810
|
+
* Size (in bytes) of each array element (if known).
|
|
1811
|
+
*/
|
|
1812
|
+
BYTES_PER_ELEMENT: number | null;
|
|
1813
|
+
|
|
1814
|
+
/**
|
|
1815
|
+
* A reference to the underlying data buffer.
|
|
1816
|
+
*/
|
|
1817
|
+
data: ArrayLike<any> | AccessorArrayLike<any>; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
1818
|
+
|
|
1819
|
+
/**
|
|
1820
|
+
* Underlying data type.
|
|
1821
|
+
*/
|
|
1822
|
+
dtype: string;
|
|
1823
|
+
|
|
1824
|
+
/**
|
|
1825
|
+
* Flags and other meta information (e.g., memory layout of the array).
|
|
1826
|
+
*/
|
|
1827
|
+
flags: Flags;
|
|
1828
|
+
|
|
1829
|
+
/**
|
|
1830
|
+
* Number of array elements.
|
|
1831
|
+
*/
|
|
1832
|
+
length: number;
|
|
1833
|
+
|
|
1834
|
+
/**
|
|
1835
|
+
* Number of dimensions.
|
|
1836
|
+
*/
|
|
1837
|
+
ndims: number;
|
|
1838
|
+
|
|
1839
|
+
/**
|
|
1840
|
+
* Index offset which specifies the `buffer` index at which to start iterating over array elements.
|
|
1841
|
+
*/
|
|
1842
|
+
offset: number;
|
|
1843
|
+
|
|
1844
|
+
/**
|
|
1845
|
+
* Array order.
|
|
1846
|
+
*
|
|
1847
|
+
* ## Notes
|
|
1848
|
+
*
|
|
1849
|
+
* - The array order is either row-major (C-style) or column-major (Fortran-style).
|
|
1850
|
+
*/
|
|
1851
|
+
order: Order;
|
|
1852
|
+
|
|
1853
|
+
/**
|
|
1854
|
+
* Array shape.
|
|
1855
|
+
*/
|
|
1856
|
+
shape: Shape;
|
|
1857
|
+
|
|
1858
|
+
/**
|
|
1859
|
+
* Array strides.
|
|
1860
|
+
*/
|
|
1861
|
+
strides: Strides;
|
|
1862
|
+
|
|
1863
|
+
/**
|
|
1864
|
+
* Returns an array element specified according to provided subscripts.
|
|
1865
|
+
*
|
|
1866
|
+
* ## Notes
|
|
1867
|
+
*
|
|
1868
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
1869
|
+
*
|
|
1870
|
+
* @param args - subscripts
|
|
1871
|
+
* @returns array element
|
|
1872
|
+
*/
|
|
1873
|
+
get( ...args: Array<number> ): any; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
1874
|
+
|
|
1875
|
+
/**
|
|
1876
|
+
* Sets an array element specified according to provided subscripts.
|
|
1877
|
+
*
|
|
1878
|
+
* ## Notes
|
|
1879
|
+
*
|
|
1880
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
1881
|
+
*
|
|
1882
|
+
* @param args - subscripts and value to set
|
|
1883
|
+
* @returns ndarray instance
|
|
1884
|
+
*/
|
|
1885
|
+
set( ...args: Array<any> ): ndarray; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
1886
|
+
}
|
|
1887
|
+
|
|
1888
|
+
/**
|
|
1889
|
+
* Interface describing an ndarray having a generic data type.
|
|
1890
|
+
*
|
|
1891
|
+
* @example
|
|
1892
|
+
* const arr: genericndarray<any> = {
|
|
1893
|
+
* 'byteLength': null,
|
|
1894
|
+
* 'BYTES_PER_ELEMENT': null,
|
|
1895
|
+
* 'data': [ 1, 2, 3 ],
|
|
1896
|
+
* 'dtype': 'generic',
|
|
1897
|
+
* 'flags': {
|
|
1898
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
1899
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
1900
|
+
* },
|
|
1901
|
+
* 'length': 3,
|
|
1902
|
+
* 'ndims': 1,
|
|
1903
|
+
* 'offset': 0,
|
|
1904
|
+
* 'order': 'row-major',
|
|
1905
|
+
* 'shape': [ 3 ],
|
|
1906
|
+
* 'strides': [ 1 ],
|
|
1907
|
+
* 'get': function get( i ) {
|
|
1908
|
+
* return this.data[ i ];
|
|
1909
|
+
* },
|
|
1910
|
+
* 'set': function set( i, v ) {
|
|
1911
|
+
* this.data[ i ] = v;
|
|
1912
|
+
* return this;
|
|
1913
|
+
* }
|
|
1914
|
+
* };
|
|
1915
|
+
*/
|
|
1916
|
+
interface genericndarray<T> extends ndarray {
|
|
1917
|
+
/**
|
|
1918
|
+
* Size (in bytes) of the array.
|
|
1919
|
+
*/
|
|
1920
|
+
byteLength: null;
|
|
1921
|
+
|
|
1922
|
+
/**
|
|
1923
|
+
* Size (in bytes) of each array element.
|
|
1924
|
+
*/
|
|
1925
|
+
BYTES_PER_ELEMENT: null;
|
|
1926
|
+
|
|
1927
|
+
/**
|
|
1928
|
+
* Underlying data type.
|
|
1929
|
+
*/
|
|
1930
|
+
dtype: 'generic';
|
|
1931
|
+
|
|
1932
|
+
/**
|
|
1933
|
+
* A reference to the underlying data buffer.
|
|
1934
|
+
*/
|
|
1935
|
+
data: ArrayLike<T>;
|
|
1936
|
+
|
|
1937
|
+
/**
|
|
1938
|
+
* Returns an array element specified according to provided subscripts.
|
|
1939
|
+
*
|
|
1940
|
+
* ## Notes
|
|
1941
|
+
*
|
|
1942
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
1943
|
+
*
|
|
1944
|
+
* @param args - subscripts
|
|
1945
|
+
* @returns array element
|
|
1946
|
+
*/
|
|
1947
|
+
get( ...args: Array<number> ): T;
|
|
1948
|
+
|
|
1949
|
+
/**
|
|
1950
|
+
* Sets an array element specified according to provided subscripts.
|
|
1951
|
+
*
|
|
1952
|
+
* ## Notes
|
|
1953
|
+
*
|
|
1954
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
1955
|
+
*
|
|
1956
|
+
* @param args - subscripts and value to set
|
|
1957
|
+
* @returns ndarray instance
|
|
1958
|
+
*/
|
|
1959
|
+
set( ...args: Array<number|T> ): genericndarray<T>;
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1962
|
+
/**
|
|
1963
|
+
* Interface describing an ndarray having a homogeneous data type.
|
|
1964
|
+
*
|
|
1965
|
+
* @example
|
|
1966
|
+
* const arr: typedndarray<number> = {
|
|
1967
|
+
* 'byteLength': null,
|
|
1968
|
+
* 'BYTES_PER_ELEMENT': null,
|
|
1969
|
+
* 'data': [ 1, 2, 3 ],
|
|
1970
|
+
* 'dtype': 'generic',
|
|
1971
|
+
* 'flags': {
|
|
1972
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
1973
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
1974
|
+
* },
|
|
1975
|
+
* 'length': 3,
|
|
1976
|
+
* 'ndims': 1,
|
|
1977
|
+
* 'offset': 0,
|
|
1978
|
+
* 'order': 'row-major',
|
|
1979
|
+
* 'shape': [ 3 ],
|
|
1980
|
+
* 'strides': [ 1 ],
|
|
1981
|
+
* 'get': function get( i ) {
|
|
1982
|
+
* return this.data[ i ];
|
|
1983
|
+
* },
|
|
1984
|
+
* 'set': function set( i, v ) {
|
|
1985
|
+
* this.data[ i ] = v;
|
|
1986
|
+
* return this;
|
|
1987
|
+
* }
|
|
1988
|
+
* };
|
|
1989
|
+
*/
|
|
1990
|
+
interface typedndarray<T> extends ndarray {
|
|
1991
|
+
/**
|
|
1992
|
+
* A reference to the underlying data buffer.
|
|
1993
|
+
*/
|
|
1994
|
+
data: ArrayLike<T>;
|
|
1995
|
+
|
|
1996
|
+
/**
|
|
1997
|
+
* Returns an array element specified according to provided subscripts.
|
|
1998
|
+
*
|
|
1999
|
+
* ## Notes
|
|
2000
|
+
*
|
|
2001
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
2002
|
+
*
|
|
2003
|
+
* @param args - subscripts
|
|
2004
|
+
* @returns array element
|
|
2005
|
+
*/
|
|
2006
|
+
get( ...args: Array<number> ): T;
|
|
2007
|
+
|
|
2008
|
+
/**
|
|
2009
|
+
* Sets an array element specified according to provided subscripts.
|
|
2010
|
+
*
|
|
2011
|
+
* ## Notes
|
|
2012
|
+
*
|
|
2013
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
2014
|
+
*
|
|
2015
|
+
* @param args - subscripts and value to set
|
|
2016
|
+
* @returns ndarray instance
|
|
2017
|
+
*/
|
|
2018
|
+
set( ...args: Array<number | T> ): typedndarray<T>;
|
|
2019
|
+
}
|
|
2020
|
+
|
|
2021
|
+
/**
|
|
2022
|
+
* Interface describing an ndarray having a floating-point data type.
|
|
2023
|
+
*
|
|
2024
|
+
* @example
|
|
2025
|
+
* const arr: floatndarray = {
|
|
2026
|
+
* 'byteLength': 24,
|
|
2027
|
+
* 'BYTES_PER_ELEMENT': 8,
|
|
2028
|
+
* 'data': new Float64Array( [ 1, 2, 3 ] ),
|
|
2029
|
+
* 'dtype': 'float64',
|
|
2030
|
+
* 'flags': {
|
|
2031
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
2032
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
2033
|
+
* },
|
|
2034
|
+
* 'length': 3,
|
|
2035
|
+
* 'ndims': 1,
|
|
2036
|
+
* 'offset': 0,
|
|
2037
|
+
* 'order': 'row-major',
|
|
2038
|
+
* 'shape': [ 3 ],
|
|
2039
|
+
* 'strides': [ 1 ],
|
|
2040
|
+
* 'get': function get( i ) {
|
|
2041
|
+
* return this.data[ i ];
|
|
2042
|
+
* },
|
|
2043
|
+
* 'set': function set( i, v ) {
|
|
2044
|
+
* this.data[ i ] = v;
|
|
2045
|
+
* return this;
|
|
2046
|
+
* }
|
|
2047
|
+
* };
|
|
2048
|
+
*/
|
|
2049
|
+
interface floatndarray extends typedndarray<number> {
|
|
2050
|
+
/**
|
|
2051
|
+
* Size (in bytes) of the array.
|
|
2052
|
+
*/
|
|
2053
|
+
byteLength: number;
|
|
2054
|
+
|
|
2055
|
+
/**
|
|
2056
|
+
* Size (in bytes) of each array element.
|
|
2057
|
+
*/
|
|
2058
|
+
BYTES_PER_ELEMENT: number;
|
|
2059
|
+
|
|
2060
|
+
/**
|
|
2061
|
+
* A reference to the underlying data buffer.
|
|
2062
|
+
*/
|
|
2063
|
+
data: FloatTypedArray;
|
|
2064
|
+
|
|
2065
|
+
/**
|
|
2066
|
+
* Underlying data type.
|
|
2067
|
+
*/
|
|
2068
|
+
dtype: RealFloatingPointDataType;
|
|
2069
|
+
|
|
2070
|
+
/**
|
|
2071
|
+
* Sets an array element specified according to provided subscripts.
|
|
2072
|
+
*
|
|
2073
|
+
* ## Notes
|
|
2074
|
+
*
|
|
2075
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
2076
|
+
*
|
|
2077
|
+
* @param args - subscripts and value to set
|
|
2078
|
+
* @returns ndarray instance
|
|
2079
|
+
*/
|
|
2080
|
+
set( ...args: Array<number> ): floatndarray;
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
/**
|
|
2084
|
+
* Interface describing an ndarray having a double-precision floating-point data type.
|
|
2085
|
+
*
|
|
2086
|
+
* @example
|
|
2087
|
+
* const arr: float64ndarray = {
|
|
2088
|
+
* 'byteLength': 24,
|
|
2089
|
+
* 'BYTES_PER_ELEMENT': 8,
|
|
2090
|
+
* 'data': new Float64Array( [ 1, 2, 3 ] ),
|
|
2091
|
+
* 'dtype': 'float64',
|
|
2092
|
+
* 'flags': {
|
|
2093
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
2094
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
2095
|
+
* },
|
|
2096
|
+
* 'length': 3,
|
|
2097
|
+
* 'ndims': 1,
|
|
2098
|
+
* 'offset': 0,
|
|
2099
|
+
* 'order': 'row-major',
|
|
2100
|
+
* 'shape': [ 3 ],
|
|
2101
|
+
* 'strides': [ 1 ],
|
|
2102
|
+
* 'get': function get( i ) {
|
|
2103
|
+
* return this.data[ i ];
|
|
2104
|
+
* },
|
|
2105
|
+
* 'set': function set( i, v ) {
|
|
2106
|
+
* this.data[ i ] = v;
|
|
2107
|
+
* return this;
|
|
2108
|
+
* }
|
|
2109
|
+
* };
|
|
2110
|
+
*/
|
|
2111
|
+
interface float64ndarray extends floatndarray {
|
|
2112
|
+
/**
|
|
2113
|
+
* Size (in bytes) of each array element.
|
|
2114
|
+
*/
|
|
2115
|
+
BYTES_PER_ELEMENT: 8;
|
|
2116
|
+
|
|
2117
|
+
/**
|
|
2118
|
+
* A reference to the underlying data buffer.
|
|
2119
|
+
*/
|
|
2120
|
+
data: Float64Array;
|
|
2121
|
+
|
|
2122
|
+
/**
|
|
2123
|
+
* Underlying data type.
|
|
2124
|
+
*/
|
|
2125
|
+
dtype: 'float64';
|
|
2126
|
+
|
|
2127
|
+
/**
|
|
2128
|
+
* Sets an array element specified according to provided subscripts.
|
|
2129
|
+
*
|
|
2130
|
+
* ## Notes
|
|
2131
|
+
*
|
|
2132
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
2133
|
+
*
|
|
2134
|
+
* @param args - subscripts and value to set
|
|
2135
|
+
* @returns ndarray instance
|
|
2136
|
+
*/
|
|
2137
|
+
set( ...args: Array<number> ): float64ndarray;
|
|
2138
|
+
}
|
|
2139
|
+
|
|
2140
|
+
/**
|
|
2141
|
+
* Interface describing an ndarray having a single-precision floating-point data type.
|
|
2142
|
+
*
|
|
2143
|
+
* @example
|
|
2144
|
+
* const arr: float32ndarray = {
|
|
2145
|
+
* 'byteLength': 12,
|
|
2146
|
+
* 'BYTES_PER_ELEMENT': 4,
|
|
2147
|
+
* 'data': new Float32Array( [ 1, 2, 3 ] ),
|
|
2148
|
+
* 'dtype': 'float32',
|
|
2149
|
+
* 'flags': {
|
|
2150
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
2151
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
2152
|
+
* },
|
|
2153
|
+
* 'length': 3,
|
|
2154
|
+
* 'ndims': 1,
|
|
2155
|
+
* 'offset': 0,
|
|
2156
|
+
* 'order': 'row-major',
|
|
2157
|
+
* 'shape': [ 3 ],
|
|
2158
|
+
* 'strides': [ 1 ],
|
|
2159
|
+
* 'get': function get( i ) {
|
|
2160
|
+
* return this.data[ i ];
|
|
2161
|
+
* },
|
|
2162
|
+
* 'set': function set( i, v ) {
|
|
2163
|
+
* this.data[ i ] = v;
|
|
2164
|
+
* return this;
|
|
2165
|
+
* }
|
|
2166
|
+
* };
|
|
2167
|
+
*/
|
|
2168
|
+
interface float32ndarray extends floatndarray {
|
|
2169
|
+
/**
|
|
2170
|
+
* Size (in bytes) of each array element.
|
|
2171
|
+
*/
|
|
2172
|
+
BYTES_PER_ELEMENT: 4;
|
|
2173
|
+
|
|
2174
|
+
/**
|
|
2175
|
+
* A reference to the underlying data buffer.
|
|
2176
|
+
*/
|
|
2177
|
+
data: Float32Array;
|
|
2178
|
+
|
|
2179
|
+
/**
|
|
2180
|
+
* Underlying data type.
|
|
2181
|
+
*/
|
|
2182
|
+
dtype: 'float32';
|
|
2183
|
+
|
|
2184
|
+
/**
|
|
2185
|
+
* Sets an array element specified according to provided subscripts.
|
|
2186
|
+
*
|
|
2187
|
+
* ## Notes
|
|
2188
|
+
*
|
|
2189
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
2190
|
+
*
|
|
2191
|
+
* @param args - subscripts and value to set
|
|
2192
|
+
* @returns ndarray instance
|
|
2193
|
+
*/
|
|
2194
|
+
set( ...args: Array<number> ): float32ndarray;
|
|
2195
|
+
}
|
|
2196
|
+
|
|
2197
|
+
/**
|
|
2198
|
+
* Interface describing an ndarray having an integer data type.
|
|
2199
|
+
*
|
|
2200
|
+
* @example
|
|
2201
|
+
* const arr: integerndarray = {
|
|
2202
|
+
* 'byteLength': 12,
|
|
2203
|
+
* 'BYTES_PER_ELEMENT': 4,
|
|
2204
|
+
* 'data': new Int32Array( [ 1, 2, 3 ] ),
|
|
2205
|
+
* 'dtype': 'int32',
|
|
2206
|
+
* 'flags': {
|
|
2207
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
2208
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
2209
|
+
* },
|
|
2210
|
+
* 'length': 3,
|
|
2211
|
+
* 'ndims': 1,
|
|
2212
|
+
* 'offset': 0,
|
|
2213
|
+
* 'order': 'row-major',
|
|
2214
|
+
* 'shape': [ 3 ],
|
|
2215
|
+
* 'strides': [ 1 ],
|
|
2216
|
+
* 'get': function get( i ) {
|
|
2217
|
+
* return this.data[ i ];
|
|
2218
|
+
* },
|
|
2219
|
+
* 'set': function set( i, v ) {
|
|
2220
|
+
* this.data[ i ] = v;
|
|
2221
|
+
* return this;
|
|
2222
|
+
* }
|
|
2223
|
+
* };
|
|
2224
|
+
*/
|
|
2225
|
+
interface integerndarray extends typedndarray<number> {
|
|
2226
|
+
/**
|
|
2227
|
+
* Size (in bytes) of the array.
|
|
2228
|
+
*/
|
|
2229
|
+
byteLength: number;
|
|
2230
|
+
|
|
2231
|
+
/**
|
|
2232
|
+
* Size (in bytes) of each array element.
|
|
2233
|
+
*/
|
|
2234
|
+
BYTES_PER_ELEMENT: number;
|
|
2235
|
+
|
|
2236
|
+
/**
|
|
2237
|
+
* A reference to the underlying data buffer.
|
|
2238
|
+
*/
|
|
2239
|
+
data: IntegerTypedArray;
|
|
2240
|
+
|
|
2241
|
+
/**
|
|
2242
|
+
* Underlying data type.
|
|
2243
|
+
*/
|
|
2244
|
+
dtype: IntegerDataType;
|
|
2245
|
+
|
|
2246
|
+
/**
|
|
2247
|
+
* Sets an array element specified according to provided subscripts.
|
|
2248
|
+
*
|
|
2249
|
+
* ## Notes
|
|
2250
|
+
*
|
|
2251
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
2252
|
+
*
|
|
2253
|
+
* @param args - subscripts and value to set
|
|
2254
|
+
* @returns ndarray instance
|
|
2255
|
+
*/
|
|
2256
|
+
set( ...args: Array<number> ): integerndarray;
|
|
2257
|
+
}
|
|
2258
|
+
|
|
2259
|
+
/**
|
|
2260
|
+
* Interface describing an ndarray having a signed integer data type.
|
|
2261
|
+
*
|
|
2262
|
+
* @example
|
|
2263
|
+
* const arr: signedintegerndarray = {
|
|
2264
|
+
* 'byteLength': 12,
|
|
2265
|
+
* 'BYTES_PER_ELEMENT': 4,
|
|
2266
|
+
* 'data': new Int32Array( [ 1, 2, 3 ] ),
|
|
2267
|
+
* 'dtype': 'int32',
|
|
2268
|
+
* 'flags': {
|
|
2269
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
2270
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
2271
|
+
* },
|
|
2272
|
+
* 'length': 3,
|
|
2273
|
+
* 'ndims': 1,
|
|
2274
|
+
* 'offset': 0,
|
|
2275
|
+
* 'order': 'row-major',
|
|
2276
|
+
* 'shape': [ 3 ],
|
|
2277
|
+
* 'strides': [ 1 ],
|
|
2278
|
+
* 'get': function get( i ) {
|
|
2279
|
+
* return this.data[ i ];
|
|
2280
|
+
* },
|
|
2281
|
+
* 'set': function set( i, v ) {
|
|
2282
|
+
* this.data[ i ] = v;
|
|
2283
|
+
* return this;
|
|
2284
|
+
* }
|
|
2285
|
+
* };
|
|
2286
|
+
*/
|
|
2287
|
+
interface signedintegerndarray extends typedndarray<number> {
|
|
2288
|
+
/**
|
|
2289
|
+
* Size (in bytes) of the array.
|
|
2290
|
+
*/
|
|
2291
|
+
byteLength: number;
|
|
2292
|
+
|
|
2293
|
+
/**
|
|
2294
|
+
* Size (in bytes) of each array element.
|
|
2295
|
+
*/
|
|
2296
|
+
BYTES_PER_ELEMENT: number;
|
|
2297
|
+
|
|
2298
|
+
/**
|
|
2299
|
+
* A reference to the underlying data buffer.
|
|
2300
|
+
*/
|
|
2301
|
+
data: SignedIntegerTypedArray;
|
|
2302
|
+
|
|
2303
|
+
/**
|
|
2304
|
+
* Underlying data type.
|
|
2305
|
+
*/
|
|
2306
|
+
dtype: SignedIntegerDataType;
|
|
2307
|
+
|
|
2308
|
+
/**
|
|
2309
|
+
* Sets an array element specified according to provided subscripts.
|
|
2310
|
+
*
|
|
2311
|
+
* ## Notes
|
|
2312
|
+
*
|
|
2313
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
2314
|
+
*
|
|
2315
|
+
* @param args - subscripts and value to set
|
|
2316
|
+
* @returns ndarray instance
|
|
2317
|
+
*/
|
|
2318
|
+
set( ...args: Array<number> ): signedintegerndarray;
|
|
2319
|
+
}
|
|
2320
|
+
|
|
2321
|
+
/**
|
|
2322
|
+
* Interface describing an ndarray having a signed 32-bit integer data type.
|
|
2323
|
+
*
|
|
2324
|
+
* @example
|
|
2325
|
+
* const arr: int32ndarray = {
|
|
2326
|
+
* 'byteLength': 12,
|
|
2327
|
+
* 'BYTES_PER_ELEMENT': 4,
|
|
2328
|
+
* 'data': new Int32Array( [ 1, 2, 3 ] ),
|
|
2329
|
+
* 'dtype': 'int32',
|
|
2330
|
+
* 'flags': {
|
|
2331
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
2332
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
2333
|
+
* },
|
|
2334
|
+
* 'length': 3,
|
|
2335
|
+
* 'ndims': 1,
|
|
2336
|
+
* 'offset': 0,
|
|
2337
|
+
* 'order': 'row-major',
|
|
2338
|
+
* 'shape': [ 3 ],
|
|
2339
|
+
* 'strides': [ 1 ],
|
|
2340
|
+
* 'get': function get( i ) {
|
|
2341
|
+
* return this.data[ i ];
|
|
2342
|
+
* },
|
|
2343
|
+
* 'set': function set( i, v ) {
|
|
2344
|
+
* this.data[ i ] = v;
|
|
2345
|
+
* return this;
|
|
2346
|
+
* }
|
|
2347
|
+
* };
|
|
2348
|
+
*/
|
|
2349
|
+
interface int32ndarray extends signedintegerndarray {
|
|
2350
|
+
/**
|
|
2351
|
+
* Size (in bytes) of each array element.
|
|
2352
|
+
*/
|
|
2353
|
+
BYTES_PER_ELEMENT: 4;
|
|
2354
|
+
|
|
2355
|
+
/**
|
|
2356
|
+
* A reference to the underlying data buffer.
|
|
2357
|
+
*/
|
|
2358
|
+
data: Int32Array;
|
|
2359
|
+
|
|
2360
|
+
/**
|
|
2361
|
+
* Underlying data type.
|
|
2362
|
+
*/
|
|
2363
|
+
dtype: 'int32';
|
|
2364
|
+
|
|
2365
|
+
/**
|
|
2366
|
+
* Sets an array element specified according to provided subscripts.
|
|
2367
|
+
*
|
|
2368
|
+
* ## Notes
|
|
2369
|
+
*
|
|
2370
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
2371
|
+
*
|
|
2372
|
+
* @param args - subscripts and value to set
|
|
2373
|
+
* @returns ndarray instance
|
|
2374
|
+
*/
|
|
2375
|
+
set( ...args: Array<number> ): int32ndarray;
|
|
2376
|
+
}
|
|
2377
|
+
|
|
2378
|
+
/**
|
|
2379
|
+
* Interface describing an ndarray having a signed 16-bit integer data type.
|
|
2380
|
+
*
|
|
2381
|
+
* @example
|
|
2382
|
+
* const arr: int16ndarray = {
|
|
2383
|
+
* 'byteLength': 6,
|
|
2384
|
+
* 'BYTES_PER_ELEMENT': 2,
|
|
2385
|
+
* 'data': new Int16Array( [ 1, 2, 3 ] ),
|
|
2386
|
+
* 'dtype': 'int16',
|
|
2387
|
+
* 'flags': {
|
|
2388
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
2389
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
2390
|
+
* },
|
|
2391
|
+
* 'length': 3,
|
|
2392
|
+
* 'ndims': 1,
|
|
2393
|
+
* 'offset': 0,
|
|
2394
|
+
* 'order': 'row-major',
|
|
2395
|
+
* 'shape': [ 3 ],
|
|
2396
|
+
* 'strides': [ 1 ],
|
|
2397
|
+
* 'get': function get( i ) {
|
|
2398
|
+
* return this.data[ i ];
|
|
2399
|
+
* },
|
|
2400
|
+
* 'set': function set( i, v ) {
|
|
2401
|
+
* this.data[ i ] = v;
|
|
2402
|
+
* return this;
|
|
2403
|
+
* }
|
|
2404
|
+
* };
|
|
2405
|
+
*/
|
|
2406
|
+
interface int16ndarray extends signedintegerndarray {
|
|
2407
|
+
/**
|
|
2408
|
+
* Size (in bytes) of each array element.
|
|
2409
|
+
*/
|
|
2410
|
+
BYTES_PER_ELEMENT: 2;
|
|
2411
|
+
|
|
2412
|
+
/**
|
|
2413
|
+
* A reference to the underlying data buffer.
|
|
2414
|
+
*/
|
|
2415
|
+
data: Int16Array;
|
|
2416
|
+
|
|
2417
|
+
/**
|
|
2418
|
+
* Underlying data type.
|
|
2419
|
+
*/
|
|
2420
|
+
dtype: 'int16';
|
|
2421
|
+
|
|
2422
|
+
/**
|
|
2423
|
+
* Sets an array element specified according to provided subscripts.
|
|
2424
|
+
*
|
|
2425
|
+
* ## Notes
|
|
2426
|
+
*
|
|
2427
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
2428
|
+
*
|
|
2429
|
+
* @param args - subscripts and value to set
|
|
2430
|
+
* @returns ndarray instance
|
|
2431
|
+
*/
|
|
2432
|
+
set( ...args: Array<number> ): int16ndarray;
|
|
2433
|
+
}
|
|
2434
|
+
|
|
2435
|
+
/**
|
|
2436
|
+
* Interface describing an ndarray having a signed 8-bit integer data type.
|
|
2437
|
+
*
|
|
2438
|
+
* @example
|
|
2439
|
+
* const arr: int8ndarray = {
|
|
2440
|
+
* 'byteLength': 3,
|
|
2441
|
+
* 'BYTES_PER_ELEMENT': 1,
|
|
2442
|
+
* 'data': new Int8Array( [ 1, 2, 3 ] ),
|
|
2443
|
+
* 'dtype': 'int8',
|
|
2444
|
+
* 'flags': {
|
|
2445
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
2446
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
2447
|
+
* },
|
|
2448
|
+
* 'length': 3,
|
|
2449
|
+
* 'ndims': 1,
|
|
2450
|
+
* 'offset': 0,
|
|
2451
|
+
* 'order': 'row-major',
|
|
2452
|
+
* 'shape': [ 3 ],
|
|
2453
|
+
* 'strides': [ 1 ],
|
|
2454
|
+
* 'get': function get( i ) {
|
|
2455
|
+
* return this.data[ i ];
|
|
2456
|
+
* },
|
|
2457
|
+
* 'set': function set( i, v ) {
|
|
2458
|
+
* this.data[ i ] = v;
|
|
2459
|
+
* return this;
|
|
2460
|
+
* }
|
|
2461
|
+
* };
|
|
2462
|
+
*/
|
|
2463
|
+
interface int8ndarray extends signedintegerndarray {
|
|
2464
|
+
/**
|
|
2465
|
+
* Size (in bytes) of each array element.
|
|
2466
|
+
*/
|
|
2467
|
+
BYTES_PER_ELEMENT: 1;
|
|
2468
|
+
|
|
2469
|
+
/**
|
|
2470
|
+
* A reference to the underlying data buffer.
|
|
2471
|
+
*/
|
|
2472
|
+
data: Int8Array;
|
|
2473
|
+
|
|
2474
|
+
/**
|
|
2475
|
+
* Underlying data type.
|
|
2476
|
+
*/
|
|
2477
|
+
dtype: 'int8';
|
|
2478
|
+
|
|
2479
|
+
/**
|
|
2480
|
+
* Sets an array element specified according to provided subscripts.
|
|
2481
|
+
*
|
|
2482
|
+
* ## Notes
|
|
2483
|
+
*
|
|
2484
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
2485
|
+
*
|
|
2486
|
+
* @param args - subscripts and value to set
|
|
2487
|
+
* @returns ndarray instance
|
|
2488
|
+
*/
|
|
2489
|
+
set( ...args: Array<number> ): int8ndarray;
|
|
2490
|
+
}
|
|
2491
|
+
|
|
2492
|
+
/**
|
|
2493
|
+
* Interface describing an ndarray having an unsigned integer data type.
|
|
2494
|
+
*
|
|
2495
|
+
* @example
|
|
2496
|
+
* const arr: unsignedintegerndarray = {
|
|
2497
|
+
* 'byteLength': 12,
|
|
2498
|
+
* 'BYTES_PER_ELEMENT': 4,
|
|
2499
|
+
* 'data': new Uint32Array( [ 1, 2, 3 ] ),
|
|
2500
|
+
* 'dtype': 'uint32',
|
|
2501
|
+
* 'flags': {
|
|
2502
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
2503
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
2504
|
+
* },
|
|
2505
|
+
* 'length': 3,
|
|
2506
|
+
* 'ndims': 1,
|
|
2507
|
+
* 'offset': 0,
|
|
2508
|
+
* 'order': 'row-major',
|
|
2509
|
+
* 'shape': [ 3 ],
|
|
2510
|
+
* 'strides': [ 1 ],
|
|
2511
|
+
* 'get': function get( i ) {
|
|
2512
|
+
* return this.data[ i ];
|
|
2513
|
+
* },
|
|
2514
|
+
* 'set': function set( i, v ) {
|
|
2515
|
+
* this.data[ i ] = v;
|
|
2516
|
+
* return this;
|
|
2517
|
+
* }
|
|
2518
|
+
* };
|
|
2519
|
+
*/
|
|
2520
|
+
interface unsignedintegerndarray extends typedndarray<number> {
|
|
2521
|
+
/**
|
|
2522
|
+
* Size (in bytes) of the array.
|
|
2523
|
+
*/
|
|
2524
|
+
byteLength: number;
|
|
2525
|
+
|
|
2526
|
+
/**
|
|
2527
|
+
* Size (in bytes) of each array element.
|
|
2528
|
+
*/
|
|
2529
|
+
BYTES_PER_ELEMENT: number;
|
|
2530
|
+
|
|
2531
|
+
/**
|
|
2532
|
+
* A reference to the underlying data buffer.
|
|
2533
|
+
*/
|
|
2534
|
+
data: UnsignedIntegerTypedArray;
|
|
2535
|
+
|
|
2536
|
+
/**
|
|
2537
|
+
* Underlying data type.
|
|
2538
|
+
*/
|
|
2539
|
+
dtype: UnsignedIntegerDataType;
|
|
2540
|
+
|
|
2541
|
+
/**
|
|
2542
|
+
* Sets an array element specified according to provided subscripts.
|
|
2543
|
+
*
|
|
2544
|
+
* ## Notes
|
|
2545
|
+
*
|
|
2546
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
2547
|
+
*
|
|
2548
|
+
* @param args - subscripts and value to set
|
|
2549
|
+
* @returns ndarray instance
|
|
2550
|
+
*/
|
|
2551
|
+
set( ...args: Array<number> ): unsignedintegerndarray;
|
|
2552
|
+
}
|
|
2553
|
+
|
|
2554
|
+
/**
|
|
2555
|
+
* Interface describing an ndarray having an unsigned 32-bit integer data type.
|
|
2556
|
+
*
|
|
2557
|
+
* @example
|
|
2558
|
+
* const arr: uint32ndarray = {
|
|
2559
|
+
* 'byteLength': 12,
|
|
2560
|
+
* 'BYTES_PER_ELEMENT': 4,
|
|
2561
|
+
* 'data': new Uint32Array( [ 1, 2, 3 ] ),
|
|
2562
|
+
* 'dtype': 'uint32',
|
|
2563
|
+
* 'flags': {
|
|
2564
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
2565
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
2566
|
+
* },
|
|
2567
|
+
* 'length': 3,
|
|
2568
|
+
* 'ndims': 1,
|
|
2569
|
+
* 'offset': 0,
|
|
2570
|
+
* 'order': 'row-major',
|
|
2571
|
+
* 'shape': [ 3 ],
|
|
2572
|
+
* 'strides': [ 1 ],
|
|
2573
|
+
* 'get': function get( i ) {
|
|
2574
|
+
* return this.data[ i ];
|
|
2575
|
+
* },
|
|
2576
|
+
* 'set': function set( i, v ) {
|
|
2577
|
+
* this.data[ i ] = v;
|
|
2578
|
+
* return this;
|
|
2579
|
+
* }
|
|
2580
|
+
* };
|
|
2581
|
+
*/
|
|
2582
|
+
interface uint32ndarray extends unsignedintegerndarray {
|
|
2583
|
+
/**
|
|
2584
|
+
* Size (in bytes) of each array element.
|
|
2585
|
+
*/
|
|
2586
|
+
BYTES_PER_ELEMENT: 4;
|
|
2587
|
+
|
|
2588
|
+
/**
|
|
2589
|
+
* A reference to the underlying data buffer.
|
|
2590
|
+
*/
|
|
2591
|
+
data: Uint32Array;
|
|
2592
|
+
|
|
2593
|
+
/**
|
|
2594
|
+
* Underlying data type.
|
|
2595
|
+
*/
|
|
2596
|
+
dtype: 'uint32';
|
|
2597
|
+
|
|
2598
|
+
/**
|
|
2599
|
+
* Sets an array element specified according to provided subscripts.
|
|
2600
|
+
*
|
|
2601
|
+
* ## Notes
|
|
2602
|
+
*
|
|
2603
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
2604
|
+
*
|
|
2605
|
+
* @param args - subscripts and value to set
|
|
2606
|
+
* @returns ndarray instance
|
|
2607
|
+
*/
|
|
2608
|
+
set( ...args: Array<number> ): uint32ndarray;
|
|
2609
|
+
}
|
|
2610
|
+
|
|
2611
|
+
/**
|
|
2612
|
+
* Interface describing an ndarray having an unsigned 16-bit integer data type.
|
|
2613
|
+
*
|
|
2614
|
+
* @example
|
|
2615
|
+
* const arr: uint16ndarray = {
|
|
2616
|
+
* 'byteLength': 6,
|
|
2617
|
+
* 'BYTES_PER_ELEMENT': 2,
|
|
2618
|
+
* 'data': new Uint16Array( [ 1, 2, 3 ] ),
|
|
2619
|
+
* 'dtype': 'uint16',
|
|
2620
|
+
* 'flags': {
|
|
2621
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
2622
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
2623
|
+
* },
|
|
2624
|
+
* 'length': 3,
|
|
2625
|
+
* 'ndims': 1,
|
|
2626
|
+
* 'offset': 0,
|
|
2627
|
+
* 'order': 'row-major',
|
|
2628
|
+
* 'shape': [ 3 ],
|
|
2629
|
+
* 'strides': [ 1 ],
|
|
2630
|
+
* 'get': function get( i ) {
|
|
2631
|
+
* return this.data[ i ];
|
|
2632
|
+
* },
|
|
2633
|
+
* 'set': function set( i, v ) {
|
|
2634
|
+
* this.data[ i ] = v;
|
|
2635
|
+
* return this;
|
|
2636
|
+
* }
|
|
2637
|
+
* };
|
|
2638
|
+
*/
|
|
2639
|
+
interface uint16ndarray extends unsignedintegerndarray {
|
|
2640
|
+
/**
|
|
2641
|
+
* Size (in bytes) of each array element.
|
|
2642
|
+
*/
|
|
2643
|
+
BYTES_PER_ELEMENT: 2;
|
|
2644
|
+
|
|
2645
|
+
/**
|
|
2646
|
+
* A reference to the underlying data buffer.
|
|
2647
|
+
*/
|
|
2648
|
+
data: Uint16Array;
|
|
2649
|
+
|
|
2650
|
+
/**
|
|
2651
|
+
* Underlying data type.
|
|
2652
|
+
*/
|
|
2653
|
+
dtype: 'uint16';
|
|
2654
|
+
|
|
2655
|
+
/**
|
|
2656
|
+
* Sets an array element specified according to provided subscripts.
|
|
2657
|
+
*
|
|
2658
|
+
* ## Notes
|
|
2659
|
+
*
|
|
2660
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
2661
|
+
*
|
|
2662
|
+
* @param args - subscripts and value to set
|
|
2663
|
+
* @returns ndarray instance
|
|
2664
|
+
*/
|
|
2665
|
+
set( ...args: Array<number> ): uint16ndarray;
|
|
2666
|
+
}
|
|
2667
|
+
|
|
2668
|
+
/**
|
|
2669
|
+
* Interface describing an ndarray having an unsigned 8-bit integer data type.
|
|
2670
|
+
*
|
|
2671
|
+
* @example
|
|
2672
|
+
* const arr: uint8ndarray = {
|
|
2673
|
+
* 'byteLength': 3,
|
|
2674
|
+
* 'BYTES_PER_ELEMENT': 1,
|
|
2675
|
+
* 'data': new Uint8Array( [ 1, 2, 3 ] ),
|
|
2676
|
+
* 'dtype': 'uint8',
|
|
2677
|
+
* 'flags': {
|
|
2678
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
2679
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
2680
|
+
* },
|
|
2681
|
+
* 'length': 3,
|
|
2682
|
+
* 'ndims': 1,
|
|
2683
|
+
* 'offset': 0,
|
|
2684
|
+
* 'order': 'row-major',
|
|
2685
|
+
* 'shape': [ 3 ],
|
|
2686
|
+
* 'strides': [ 1 ],
|
|
2687
|
+
* 'get': function get( i ) {
|
|
2688
|
+
* return this.data[ i ];
|
|
2689
|
+
* },
|
|
2690
|
+
* 'set': function set( i, v ) {
|
|
2691
|
+
* this.data[ i ] = v;
|
|
2692
|
+
* return this;
|
|
2693
|
+
* }
|
|
2694
|
+
* };
|
|
2695
|
+
*/
|
|
2696
|
+
interface uint8ndarray extends unsignedintegerndarray {
|
|
2697
|
+
/**
|
|
2698
|
+
* Size (in bytes) of each array element.
|
|
2699
|
+
*/
|
|
2700
|
+
BYTES_PER_ELEMENT: 1;
|
|
2701
|
+
|
|
2702
|
+
/**
|
|
2703
|
+
* A reference to the underlying data buffer.
|
|
2704
|
+
*/
|
|
2705
|
+
data: Uint8Array;
|
|
2706
|
+
|
|
2707
|
+
/**
|
|
2708
|
+
* Underlying data type.
|
|
2709
|
+
*/
|
|
2710
|
+
dtype: 'uint8';
|
|
2711
|
+
|
|
2712
|
+
/**
|
|
2713
|
+
* Sets an array element specified according to provided subscripts.
|
|
2714
|
+
*
|
|
2715
|
+
* ## Notes
|
|
2716
|
+
*
|
|
2717
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
2718
|
+
*
|
|
2719
|
+
* @param args - subscripts and value to set
|
|
2720
|
+
* @returns ndarray instance
|
|
2721
|
+
*/
|
|
2722
|
+
set( ...args: Array<number> ): uint8ndarray;
|
|
2723
|
+
}
|
|
2724
|
+
|
|
2725
|
+
/**
|
|
2726
|
+
* Interface describing an ndarray having a clamped unsigned 8-bit integer data type.
|
|
2727
|
+
*
|
|
2728
|
+
* @example
|
|
2729
|
+
* const arr: uint8cndarray = {
|
|
2730
|
+
* 'byteLength': 12,
|
|
2731
|
+
* 'BYTES_PER_ELEMENT': 4,
|
|
2732
|
+
* 'data': new Uint8ClampedArray( [ 1, 2, 3 ] ),
|
|
2733
|
+
* 'dtype': 'uint8c',
|
|
2734
|
+
* 'flags': {
|
|
2735
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
2736
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
2737
|
+
* },
|
|
2738
|
+
* 'length': 3,
|
|
2739
|
+
* 'ndims': 1,
|
|
2740
|
+
* 'offset': 0,
|
|
2741
|
+
* 'order': 'row-major',
|
|
2742
|
+
* 'shape': [ 3 ],
|
|
2743
|
+
* 'strides': [ 1 ],
|
|
2744
|
+
* 'get': function get( i ) {
|
|
2745
|
+
* return this.data[ i ];
|
|
2746
|
+
* },
|
|
2747
|
+
* 'set': function set( i, v ) {
|
|
2748
|
+
* this.data[ i ] = v;
|
|
2749
|
+
* return this;
|
|
2750
|
+
* }
|
|
2751
|
+
* };
|
|
2752
|
+
*/
|
|
2753
|
+
interface uint8cndarray extends unsignedintegerndarray {
|
|
2754
|
+
/**
|
|
2755
|
+
* Size (in bytes) of each array element.
|
|
2756
|
+
*/
|
|
2757
|
+
BYTES_PER_ELEMENT: 1;
|
|
2758
|
+
|
|
2759
|
+
/**
|
|
2760
|
+
* A reference to the underlying data buffer.
|
|
2761
|
+
*/
|
|
2762
|
+
data: Uint8ClampedArray;
|
|
2763
|
+
|
|
2764
|
+
/**
|
|
2765
|
+
* Underlying data type.
|
|
2766
|
+
*/
|
|
2767
|
+
dtype: 'uint8c';
|
|
2768
|
+
|
|
2769
|
+
/**
|
|
2770
|
+
* Sets an array element specified according to provided subscripts.
|
|
2771
|
+
*
|
|
2772
|
+
* ## Notes
|
|
2773
|
+
*
|
|
2774
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
2775
|
+
*
|
|
2776
|
+
* @param args - subscripts and value to set
|
|
2777
|
+
* @returns ndarray instance
|
|
2778
|
+
*/
|
|
2779
|
+
set( ...args: Array<number> ): uint8cndarray;
|
|
2780
|
+
}
|
|
2781
|
+
|
|
2782
|
+
/**
|
|
2783
|
+
* Interface describing an ndarray having a boolean data type.
|
|
2784
|
+
*
|
|
2785
|
+
* @example
|
|
2786
|
+
* const arr: booleanndarray = {
|
|
2787
|
+
* 'byteLength': 3,
|
|
2788
|
+
* 'BYTES_PER_ELEMENT': 1,
|
|
2789
|
+
* 'data': new BooleanArray( [ true, false, true ] ),
|
|
2790
|
+
* 'dtype': 'bool',
|
|
2791
|
+
* 'flags': {
|
|
2792
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
2793
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
2794
|
+
* },
|
|
2795
|
+
* 'length': 3,
|
|
2796
|
+
* 'ndims': 1,
|
|
2797
|
+
* 'offset': 0,
|
|
2798
|
+
* 'order': 'row-major',
|
|
2799
|
+
* 'shape': [ 3 ],
|
|
2800
|
+
* 'strides': [ 1 ],
|
|
2801
|
+
* 'get': function get( i ) {
|
|
2802
|
+
* return this.data.get( i );
|
|
2803
|
+
* },
|
|
2804
|
+
* 'set': function set( i, v ) {
|
|
2805
|
+
* this.data.set( v, i );
|
|
2806
|
+
* return this;
|
|
2807
|
+
* }
|
|
2808
|
+
* };
|
|
2809
|
+
*/
|
|
2810
|
+
interface booleanndarray extends typedndarray<boolean> {
|
|
2811
|
+
/**
|
|
2812
|
+
* Size (in bytes) of each array element.
|
|
2813
|
+
*/
|
|
2814
|
+
BYTES_PER_ELEMENT: 1;
|
|
2815
|
+
|
|
2816
|
+
/**
|
|
2817
|
+
* A reference to the underlying data buffer.
|
|
2818
|
+
*/
|
|
2819
|
+
data: BooleanTypedArray;
|
|
2820
|
+
|
|
2821
|
+
/**
|
|
2822
|
+
* Underlying data type.
|
|
2823
|
+
*/
|
|
2824
|
+
dtype: 'bool';
|
|
2825
|
+
|
|
2826
|
+
/**
|
|
2827
|
+
* Sets an array element specified according to provided subscripts.
|
|
2828
|
+
*
|
|
2829
|
+
* ## Notes
|
|
2830
|
+
*
|
|
2831
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
2832
|
+
*
|
|
2833
|
+
* @param args - subscripts and value to set
|
|
2834
|
+
* @returns ndarray instance
|
|
2835
|
+
*/
|
|
2836
|
+
set( ...args: Array<number | boolean> ): booleanndarray;
|
|
2837
|
+
}
|
|
2838
|
+
|
|
2839
|
+
/**
|
|
2840
|
+
* Interface describing an ndarray having a boolean data type.
|
|
2841
|
+
*
|
|
2842
|
+
* @example
|
|
2843
|
+
* const arr: boolndarray = {
|
|
2844
|
+
* 'byteLength': 3,
|
|
2845
|
+
* 'BYTES_PER_ELEMENT': 1,
|
|
2846
|
+
* 'data': new BooleanArray( [ true, false, true ] ),
|
|
2847
|
+
* 'dtype': 'bool',
|
|
2848
|
+
* 'flags': {
|
|
2849
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
2850
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
2851
|
+
* },
|
|
2852
|
+
* 'length': 3,
|
|
2853
|
+
* 'ndims': 1,
|
|
2854
|
+
* 'offset': 0,
|
|
2855
|
+
* 'order': 'row-major',
|
|
2856
|
+
* 'shape': [ 3 ],
|
|
2857
|
+
* 'strides': [ 1 ],
|
|
2858
|
+
* 'get': function get( i ) {
|
|
2859
|
+
* return this.data.get( i );
|
|
2860
|
+
* },
|
|
2861
|
+
* 'set': function set( i, v ) {
|
|
2862
|
+
* this.data.set( v, i );
|
|
2863
|
+
* return this;
|
|
2864
|
+
* }
|
|
2865
|
+
* };
|
|
2866
|
+
*/
|
|
2867
|
+
interface boolndarray extends booleanndarray {
|
|
2868
|
+
/**
|
|
2869
|
+
* Size (in bytes) of each array element.
|
|
2870
|
+
*/
|
|
2871
|
+
BYTES_PER_ELEMENT: 1;
|
|
2872
|
+
|
|
2873
|
+
/**
|
|
2874
|
+
* A reference to the underlying data buffer.
|
|
2875
|
+
*/
|
|
2876
|
+
data: BooleanArray;
|
|
2877
|
+
|
|
2878
|
+
/**
|
|
2879
|
+
* Underlying data type.
|
|
2880
|
+
*/
|
|
2881
|
+
dtype: 'bool';
|
|
2882
|
+
|
|
2883
|
+
/**
|
|
2884
|
+
* Sets an array element specified according to provided subscripts.
|
|
2885
|
+
*
|
|
2886
|
+
* ## Notes
|
|
2887
|
+
*
|
|
2888
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
2889
|
+
*
|
|
2890
|
+
* @param args - subscripts and value to set
|
|
2891
|
+
* @returns ndarray instance
|
|
2892
|
+
*/
|
|
2893
|
+
set( ...args: Array<number | boolean> ): boolndarray;
|
|
2894
|
+
}
|
|
2895
|
+
|
|
2896
|
+
/**
|
|
2897
|
+
* Interface describing an ndarray having a real-valued data type.
|
|
2898
|
+
*
|
|
2899
|
+
* @example
|
|
2900
|
+
* const arr: realndarray = {
|
|
2901
|
+
* 'byteLength': 24,
|
|
2902
|
+
* 'BYTES_PER_ELEMENT': 8,
|
|
2903
|
+
* 'data': new Float64Array( [ 1, 2, 3 ] ),
|
|
2904
|
+
* 'dtype': 'float64',
|
|
2905
|
+
* 'flags': {
|
|
2906
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
2907
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
2908
|
+
* },
|
|
2909
|
+
* 'length': 3,
|
|
2910
|
+
* 'ndims': 1,
|
|
2911
|
+
* 'offset': 0,
|
|
2912
|
+
* 'order': 'row-major',
|
|
2913
|
+
* 'shape': [ 3 ],
|
|
2914
|
+
* 'strides': [ 1 ],
|
|
2915
|
+
* 'get': function get( i ) {
|
|
2916
|
+
* return this.data[ i ];
|
|
2917
|
+
* },
|
|
2918
|
+
* 'set': function set( i, v ) {
|
|
2919
|
+
* this.data[ i ] = v;
|
|
2920
|
+
* return this;
|
|
2921
|
+
* }
|
|
2922
|
+
* };
|
|
2923
|
+
*/
|
|
2924
|
+
interface realndarray extends typedndarray<number> {
|
|
2925
|
+
/**
|
|
2926
|
+
* Size (in bytes) of the array.
|
|
2927
|
+
*/
|
|
2928
|
+
byteLength: number;
|
|
2929
|
+
|
|
2930
|
+
/**
|
|
2931
|
+
* Size (in bytes) of each array element.
|
|
2932
|
+
*/
|
|
2933
|
+
BYTES_PER_ELEMENT: number;
|
|
2934
|
+
|
|
2935
|
+
/**
|
|
2936
|
+
* A reference to the underlying data buffer.
|
|
2937
|
+
*/
|
|
2938
|
+
data: RealTypedArray;
|
|
2939
|
+
|
|
2940
|
+
/**
|
|
2941
|
+
* Underlying data type.
|
|
2942
|
+
*/
|
|
2943
|
+
dtype: RealDataType;
|
|
2944
|
+
|
|
2945
|
+
/**
|
|
2946
|
+
* Sets an array element specified according to provided subscripts.
|
|
2947
|
+
*
|
|
2948
|
+
* ## Notes
|
|
2949
|
+
*
|
|
2950
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
2951
|
+
*
|
|
2952
|
+
* @param args - subscripts and value to set
|
|
2953
|
+
* @returns ndarray instance
|
|
2954
|
+
*/
|
|
2955
|
+
set( ...args: Array<number> ): realndarray;
|
|
2956
|
+
}
|
|
2957
|
+
|
|
2958
|
+
/**
|
|
2959
|
+
* Interface describing an ndarray having a real or complex number data type.
|
|
2960
|
+
*
|
|
2961
|
+
* @example
|
|
2962
|
+
* const arr: realcomplexndarray = {
|
|
2963
|
+
* 'byteLength': 24,
|
|
2964
|
+
* 'BYTES_PER_ELEMENT': 8,
|
|
2965
|
+
* 'data': new Float64Array( [ 1, 2, 3 ] ),
|
|
2966
|
+
* 'dtype': 'float64',
|
|
2967
|
+
* 'flags': {
|
|
2968
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
2969
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
2970
|
+
* },
|
|
2971
|
+
* 'length': 3,
|
|
2972
|
+
* 'ndims': 1,
|
|
2973
|
+
* 'offset': 0,
|
|
2974
|
+
* 'order': 'row-major',
|
|
2975
|
+
* 'shape': [ 3 ],
|
|
2976
|
+
* 'strides': [ 1 ],
|
|
2977
|
+
* 'get': function get( i ) {
|
|
2978
|
+
* return this.data[ i ];
|
|
2979
|
+
* },
|
|
2980
|
+
* 'set': function set( i, v ) {
|
|
2981
|
+
* this.data[ i ] = v;
|
|
2982
|
+
* return this;
|
|
2983
|
+
* }
|
|
2984
|
+
* };
|
|
2985
|
+
*/
|
|
2986
|
+
interface realcomplexndarray extends ndarray {
|
|
2987
|
+
/**
|
|
2988
|
+
* Size (in bytes) of the array.
|
|
2989
|
+
*/
|
|
2990
|
+
byteLength: number;
|
|
2991
|
+
|
|
2992
|
+
/**
|
|
2993
|
+
* Size (in bytes) of each array element.
|
|
2994
|
+
*/
|
|
2995
|
+
BYTES_PER_ELEMENT: number;
|
|
2996
|
+
|
|
2997
|
+
/**
|
|
2998
|
+
* A reference to the underlying data buffer.
|
|
2999
|
+
*/
|
|
3000
|
+
data: RealOrComplexTypedArray;
|
|
3001
|
+
|
|
3002
|
+
/**
|
|
3003
|
+
* Underlying data type.
|
|
3004
|
+
*/
|
|
3005
|
+
dtype: NumericDataType;
|
|
3006
|
+
|
|
3007
|
+
/**
|
|
3008
|
+
* Returns an array element specified according to provided subscripts.
|
|
3009
|
+
*
|
|
3010
|
+
* ## Notes
|
|
3011
|
+
*
|
|
3012
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
3013
|
+
*
|
|
3014
|
+
* @param args - subscripts
|
|
3015
|
+
* @returns array element
|
|
3016
|
+
*/
|
|
3017
|
+
get( ...args: Array<number> ): number | ComplexLike | void;
|
|
3018
|
+
|
|
3019
|
+
/**
|
|
3020
|
+
* Sets an array element specified according to provided subscripts.
|
|
3021
|
+
*
|
|
3022
|
+
* ## Notes
|
|
3023
|
+
*
|
|
3024
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
3025
|
+
*
|
|
3026
|
+
* @param args - subscripts and value to set
|
|
3027
|
+
* @returns ndarray instance
|
|
3028
|
+
*/
|
|
3029
|
+
set( ...args: Array<number | ComplexLike> ): realcomplexndarray;
|
|
3030
|
+
}
|
|
3031
|
+
|
|
3032
|
+
/**
|
|
3033
|
+
* Interface describing an ndarray having a floating-point real or complex number data type.
|
|
3034
|
+
*
|
|
3035
|
+
* @example
|
|
3036
|
+
* const arr: floatcomplexndarray = {
|
|
3037
|
+
* 'byteLength': 24,
|
|
3038
|
+
* 'BYTES_PER_ELEMENT': 8,
|
|
3039
|
+
* 'data': new Float64Array( [ 1, 2, 3 ] ),
|
|
3040
|
+
* 'dtype': 'float64',
|
|
3041
|
+
* 'flags': {
|
|
3042
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
3043
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
3044
|
+
* },
|
|
3045
|
+
* 'length': 3,
|
|
3046
|
+
* 'ndims': 1,
|
|
3047
|
+
* 'offset': 0,
|
|
3048
|
+
* 'order': 'row-major',
|
|
3049
|
+
* 'shape': [ 3 ],
|
|
3050
|
+
* 'strides': [ 1 ],
|
|
3051
|
+
* 'get': function get( i ) {
|
|
3052
|
+
* return this.data[ i ];
|
|
3053
|
+
* },
|
|
3054
|
+
* 'set': function set( i, v ) {
|
|
3055
|
+
* this.data[ i ] = v;
|
|
3056
|
+
* return this;
|
|
3057
|
+
* }
|
|
3058
|
+
* };
|
|
3059
|
+
*/
|
|
3060
|
+
interface floatcomplexndarray extends ndarray {
|
|
3061
|
+
/**
|
|
3062
|
+
* Size (in bytes) of the array.
|
|
3063
|
+
*/
|
|
3064
|
+
byteLength: number;
|
|
3065
|
+
|
|
3066
|
+
/**
|
|
3067
|
+
* Size (in bytes) of each array element.
|
|
3068
|
+
*/
|
|
3069
|
+
BYTES_PER_ELEMENT: number;
|
|
3070
|
+
|
|
3071
|
+
/**
|
|
3072
|
+
* A reference to the underlying data buffer.
|
|
3073
|
+
*/
|
|
3074
|
+
data: FloatOrComplexTypedArray;
|
|
3075
|
+
|
|
3076
|
+
/**
|
|
3077
|
+
* Underlying data type.
|
|
3078
|
+
*/
|
|
3079
|
+
dtype: FloatingPointDataType;
|
|
3080
|
+
|
|
3081
|
+
/**
|
|
3082
|
+
* Returns an array element specified according to provided subscripts.
|
|
3083
|
+
*
|
|
3084
|
+
* ## Notes
|
|
3085
|
+
*
|
|
3086
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
3087
|
+
*
|
|
3088
|
+
* @param args - subscripts
|
|
3089
|
+
* @returns array element
|
|
3090
|
+
*/
|
|
3091
|
+
get( ...args: Array<number> ): number | ComplexLike | void;
|
|
3092
|
+
|
|
3093
|
+
/**
|
|
3094
|
+
* Sets an array element specified according to provided subscripts.
|
|
3095
|
+
*
|
|
3096
|
+
* ## Notes
|
|
3097
|
+
*
|
|
3098
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
3099
|
+
*
|
|
3100
|
+
* @param args - subscripts and value to set
|
|
3101
|
+
* @returns ndarray instance
|
|
3102
|
+
*/
|
|
3103
|
+
set( ...args: Array<number | ComplexLike> ): floatcomplexndarray;
|
|
3104
|
+
}
|
|
3105
|
+
|
|
3106
|
+
/**
|
|
3107
|
+
* Interface describing an ndarray having a complex number data type.
|
|
3108
|
+
*
|
|
3109
|
+
* @example
|
|
3110
|
+
* const arr: complexndarray = {
|
|
3111
|
+
* 'byteLength': 48,
|
|
3112
|
+
* 'BYTES_PER_ELEMENT': 16,
|
|
3113
|
+
* 'data': new Complex128Array( [ 1, 2, 3, 4, 5, 6 ] ),
|
|
3114
|
+
* 'dtype': 'complex128',
|
|
3115
|
+
* 'flags': {
|
|
3116
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
3117
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
3118
|
+
* },
|
|
3119
|
+
* 'length': 3,
|
|
3120
|
+
* 'ndims': 1,
|
|
3121
|
+
* 'offset': 0,
|
|
3122
|
+
* 'order': 'row-major',
|
|
3123
|
+
* 'shape': [ 3 ],
|
|
3124
|
+
* 'strides': [ 1 ],
|
|
3125
|
+
* 'get': function get( i ) {
|
|
3126
|
+
* return new Complex128( this.data[ i*2 ], this.data[ (i*2)+1 ] );
|
|
3127
|
+
* },
|
|
3128
|
+
* 'set': function set( i, v ) {
|
|
3129
|
+
* this.data[ i ] = v;
|
|
3130
|
+
* return this;
|
|
3131
|
+
* }
|
|
3132
|
+
* };
|
|
3133
|
+
*/
|
|
3134
|
+
interface complexndarray extends ndarray {
|
|
3135
|
+
/**
|
|
3136
|
+
* Size (in bytes) of the array.
|
|
3137
|
+
*/
|
|
3138
|
+
byteLength: number;
|
|
3139
|
+
|
|
3140
|
+
/**
|
|
3141
|
+
* Size (in bytes) of each array element.
|
|
3142
|
+
*/
|
|
3143
|
+
BYTES_PER_ELEMENT: number;
|
|
3144
|
+
|
|
3145
|
+
/**
|
|
3146
|
+
* A reference to the underlying data buffer.
|
|
3147
|
+
*/
|
|
3148
|
+
data: ComplexTypedArray;
|
|
3149
|
+
|
|
3150
|
+
/**
|
|
3151
|
+
* Underlying data type.
|
|
3152
|
+
*/
|
|
3153
|
+
dtype: ComplexFloatingPointDataType;
|
|
3154
|
+
|
|
3155
|
+
/**
|
|
3156
|
+
* Returns an array element specified according to provided subscripts.
|
|
3157
|
+
*
|
|
3158
|
+
* ## Notes
|
|
3159
|
+
*
|
|
3160
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
3161
|
+
*
|
|
3162
|
+
* @param args - subscripts
|
|
3163
|
+
* @returns array element
|
|
3164
|
+
*/
|
|
3165
|
+
get( ...args: Array<number> ): ComplexLike | void;
|
|
3166
|
+
|
|
3167
|
+
/**
|
|
3168
|
+
* Sets an array element specified according to provided subscripts.
|
|
3169
|
+
*
|
|
3170
|
+
* ## Notes
|
|
3171
|
+
*
|
|
3172
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
3173
|
+
*
|
|
3174
|
+
* @param args - subscripts and value to set
|
|
3175
|
+
* @returns ndarray instance
|
|
3176
|
+
*/
|
|
3177
|
+
set( ...args: Array<number | ComplexLike> ): complexndarray;
|
|
3178
|
+
}
|
|
3179
|
+
|
|
3180
|
+
/**
|
|
3181
|
+
* Interface describing an ndarray having a double-precision complex floating-point data type.
|
|
3182
|
+
*
|
|
3183
|
+
* @example
|
|
3184
|
+
* const arr: complex128ndarray = {
|
|
3185
|
+
* 'byteLength': 48,
|
|
3186
|
+
* 'BYTES_PER_ELEMENT': 16,
|
|
3187
|
+
* 'data': new Complex128Array( [ 1, 2, 3, 4, 5, 6 ] ),
|
|
3188
|
+
* 'dtype': 'complex128',
|
|
3189
|
+
* 'flags': {
|
|
3190
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
3191
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
3192
|
+
* },
|
|
3193
|
+
* 'length': 3,
|
|
3194
|
+
* 'ndims': 1,
|
|
3195
|
+
* 'offset': 0,
|
|
3196
|
+
* 'order': 'row-major',
|
|
3197
|
+
* 'shape': [ 3 ],
|
|
3198
|
+
* 'strides': [ 1 ],
|
|
3199
|
+
* 'get': function get( i ) {
|
|
3200
|
+
* return new Complex128( this.data[ i*2 ], this.data[ (i*2)+1 ] );
|
|
3201
|
+
* },
|
|
3202
|
+
* 'set': function set( i, v ) {
|
|
3203
|
+
* this.data[ i ] = v;
|
|
3204
|
+
* return this;
|
|
3205
|
+
* }
|
|
3206
|
+
* };
|
|
3207
|
+
*/
|
|
3208
|
+
interface complex128ndarray extends complexndarray {
|
|
3209
|
+
/**
|
|
3210
|
+
* Size (in bytes) of each array element.
|
|
3211
|
+
*/
|
|
3212
|
+
BYTES_PER_ELEMENT: 16;
|
|
3213
|
+
|
|
3214
|
+
/**
|
|
3215
|
+
* A reference to the underlying data buffer.
|
|
3216
|
+
*/
|
|
3217
|
+
data: Complex128Array;
|
|
3218
|
+
|
|
3219
|
+
/**
|
|
3220
|
+
* Underlying data type.
|
|
3221
|
+
*/
|
|
3222
|
+
dtype: 'complex128';
|
|
3223
|
+
|
|
3224
|
+
/**
|
|
3225
|
+
* Returns an array element specified according to provided subscripts.
|
|
3226
|
+
*
|
|
3227
|
+
* ## Notes
|
|
3228
|
+
*
|
|
3229
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
3230
|
+
*
|
|
3231
|
+
* @param args - subscripts
|
|
3232
|
+
* @returns array element
|
|
3233
|
+
*/
|
|
3234
|
+
get( ...args: Array<number> ): Complex128 | void;
|
|
3235
|
+
|
|
3236
|
+
/**
|
|
3237
|
+
* Sets an array element specified according to provided subscripts.
|
|
3238
|
+
*
|
|
3239
|
+
* ## Notes
|
|
3240
|
+
*
|
|
3241
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
3242
|
+
*
|
|
3243
|
+
* @param args - subscripts and value to set
|
|
3244
|
+
* @returns ndarray instance
|
|
3245
|
+
*/
|
|
3246
|
+
set( ...args: Array<number | ComplexLike> ): complex128ndarray;
|
|
3247
|
+
}
|
|
3248
|
+
|
|
3249
|
+
/**
|
|
3250
|
+
* Interface describing an ndarray having a single-precision complex floating-point data type.
|
|
3251
|
+
*
|
|
3252
|
+
* @example
|
|
3253
|
+
* const arr: complex64ndarray = {
|
|
3254
|
+
* 'byteLength': 24,
|
|
3255
|
+
* 'BYTES_PER_ELEMENT': 8,
|
|
3256
|
+
* 'data': new Complex64Array( [ 1, 2, 3, 4, 5, 6 ] ),
|
|
3257
|
+
* 'dtype': 'complex64',
|
|
3258
|
+
* 'flags': {
|
|
3259
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
3260
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
3261
|
+
* },
|
|
3262
|
+
* 'length': 3,
|
|
3263
|
+
* 'ndims': 1,
|
|
3264
|
+
* 'offset': 0,
|
|
3265
|
+
* 'order': 'row-major',
|
|
3266
|
+
* 'shape': [ 3 ],
|
|
3267
|
+
* 'strides': [ 1 ],
|
|
3268
|
+
* 'get': function get( i ) {
|
|
3269
|
+
* return new Complex64( this.data[ i*2 ], this.data[ (i*2)+1 ] );
|
|
3270
|
+
* },
|
|
3271
|
+
* 'set': function set( i, v ) {
|
|
3272
|
+
* this.data[ i ] = v;
|
|
3273
|
+
* return this;
|
|
3274
|
+
* }
|
|
3275
|
+
* };
|
|
3276
|
+
*/
|
|
3277
|
+
interface complex64ndarray extends complexndarray {
|
|
3278
|
+
/**
|
|
3279
|
+
* Size (in bytes) of each array element.
|
|
3280
|
+
*/
|
|
3281
|
+
BYTES_PER_ELEMENT: 8;
|
|
3282
|
+
|
|
3283
|
+
/**
|
|
3284
|
+
* A reference to the underlying data buffer.
|
|
3285
|
+
*/
|
|
3286
|
+
data: Complex64Array;
|
|
3287
|
+
|
|
3288
|
+
/**
|
|
3289
|
+
* Underlying data type.
|
|
3290
|
+
*/
|
|
3291
|
+
dtype: 'complex64';
|
|
3292
|
+
|
|
3293
|
+
/**
|
|
3294
|
+
* Returns an array element specified according to provided subscripts.
|
|
3295
|
+
*
|
|
3296
|
+
* ## Notes
|
|
3297
|
+
*
|
|
3298
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
3299
|
+
*
|
|
3300
|
+
* @param args - subscripts
|
|
3301
|
+
* @returns array element
|
|
3302
|
+
*/
|
|
3303
|
+
get( ...args: Array<number> ): Complex64 | void;
|
|
3304
|
+
|
|
3305
|
+
/**
|
|
3306
|
+
* Sets an array element specified according to provided subscripts.
|
|
3307
|
+
*
|
|
3308
|
+
* ## Notes
|
|
3309
|
+
*
|
|
3310
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
3311
|
+
*
|
|
3312
|
+
* @param args - subscripts and value to set
|
|
3313
|
+
* @returns ndarray instance
|
|
3314
|
+
*/
|
|
3315
|
+
set( ...args: Array<number | ComplexLike> ): complex64ndarray;
|
|
3316
|
+
}
|
|
3317
|
+
|
|
3318
|
+
/**
|
|
3319
|
+
* Interface describing a one-dimensional ndarray having a homogeneous data type.
|
|
3320
|
+
*
|
|
3321
|
+
* @example
|
|
3322
|
+
* const arr: Vector<number> = {
|
|
3323
|
+
* 'byteLength': 24,
|
|
3324
|
+
* 'BYTES_PER_ELEMENT': 8,
|
|
3325
|
+
* 'data': new Float64Array( [ 1, 2, 3 ] ),
|
|
3326
|
+
* 'dtype': 'float64',
|
|
3327
|
+
* 'flags': {
|
|
3328
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
3329
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
3330
|
+
* },
|
|
3331
|
+
* 'length': 3,
|
|
3332
|
+
* 'ndims': 1,
|
|
3333
|
+
* 'offset': 0,
|
|
3334
|
+
* 'order': 'row-major',
|
|
3335
|
+
* 'shape': [ 3 ],
|
|
3336
|
+
* 'strides': [ 1 ],
|
|
3337
|
+
* 'get': function get( i ) {
|
|
3338
|
+
* return this.data[ i ];
|
|
3339
|
+
* },
|
|
3340
|
+
* 'set': function set( i, v ) {
|
|
3341
|
+
* this.data[ i ] = v;
|
|
3342
|
+
* return this;
|
|
3343
|
+
* }
|
|
3344
|
+
* };
|
|
3345
|
+
*/
|
|
3346
|
+
interface Vector<T> extends typedndarray<T> {
|
|
3347
|
+
/**
|
|
3348
|
+
* Number of dimensions.
|
|
3349
|
+
*/
|
|
3350
|
+
ndims: 1;
|
|
3351
|
+
|
|
3352
|
+
/**
|
|
3353
|
+
* Array shape.
|
|
3354
|
+
*/
|
|
3355
|
+
shape: [ number ];
|
|
3356
|
+
|
|
3357
|
+
/**
|
|
3358
|
+
* Array strides.
|
|
3359
|
+
*/
|
|
3360
|
+
strides: [ number ];
|
|
3361
|
+
|
|
3362
|
+
/**
|
|
3363
|
+
* Sets an array element specified according to provided subscripts.
|
|
3364
|
+
*
|
|
3365
|
+
* ## Notes
|
|
3366
|
+
*
|
|
3367
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
3368
|
+
*
|
|
3369
|
+
* @param i - element index
|
|
3370
|
+
* @param value - value to set
|
|
3371
|
+
* @returns ndarray instance
|
|
3372
|
+
*/
|
|
3373
|
+
set( i: number, value: T ): Vector<T>;
|
|
3374
|
+
}
|
|
3375
|
+
|
|
3376
|
+
/**
|
|
3377
|
+
* Interface describing a two-dimensional ndarray having a homogeneous data type.
|
|
3378
|
+
*
|
|
3379
|
+
* @example
|
|
3380
|
+
* const arr: Matrix<number> = {
|
|
3381
|
+
* 'byteLength': 24,
|
|
3382
|
+
* 'BYTES_PER_ELEMENT': 8,
|
|
3383
|
+
* 'data': new Float64Array( [ 1, 2, 3 ] ),
|
|
3384
|
+
* 'dtype': 'float64',
|
|
3385
|
+
* 'flags': {
|
|
3386
|
+
* 'ROW_MAJOR_CONTIGUOUS': true,
|
|
3387
|
+
* 'COLUMN_MAJOR_CONTIGUOUS': false
|
|
3388
|
+
* },
|
|
3389
|
+
* 'length': 3,
|
|
3390
|
+
* 'ndims': 2,
|
|
3391
|
+
* 'offset': 0,
|
|
3392
|
+
* 'order': 'row-major',
|
|
3393
|
+
* 'shape': [ 1, 3 ],
|
|
3394
|
+
* 'strides': [ 3, 1 ],
|
|
3395
|
+
* 'get': function get( i ) {
|
|
3396
|
+
* return this.data[ i ];
|
|
3397
|
+
* },
|
|
3398
|
+
* 'set': function set( i, v ) {
|
|
3399
|
+
* this.data[ i ] = v;
|
|
3400
|
+
* return this;
|
|
3401
|
+
* }
|
|
3402
|
+
* };
|
|
3403
|
+
*/
|
|
3404
|
+
interface Matrix<T> extends typedndarray<T> {
|
|
3405
|
+
/**
|
|
3406
|
+
* Number of dimensions.
|
|
3407
|
+
*/
|
|
3408
|
+
ndims: 2;
|
|
3409
|
+
|
|
3410
|
+
/**
|
|
3411
|
+
* Array shape.
|
|
3412
|
+
*/
|
|
3413
|
+
shape: [ number, number ];
|
|
3414
|
+
|
|
3415
|
+
/**
|
|
3416
|
+
* Array strides.
|
|
3417
|
+
*/
|
|
3418
|
+
strides: [ number, number ];
|
|
3419
|
+
|
|
3420
|
+
/**
|
|
3421
|
+
* Sets an array element specified according to provided subscripts.
|
|
3422
|
+
*
|
|
3423
|
+
* ## Notes
|
|
3424
|
+
*
|
|
3425
|
+
* - The number of provided subscripts should equal the number of dimensions.
|
|
3426
|
+
*
|
|
3427
|
+
* @param i - index along first dimension
|
|
3428
|
+
* @param j - index along second dimension
|
|
3429
|
+
* @param value - value to set
|
|
3430
|
+
* @returns ndarray instance
|
|
3431
|
+
*/
|
|
3432
|
+
set( i: number, j: number, value: T ): Matrix<T>;
|
|
3433
|
+
}
|
|
3434
|
+
}
|
|
3435
|
+
|
|
3436
|
+
/**
|
|
3437
|
+
* Module containing object definitions.
|
|
3438
|
+
*
|
|
3439
|
+
* @example
|
|
3440
|
+
* import * as obj from `@stdlib/types/object`;
|
|
3441
|
+
*
|
|
3442
|
+
* const desc: obj.DataPropertyDescriptor = {
|
|
3443
|
+
* 'configurable': false,
|
|
3444
|
+
* 'enumerable': true,
|
|
3445
|
+
* 'writable': false,
|
|
3446
|
+
* 'value': 'beep'
|
|
3447
|
+
* };
|
|
3448
|
+
*
|
|
3449
|
+
* @example
|
|
3450
|
+
* import { DataPropertyDescriptor } from `@stdlib/types/object`;
|
|
3451
|
+
*
|
|
3452
|
+
* const desc: DataPropertyDescriptor = {
|
|
3453
|
+
* 'configurable': false,
|
|
3454
|
+
* 'enumerable': true,
|
|
3455
|
+
* 'writable': false,
|
|
3456
|
+
* 'value': 'beep'
|
|
3457
|
+
* };
|
|
3458
|
+
*/
|
|
3459
|
+
declare module '@stdlib/types/object' {
|
|
3460
|
+
/**
|
|
3461
|
+
* Interface describing a data property descriptor object.
|
|
3462
|
+
*
|
|
3463
|
+
* @example
|
|
3464
|
+
* const desc: DataPropertyDescriptor = {
|
|
3465
|
+
* 'configurable': false,
|
|
3466
|
+
* 'enumerable': true,
|
|
3467
|
+
* 'writable': false,
|
|
3468
|
+
* 'value': 'beep'
|
|
3469
|
+
* };
|
|
3470
|
+
*/
|
|
3471
|
+
interface DataPropertyDescriptor {
|
|
3472
|
+
/**
|
|
3473
|
+
* Specifies whether a property descriptor may be changed and whether a property may be deleted from a corresponding object (default: `false`).
|
|
3474
|
+
*/
|
|
3475
|
+
configurable?: boolean;
|
|
3476
|
+
|
|
3477
|
+
/**
|
|
3478
|
+
* Specifies whether a property can be enumerated (default: `false`).
|
|
3479
|
+
*/
|
|
3480
|
+
enumerable?: boolean;
|
|
3481
|
+
|
|
3482
|
+
/**
|
|
3483
|
+
* Specifies whether the value associated with a property can be changed via the assignment operator (default: `false`).
|
|
3484
|
+
*/
|
|
3485
|
+
writable?: boolean;
|
|
3486
|
+
|
|
3487
|
+
/**
|
|
3488
|
+
* Value associated with a property (default: `undefined`).
|
|
3489
|
+
*/
|
|
3490
|
+
value?: any;
|
|
3491
|
+
}
|
|
3492
|
+
|
|
3493
|
+
/**
|
|
3494
|
+
* Interface describing an accessor property descriptor object.
|
|
3495
|
+
*
|
|
3496
|
+
* @example
|
|
3497
|
+
* const desc: AccessorPropertyDescriptor = {
|
|
3498
|
+
* 'configurable': false,
|
|
3499
|
+
* 'enumerable': true,
|
|
3500
|
+
* 'get': (): string => 'foo',
|
|
3501
|
+
* 'set': () => { throw new Error( 'invalid operation.' ); }
|
|
3502
|
+
* };
|
|
3503
|
+
*/
|
|
3504
|
+
interface AccessorPropertyDescriptor {
|
|
3505
|
+
/**
|
|
3506
|
+
* Specifies whether a property descriptor may be changed and whether a property may be deleted from a corresponding object (default: `false`).
|
|
3507
|
+
*/
|
|
3508
|
+
configurable?: boolean;
|
|
3509
|
+
|
|
3510
|
+
/**
|
|
3511
|
+
* Specifies whether a property can be enumerated (default: `false`).
|
|
3512
|
+
*/
|
|
3513
|
+
enumerable?: boolean;
|
|
3514
|
+
|
|
3515
|
+
/**
|
|
3516
|
+
* A function which serves as a getter for the property.
|
|
3517
|
+
*
|
|
3518
|
+
* ## Notes
|
|
3519
|
+
*
|
|
3520
|
+
* - If omitted from a descriptor, a property value cannot be accessed.
|
|
3521
|
+
* - When the property is accessed, the function is called without arguments and with `this` set to the object through which the property is accessed (note: this may **not** be the object on which the property is defined due to inheritance).
|
|
3522
|
+
* - The return value will be used as the value of the property.
|
|
3523
|
+
*/
|
|
3524
|
+
get?(): any;
|
|
3525
|
+
|
|
3526
|
+
/**
|
|
3527
|
+
* A function which serves as a setter for the property.
|
|
3528
|
+
*
|
|
3529
|
+
* ## Notes
|
|
3530
|
+
*
|
|
3531
|
+
* - If omitted from a descriptor, a property value cannot be assigned.
|
|
3532
|
+
* - When the property is assigned to, the function is called with one argument (the value being assigned to the property) and with `this` set to the object through which the property is assigned.
|
|
3533
|
+
*/
|
|
3534
|
+
set?( x: any ): void;
|
|
3535
|
+
}
|
|
3536
|
+
|
|
3537
|
+
/**
|
|
3538
|
+
* Property descriptor object.
|
|
3539
|
+
*
|
|
3540
|
+
* @example
|
|
3541
|
+
* const desc: PropertyDescriptor = {
|
|
3542
|
+
* 'configurable': false,
|
|
3543
|
+
* 'enumerable': true,
|
|
3544
|
+
* 'writable': false,
|
|
3545
|
+
* 'value': 'beep'
|
|
3546
|
+
* };
|
|
3547
|
+
*/
|
|
3548
|
+
type PropertyDescriptor = DataPropertyDescriptor | AccessorPropertyDescriptor;
|
|
3549
|
+
|
|
3550
|
+
/**
|
|
3551
|
+
* An object property name.
|
|
3552
|
+
*
|
|
3553
|
+
* @example
|
|
3554
|
+
* const prop: PropertyName = 'foo';
|
|
3555
|
+
*/
|
|
3556
|
+
type PropertyName = string | symbol;
|
|
3557
|
+
}
|
|
3558
|
+
|
|
3559
|
+
/**
|
|
3560
|
+
* Module containing definitions for complex numbers.
|
|
3561
|
+
*
|
|
3562
|
+
* @example
|
|
3563
|
+
* import * as complex from `@stdlib/types/complex`;
|
|
3564
|
+
*
|
|
3565
|
+
* const x: complex.ComplexLike = { 're': 5.0, 'im': 3.0 };
|
|
3566
|
+
*/
|
|
3567
|
+
declare module '@stdlib/types/complex' {
|
|
3568
|
+
/**
|
|
3569
|
+
* Complex number data type.
|
|
3570
|
+
*/
|
|
3571
|
+
type ComplexFloatingPointDataType = 'complex64' | 'complex128';
|
|
3572
|
+
|
|
3573
|
+
/**
|
|
3574
|
+
* A complex number-like object.
|
|
3575
|
+
*
|
|
3576
|
+
* @example
|
|
3577
|
+
* const x: ComplexLike = { 're': 5.0, 'im': 3.0 };
|
|
3578
|
+
*/
|
|
3579
|
+
interface ComplexLike {
|
|
3580
|
+
/**
|
|
3581
|
+
* Real component.
|
|
3582
|
+
*/
|
|
3583
|
+
re: number;
|
|
3584
|
+
|
|
3585
|
+
/**
|
|
3586
|
+
* Imaginary component.
|
|
3587
|
+
*/
|
|
3588
|
+
im: number;
|
|
3589
|
+
}
|
|
3590
|
+
|
|
3591
|
+
/**
|
|
3592
|
+
* A 64-bit complex number.
|
|
3593
|
+
*
|
|
3594
|
+
* @example
|
|
3595
|
+
* const x: Complex64 = {
|
|
3596
|
+
* 're': 5.0,
|
|
3597
|
+
* 'im': 3.0,
|
|
3598
|
+
* 'byteLength': 8,
|
|
3599
|
+
* 'BYTES_PER_ELEMENT': 4
|
|
3600
|
+
* };
|
|
3601
|
+
*/
|
|
3602
|
+
interface Complex64 extends ComplexLike {
|
|
3603
|
+
/**
|
|
3604
|
+
* Size (in bytes) of the complex number.
|
|
3605
|
+
*/
|
|
3606
|
+
byteLength: 8;
|
|
3607
|
+
|
|
3608
|
+
/**
|
|
3609
|
+
* Size (in bytes) of each component.
|
|
3610
|
+
*/
|
|
3611
|
+
BYTES_PER_ELEMENT: 4;
|
|
3612
|
+
}
|
|
3613
|
+
|
|
3614
|
+
/**
|
|
3615
|
+
* A 128-bit complex number.
|
|
3616
|
+
*
|
|
3617
|
+
* @example
|
|
3618
|
+
* const x: Complex128 = {
|
|
3619
|
+
* 're': 5.0,
|
|
3620
|
+
* 'im': 3.0,
|
|
3621
|
+
* 'byteLength': 16,
|
|
3622
|
+
* 'BYTES_PER_ELEMENT': 8
|
|
3623
|
+
* };
|
|
3624
|
+
*/
|
|
3625
|
+
interface Complex128 extends ComplexLike {
|
|
3626
|
+
/**
|
|
3627
|
+
* Size (in bytes) of the complex number.
|
|
3628
|
+
*/
|
|
3629
|
+
byteLength: 16;
|
|
3630
|
+
|
|
3631
|
+
/**
|
|
3632
|
+
* Size (in bytes) of each component.
|
|
3633
|
+
*/
|
|
3634
|
+
BYTES_PER_ELEMENT: 8;
|
|
3635
|
+
}
|
|
3636
|
+
}
|
|
3637
|
+
|
|
3638
|
+
/**
|
|
3639
|
+
* Module containing PRNG definitions.
|
|
3640
|
+
*
|
|
3641
|
+
* @example
|
|
3642
|
+
* import * as random from `@stdlib/types/random`;
|
|
3643
|
+
*
|
|
3644
|
+
* const rand: random.PRNG = () => 3.14;
|
|
3645
|
+
*
|
|
3646
|
+
* @example
|
|
3647
|
+
* import { PRNG } from `@stdlib/types/random`;
|
|
3648
|
+
*
|
|
3649
|
+
* const rand: PRNG = () => 3.14;
|
|
3650
|
+
*/
|
|
3651
|
+
declare module '@stdlib/types/random' {
|
|
3652
|
+
import { ArrayLike } from '@stdlib/types/array'; // eslint-disable-line no-duplicate-imports
|
|
3653
|
+
|
|
3654
|
+
/**
|
|
3655
|
+
* A pseudorandom number generator (PRNG).
|
|
3656
|
+
*
|
|
3657
|
+
* @param args - PRNG parameters
|
|
3658
|
+
* @returns pseudorandom number
|
|
3659
|
+
*
|
|
3660
|
+
* @example
|
|
3661
|
+
* const rand: PRNG = () => 3.14;
|
|
3662
|
+
*/
|
|
3663
|
+
type PRNG = ( ...args: Array<any> ) => number;
|
|
3664
|
+
|
|
3665
|
+
/**
|
|
3666
|
+
* A pseudorandom number generator (PRNG) seed for the 32-bit Mersenne Twister (MT19937) PRNG.
|
|
3667
|
+
*
|
|
3668
|
+
* @example
|
|
3669
|
+
* const s: PRNGSeedMT19937 = 12345;
|
|
3670
|
+
*
|
|
3671
|
+
* @example
|
|
3672
|
+
* const s: PRNGSeedMT19937 = [ 12345, 67891 ];
|
|
3673
|
+
*/
|
|
3674
|
+
type PRNGSeedMT19937 = number | ArrayLike<number>;
|
|
3675
|
+
|
|
3676
|
+
/**
|
|
3677
|
+
* A pseudorandom number generator (PRNG) state for the 32-bit Mersenne Twister (MT19937) PRNG.
|
|
3678
|
+
*
|
|
3679
|
+
* @example
|
|
3680
|
+
* const s: PRNGStateMT19937 = new Uint32Array( 627 );
|
|
3681
|
+
*/
|
|
3682
|
+
type PRNGStateMT19937 = Uint32Array;
|
|
3683
|
+
|
|
3684
|
+
/**
|
|
3685
|
+
* A pseudorandom number generator (PRNG) seed for the MINSTD PRNG.
|
|
3686
|
+
*
|
|
3687
|
+
* @example
|
|
3688
|
+
* const s: PRNGSeedMINSTD = 12345;
|
|
3689
|
+
*
|
|
3690
|
+
* @example
|
|
3691
|
+
* const s: PRNGSeedMINSTD = [ 12345, 67891 ];
|
|
3692
|
+
*/
|
|
3693
|
+
type PRNGSeedMINSTD = number | ArrayLike<number>;
|
|
3694
|
+
|
|
3695
|
+
/**
|
|
3696
|
+
* A pseudorandom number generator (PRNG) state for the MINSTD PRNG.
|
|
3697
|
+
*
|
|
3698
|
+
* @example
|
|
3699
|
+
* const s: PRNGStateMINSTD = new Int32Array( 6 );
|
|
3700
|
+
*/
|
|
3701
|
+
type PRNGStateMINSTD = Int32Array;
|
|
3702
|
+
}
|
|
3703
|
+
|
|
3704
|
+
/**
|
|
3705
|
+
* Module containing type utilities.
|
|
3706
|
+
*
|
|
3707
|
+
* @example
|
|
3708
|
+
* import * as utilities from `@stdlib/types/utilities`;
|
|
3709
|
+
*/
|
|
3710
|
+
declare module '@stdlib/types/utilities' {
|
|
3711
|
+
/**
|
|
3712
|
+
* Override the properties of a first type with the properties of a second type.
|
|
3713
|
+
*/
|
|
3714
|
+
type Override<T, U> = Omit<T, keyof U> & U;
|
|
3715
|
+
|
|
3716
|
+
/**
|
|
3717
|
+
* Remap all properties of a type for better Intellisense.
|
|
3718
|
+
*/
|
|
3719
|
+
type Remap<T> = {
|
|
3720
|
+
[K in keyof T]: T[K];
|
|
3721
|
+
} & {};
|
|
3722
|
+
}
|
|
3723
|
+
|
|
3724
|
+
/**
|
|
3725
|
+
* Module containing definitions for slices.
|
|
3726
|
+
*
|
|
3727
|
+
* @example
|
|
3728
|
+
* import * as slice from `@stdlib/types/slice`;
|
|
3729
|
+
*
|
|
3730
|
+
* const s: slice.Slice = { 'start': 0, 'stop': 10, 'step': 1 };
|
|
3731
|
+
*/
|
|
3732
|
+
declare module '@stdlib/types/slice' {
|
|
3733
|
+
import { ArrayLike } from '@stdlib/types/array'; // eslint-disable-line no-duplicate-imports
|
|
3734
|
+
|
|
3735
|
+
/**
|
|
3736
|
+
* A slice object.
|
|
3737
|
+
*
|
|
3738
|
+
* @example
|
|
3739
|
+
* const s: Slice = { 'start': 0, 'stop': 10, 'step': 1 };
|
|
3740
|
+
*/
|
|
3741
|
+
interface Slice<T = number | null, U = number | null, V = number | null> {
|
|
3742
|
+
/**
|
|
3743
|
+
* Starting index (inclusive).
|
|
3744
|
+
*/
|
|
3745
|
+
start: T;
|
|
3746
|
+
|
|
3747
|
+
/**
|
|
3748
|
+
* Ending index (exclusive).
|
|
3749
|
+
*/
|
|
3750
|
+
stop: U;
|
|
3751
|
+
|
|
3752
|
+
/**
|
|
3753
|
+
* Index increment.
|
|
3754
|
+
*/
|
|
3755
|
+
step: V;
|
|
3756
|
+
}
|
|
3757
|
+
|
|
3758
|
+
/**
|
|
3759
|
+
* A multi-slice object.
|
|
3760
|
+
*
|
|
3761
|
+
* @example
|
|
3762
|
+
* const s: MultiSlice = { 'ndims': 1, 'data': [ 10 ] };
|
|
3763
|
+
*/
|
|
3764
|
+
interface MultiSlice {
|
|
3765
|
+
/**
|
|
3766
|
+
* Number of slice dimensions.
|
|
3767
|
+
*/
|
|
3768
|
+
ndims: number;
|
|
3769
|
+
|
|
3770
|
+
/**
|
|
3771
|
+
* Slice data.
|
|
3772
|
+
*/
|
|
3773
|
+
data: ArrayLike<Slice | number | null>;
|
|
3774
|
+
}
|
|
3775
|
+
}
|
|
3776
|
+
|
|
3777
|
+
/**
|
|
3778
|
+
* Module containing definitions for WebAssembly.
|
|
3779
|
+
*
|
|
3780
|
+
* @example
|
|
3781
|
+
* import * as wasm from `@stdlib/types/wasm`;
|
|
3782
|
+
*/
|
|
3783
|
+
declare module '@stdlib/types/wasm' {
|
|
3784
|
+
import { Collection, AccessorArrayLike } from '@stdlib/types/array'; // eslint-disable-line no-duplicate-imports
|
|
3785
|
+
|
|
3786
|
+
/**
|
|
3787
|
+
* WebAssembly memory interface.
|
|
3788
|
+
*/
|
|
3789
|
+
interface Memory {
|
|
3790
|
+
/**
|
|
3791
|
+
* Underlying `ArrayBuffer` (or `SharedArrayBuffer`) associated with a memory instance.
|
|
3792
|
+
*/
|
|
3793
|
+
buffer: ArrayBuffer;
|
|
3794
|
+
|
|
3795
|
+
/**
|
|
3796
|
+
* Increases the size of the memory instance by a specified number of WebAssembly pages (i.e., 64KiB).
|
|
3797
|
+
*
|
|
3798
|
+
* ## Notes
|
|
3799
|
+
*
|
|
3800
|
+
* - Upon increasing the size, the previous `ArrayBuffer` is detached, thus invalidating any typed arrays which were views over the previous `ArrayBuffer`.
|
|
3801
|
+
* - Detachment means that the previous `ArrayBuffer` byte length becomes zero, and it no longer has bytes accessible to JavaScript.
|
|
3802
|
+
* - `ArrayBuffer` detachment applies even when `delta` is zero.
|
|
3803
|
+
* - Detachment only applies for non-shared memory instances. For a shared memory instance, the initial buffer (which is a `SharedArrayBuffer`) will not become detached and, instead, its length will not be updated.
|
|
3804
|
+
* - Accesses to the `buffer` property after growing a `SharedArrayBuffer` will yield a larger `SharedArrayBuffer` which may access a larger span of memory than the buffer before growing memory.
|
|
3805
|
+
* - Every `SharedArrayBuffer` accessed via the `buffer` property will always refer to the start of the same memory address range and thus manipulate the same data.
|
|
3806
|
+
*
|
|
3807
|
+
* @param delta - number of WebAssembly pages (i.e., 64KiB) by which to grow the underlying memory
|
|
3808
|
+
* @returns size of the previous `ArrayBuffer` (or `SharedArrayBuffer`)
|
|
3809
|
+
*/
|
|
3810
|
+
grow( delta: number ): number;
|
|
3811
|
+
}
|
|
3812
|
+
|
|
3813
|
+
/**
|
|
3814
|
+
* WebAssembly module wrapper interface.
|
|
3815
|
+
*/
|
|
3816
|
+
interface ModuleWrapper {
|
|
3817
|
+
/**
|
|
3818
|
+
* WebAssembly binary code.
|
|
3819
|
+
*/
|
|
3820
|
+
binary: Uint8Array;
|
|
3821
|
+
|
|
3822
|
+
/**
|
|
3823
|
+
* WebAssembly memory.
|
|
3824
|
+
*/
|
|
3825
|
+
memory: Memory | null;
|
|
3826
|
+
|
|
3827
|
+
/**
|
|
3828
|
+
* WebAssembly memory buffer as a Uint8Array.
|
|
3829
|
+
*/
|
|
3830
|
+
buffer: Uint8Array | null;
|
|
3831
|
+
|
|
3832
|
+
/**
|
|
3833
|
+
* WebAssembly memory buffer as a DataView.
|
|
3834
|
+
*/
|
|
3835
|
+
view: DataView | null;
|
|
3836
|
+
|
|
3837
|
+
/**
|
|
3838
|
+
* "Raw" WebAssembly module exports.
|
|
3839
|
+
*/
|
|
3840
|
+
exports: Object | null;
|
|
3841
|
+
|
|
3842
|
+
/**
|
|
3843
|
+
* Asynchronously initializes a WebAssembly module instance.
|
|
3844
|
+
*
|
|
3845
|
+
* @returns promise which resolves upon initializing a WebAssembly module instance
|
|
3846
|
+
*/
|
|
3847
|
+
initialize(): Promise<ModuleWrapper>;
|
|
3848
|
+
|
|
3849
|
+
/**
|
|
3850
|
+
* Asynchronously initializes a WebAssembly module instance.
|
|
3851
|
+
*
|
|
3852
|
+
* @param clbk - callback to invoke upon initializing a WebAssembly module
|
|
3853
|
+
*/
|
|
3854
|
+
initializeAsync( clbk: ( error: Error | null, mod?: ModuleWrapper ) => void ): void;
|
|
3855
|
+
|
|
3856
|
+
/**
|
|
3857
|
+
* Synchronously initializes a WebAssembly module instance.
|
|
3858
|
+
*
|
|
3859
|
+
* @returns module wrapper instance
|
|
3860
|
+
*/
|
|
3861
|
+
initializeSync(): ModuleWrapper;
|
|
3862
|
+
|
|
3863
|
+
/**
|
|
3864
|
+
* Reallocates the underlying WebAssembly memory instance to a specified number of bytes.
|
|
3865
|
+
*
|
|
3866
|
+
* ## Notes
|
|
3867
|
+
*
|
|
3868
|
+
* - WebAssembly memory can only **grow**, not shrink. Hence, if provided a number of bytes which is less than or equal to the size of the current memory, the function does nothing.
|
|
3869
|
+
* - When non-shared memory is resized, the underlying the `ArrayBuffer` is detached, consequently invalidating any associated typed array views. Before resizing non-shared memory, ensure that associated typed array views no longer need byte access and can be garbage collected.
|
|
3870
|
+
*
|
|
3871
|
+
* @param nbytes - memory size (in bytes)
|
|
3872
|
+
* @returns boolean indicating whether the resize operation was successful
|
|
3873
|
+
*/
|
|
3874
|
+
realloc( nbytes: number ): boolean;
|
|
3875
|
+
|
|
3876
|
+
/**
|
|
3877
|
+
* Returns a boolean indicating whether the underlying WebAssembly memory instance has the capacity to store a provided list of values starting from a specified byte offset.
|
|
3878
|
+
*
|
|
3879
|
+
* @param byteOffset - byte offset at which to start writing values
|
|
3880
|
+
* @param values - input array containing values to write
|
|
3881
|
+
* @returns boolean indicating whether the underlying WebAssembly memory instance has enough capacity
|
|
3882
|
+
*/
|
|
3883
|
+
hasCapacity( byteOffset: number, values: Collection | AccessorArrayLike<any> ): boolean;
|
|
3884
|
+
|
|
3885
|
+
/**
|
|
3886
|
+
* Returns a boolean indicating whether a provided list of values is a view of the underlying memory of the WebAssembly module.
|
|
3887
|
+
*
|
|
3888
|
+
* @param values - input array
|
|
3889
|
+
* @returns boolean indicating whether the list is a memory view
|
|
3890
|
+
*/
|
|
3891
|
+
isView( values: Collection | AccessorArrayLike<any> ): boolean;
|
|
3892
|
+
|
|
3893
|
+
/**
|
|
3894
|
+
* Writes values to the underlying WebAssembly memory instance.
|
|
3895
|
+
*
|
|
3896
|
+
* ## Notes
|
|
3897
|
+
*
|
|
3898
|
+
* - The function infers element size (i.e., number of bytes per element) from the data type of the input array. For example, if provided a `Float32Array`, the function writes each element as a single-precision floating-point number to the underlying WebAssembly memory instance.
|
|
3899
|
+
* - In order to write elements as a different data type, you need to perform an explicit cast **before** calling this method. For example, in order to write single-precision floating-point numbers contained in a `Float32Array` as signed 32-bit integers, you must first convert the `Float32Array` to an `Int32Array` before passing the values to this method.
|
|
3900
|
+
* - If provided an array having an unknown or "generic" data type, elements are written as double-precision floating-point numbers.
|
|
3901
|
+
*
|
|
3902
|
+
* @param byteOffset - byte offset at which to start writing values
|
|
3903
|
+
* @param values - input array containing values to write
|
|
3904
|
+
* @returns module wrapper instance
|
|
3905
|
+
*/
|
|
3906
|
+
write( byteOffset: number, values: Collection | AccessorArrayLike<any> ): ModuleWrapper;
|
|
3907
|
+
|
|
3908
|
+
/**
|
|
3909
|
+
* Reads values from the underlying WebAssembly memory instance.
|
|
3910
|
+
*
|
|
3911
|
+
* ## Notes
|
|
3912
|
+
*
|
|
3913
|
+
* - The function infers element size (i.e., number of bytes per element) from the data type of the output array. For example, if provided a `Float32Array`, the function reads each element as a single-precision floating-point number from the underlying WebAssembly memory instance.
|
|
3914
|
+
* - In order to read elements as a different data type, you need to perform an explicit cast **after** calling this method. For example, in order to read single-precision floating-point numbers contained in a `Float32Array` as signed 32-bit integers, you must convert the `Float32Array` to an `Int32Array` after reading memory values using this method.
|
|
3915
|
+
* - If provided an output array having an unknown or "generic" data type, elements are read as double-precision floating-point numbers.
|
|
3916
|
+
*
|
|
3917
|
+
* @param byteOffset - byte offset at which to start reading values
|
|
3918
|
+
* @param out - output array
|
|
3919
|
+
* @returns module wrapper instance
|
|
3920
|
+
*/
|
|
3921
|
+
read( byteOffset: number, out: Collection | AccessorArrayLike<any> ): ModuleWrapper;
|
|
3922
|
+
}
|
|
3923
|
+
}
|