ziko 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,140 +1,147 @@
1
- import type { Complex } from "../complex/index.js";
2
- import type { MapfunResult, Mappable } from "../utils/mapfun.js";
1
+ export type * from './arithmetic/index.d.ts'
2
+ export type * from './conversions/index.d.ts'
3
+ export type * from './logic/index.d.ts'
4
+ export type * from './utils/index.d.ts'
5
+ export type * from './mapfun/index.d.ts'
6
+ export type * from './ufunc/index.d.ts'
3
7
 
4
- /* -------------------- MapfunWrap -------------------- */
8
+ // import type { Complex } from "../complex/index.js";
9
+ // import type { MapfunResult, Mappable } from "../utils/mapfun.js";
5
10
 
6
- type MapfunWrap<F extends (x: any) => any, A extends Mappable[]> =
7
- A["length"] extends 1
8
- ? MapfunResult<F, A[0]>
9
- : { [K in keyof A]: MapfunResult<F, A[K]> };
11
+ // /* -------------------- MapfunWrap -------------------- */
10
12
 
13
+ // type MapfunWrap<F extends (x: any) => any, A extends Mappable[]> =
14
+ // A["length"] extends 1
15
+ // ? MapfunResult<F, A[0]>
16
+ // : { [K in keyof A]: MapfunResult<F, A[K]> };
11
17
 
12
- /* -------------------- mapfun-based simple operators -------------------- */
13
18
 
14
- export declare function abs<A extends Mappable[]>(...x: A):
15
- MapfunWrap<typeof Math.abs, A>;
19
+ // /* -------------------- mapfun-based simple operators -------------------- */
16
20
 
17
- export declare function sqrt<A extends Mappable[]>(...x: A):
18
- MapfunWrap<typeof Math.sqrt, A>;
21
+ // export declare function abs<A extends Mappable[]>(...x: A):
22
+ // MapfunWrap<typeof Math.abs, A>;
19
23
 
20
- export declare function e<A extends Mappable[]>(...x: A):
21
- MapfunWrap<typeof Math.exp, A>;
24
+ // export declare function sqrt<A extends Mappable[]>(...x: A):
25
+ // MapfunWrap<typeof Math.sqrt, A>;
22
26
 
23
- export declare function ln<A extends Mappable[]>(...x: A):
24
- MapfunWrap<typeof Math.log, A>;
27
+ // export declare function e<A extends Mappable[]>(...x: A):
28
+ // MapfunWrap<typeof Math.exp, A>;
25
29
 
26
- /* ---- Fixed-based operators ---- */
30
+ // export declare function ln<A extends Mappable[]>(...x: A):
31
+ // MapfunWrap<typeof Math.log, A>;
27
32
 
28
- export declare function cos<A extends Mappable[]>(...x: A):
29
- MapfunWrap<typeof Math.cos, A>;
33
+ // /* ---- Fixed-based operators ---- */
30
34
 
31
- export declare function sin<A extends Mappable[]>(...x: A):
32
- MapfunWrap<Math.sin, A>;
35
+ // export declare function cos<A extends Mappable[]>(...x: A):
36
+ // MapfunWrap<typeof Math.cos, A>;
33
37
 
34
- export declare function tan<A extends Mappable[]>(...x: A):
35
- MapfunWrap<Math.tan, A>;
38
+ // export declare function sin<A extends Mappable[]>(...x: A):
39
+ // MapfunWrap<Math.sin, A>;
36
40
 
37
- export declare function sec<A extends Mappable[]>(...x: A):
38
- MapfunWrap<Math.sec, A>;
41
+ // export declare function tan<A extends Mappable[]>(...x: A):
42
+ // MapfunWrap<Math.tan, A>;
39
43
 
40
- export declare function sinc<A extends Mappable[]>(...x: A):
41
- MapfunWrap<Math.sinc, A>;
44
+ // export declare function sec<A extends Mappable[]>(...x: A):
45
+ // MapfunWrap<Math.sec, A>;
42
46
 
43
- export declare function csc<A extends Mappable[]>(...x: A):
44
- MapfunWrap<Math.csc, A>;
47
+ // export declare function sinc<A extends Mappable[]>(...x: A):
48
+ // MapfunWrap<Math.sinc, A>;
45
49
 
