ziko 0.49.2 → 0.49.4

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.
package/dist/ziko.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  /*
3
3
  Project: ziko.js
4
4
  Author: Zakaria Elalaoui
5
- Date : Tue Nov 25 2025 11:09:43 GMT+0100 (UTC+01:00)
5
+ Date : Tue Nov 25 2025 19:12:26 GMT+0100 (UTC+01:00)
6
6
  Git-Repo : https://github.com/zakarialaoui10/ziko.js
7
7
  Git-Wiki : https://github.com/zakarialaoui10/ziko.js/wiki
8
8
  Released under MIT License
@@ -1179,17 +1179,143 @@ const __CACHE__ = {
1179
1179
  }
1180
1180
  };
1181
1181
 
1182
+ class ZikoUseChannel{
1183
+ constructor(name = ""){
1184
+ this.channel = new BroadcastChannel(name);
1185
+ this.EVENTS_DATAS_PAIRS = new Map();
1186
+ this.EVENTS_HANDLERS_PAIRS = new Map();
1187
+ this.LAST_RECEIVED_EVENT = "";
1188
+ this.UUID="ziko-channel"+Random.string(10);
1189
+ this.SUBSCRIBERS = new Set([this.UUID]);
1190
+ }
1191
+ get broadcast(){
1192
+ // update receiver
1193
+ return this;
1194
+ }
1195
+ emit(event, data){
1196
+ this.EVENTS_DATAS_PAIRS.set(event,data);
1197
+ this.#maintainEmit(event);
1198
+ return this;
1199
+ }
1200
+ on(event,handler=console.log){
1201
+ this.EVENTS_HANDLERS_PAIRS.set(event,handler);
1202
+ this.#maintainOn();
1203
+ return this;
1204
+ }
1205
+ #maintainOn(){
1206
+ this.channel.onmessage = (e) => {
1207
+ this.LAST_RECEIVED_EVENT=e.data.last_sended_event;
1208
+ const USER_ID=e.data.userId;
1209
+ this.SUBSCRIBERS.add(USER_ID);
1210
+ const Data=e.data.EVENTS_DATAS_PAIRS.get(this.LAST_RECEIVED_EVENT);
1211
+ const Handler=this.EVENTS_HANDLERS_PAIRS.get(this.LAST_RECEIVED_EVENT);
1212
+ if(Data && Handler)Handler(Data);
1213
+ };
1214
+ return this;
1215
+ }
1216
+ #maintainEmit(event){
1217
+ this.channel.postMessage({
1218
+ EVENTS_DATAS_PAIRS:this.EVENTS_DATAS_PAIRS,
1219
+ last_sended_event:event,
1220
+ userId:this.UUID
1221
+ });
1222
+ return this;
1223
+ }
1224
+ close(){
1225
+ this.channel.close();
1226
+ return this;
1227
+ }
1228
+ }
1229
+ const useChannel = name => new ZikoUseChannel(name);
1230
+
1231
+ // To do : remove old items
1232
+ class ZikoUseStorage{
1233
+ constructor(storage, globalKey, initialValue){
1234
+ this.cache={
1235
+ storage,
1236
+ globalKey,
1237
+ channel:useChannel(`Ziko:useStorage-${globalKey}`),
1238
+ oldItemKeys:new Set()
1239
+ };
1240
+ this.#init(initialValue);
1241
+ this.#maintain();
1242
+ }
1243
+ get items(){
1244
+ return JSON.parse(this.cache.storage[this.cache.globalKey]??null);
1245
+ }
1246
+ #maintain() {
1247
+ for(let i in this.items)Object.assign(this, { [[i]]: this.items[i] });
1248
+ }
1249
+ #init(initialValue){
1250
+ this.cache.channel=useChannel(`Ziko:useStorage-${this.cache.globalKey}`);
1251
+ this.cache.channel.on("Ziko-Storage-Updated",()=>this.#maintain());
1252
+ if(!initialValue)return;
1253
+ if(this.cache.storage[this.cache.globalKey]){
1254
+ Object.keys(this.items).forEach(key=>this.cache.oldItemKeys.add(key));
1255
+ // console.group("Ziko:useStorage")
1256
+ // console.warn(`Storage key '${this.cache.globalKey}' already exists. we will not overwrite it.`);
1257
+ // console.info(`%cWe'll keep the existing data.`,"background-color:#2222dd; color:gold;");
1258
+ // console.group("")
1259
+ }
1260
+ else this.set(initialValue);
1261
+ }
1262
+ set(data){
1263
+ this.cache.storage.setItem(this.cache.globalKey,JSON.stringify(data));
1264
+ this.cache.channel.emit("Ziko-Storage-Updated",{});
1265
+ Object.keys(data).forEach(key=>this.cache.oldItemKeys.add(key));
1266
+ this.#maintain();
1267
+ return this
1268
+ }
1269
+ add(data){
1270
+ const db={
1271
+ ...this.items,
1272
+ ...data
1273
+ };
1274
+ this.cache.storage.setItem(this.cache.globalKey,JSON.stringify(db));
1275
+ this.#maintain();
1276
+ return this;
1277
+ }
1278
+ remove(...keys){
1279
+ const db={...this.items};
1280
+ for(let i=0;i<keys.length;i++){
1281
+ delete db[keys[i]];
1282
+ delete this[keys[i]];
1283
+ }
1284
+ this.set(db);
1285
+ return this;
1286
+ }
1287
+ get(key){
1288
+ return this.items[key];
1289
+ }
1290
+ clear(){
1291
+ this.cache.storage.removeItem(this.cache.globalKey);
1292
+ this.#maintain();
1293
+ return this;
1294
+ }
1295
+
1296
+ }
1297
+ const useLocaleStorage=(key,initialValue)=>new ZikoUseStorage(localStorage,key,initialValue);
1298
+ const useSessionStorage=(key,initialValue)=>new ZikoUseStorage(sessionStorage,key,initialValue);
1299
+
1182
1300
  const __State__ = {
1183
1301
  store : new Map(),
1184
- index : import.meta.hot?.data?.__Ziko__?.__State__?.index ?? 0,
1302
+ index : 0,
1303
+ session_storage : null,
1185
1304
  register: function(state){
1186
- console.log({
1187
- // hmr : import.meta.hot?.data.__Ziko__.__State__.index,
1188
- index : this.index
1189
- });
1305
+ if(!import.meta.env.SSR && import.meta.env.DEV){
1306
+ if(!this.session) this.session_storage = useSessionStorage('ziko-state', {});
1307
+ const savedValue = this.session_storage.get(this.index);
1308
+ if(!savedValue) this.session_storage.add({[this.index] : state.value});
1309
+ else state.value = savedValue;
1310
+ }
1190
1311
  this.store.set(this.index++, state);
1191
- }
1192
-
1312
+ },
1313
+ update: function(index, value){
1314
+ if(!import.meta.env.SSR && import.meta.env.DEV){
1315
+ this.session_storage.add({[index] : value});
1316
+ }
1317
+ },
1318
+
1193
1319
  };
1194
1320
 
1195
1321
  function __init__global__(){
@@ -1447,20 +1573,8 @@ function _register_to_class_(target, mixin) {
1447
1573
 
1448
1574
  if(!globalThis.__Ziko__) __init__global__();
1449
1575
 
1450
- // HMR persistence
1451
- if (import.meta.hot?.data) {
1452
- import.meta.hot.data.__Ziko__ = import.meta.hot.data?.__Ziko__ || globalThis?.__Ziko__;
1453
- globalThis.__Ziko__ = import.meta.hot.data.__Ziko__;
1454
- // import.meta.hot.accept(n=>console.log(n));
1455
- // console.log(import.meta.hot.data.__Ziko__.__State__.store)
1456
- }
1457
-
1458
-
1459
-
1460
1576
  function useState(initialValue) {
1461
-
1462
- // console.log(import.meta.hot.data.__Ziko__.__State__.store.get(0))
1463
-
1577
+
1464
1578
  const {store, index} = __Ziko__.__State__;
1465
1579
  __Ziko__.__State__.register({
1466
1580
  value : initialValue,
@@ -1468,7 +1582,7 @@ function useState(initialValue) {
1468
1582
  paused : false
1469
1583
  });
1470
1584
 
1471
- const current = store.get(index);
1585
+ let current = store.get(index);
1472
1586
 
1473
1587
  function getValue() {
1474
1588
  return {
@@ -1480,10 +1594,13 @@ function useState(initialValue) {
1480
1594
 
1481
1595
  function setValue(newValue) {
1482
1596
  if (current.paused) return;
1483
- if (typeof newValue === "function") newValue = newValue(current.value);
1597
+ if (typeof newValue === "function") {
1598
+ newValue = newValue(current.value);
1599
+ }
1484
1600
  if (newValue !== current.value) {
1485
1601
  current.value = newValue;
1486
1602
  current.subscribers.forEach(fn => fn(current.value));
1603
+ __Ziko__.__State__.update(index, newValue);
1487
1604
  }
1488
1605
  }
1489
1606
 
@@ -4465,6 +4582,7 @@ const throttle=(fn,delay)=>{
4465
4582
  }
4466
4583
  };
4467
4584
 
4585
+ const sleep= ms => new Promise(res => setTimeout(res, ms));
4468
4586
  function timeout(ms, fn) {
4469
4587
  let id;
4470
4588
  const promise = new Promise((resolve) => {
@@ -4481,10 +4599,6 @@ function timeout(ms, fn) {
4481
4599
  };
4482
4600
  }
4483
4601
 
4484
- const sleep= ms => new Promise(res => setTimeout(res, ms));
4485
-
4486
- // use it with await
4487
-
4488
4602
  class TimeLoop {
4489
4603
  constructor(callback, { step = 1000, t0 = 0, t1 = Infinity, autoplay = true } = {}) {
4490
4604
  this.callback = callback;
@@ -5094,55 +5208,6 @@ const useReactive = (nested_value) => mapfun$1(
5094
5208
  nested_value
5095
5209
  );
5096
5210
 
5097
- class ZikoUseChannel{
5098
- constructor(name = ""){
5099
- this.channel = new BroadcastChannel(name);
5100
- this.EVENTS_DATAS_PAIRS = new Map();
5101
- this.EVENTS_HANDLERS_PAIRS = new Map();
5102
- this.LAST_RECEIVED_EVENT = "";
5103
- this.UUID="ziko-channel"+Random.string(10);
5104
- this.SUBSCRIBERS = new Set([this.UUID]);
5105
- }
5106
- get broadcast(){
5107
- // update receiver
5108
- return this;
5109
- }
5110
- emit(event, data){
5111
- this.EVENTS_DATAS_PAIRS.set(event,data);
5112
- this.#maintainEmit(event);
5113
- return this;
5114
- }
5115
- on(event,handler=console.log){
5116
- this.EVENTS_HANDLERS_PAIRS.set(event,handler);
5117
- this.#maintainOn();
5118
- return this;
5119
- }
5120
- #maintainOn(){
5121
- this.channel.onmessage = (e) => {
5122
- this.LAST_RECEIVED_EVENT=e.data.last_sended_event;
5123
- const USER_ID=e.data.userId;
5124
- this.SUBSCRIBERS.add(USER_ID);
5125
- const Data=e.data.EVENTS_DATAS_PAIRS.get(this.LAST_RECEIVED_EVENT);
5126
- const Handler=this.EVENTS_HANDLERS_PAIRS.get(this.LAST_RECEIVED_EVENT);
5127
- if(Data && Handler)Handler(Data);
5128
- };
5129
- return this;
5130
- }
5131
- #maintainEmit(event){
5132
- this.channel.postMessage({
5133
- EVENTS_DATAS_PAIRS:this.EVENTS_DATAS_PAIRS,
5134
- last_sended_event:event,
5135
- userId:this.UUID
5136
- });
5137
- return this;
5138
- }
5139
- close(){
5140
- this.channel.close();
5141
- return this;
5142
- }
5143
- }
5144
- const useChannel = name => new ZikoUseChannel(name);
5145
-
5146
5211
  class ZikoUseThreed {
5147
5212
  #workerContent;
5148
5213
  constructor() {
@@ -5259,75 +5324,6 @@ tags.p("Test useRoot ").style({
5259
5324
 
5260
5325
  */
