-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
115 lines (105 loc) · 2.72 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/*
* @license Apache-2.0
*
* Copyright (c) 2022 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// TypeScript Version: 4.1
/* eslint-disable max-lines */
import log = require( './../../log' );
import logEach = require( './../../log-each' );
import logEachMap = require( './../../log-each-map' );
/**
* Interface describing the `console` namespace.
*/
interface Namespace {
/**
* Outputs a message to the debugger console.
*
* @param data - data to log
* @param args - additional arguments (including substitution values)
*
* @example
* ns.log( 'Hello, World!' );
*
* @example
* ns.log( 'Hello, %s!', 'World' );
*/
log: typeof log;
/**
* Inserts array element values into a format string and prints the result.
*
* ## Notes
*
* - If an interpolated argument is not a collection, the argument is broadcasted for each iteration.
*
* @param str - format string
* @param args - collections or values
* @throws provided collections must have the same length
*
* @example
* var x = [ 1, 2, 3 ];
* var y = [ 4, 5, 6 ];
*
* ns.logEach( '%d < %d ', x, y );
* // e.g., => '1 < 4\n2 < 5\n3 < 6\n'
*
* @example
* var x = [ 0.5, 1.0, 1.5 ];
* var y = [ 0.25, 0.5, 0.75 ];
*
* ns.logEach( '%0.2f > %0.2f', x, y );
* // e.g., => '0.50 > 0.25\n1.00 > 0.50\n1.50 > 0.75\n'
*
* @example
* var x = [ 'foo', 'bar' ];
* var y = [ 'beep', 'boop' ];
*
* ns.logEach( 'x: %s, y: %s', x, y );
* // e.g., => 'x: foo, y: beep\nx: bar, y: boop\n'
*/
logEach: typeof logEach;
/**
* Inserts array element values and the result of a callback function into a format string and prints the result.
*
* ## Notes
*
* - If an interpolated argument is not a collection, the argument is broadcasted for each iteration.
*
* @param str - format string
* @param arg0 - first input value
* @param arg1 - second input value
* @param arg2 - third input value
* @param args - additional input values
*
* @example
* function clbk( x, y, z ) {
* return x + y + z;
* }
*
* var x = [ 1, 2, 3 ];
* var y = [ 4, 5, 6 ];
* var z = [ 7, 8, 9 ];
*
* ns.logEachMap( '%d', x, y, z, clbk );
* // e.g., => '12\n15\n18\n'
*/
logEachMap: typeof logEachMap;
}
/**
* Debugger console.
*/
declare var ns: Namespace;
// EXPORTS //
export = ns;