46
- export declare function cot<A extends Mappable[]>(...x: A):
47
- MapfunWrap<Math.cot, A>;
50
+ // export declare function csc<A extends Mappable[]>(...x: A):
51
+ // MapfunWrap<Math.csc, A>;
48
52
 
49
- export declare function acos<A extends Mappable[]>(...x: A):
50
- MapfunWrap<Math.acos, A>;
53
+ // export declare function cot<A extends Mappable[]>(...x: A):
54
+ // MapfunWrap<Math.cot, A>;
51
55
 
52
- export declare function asin<A extends Mappable[]>(...x: A):
53
- MapfunWrap<Math.asin, A>;
56
+ // export declare function acos<A extends Mappable[]>(...x: A):
57
+ // MapfunWrap<Math.acos, A>;
54
58
 
55
- export declare function atan<A extends Mappable[]>(...x: A):
56
- MapfunWrap<Math.atan, A>;
59
+ // export declare function asin<A extends Mappable[]>(...x: A):
60
+ // MapfunWrap<Math.asin, A>;
57
61
 
58
- export declare function acot<A extends Mappable[]>(...x: A):
59
- MapfunWrap<Math.acot, A>;
62
+ // export declare function atan<A extends Mappable[]>(...x: A):
63
+ // MapfunWrap<Math.atan, A>;
60
64
 
61
- export declare function cosh<A extends Mappable[]>(...x: A):
62
- MapfunWrap<Math.cosh, A>;
65
+ // export declare function acot<A extends Mappable[]>(...x: A):
66
+ // MapfunWrap<Math.acot, A>;
63
67
 
64
- export declare function sinh<A extends Mappable[]>(...x: A):
65
- MapfunWrap<Math.sinh, A>;
68
+ // export declare function cosh<A extends Mappable[]>(...x: A):
69
+ // MapfunWrap<Math.cosh, A>;
66
70
 
67
- export declare function tanh<A extends Mappable[]>(...x: A):
68
- MapfunWrap<Math.tanh, A>;
71
+ // export declare function sinh<A extends Mappable[]>(...x: A):
72
+ // MapfunWrap<Math.sinh, A>;
69
73
 
70
- export declare function coth<A extends Mappable[]>(...x: A):
71
- MapfunWrap<Math.coth, A>;
74
+ // export declare function tanh<A extends Mappable[]>(...x: A):
75
+ // MapfunWrap<Math.tanh, A>;
72
76
 
73
- export declare function acosh<A extends Mappable[]>(...x: A):
74
- MapfunWrap<Math.acosh, A>;
77
+ // export declare function coth<A extends Mappable[]>(...x: A):
78
+ // MapfunWrap<Math.coth, A>;
75
79
 
76
- export declare function asinh<A extends Mappable[]>(...x: A):
77
- MapfunWrap<Math.asinh, A>;
80
+ // export declare function acosh<A extends Mappable[]>(...x: A):
81
+ // MapfunWrap<Math.acosh, A>;
78
82
 
79
- export declare function atanh<A extends Mappable[]>(...x: A):
80
- MapfunWrap<Math.atanh, A>;
83
+ // export declare function asinh<A extends Mappable[]>(...x: A):
84
+ // MapfunWrap<Math.asinh, A>;
81
85
 
82
- /* ---- Math wrappers ---- */
86
+ // export declare function atanh<A extends Mappable[]>(...x: A):
87
+ // MapfunWrap<Math.atanh, A>;
83
88
 
84
- export declare function ceil<A extends Mappable[]>(...x: A):
85
- MapfunWrap<typeof Math.ceil, A>;
89
+ // /* ---- Math wrappers ---- */
86
90
 
87
- export declare function floor<A extends Mappable[]>(...x: A):
88
- MapfunWrap<typeof Math.floor, A>;
91
+ // export declare function ceil<A extends Mappable[]>(...x: A):
92
+ // MapfunWrap<typeof Math.ceil, A>;
89
93
 
90
- export declare function round<A extends Mappable[]>(...x: A):
91
- MapfunWrap<typeof Math.round, A>;
94
+ // export declare function floor<A extends Mappable[]>(...x: A):
95
+ // MapfunWrap<typeof Math.floor, A>;
92
96
 
93
- export declare function sign<A extends Mappable[]>(...x: A):
94
- MapfunWrap<typeof Math.sign, A>;
97
+ // export declare function round<A extends Mappable[]>(...x: A):
98
+ // MapfunWrap<typeof Math.round, A>;
95
99
 
