Skip to content

Commit f78f9cf

Browse files
committed
Add namespace files
1 parent 9da7f84 commit f78f9cf

File tree

13 files changed

+582
-1
lines changed

13 files changed

+582
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
<!--
2+
3+
@license Apache-2.0
4+
5+
Copyright (c) 2022 The Stdlib Authors.
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
19+
-->
20+
21+
# Assertions for Native Add-ons
22+
23+
> C utilities for Node-API call assertions.
24+
25+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
26+
27+
<section class="intro">
28+
29+
This package exposes an absolute file path for the directory containing header files for various C assertion APIs.
30+
31+
</section>
32+
33+
<!-- /.intro -->
34+
35+
<!-- Package usage documentation. -->
36+
37+
<section class="usage">
38+
39+
## Usage
40+
41+
```javascript
42+
var headerDir = require( '@stdlib/assert/napi' );
43+
```
44+
45+
#### headerDir
46+
47+
Absolute file path for the directory containing header files for C APIs.
48+
49+
```javascript
50+
var dir = headerDir;
51+
// returns <string>
52+
```
53+
54+
</section>
55+
56+
<!-- /.usage -->
57+
58+
<!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
59+
60+
<section class="notes">
61+
62+
</section>
63+
64+
<!-- /.notes -->
65+
66+
<!-- Package usage examples. -->
67+
68+
<section class="examples">
69+
70+
## Examples
71+
72+
```javascript
73+
var headerDir = require( '@stdlib/assert/napi' );
74+
75+
console.log( headerDir );
76+
// => <string>
77+
```
78+
79+
</section>
80+
81+
<!-- /.examples -->
82+
83+
<!-- C interface documentation. -->
84+
85+
* * *
86+
87+
<section class="c">
88+
89+
## C APIs
90+
91+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
92+
93+
<section class="intro">
94+
95+
This package exposes various C utilities for Node-API call assertions. The included C APIs are the APIs implemented in the following packages:
96+
97+
<!-- NOTE: please keep in alphabetical order -->
98+
99+
For API documentation, consult the individual packages.
100+
101+
</section>
102+
103+
<!-- /.intro -->
104+
105+
<!-- C usage documentation. -->
106+
107+
<section class="usage">
108+
109+
### Usage
110+
111+
```c
112+
#include "stdlib/assert/napi.h"
113+
```
114+
115+
</section>
116+
117+
<!-- /.usage -->
118+
119+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
120+
121+
<section class="notes">
122+
123+
</section>
124+
125+
<!-- /.notes -->
126+
127+
<!-- C API usage examples. -->
128+
129+
<section class="examples">
130+
131+
### Examples
132+
133+
```c
134+
#include "stdlib/assert/napi.h"
135+
```
136+
137+
</section>
138+
139+
<!-- /.examples -->
140+
141+
</section>
142+
143+
<!-- /.c -->
144+
145+
<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
146+
147+
<section class="references">
148+
149+
</section>
150+
151+
<!-- /.references -->
152+
153+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
154+
155+
<section class="related">
156+
157+
</section>
158+
159+
<!-- /.related -->
160+
161+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
162+
163+
<section class="links">
164+
165+
</section>
166+
167+
<!-- /.links -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2022 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+
/**
22+
* Absolute file path for the directory containing header files for C APIs.
23+
*
24+
* @example
25+
* var dir = headerDir;
26+
* // returns <string>
27+
*/
28+
declare const headerDir: string;
29+
30+
31+
// EXPORTS //
32+
33+
export = headerDir;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2022 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+
import headerDir = require( './index' );
20+
21+
22+
// TESTS //
23+
24+
// The variable is a string...
25+
{
26+
// tslint:disable-next-line:no-unused-expression
27+
headerDir; // $ExpectType string
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2022 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+
'use strict';
20+
21+
var headerDir = require( './../lib' );
22+
23+
console.log( headerDir );
24+
// => <string>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2022 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+
#ifndef STDLIB_ASSERT_NAPI_H
20+
#define STDLIB_ASSERT_NAPI_H
21+
22+
// Note: keep in alphabetical order...
23+
#include "stdlib/assert/napi/equal_typedarray_types.h"
24+
#include "stdlib/assert/napi/equal_types.h"
25+
#include "stdlib/assert/napi/is_type.h"
26+
#include "stdlib/assert/napi/is_typedarray.h"
27+
#include "stdlib/assert/napi/status_ok.h"
28+
29+
#endif // !STDLIB_ASSERT_NAPI_H
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2022 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+
'use strict';
20+
21+
// MAIN //
22+
23+
var headerDir = null;
24+
25+
26+
// EXPORTS //
27+
28+
module.exports = headerDir;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2022 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+
'use strict';
20+
21+
/**
22+
* Absolute file path for the directory containing header files for C APIs.
23+
*
24+
* @module @stdlib/napi
25+
*
26+
* @example
27+
* var headerDir = require( '@stdlib/napi' );
28+
*
29+
* console.log( headerDir );
30+
*/
31+
32+
// MODULES //
33+
34+
var main = require( './main.js' );
35+
36+
37+
// EXPORTS //
38+
39+
module.exports = main;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2022 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+
'use strict';
20+
21+
// MODULES //
22+
23+
var resolve = require( 'path' ).resolve;
24+
25+
26+
// MAIN //
27+
28+
/**
29+
* Absolute file path for the directory containing header files for C APIs.
30+
*
31+
* @name headerDir
32+
* @constant
33+
* @type {string}
34+
*/
35+
var headerDir = resolve( __dirname, '..', 'include' );
36+
37+
38+
// EXPORTS //
39+
40+
module.exports = headerDir;

0 commit comments

Comments
 (0)