Skip to content

Commit bcfbdda

Browse files
committed
Add Typescript definitions
1 parent 04d14d6 commit bcfbdda

File tree

15 files changed

+357
-0
lines changed

15 files changed

+357
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
// TypeScript Version: 2.0
20+
21+
/**
22+
* Returns the current working directory of the process.
23+
*
24+
* @returns current working directory of the process
25+
*
26+
* @example
27+
* var dir = cwd();
28+
* // returns '/path/to/current/working/directory'
29+
*/
30+
declare function cwd(): string;
31+
32+
33+
// EXPORTS //
34+
35+
export = cwd;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
import cwd = require( './index' );
20+
21+
22+
// TESTS //
23+
24+
// The function returns a string...
25+
{
26+
cwd(); // $ExpectType string
27+
}
28+
29+
// The compiler throws an error if the function is provided arguments...
30+
{
31+
cwd( true ); // $ExpectError
32+
cwd( [], 123 ); // $ExpectError
33+
}

lib/node_modules/@stdlib/process/cwd/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"lib": "./lib",
2727
"test": "./test"
2828
},
29+
"types": "./docs/types",
2930
"scripts": {},
3031
"homepage": "https://github.com/stdlib-js/stdlib",
3132
"repository": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
// TypeScript Version: 2.0
20+
21+
/**
22+
* Returns the effective numeric group identity of the calling process.
23+
*
24+
* ## Notes
25+
*
26+
* - The function only returns an effective group identity on POSIX platforms. For all other platforms (e.g., Windows and Android), the function returns `null`.
27+
*
28+
* @returns effective numeric group identity or null
29+
*
30+
* @example
31+
* var gid = getegid();
32+
*/
33+
declare function getegid(): number | null;
34+
35+
36+
// EXPORTS //
37+
38+
export = getegid;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
import getegid = require( './index' );
20+
21+
22+
// TESTS //
23+
24+
// The function returns a number or null...
25+
{
26+
getegid(); // $ExpectType number | null
27+
}
28+
29+
// The compiler throws an error if the function is provided arguments...
30+
{
31+
getegid( true ); // $ExpectError
32+
getegid( [], 123 ); // $ExpectError
33+
}

lib/node_modules/@stdlib/process/getegid/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"lib": "./lib",
2323
"test": "./test"
2424
},
25+
"types": "./docs/types",
2526
"scripts": {},
2627
"homepage": "https://github.com/stdlib-js/stdlib",
2728
"repository": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
// TypeScript Version: 2.0
20+
21+
/**
22+
* Returns the effective numeric user identity of the calling process.
23+
*
24+
* ## Notes
25+
*
26+
* - The function only returns an effective user identity on POSIX platforms. For all other platforms (e.g., Windows and Android), the function returns `null`.
27+
*
28+
* @returns effective numeric user identity or null
29+
*
30+
* @example
31+
* var uid = geteuid();
32+
*/
33+
declare function geteuid(): number | null;
34+
35+
36+
// EXPORTS //
37+
38+
export = geteuid;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
import geteuid = require( './index' );
20+
21+
22+
// TESTS //
23+
24+
// The function returns a number or null...
25+
{
26+
geteuid(); // $ExpectType number | null
27+
}
28+
29+
// The compiler throws an error if the function is provided arguments...
30+
{
31+
geteuid( true ); // $ExpectError
32+
geteuid( [], 123 ); // $ExpectError
33+
}

lib/node_modules/@stdlib/process/geteuid/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"lib": "./lib",
2323
"test": "./test"
2424
},
25+
"types": "./docs/types",
2526
"scripts": {},
2627
"homepage": "https://github.com/stdlib-js/stdlib",
2728
"repository": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
// TypeScript Version: 2.0
20+
21+
/**
22+
* Returns the numeric group identity of the calling process.
23+
*
24+
* ## Notes
25+
*
26+
* - The function only returns a group identity on POSIX platforms. For all other platforms (e.g., Windows and Android), the function returns `null`.
27+
*
28+
* @returns numeric group identity or null
29+
*
30+
* @example
31+
* var gid = getgid();
32+
*/
33+
declare function getgid(): number | null;
34+
35+
36+
// EXPORTS //
37+
38+
export = getgid;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
import getgid = require( './index' );
20+
21+
22+
// TESTS //
23+
24+
// The function returns a number or null...
25+
{
26+
getgid(); // $ExpectType number | null
27+
}
28+
29+
// The compiler throws an error if the function is provided arguments...
30+
{
31+
getgid( true ); // $ExpectError
32+
getgid( [], 123 ); // $ExpectError
33+
}

lib/node_modules/@stdlib/process/getgid/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"lib": "./lib",
2323
"test": "./test"
2424
},
25+
"types": "./docs/types",
2526
"scripts": {},
2627
"homepage": "https://github.com/stdlib-js/stdlib",
2728
"repository": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
// TypeScript Version: 2.0
20+
21+
/**
22+
* Returns the numeric user identity of the calling process.
23+
*
24+
* ## Notes
25+
*
26+
* - The function only returns a user identity on POSIX platforms. For all other platforms (e.g., Windows and Android), the function returns `null`.
27+
*
28+
* @returns numeric user identity or null
29+
*
30+
* @example
31+
* var uid = getuid();
32+
*/
33+
declare function getuid(): number | null;
34+
35+
36+
// EXPORTS //
37+
38+
export = getuid;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
import getuid = require( './index' );
20+
21+
22+
// TESTS //
23+
24+
// The function returns a number or null...
25+
{
26+
getuid(); // $ExpectType number | null
27+
}
28+
29+
// The compiler throws an error if the function is provided arguments...
30+
{
31+
getuid( true ); // $ExpectError
32+
getuid( [], 123 ); // $ExpectError
33+
}

0 commit comments

Comments
 (0)