96
- export declare function sig<A extends Mappable[]>(...x: A):
97
- MapfunWrap<(n: number) => number, A>;
100
+ // export declare function sign<A extends Mappable[]>(...x: A):
101
+ // MapfunWrap<typeof Math.sign, A>;
98
102
 
99
- export declare function fact<A extends Mappable[]>(...x: A):
100
- MapfunWrap<(n: number) => number, A>;
103
+ // export declare function sig<A extends Mappable[]>(...x: A):
104
+ // MapfunWrap<(n: number) => number, A>;
101
105
 
106
+ // export declare function fact<A extends Mappable[]>(...x: A):
107
+ // MapfunWrap<(n: number) => number, A>;
102
108
 
103
- /* -------------------- pow -------------------- */
104
109
 
105
- export declare function pow(x: number, n: number): number;
106
- export declare function pow(x: number, n: Complex): Complex;
107
- export declare function pow(x: number, n: Mappable): any;
110
+ // /* -------------------- pow -------------------- */
108
111
 
109
- export declare function pow(x: Complex, n: number): Complex;
110
- export declare function pow(x: Complex, n: Complex): Complex;
111
- export declare function pow(x: Complex, n: Mappable): any;
112
+ // export declare function pow(x: number, n: number): number;
113
+ // export declare function pow(x: number, n: Complex): Complex;
114
+ // export declare function pow(x: number, n: Mappable): any;
112
115
 
113
- export declare function pow(x: Mappable[], n: number): any[];
114
- export declare function pow(x: Mappable[], n: Mappable[]): any[];
116
+ // export declare function pow(x: Complex, n: number): Complex;
117
+ // export declare function pow(x: Complex, n: Complex): Complex;
118
+ // export declare function pow(x: Complex, n: Mappable): any;
115
119
 
120
+ // export declare function pow(x: Mappable[], n: number): any[];
121
+ // export declare function pow(x: Mappable[], n: Mappable[]): any[];
116
122
 
117
- /* -------------------- sqrtn -------------------- */
118
123
 
119
- export declare function sqrtn(x: number, n: number): number;
120
- export declare function sqrtn(x: number, n: Mappable): any;
124
+ // /* -------------------- sqrtn -------------------- */
121
125
 
122
- export declare function sqrtn(x: Complex, n: number): Complex;
123
- export declare function sqrtn(x: Complex, n: Mappable): any;
126
+ // export declare function sqrtn(x: number, n: number): number;
127
+ // export declare function sqrtn(x: number, n: Mappable): any;
124
128
 
125
- export declare function sqrtn(x: Mappable[], n: number): any[];
126
- export declare function sqrtn(x: Mappable[], n: Mappable[]): any[];
129
+ // export declare function sqrtn(x: Complex, n: number): Complex;
130
+ // export declare function sqrtn(x: Complex, n: Mappable): any;
127
131
 
132
+ // export declare function sqrtn(x: Mappable[], n: number): any[];
133
+ // export declare function sqrtn(x: Mappable[], n: Mappable[]): any[];
128
134
 
129
- /* -------------------- atan2 -------------------- */
130
135
 
131
- export declare function atan2(x: number, y: number, rad?: boolean): number;
132
- export declare function atan2(x: number, y: Mappable, rad?: boolean): any;
133
- export declare function atan2(x: Mappable, y: number, rad?: boolean): any;
134
- export declare function atan2(x: Mappable[], y: Mappable[], rad?: boolean): any[];
136
+ // /* -------------------- atan2 -------------------- */
135
137
 
138
+ // export declare function atan2(x: number, y: number, rad?: boolean): number;
139
+ // export declare function atan2(x: number, y: Mappable, rad?: boolean): any;
140
+ // export declare function atan2(x: Mappable, y: number, rad?: boolean): any;
141
+ // export declare function atan2(x: Mappable[], y: Mappable[], rad?: boolean): any[];
136
142
 
137
- /* -------------------- hypot -------------------- */
138
143
 
139
- export declare function hypot(...x: number[]): number;
140
- export declare function hypot(...x: Mappable[]): any;
144
+ // /* -------------------- hypot -------------------- */
145
+
146
+ // export declare function hypot(...x: number[]): number;
147
+ // export declare function hypot(...x: Mappable[]): any;
@@ -1,11 +1,53 @@
1
1
  import type { Complex } from "../../complex/index.d.ts";
