Skip to content

Commit d7f89fb

Browse files
committed
Add missing types field and namespace Typescript definition
1 parent df0bb55 commit d7f89fb

4 files changed

Lines changed: 105 additions & 0 deletions

File tree

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2021 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+
// TypeScript Version: 2.0
20+
21+
/* tslint:disable:max-line-length */
22+
/* tslint:disable:max-file-line-count */
23+
24+
import constants = require( '@stdlib/constants/math' );
25+
import base = require( '@stdlib/math/base' );
26+
import iter = require( '@stdlib/math/iter' );
27+
import special = require( '@stdlib/math/special' );
28+
import strided = require( '@stdlib/math/strided' );
29+
import utils = require( '@stdlib/math/utils' );
30+
31+
/**
32+
* Interface describing the `math` namespace.
33+
*/
34+
interface Math {
35+
/**
36+
* Mathematical constants.
37+
*/
38+
constants: typeof constants;
39+
40+
/**
41+
* Standard library base math.
42+
*/
43+
base: typeof base;
44+
45+
/**
46+
* Standard library math iterators.
47+
*/
48+
iter: typeof iter;
49+
50+
/**
51+
* Standard library special math functions.
52+
*/
53+
special: typeof special;
54+
55+
/**
56+
* Standard library strided math functions.
57+
*/
58+
strided: typeof strided;
59+
60+
/**
61+
* Standard library generic mathematical utilities.
62+
*/
63+
utils: typeof utils;
64+
}
65+
66+
/**
67+
* Standard math.
68+
*/
69+
declare var math: Math;
70+
71+
72+
// EXPORTS //
73+
74+
export = math;
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2021 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+
/* tslint:disable:no-unused-expression */
20+
21+
import math = require( './index' );
22+
23+
24+
// TESTS //
25+
26+
// The exported value is the expected interface...
27+
{
28+
math; // $ExpectType Math
29+
}

lib/node_modules/@stdlib/math/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"lib": "./lib",
2020
"test": "./test"
2121
},
22+
"types": "./docs/types",
2223
"scripts": {},
2324
"homepage": "https://github.com/stdlib-js/stdlib",
2425
"repository": {

lib/node_modules/@stdlib/math/utils/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"lib": "./lib",
2020
"test": "./test"
2121
},
22+
"types": "./docs/types",
2223
"scripts": {},
2324
"homepage": "https://github.com/stdlib-js/stdlib",
2425
"repository": {

0 commit comments

Comments
 (0)