5261
5326
 
5262
- // To do : remove old items
5263
- class ZikoUseStorage{
5264
- constructor(storage, globalKey, initialValue){
5265
- this.cache={
5266
- storage,
5267
- globalKey,
5268
- channel:useChannel(`Ziko:useStorage-${globalKey}`),
5269
- oldItemKeys:new Set()
5270
- };
5271
- this.#init(initialValue);
5272
- this.#maintain();
5273
- }
5274
- get items(){
5275
- return JSON.parse(this.cache.storage[this.cache.globalKey]??null);
5276
- }
5277
- #maintain() {
5278
- for(let i in this.items)Object.assign(this, { [[i]]: this.items[i] });
5279
- }
5280
- #init(initialValue){
5281
- this.cache.channel=useChannel(`Ziko:useStorage-${this.cache.globalKey}`);
5282
- this.cache.channel.on("Ziko-Storage-Updated",()=>this.#maintain());
5283
- if(!initialValue)return;
5284
- if(this.cache.storage[this.cache.globalKey]){
5285
- Object.keys(this.items).forEach(key=>this.cache.oldItemKeys.add(key));
5286
- console.group("Ziko:useStorage");
5287
- console.warn(`Storage key '${this.cache.globalKey}' already exists. we will not overwrite it.`);
5288
- console.info(`%cWe'll keep the existing data.`,"background-color:#2222dd; color:gold;");
5289
- console.group("");
5290
- }
5291
- else this.set(initialValue);
5292
- }
5293
- set(data){
5294
- this.cache.storage.setItem(this.cache.globalKey,JSON.stringify(data));
5295
- this.cache.channel.emit("Ziko-Storage-Updated",{});
5296
- Object.keys(data).forEach(key=>this.cache.oldItemKeys.add(key));
5297
- this.#maintain();
5298
- return this
5299
- }
5300
- add(data){
5301
- const db={
5302
- ...this.items,
5303
- ...data
5304
- };
5305
- this.cache.storage.setItem(this.cache.globalKey,JSON.stringify(db));
5306
- this.#maintain();
5307
- return this;
5308
- }
5309
- remove(...keys){
5310
- const db={...this.items};
5311
- for(let i=0;i<keys.length;i++){
5312
- delete db[keys[i]];
5313
- delete this[keys[i]];
5314
- }
5315
- this.set(db);
5316
- return this;
5317
- }
5318
- get(key){
5319
- return this.items[key];
5320
- }
5321
- clear(){
5322
- this.cache.storage.removeItem(this.cache.globalKey);
5323
- this.#maintain();
5324
- return this;
5325
- }
5326
-
5327
- }
5328
- const useLocaleStorage=(key,initialValue)=>new ZikoUseStorage(localStorage,key,initialValue);
5329
- const useSessionStorage=(key,initialValue)=>new ZikoUseStorage(sessionStorage,key,initialValue);
5330
-
5331
5327
  let {sqrt, cos, sin, exp, log, cosh, sinh} = Math;