2
- // import type { Matrix } from "../../matrix/index.d.ts";
3
2
  import { Matrix } from '../../../../src/math/matrix/index.js'
4
3
 
5
- export declare const not: (x: 0 | 1 | Complex | Matrix) => 0 | 1 | Complex | Matrix;
6
- export declare const and: (...x: (0 | 1 | Complex | Matrix)[]) => 0 | 1 | Complex | Matrix;
7
- export declare const or: (...x: (0 | 1 | Complex | Matrix)[]) => 0 | 1 | Complex | Matrix;
8
- export declare const xor: (...x: (0 | 1 | Complex | Matrix)[]) => 0 | 1 | Complex | Matrix;
9
- export declare const nand: (...x: (0 | 1 | Complex | Matrix)[]) => 0 | 1 | Complex | Matrix;
10
- export declare const nor: (...x: (0 | 1 | Complex | Matrix)[]) => 0 | 1 | Complex | Matrix;
11
- export declare const xnor: (...x: (0 | 1 | Complex | Matrix)[]) => 0 | 1 | Complex | Matrix;
4
+ export type LogicValue = 0 | 1 | Complex | Matrix;
5
+
6
+ /**
7
+ * Logical NOT operation.
8
+ */
9
+ export declare const not: (
10
+ x: LogicValue
11
+ ) => LogicValue;
12
+
13
+ /**
14
+ * Logical AND operation.
15
+ */
16
+ export declare const and: (
17
+ ...x: LogicValue[]
18
+ ) => LogicValue;
19
+
20
+ /**
21
+ * Logical OR operation.
22
+ */
23
+ export declare const or: (
24
+ ...x: LogicValue[]
25
+ ) => LogicValue;
26
+
27
+ /**
28
+ * Logical XOR operation.
29
+ */
30
+ export declare const xor: (
31
+ ...x: LogicValue[]
32
+ ) => LogicValue;
33
+
34
+ /**
35
+ * Logical NAND operation.
36
+ */
37
+ export declare const nand: (
38
+ ...x: LogicValue[]
39
+ ) => LogicValue;
40
+
41
+ /**
42
+ * Logical NOR operation.
43
+ */
44
+ export declare const nor: (
45
+ ...x: LogicValue[]
46
+ ) => LogicValue;
47
+
48
+ /**
49
+ * Logical XNOR operation.
50
+ */
51
+ export declare const xnor: (
52
+ ...x: LogicValue[]
53
+ ) => LogicValue;
@@ -1,4 +1,4 @@
1
- const not = x => {
1
+ export const not = x => {
2
2
  if(x.isComplex?.()) return new x.constructor(not(x.a), not(x.b))
3
3
  if(x.isMatrix?.()) return new x.constructor(x.rows, x.cols, x.arr.flat(1).map(not))
4
4
  return + !x;
@@ -1,87 +1,53 @@
1
- import { Complex } from "../../../src/math/Complex/index.js";
2
- import { Matrix } from "../../../src/math/matrix/index.js";
1
+ type TypedArray =
2
+ | Int8Array
3
+ | Uint8Array
4
+ | Uint8ClampedArray
5
+ | Int16Array
6
+ | Uint16Array
7
+ | Int32Array
8
+ | Uint32Array
9
+ | Float32Array
10
+ | Float64Array
11
+ | BigInt64Array
12
+ | BigUint64Array;
3
13
 
4
14
  /**
5
- * Objects that behave like primitives for mapfun,
6
- * meaning fun(x) is applied directly without recursion.
15
+ * Custom mapped type that recursively applies leaf transformation `R`
16
+ * while strictly maintaining structure (tuples, arrays, sets, maps, objects).
7
17
  */
8
- export interface MapfunPrimitiveLike {
9
- __mapfun__?: boolean;
10
- }
11
-
12
- export type PrimitiveLike =
13
- | number
14
- | boolean
15
- | string
16
- | bigint
17
- | undefined
18
- | null
19
- | { readonly __mapfun__: boolean };
20
-
21
- export type Mappable =
22
- | number
23
- | string
24
- | boolean
25
- | bigint
26
- | undefined
27
- | null
28
- | Matrix
29
- | MapfunPrimitiveLike
30
- | any[]
31
- | Set<any>
32
- | Map<any, any>
33
- | object;
34
-
35
- /**
36
- * mapfun transform rules
37
- */
38
- export type MapfunResult<F extends (x: any) => any, T> =
39
- // Objects with __mapfun__ → treat as primitive (call fun(x))
40
- // T extends MapfunPrimitiveLike
41
- // ? ReturnType<F> :
42
-
43
- // Matrix → always return Matrix (your JS logic rebuilds a new Matrix)
44
-
45
- T extends PrimitiveLike
46
- ? ReturnType<F> :
47
- // T extends Complex
48
- // ? T :
49
- T extends Matrix
50
- ? T :
51
-
52
- // Array → deep-map
18
+ export type MapFunResult<T, R> =
19
+ // 1. Primitive types or explicit mapfun override tag
20
+ T extends number | string | boolean | bigint | symbol | null | undefined | { __mapfun__?: any }
21
+ ? R
22
+ : // 2. Preserve Tuple length and element order precisely
23
+ T extends [infer Head, ...infer Tail]
24
+ ? [MapFunResult<Head, R>, ...MapFunResult<Tail, R>]
25
+ : // 3. Standard homogeneous Arrays
53
26
  T extends Array<infer U>
54
- ? Array<MapfunResult<F, U>> :
55
-
56
- // Set → deep-map
27
+ ? Array<MapFunResult<U, R>>
28
+ : // 4. TypedArray views
29
+ T extends TypedArray
30
+ ? T
31
+ : // 5. Sets
57
32
  T extends Set<infer U>
58
- ? Set<MapfunResult<F, U>> :
59
-
60
- // Map → deep-map values
33
+ ? Set<MapFunResult<U, R>>
34
+ : // 6. Maps
61
35
  T extends Map<infer K, infer V>
62
- ? Map<K, MapfunResult<F, V>> :
63
-
64
- // Other objects → recursively map fields
36
+ ? Map<K, MapFunResult<V, R>>
37
+ : // 7. Matrix objects
38
+ T extends { isMatrix: () => boolean }
39
+ ? T
40
+ : // 8. Plain Objects (preserve property keys)
65
41
  T extends object
66
- ? { [K in keyof T]: MapfunResult<F, T[K]> } :
67
-
68
- // Primitive
69
- ReturnType<F>;
70
-
71
- /**
72
- * If only one argument → return mapped value
73
- * If multiple → return tuple of mapped values
74
- */
75
- type UnwrapSingle<T extends unknown[]> =
76
- T extends [infer U] ? U : { [K in keyof T]: T[K] };
77
-
78
- /**
79
- * mapfun main declaration
80
- */
81
- export declare function mapfun<
82
- F extends (x: any) => any,
83
- A extends Mappable[]
84
- >(
85
- fun: F,
86
- ...values: A
87
- ): UnwrapSingle<{ [K in keyof A]: MapfunResult<F, A[K]> }>;
42
+ ? { [K in keyof T]: MapFunResult<T[K], R> }
43
+ : R;
44
+
45
+ export function mapfun<T, R>(
46
+ fun: (value: any) => R,
47
+ x: T
48
+ ): MapFunResult<T, R>;
49
+
50
+ export function mapfun<T extends any[], R>(
51
+ fun: (value: any) => R,
52
+ ...X: T
53
+ ): { [K in keyof T]: MapFunResult<T[K], R> };
@@ -0,0 +1,162 @@
1
+ // import { Complex } from "../../../src/math/Complex/index.js";
2
+ // import { Matrix } from "../../../src/math/matrix/index.js";
3
+
4
+ // /**
5
+ // * Objects that behave like primitives for mapfun,
6
+ // * meaning fun(x) is applied directly without recursion.
7
+ // */
8
+ // export interface MapfunPrimitiveLike {
9
+ // __mapfun__?: boolean;
10
+ // }
11
+
12
+ // export type PrimitiveLike =
13
+ // | number
14
+ // | boolean
15
+ // | string
16
+ // | bigint
17
+ // | undefined
18
+ // | null
19
+ // | { readonly __mapfun__: boolean };
20
+
21
+ // export type Mappable =
22
+ // | number
23
+ // | string
24
+ // | boolean
25
+ // | bigint
26
+ // | undefined
27
+ // | null
28
+ // | Matrix
29
+ // | MapfunPrimitiveLike
30
+ // | any[]
31
+ // | Set<any>
32
+ // | Map<any, any>
33
+ // | object;
34
+
35
+ // /**
36
+ // * mapfun transform rules
37
+ // */
38
+ // export type MapfunResult<F extends (x: any) => any, T> =
39
+ // // Objects with __mapfun__ → treat as primitive (call fun(x))
40
+ // // T extends MapfunPrimitiveLike
41
+ // // ? ReturnType<F> :
42
+
43
+ // // Matrix → always return Matrix (your JS logic rebuilds a new Matrix)
44
+
45
+ // T extends PrimitiveLike
46
+ // ? ReturnType<F> :
47
+ // // T extends Complex
48
+ // // ? T :
49
+ // T extends Matrix
50
+ // ? T :
51
+
52
+ // // Array → deep-map
53
+ // T extends Array<infer U>
54
+ // ? Array<MapfunResult<F, U>> :
55
+
56
+ // // Set → deep-map
57
+ // T extends Set<infer U>
58
+ // ? Set<MapfunResult<F, U>> :
59
+
60
+ // // Map → deep-map values
61
+ // T extends Map<infer K, infer V>
62
+ // ? Map<K, MapfunResult<F, V>> :
63
+
64
+ // // Other objects → recursively map fields
65
+ // T extends object
66
+ // ? { [K in keyof T]: MapfunResult<F, T[K]> } :
67
+
68
+ // // Primitive
69
+ // ReturnType<F>;
70
+
71
+ // /**
72
+ // * If only one argument → return mapped value
73
+ // * If multiple → return tuple of mapped values
74
+ // */
75
+ // type UnwrapSingle<T extends unknown[]> =
76
+ // T extends [infer U] ? U : { [K in keyof T]: T[K] };
77
+
78
+ // /**
79
+ // * mapfun main declaration
80
+ // */
81
+ // export declare function mapfun<
82
+ // F extends (x: any) => any,
83
+ // A extends Mappable[]
84
+ // >(
85
+ // fun: F,
86
+ // ...values: A
87
+ // ): UnwrapSingle<{ [K in keyof A]: MapfunResult<F, A[K]> }>;
88
+
89
+
90
+ export type Primitive =
91
+ string |
92
+ number |
93
+ boolean |
94
+ bigint |
95
+ symbol |
96
+ null |
97
+ undefined;
98
+
99
+ export interface MapfunCompatible<T = any> {
100
+ __mapfun__?: boolean;
101
+ }
102
+
103
+ export interface ComplexLike {
104
+ isComplex(): boolean;
105
+ }
106
+
107
+ export interface MatrixLike {
108
+ rows: number;
109
+ cols: number;
110
+
111
+ isMatrix(): boolean;
112
+ }
113
+
114
+ export type Mappable<T = any> =
115
+ | T
116
+ | Primitive
117
+ | Mappable<T>[]
118
+ | ArrayLike<T>
119
+ | Set<Mappable<T>>
120
+ | Map<any, Mappable<T>>
121
+ | MapfunCompatible<T>
122
+ | ComplexLike
123
+ | MatrixLike
124
+ | Record<string, Mappable<T>>;
125
+
126
+
127
+ /**
128
+ * Applies a function recursively to values inside
129
+ * arrays, typed arrays, sets, maps, objects,
130
+ * complex values and matrices.
131
+ *
132
+ * @param fun Transformation function.
133
+ * @param X Values to transform.
134
+ *
135
+ * @example
136
+ * mapfun(x => x * 2, [1,2,3])
137
+ * // [2,4,6]
138
+ */
139
+ export declare function mapfun<T, R>(
140
+ fun: (value: T) => R,
141
+ x: Mappable<T>
142
+ ): R;
143
+
144
+ export declare function mapfun<T, R>(
145
+ fun: (value: T) => R,
146
+ x: Mappable<T>,
147
+ ...X: Mappable<T>[]
148
+ ): R[];
149
+
150
+
151
+ /**
152
+ * Applies a function to supported mathematical structures.
153
+ *
154
+ * Handles Complex and Matrix instances specially.
155
+ *
156
+ * @param x Input value.
157
+ * @param fn Transformation function.
158
+ */
159
+ export declare function apply_fun<T, R>(
160
+ x: Mappable<T>,
161
+ fn: (value: T) => R
162
+ ): Mappable<R>;