Skip to content

Commit df0bb55

Browse files
committed
Add namespace Typescript definition
1 parent 917c248 commit df0bb55

3 files changed

Lines changed: 98 additions & 0 deletions

File tree

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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 assert = require( '@stdlib/math/base/assert' );
25+
import complex = require( '@stdlib/math/base/complex' );
26+
import special = require( '@stdlib/math/base/special' );
27+
import tools = require( '@stdlib/math/base/tools' );
28+
import utils = require( '@stdlib/math/base/utils' );
29+
30+
/**
31+
* Interface describing the `base` namespace.
32+
*/
33+
interface Base {
34+
/**
35+
* Standard library basic mathematical assertion utilities.
36+
*/
37+
assert: typeof assert;
38+
39+
/**
40+
* Standard library base complex number math functions.
41+
*/
42+
complex: typeof complex;
43+
44+
/**
45+
* Standard library base special math functions.
46+
*/
47+
special: typeof special;
48+
49+
/**
50+
* Standard library basic mathematical tools.
51+
*/
52+
tools: typeof tools;
53+
54+
/**
55+
* Standard library basic mathematical utilities.
56+
*/
57+
utils: typeof utils;
58+
}
59+
60+
/**
61+
* Standard library base math.
62+
*/
63+
declare var base: Base;
64+
65+
66+
// EXPORTS //
67+
68+
export = base;
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 base = require( './index' );
22+
23+
24+
// TESTS //
25+
26+
// The exported value is the expected interface...
27+
{
28+
base; // $ExpectType Base
29+
}

lib/node_modules/@stdlib/math/base/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)