5332
5328
  // Math.abs = new Proxy(Math.abs, {
5333
5329
  // apply(target, thisArg, args) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ziko",
3
- "version": "0.49.2",
3
+ "version": "0.49.4",
4
4
  "description": "A versatile JavaScript library offering a rich set of Hyperscript Based UI components, advanced mathematical utilities, interactivity ,animations, client side routing and more ...",
5
5
  "keywords": [
6
6
  "front-end",
@@ -26,13 +26,13 @@
26
26
  ],
27
27
  "exports": {
28
28
  "./*": {
29
- "import" : "./src/*/index.js",
30
- "types" : "./types/*/index.d.ts"
29
+ "types" : "./types/*/index.d.ts",
30
+ "import" : "./src/*/index.js"
31
31
  },
32
32
  ".": {
33
+ "types" : "./types/index.d.ts",
33
34
  "import": "./dist/ziko.mjs",
34
- "require": "./dist/ziko.cjs",
35
- "types" : "./types/index.d.ts"
35
+ "require": "./dist/ziko.cjs"
36
36
  },
37
37
 
38
38
  "./helpers": {
@@ -1,12 +1,21 @@
1
+ import { useSessionStorage } from '../use/use-storage'
1
2
  export const __State__ = {
2
3
  store : new Map(),
3
- index : import.meta.hot?.data?.__Ziko__?.__State__?.index ?? 0,
4
+ index : 0,
5
+ session_storage : null,
4
6
  register: function(state){
5
- console.log({
6
- // hmr : import.meta.hot?.data.__Ziko__.__State__.index,
7
- index : this.index
8
- })
7
+ if(!import.meta.env.SSR && import.meta.env.DEV){
8
+ if(!this.session) this.session_storage = useSessionStorage('ziko-state', {})
9
+ const savedValue = this.session_storage.get(this.index)
10
+ if(!savedValue) this.session_storage.add({[this.index] : state.value});
11
+ else state.value = savedValue
12
+ }
9
13
  this.store.set(this.index++, state)
10
- }
11
-
14
+ },
15
+ update: function(index, value){
16
+ if(!import.meta.env.SSR && import.meta.env.DEV){
17
+ this.session_storage.add({[index] : value})
18
+ }
19
+ },
20
+
12
21
  }
@@ -1,20 +1,9 @@
1
1
  import { __init__global__ } from "../__ziko__/index.js";
2
- if(!globalThis.__Ziko__) __init__global__()
3
-
4
- // HMR persistence
5
- if (import.meta.hot?.data) {
6
- import.meta.hot.data.__Ziko__ = import.meta.hot.data?.__Ziko__ || globalThis?.__Ziko__;
7
- globalThis.__Ziko__ = import.meta.hot.data.__Ziko__;
8
- // import.meta.hot.accept(n=>console.log(n));
9
- // console.log(import.meta.hot.data.__Ziko__.__State__.store)
10
- }
11
-
12
2
 
3
+ if(!globalThis.__Ziko__) __init__global__()
13
4
 
14
5
  export function useState(initialValue) {
15
-
16
- // console.log(import.meta.hot.data.__Ziko__.__State__.store.get(0))
17
-
6
+
18
7
  const {store, index} = __Ziko__.__State__
19
8
  __Ziko__.__State__.register({
20
9
  value : initialValue,
@@ -22,7 +11,7 @@ export function useState(initialValue) {
22
11
  paused : false
23
12
  })
24
13
 
25
- const current = store.get(index);
14
+ let current = store.get(index);
26
15
 
27
16
  function getValue() {
28
17
  return {
@@ -34,10 +23,13 @@ export function useState(initialValue) {
34
23
 
35
24
  function setValue(newValue) {
36
25
  if (current.paused) return;
37
- if (typeof newValue === "function") newValue = newValue(current.value);
26
+ if (typeof newValue === "function") {
27
+ newValue = newValue(current.value);
28
+ }
38
29
  if (newValue !== current.value) {
39
30
  current.value = newValue;
40
31
  current.subscribers.forEach(fn => fn(current.value));
32
+ __Ziko__.__State__.update(index, newValue)
41
33
  }
42
34
  }
43
35
 
@@ -5,11 +5,6 @@ import {
5
5
  min,
6
6
  max
7
7
  }from "../statistics/index.js";
8
- // import {
9
- // gamma,
10
- // bessel,
11
- // beta
12
- // } from "../calculus/index.js";
13
8
 
14
9
  const abs=(...x)=>mapfun(Math.abs,...x);
15
10
  const sqrt=(...x)=>mapfun(Math.sqrt,...x);
@@ -23,10 +23,10 @@ class ZikoUseStorage{
23
23
  if(!initialValue)return;
24
24
  if(this.cache.storage[this.cache.globalKey]){
25
25
  Object.keys(this.items).forEach(key=>this.cache.oldItemKeys.add(key));
26
- console.group("Ziko:useStorage")
27
- console.warn(`Storage key '${this.cache.globalKey}' already exists. we will not overwrite it.`);
28
- console.info(`%cWe'll keep the existing data.`,"background-color:#2222dd; color:gold;");
29
- console.group("")
26
+ // console.group("Ziko:useStorage")
27
+ // console.warn(`Storage key '${this.cache.globalKey}' already exists. we will not overwrite it.`);
28
+ // console.info(`%cWe'll keep the existing data.`,"background-color:#2222dd; color:gold;");
29
+ // console.group("")
30
30
  }
31
31
  else this.set(initialValue);
32
32
  }
@@ -0,0 +1,140 @@
1
+ import type { Complex } from "../complex/index.js";
2
+ import type { MapfunResult, Mappable } from "../utils/mapfun.js";
3
+
4
+ /* -------------------- MapfunWrap -------------------- */
5
+
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]> };
10
+
11
+
12
+ /* -------------------- mapfun-based simple operators -------------------- */
13
+
14
+ export declare function abs<A extends Mappable[]>(...x: A):
15
+ MapfunWrap<typeof Math.abs, A>;
16
+
17
+ export declare function sqrt<A extends Mappable[]>(...x: A):
18
+ MapfunWrap<typeof Math.sqrt, A>;
19
+
20
+ export declare function e<A extends Mappable[]>(...x: A):
21
+ MapfunWrap<typeof Math.exp, A>;
22
+
23
+ export declare function ln<A extends Mappable[]>(...x: A):
24
+ MapfunWrap<typeof Math.log, A>;
25
+
26
+ /* ---- Fixed-based operators ---- */
27
+
28
+ export declare function cos<A extends Mappable[]>(...x: A):
29
+ MapfunWrap<typeof Math.cos, A>;
30
+
31
+ export declare function sin<A extends Mappable[]>(...x: A):
32
+ MapfunWrap<Math.sin, A>;
33
+
34
+ export declare function tan<A extends Mappable[]>(...x: A):
35
+ MapfunWrap<Math.tan, A>;
36
+
37
+ export declare function sec<A extends Mappable[]>(...x: A):
38
+ MapfunWrap<Math.sec, A>;
39
+
40
+ export declare function sinc<A extends Mappable[]>(...x: A):
41
+ MapfunWrap<Math.sinc, A>;
42
+
43
+ export declare function csc<A extends Mappable[]>(...x: A):
44
+ MapfunWrap<Math.csc, A>;
45
+
46
+ export declare function cot<A extends Mappable[]>(...x: A):
47
+ MapfunWrap<Math.cot, A>;
48
+
49
+ export declare function acos<A extends Mappable[]>(...x: A):
50
+ MapfunWrap<Math.acos, A>;
51
+
52
+ export declare function asin<A extends Mappable[]>(...x: A):
53
+ MapfunWrap<Math.asin, A>;
54
+
55
+ export declare function atan<A extends Mappable[]>(...x: A):
56
+ MapfunWrap<Math.atan, A>;
57
+
58
+ export declare function acot<A extends Mappable[]>(...x: A):
59
+ MapfunWrap<Math.acot, A>;
60
+
61
+ export declare function cosh<A extends Mappable[]>(...x: A):
62
+ MapfunWrap<Math.cosh, A>;
63
+
64
+ export declare function sinh<A extends Mappable[]>(...x: A):
65
+ MapfunWrap<Math.sinh, A>;
66
+
67
+ export declare function tanh<A extends Mappable[]>(...x: A):
68
+ MapfunWrap<Math.tanh, A>;
69
+
70
+ export declare function coth<A extends Mappable[]>(...x: A):
71
+ MapfunWrap<Math.coth, A>;
72
+
73
+ export declare function acosh<A extends Mappable[]>(...x: A):
74
+ MapfunWrap<Math.acosh, A>;
75
+
76
+ export declare function asinh<A extends Mappable[]>(...x: A):
77
+ MapfunWrap<Math.asinh, A>;
78
+
79
+ export declare function atanh<A extends Mappable[]>(...x: A):
80
+ MapfunWrap<Math.atanh, A>;
81
+
82
+ /* ---- Math wrappers ---- */
83
+
84
+ export declare function ceil<A extends Mappable[]>(...x: A):
85
+ MapfunWrap<typeof Math.ceil, A>;
86
+
87
+ export declare function floor<A extends Mappable[]>(...x: A):
88
+ MapfunWrap<typeof Math.floor, A>;
89
+
90
+ export declare function round<A extends Mappable[]>(...x: A):
91
+ MapfunWrap<typeof Math.round, A>;
92
+
93
+ export declare function sign<A extends Mappable[]>(...x: A):
94
+ MapfunWrap<typeof Math.sign, A>;
95
+
96
+ export declare function sig<A extends Mappable[]>(...x: A):
97
+ MapfunWrap<(n: number) => number, A>;
98
+
99
+ export declare function fact<A extends Mappable[]>(...x: A):
100
+ MapfunWrap<(n: number) => number, A>;
101
+
102
+
103
+ /* -------------------- pow -------------------- */
104
+
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;
108
+
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
+
113
+ export declare function pow(x: Mappable[], n: number): any[];
114
+ export declare function pow(x: Mappable[], n: Mappable[]): any[];
115
+
116
+
117
+ /* -------------------- sqrtn -------------------- */
118
+
119
+ export declare function sqrtn(x: number, n: number): number;
120
+ export declare function sqrtn(x: number, n: Mappable): any;
121
+
122
+ export declare function sqrtn(x: Complex, n: number): Complex;
123
+ export declare function sqrtn(x: Complex, n: Mappable): any;
124
+
125
+ export declare function sqrtn(x: Mappable[], n: number): any[];
126
+ export declare function sqrtn(x: Mappable[], n: Mappable[]): any[];
127
+
128
+
129
+ /* -------------------- atan2 -------------------- */
130
+
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[];
135
+
136
+
137
+ /* -------------------- hypot -------------------- */
138
+
139
+ export declare function hypot(...x: number[]): number;
140
+ export declare function hypot(...x: Mappable[]): any;
@@ -1,2 +1,3 @@
1
- export * from "./complex"
2
- export * from './utils'
1
+ export type * from './functions'
2
+ export type * from './complex'
3
+ export type * from './utils'