-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.d.ts
More file actions
1339 lines (1173 loc) · 46.3 KB
/
Copy pathtypes.d.ts
File metadata and controls
1339 lines (1173 loc) · 46.3 KB
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* Is Mobile
* @returns - True if Mobile otherwise False
* @author Joshua Jarman
*/
declare function isMobile(): boolean;
/**
* Atbash Cipher Encrypts or decrypts a given string using the Atabash cipher. Use again to decrypt. Letters and numbers are swapped with their opposites A=Z a=z 0=9 etc.
* @param str - The input string to be transformed.
* @returns - The transformed string after applying the Atabash Cipher.
* @author Joshua Jarman
*/
declare function atbash(str: string): string;
/**
* Encode Base64 Encodes a string to Base64.
* @param str - The input string to encode.
* @returns The Base64-encoded string.
* @author Joshua Jarman
*/
declare function encodeBase64(str: string): string;
/**
* Decode Base64 Decodes a string from Base64.
* @param str - The input string to decode.
* @returns The Base64-decoded string.
* @author Joshua Jarman
*/
declare function decodeBase64(str: string): string;
/**
* Braille Converts a string to or from Braille. Strips all characters not letters, numbers, or common puncuation.
* @param str - The input string to be transformed.
* @param enc - Whether we should encode or decode.
* @returns - The transformed string
* @author Joshua Jarman
*/
declare function brailleConverter(str?: string, enc?: boolean): string;
/**
* Braille Encode Converts a string to Braillee. Strips all characters not letters, numbers, or common punctuation.
* @param str - The input string to be transformed.
* @returns - The transformed string
* @author Joshua Jarman
*/
declare function brailleEncode(str?: string): string;
/**
* Braille Decode Converts a string from Braillee.
* @param str - The input string to be transformed.
* @returns - The transformed string
* @author Joshua Jarman
*/
declare function brailleDecode(str?: string): string;
/**
* Cesars Cipher Encrypts or decrypts a given string using the Caesar cipher. Use the negative of the value used to encrypt to decrypt.
* @param str - The input string to be transformed.
* @param offset - The offset value for the cipher (defaults to 0).
* @returns - The transformed string after applying the Caesar cipher.
* @author Joshua Jarman
*/
declare function ceasarsCipher(str: string, offset?: number): string;
/**
* Generate AES-CBC Encryption Key Generates an AES-CBC key asynchronously.
* @returns The base64-encoded key.
* @author Joshua Jarman
*/
declare function generateAESCBCKey(): Promise<string>;
/**
* Encrypt AES-CBC Encrypts text via AES-CBC encrption asynchronously.
* @param key - The base64-encoded encryption key.
* @param secret - A password
* @param data -The text to encrypt
* @returns - The encrypted text.
* @author Joshua Jarman
*/
declare function encryptAESCBC(key: string, secret: string, data: string): Promise<string>;
/**
* decrypt AES-CBC Decrypts text via AES-GCM encrption asynchronously.
* @param key - The base64-encoded encryption key.
* @param secret - A password
* @param data -The text to decrypt
* @returns - The decrypted text.
* @author Joshua Jarman
*/
declare function decryptAESCBC(key: string, secret: string, data: string): Promise<string>;
/**
* Generate AES-CTR Encryption Key Generates an AES-CTR key asynchronously.
* @returns The base64-encoded key.
* @author Joshua Jarman
*/
declare function generateAESCTRKey(): Promise<string>;
/**
* Encrypt AES-CTR Encrypts text via AES-CTR encrption asynchronously.
* @param key - The base64-encoded encryption key.
* @param secret - A password
* @param data -The text to encrypt
* @returns - The encrypted text.
* @author Joshua Jarman
*/
declare function encryptAESCTR(key: string, secret: string, data: string): Promise<string>;
/**
* decrypt AES-CTR Decrypts text via AES-CTR encrption asynchronously.
* @param key - The base64-encoded encryption key.
* @param secret - A password
* @param data -The text to decrypt
* @returns - The decrypted text.
* @author Joshua Jarman
*/
declare function decryptAESCTR(key: string, secret: string, data: string): Promise<string>;
/**
* Generate AES-GCM Encryption Key Generates an AES-GCM encrption key asynchronously.
* @returns - The base64-encoded key.
* @author Joshua Jarman
*/
declare function generateAESGCMKey(): Promise<string>;
/**
* Encrypt AES-GCM Encrypts text via AES-GCM encrption asynchronously.
* @param key - The base64-encoded encryption key.
* @param secret - A password
* @param data -The text to encrypt
* @returns - The encrypted text.
* @author Joshua Jarman
*/
declare function encryptAESGCM(key: string, secret: string, data: string): Promise<string>;
/**
* decrypt AES-GCM Decrypts text via AES-GCM encrption asynchronously.
* @param key - The base64-encoded encryption key.
* @param secret - A password
* @param data -The text to decrypt
* @returns - The decrypted text.
* @author Joshua Jarman
*/
declare function decryptAESGCM(key: string, secret: string, data: string): Promise<string>;
/**
* Generate RSA-OAEP Private Key Generates an RSA-OAEP key asynchronously for decryption.
* @param length - The key length. Must be at least 1024, if less will be set to 1024 automatically.
* @returns The base64-encoded key.
*/
declare function generateRSAOAEPKeyPrivate(length?: number): Promise<String>;
/**
* Exract RSA-OAEP Public Key Extracts an RSA-OAEP Public Key for encrption from a Private Key.
* @param privateKey - The base64-encoded encryption key.
* @returns - The encrypted text.
* @author Joshua Jarman
*/
declare function extractRSAOAEPKeyPublic(privateKey: string): string;
/**
* Encrypt RSA-OAEP Encrypts text via RSA-OAEP encrption asynchronously.
* @param key - The base64-encoded encryption key.
* @param data -The text to encrypt
* @returns - The encrypted text.
* @author Joshua Jarman
*/
declare function encryptRSAOAEP(key: string, data: string): Promise<string>;
/**
* Decrypt RSA-OAEP Decrypts text via RSA-OAEP encrption asynchronously.
* @param key - The base64-encoded encryption key.
* @param data -The text to decrypt
* @returns - The decrypted text.
* @author Joshua Jarman
*/
declare function decryptRSAOAEP(key: string, data: string): Promise<string>;
/**
* Interleave Interleaves characters from the input.
* @param str - The input string to be interleaved.
* @param segments - The number of segments to create.
* @returns - The interleaved string.
* @author Joshua Jarman
*/
declare function interleave(str?: string, segments?: number): string;
/**
* Deinterlave Deinterleaves characters from the input string.
* @param str - The input string to be deinterleaved.
* @param segments - The number of segments to create.
* @returns - The deinterleaved string.
* @author Joshua Jarman
*/
declare function deinterleave(str?: string, segments?: number): string;
/**
* Processes a block of input data for MD5 hashing.
* @param x - An array of 16 32-bit integers representing the current state.
* @param k - An array of 64 32-bit integers representing the input block.
*/
declare function md5cycle(x: number[], k: number[]): void;
/**
* Performs a common operation on the input values.
* @param q - A number.
* @param a - First operand.
* @param b - Second operand.
* @param x - Third operand.
* @param s - Shift value.
* @param t - Fourth operand.
* @returns - Result of the operation.
*/
declare function cmn(q: number, a: number, b: number, x: number, s: number, t: number): number;
/**
* Applies the FF function to the input values.
* @param a - First operand.
* @param b - Second operand.
* @param c - Third operand.
* @param d - Fourth operand.
* @param x - Fifth operand.
* @param s - Shift value.
* @param t - Sixth operand.
* @returns - Result of the FF function.
*/
declare function ff(a: number, b: number, c: number, d: number, x: number, s: number, t: number): number;
/**
* Applies the GG function to the input values.
* @param a - First operand.
* @param b - Second operand.
* @param c - Third operand.
* @param d - Fourth operand.
* @param x - Fifth operand.
* @param s - Shift value.
* @param t - Sixth operand.
* @returns - Result of the GG function.
*/
declare function gg(a: number, b: number, c: number, d: number, x: number, s: number, t: number): number;
/**
* Applies the HH function to the input values.
* @param a - First operand.
* @param b - Second operand.
* @param c - Third operand.
* @param d - Fourth operand.
* @param x - Fifth operand.
* @param s - Shift value.
* @param t - Sixth operand.
* @returns - Result of the HH function.
*/
declare function hh(a: number, b: number, c: number, d: number, x: number, s: number, t: number): number;
/**
* Applies the II function to the input values.
* @param a - First operand.
* @param b - Second operand.
* @param c - Third operand.
* @param d - Fourth operand.
* @param x - Fifth operand.
* @param s - Shift value.
* @param t - Sixth operand.
* @returns - Result of the II function.
*/
declare function ii(a: number, b: number, c: number, d: number, x: number, s: number, t: number): number;
/**
* Computes the MD5 hash of the input string.
* @param s - The input string.
* @returns - The MD5 hash state (array of four 32-bit integers).
*/
declare function md51(s: string): number[];
/**
* Processes a block of input data for MD5 hashing.
* @param s - The input block (64 characters).
* @returns - An array of 16 32-bit integers representing the processed block.
*/
declare function md5blk(s: string): number[];
/**
* Converts a 32-bit integer to a hexadecimal string.
* @param n - The input integer.
* @returns - The hexadecimal representation.
*/
declare function rhex(n: number): string;
/**
* Converts an array of 32-bit integers to a concatenated hexadecimal string.
* @param x - The array of integers.
* @returns - The concatenated hexadecimal string.
*/
declare function hex(x: number[]): string;
/**
* Computes the MD5 hash of the input string.
* @param str - The input string.
* @returns - The MD5 hash.
*/
declare function md5(str: string): string;
/**
* Adds two 32-bit integers.
* @param a - First operand.
* @param b - Second operand.
* @returns - Sum of the two integers.
*/
declare function add32(a: number, b: number): number;
/**
* Morse Code Converts a string to or from Morse Code. Strips all characters not letters, numbers, or .,?/@ and converts to uppercase.
* @param str - The input string to be transformed.
* @param enc - Whether we should encode or decode.
* @returns - The transformed string
* @author Joshua Jarman
*/
declare function morseCode(str?: string, enc?: boolean): string;
/**
* Morse Code Encode Converts a string to Morse Code. Strips all characters not letters, numbers, or .,?/@ and converts to uppercase.
* @param str - The input string to be transformed.
* @returns - The transformed string
* @author Joshua Jarman
*/
declare function morseCodeEncode(str?: string): string;
/**
* Morse Code Decode Converts a string from Morse Code.
* @param str - The input string to be transformed.
* @returns - The transformed string
* @author Joshua Jarman
*/
declare function morseCodeDecode(str?: string): string;
/**
* Rail Fence Cipher Encrypt Encrypts a string using the Rail Fence Cipher
* @param text - The input string to be ciphered.
* @param key - The number of rails to create.
* @returns - The encrypted message string.
* @author Joshua Jarman
*/
declare function railFenceEncrypt(text?: string, key?: number): string;
/**
* Rail Fence Cipher Decrypt Decrypts a string using the Rail Fence Cipher
* @param cipher - The input string to be unciphered.
* @param key - The number of rails to create.
* @returns - The decrypted message string.
* @author Joshua Jarman
*/
declare function railFenceDecrypt(cipher?: string, key?: number): string;
/**
* ROT13 Encrypts or decrypts letters in a given string using the rot13 cipher. Use again to decrypt.
* @param str - The input string to be transformed.
* @returns - The transformed string after applying the Caesar cipher.
* @author Joshua Jarman
*/
declare function rot13(str: string): string;
/**
* ROT18 Encrypts or decrypts letters and numbers in a given string using the rot18 cipher. Use again to decrypt.
* @param str - The input string to be transformed.
* @returns - The transformed string after applying the Caesar cipher.
* @author Joshua Jarman
*/
declare function rot18(str: string): string;
/**
* ROT47 Encrypts or decrypts all ASCII characters in a given string using the rot47 cipher. Use again to decrypt. Note that the \ character needs to be escaped in the string passed into the fucntion due to limitations with javascript string escaping.
* @param str - The input string to be transformed.
* @returns - The transformed string after applying the Caesar cipher.
* @author Joshua Jarman
*/
declare function rot47(str: string): string;
/**
* ROT5 Encrypts or decrypts numbers in a given string using the rot5 cipher. Use again to decrypt.
* @param str - The input string to be transformed.
* @returns - The transformed string after applying the Caesar cipher.
* @author Joshua Jarman
*/
declare function rot5(str: string): string;
/**
* Shift Key Cipher Encrypt Encrypts a message using the Shift Key Cipher .
* @param str - The input message to be encrypted.
* @param key - The keyword for the Shift Key Cipher .
* @returns The resulting encrypted message.
* @author Joshua Jarman
*/
declare function shiftKeyEncrypt(str: string, key?: string): string;
/**
* Shift Key Cipher Decrypt Encrypts a message using the Shift Key Cipher .
* @param str - The input message to be decrypted.
* @param key - The keyword for the Shift KeyCipher .
* @returns The resulting decrypted message.
* @author Joshua Jarman
*/
declare function shiftKeyDecrypt(str: string, key?: string): string;
/**
* Vigenère Cipher Encrypts or decrypts a message using the Vigenère cipher.
* @param message - The input message to be encrypted or decrypted.
* @param keyword - The keyword for the Vigenère cipher.
* @param shift - The shift value for encryption (positive) or decryption (negative).
* @returns The resulting encrypted or decrypted message.
* @author Joshua Jarman
*/
declare function vigenere(message: string, keyword?: string, shift?: number): string;
/**
* Vigenere Encrypt Encrypts a message using the Vigenère cipher.
* @param message - The input message to be encrypted.
* @param keyword - The keyword for the Vigenère cipher.
* @returns The resulting encrypted message.
* @author Joshua Jarman
*/
declare function vigenereEncrypt(message: string, keyword?: string): string;
/**
* Vigenere Decrypt Decrypts a message using the Vigenère cipher.
* @param message - The input message to be decrypted.
* @param keyword - The keyword for the Vigenère cipher.
* @returns The resulting decrypted message.
* @author Joshua Jarman
*/
declare function vigenereDecrypt(message: string, keyword?: string): string;
/**
* xOR Encodes a string using XOR operation with a given key.
* @param str - The input string to be encoded.
* @param key - The XOR key (default is 51).
* @returns - The encoded string.
* @author Joshua Jarman
*/
declare function xOR(str?: string, key?: number): string;
/**
* xOR Encrypt Encrypts a string using xOR operation with a given key.
* @param input - The input string to be encoded.
* @param key - The XOR key (default is 'TopSecret123!').
* @returns - The encoded string.
* @author Joshua Jarman
*/
declare function xOREncrypt(input?: string, key?: string): string;
/**
* xOR Decrypt Decrypts a string using xOR operation with a given key.
* @param input - The input string to be decoded.
* @param key - The XOR key (default is 'TopSecret123!').
* @returns - The encoded string.
* @author Joshua Jarman
*/
declare function xORDecrypt(input?: string, key?: string): string;
/**
* Queue
* Represents a queue data structure.
*/
declare class Queue {
/**
* Queue Represents a queue data structure.
* @author Joshua Jarman
*/
constructor();
/**
* enqueue Adds an element to the back of the queue.
* @param element - The element to enqueue.
* @returns
*/
enqueue(element: any): void;
/**
* dequeue Removes and returns the front element from the queue.
* @returns - The dequeued element, or undefined if the queue is empty.
*/
dequeue(): any;
/**
* peek Returns the front element without removing it from the queue.
* @returns - The front element, or undefined if the queue is empty.
*/
peek(): any;
/**
* length Gets the current length of the queue.
*/
length: number;
/**
* isEmpty Checks if the queue is empty.
*/
isEmpty: boolean;
}
declare module 'Queue' {
}
/**
* Stack
* Represents a stack data structure.
*/
declare class Stack {
/**
* Stack Represents a stack data structure.
* @author Joshua Jarman
*/
constructor();
/**
* push Adds an element to the top of the stack.
* @param element - The element to push onto the stack.
* @returns
*/
push(element: any): void;
/**
* pop Removes and returns the element from the top of the stack.
* @returns - The element, or undefined if the stack is empty.
*/
pop(): any;
/**
* peek Returns the top element without removing it from the stack.
* @returns - The front element, or undefined if the stack is empty.
*/
peek(): any;
/**
* length Gets the current length of the stack.
*/
length: number;
/**
* isEmpty Checks if the stack is empty.
*/
isEmpty: boolean;
}
declare module 'Stack' {
}
/**
* Babylonian Square Root Calculates the square root of a number using the Babylonian method.
* @param n - The input number.
* @returns - The square root of the input number (rounded to 6 decimal places).
* @author Joshua Jarman
*/
declare function babylonianSquareRoot(n: number): number;
/**
* Circle: Area To Circumference (C = 2√(Aπ))
* @param area - The Area
* @returns - The Circumference
* @author Joshua Jarman
*/
declare function circleAreaToCircumference(area: number): number;
/**
* Area To Diameter (d = 2√(A/π))
* @param area - The Area
* @returns - The Diameter
* @author Joshua Jarman
*/
declare function circleAreaToDiameter(area: number): number;
/**
* Area To Radius (r = √(A/π))
* @param area - The Area
* @returns - The Radius
* @author Joshua Jarman
*/
declare function circleAreaToRadius(area: number): number;
/**
* Circumference To Area (A = π * (C/2π)²) Circumference To Area (A = C²/4π)
* @param circumference - The Circumference
* @returns - The Area
* @author Joshua Jarman
*/
declare function circleCircumferenceToArea(circumference: number): number;
/**
* Circle: Circumference To Diameter (d = C/π)
* @param circumference - The Circumference
* @returns - The Diameter
* @author Joshua Jarman
*/
declare function circleCircumferenceToDiameter(circumference: number): number;
/**
* Circumference To Radius (r = C/2π)
* @param circumference - The Circumference
* @returns - The Radius
* @author Joshua Jarman
*/
declare function circleCircumferenceToRadius(circumference: number): number;
/**
* Diameter To Area (A = πd²/4)
* @param diameter - The Diameter
* @returns - The Area
* @author Joshua Jarman
*/
declare function circleDiameterToArea(diameter: number): number;
/**
* Diameter To Circumference (C = πd)
* @param diameter - The Diameter
* @returns - The Circumference
* @author Joshua Jarman
*/
declare function circleDiameterToCircumference(diameter: number): number;
/**
* Circle: Diameter To Radius (r = d/2)
* @param diameter - The Diameter
* @returns - The Radius
* @author Joshua Jarman
*/
declare function circleDiameterToRadius(diameter: number): number;
/**
* Circle: Radius To Area (A = πr²)
* @param radius - The Radius
* @returns - The Area
* @author Joshua Jarman
*/
declare function circleRadiusToArea(radius: number): number;
/**
* Circle: Radius To Circimfernce (C = 2πr)
* @param radius - The Radius
* @returns - The Circimfernce
* @author Joshua Jarman
*/
declare function circleRadiusToCircumference(radius: number): number;
/**
* Circle: Radius To Diameter (d = 2r)
* @param radius - The Radius
* @returns - The Diameter
* @author Joshua Jarman
*/
declare function circleRadiusToDiameter(radius: number): number;
/**
* Fake Pi Returns Pi up to 1000000 decimal places from proven pi calculation for testing Pi generation functions
* @param n - The number of terms to use.
* @returns - The value of pi as a string.
* @throws - Throws an error if n exceeds 1,000,000.
* @author Joshua Jarman
*/
declare function fakePi(n: number): string;
/**
* Fibonacci Numbers Generates the Fibonacci numbers up to a given limit.
* @param limit - The maximum value for the Fibonacci numbers.
* @returns - An array of Fibonacci numbers.
* @author Joshua Jarman
*/
declare function fibonacciNumbers(limit: number): number[];
/**
* Is Prime Checks if a number is prime
* @param num - the number to check for prime
* @returns - Boolean if prime is true or false
* @author Joshua Jarman
*/
declare function isPrime(num: number): boolean;
/**
* Newtons Square Root Calculates the square root of the number with given tolerance (precision) by using Newton's method.
* @param number - the number we want to find a square root of.
* @param tolerance - how many precise numbers after the floating point we want to get.
* @author Joshua Jarman
*/
declare function newtonsSquareRoot(number: any, tolerance?: any): number;
/**
* Sieve of Eratosthenes Generates an array of prime numbers using the Sieve of Eratosthenes algorithm.
* @param maxNum - The maximum number up to which to find prime numbers.
* @returns - An array containing prime numbers up to 'maxNum'.
* @author Joshua Jarman
*/
declare function sieveOfEratosthenes(maxNum: number): number[];
/**
* Sphere: Circumference to Volume (V = (4/3)π(C/2π)³)
* @param circumference - The Circumference
* @returns - The Volume
* @author Joshua Jarman
*/
declare function sphereCircumferenceToVolume(circumference: number): number;
/**
* Sphere: Diameter to Volume (V = (1/6)πd³)
* @param diameter - The Diameter
* @returns - The Volume
* @author Joshua Jarman
*/
declare function sphereDiameterToVolume(diameter: number): number;
/**
* Sphere: Radius to Volume (V = (4/3)πr³)
* @param radius - The Radius
* @returns - The Volume
* @author Joshua Jarman
*/
declare function sphereRadiusToVolume(radius: number): number;
/**
* Sphere: Volume to Circumference (C = 2π(³√(3V/4π)))
* @param volume - The Volume
* @returns - The Circumference
* @author Joshua Jarman
*/
declare function sphereVolumeToCircumference(volume: number): number;
/**
* Sphere: Volume to Diameter (d = 2(³√(3V/4π)))
* @param volume - The Volume
* @returns - The Diameter
* @author Joshua Jarman
*/
declare function sphereVolumeToDiameter(volume: number): number;
/**
* Sphere: Volume to Radius (r = ³√(3V/4π))
* @param volume - The Volume
* @returns - The Radius
* @author Joshua Jarman
*/
declare function sphereVolumeToRadius(volume: number): number;
/**
* Dijkstra Maze Solver Solves a maze using Dijkstra's algorithm to find the shortest path through a maze, returns -1 if no path can be found.
* @param maze - The maze to be solved, represented as a 2D array of strings.
* @param wallChar - The character that represents a wall in the maze.
* @param startChar - The character that represents the start point in the maze.
* @param endChar - The character that represents the end point in the maze.
* @returns - The path from start to end as an array of coordinates, or -1 if no solution exists.
* @author Joshua Jarman
*/
declare function dijkstraMazeSolver(maze: (string[])[], wallChar: string, startChar: string, endChar: string): (number[])[] | number;
/**
* Twin Crystal Balls Finds the index of the first true value in the array using a jump search approach.
* @param arr - The array to search.
* @returns - The index of the first true value, or -1 if not found.
* @author Joshua Jarman
*/
declare function twinCrystalBalls(arr: boolean[]): number;
/**
* Binary Search Performs binary search on a sorted array to find the index of a target value
* @param arr - The sorted array to search.
* @param target - The value to search for.
* @param start - The starting index for the search (default is 0).
* @param end - The ending index for the search (default is arr.length - 1).
* @returns - The index of the target value, or -1 if not found.
* @author Joshua Jarman
*/
declare function binarySearch(arr: number[], target: number, start?: number, end?: number): number;
/**
* Fibonacci Search Performs a Fibonacci search on a sorted array.
* @param arr - The sorted array to search.
* @param target - The target value to find.
* @returns - The index of the target value, or -1 if not found.
* @author Joshua Jarman
*/
declare function fibonacciSearch(arr: number[], target: number): number;
/**
* Interpolation Search Performs interpolation search on a sorted array to find the index of a target value
* @param arr - The sorted array to search.
* @param target - The value to search for.
* @param start - The starting index for the search (default is 0).
* @param end - The ending index for the search (default is arr.length - 1).
* @returns - The index of the target value, or -1 if not found.
* @author Joshua Jarman
*/
declare function interpolationSearch(arr: number[], target: number, start?: number, end?: number): number;
/**
* Javascript Search Performs default indexOf search on an array to find the index of a target value
* @param arr - The array to search.
* @param target - The value to search for.
* @returns - The index of the first true value, or -1 if not found.
* @author Joshua Jarman
*/
declare function javascriptSearch(arr: any[], target: any): number;
/**
* Jump Search Performs Jump search on a sorted array to find the index of a target value
* @param arr - The array to search.
* @param target - The value to search for.
* @returns - The index of the first true value, or -1 if not found.
* @author Joshua Jarman
*/
declare function jumpSearch(arr: any[], target: any): number;
/**
* Linear Search Performs linear search on a n array to find the index of a target value.
* @param arr - The array to search.
* @param target - The value to search for.
* @returns - The index of the target value, or -1 if not found.
* @author Joshua Jarman
*/
declare function linearSearch(arr: any[], target: any): number;
/**
* Bubble Sort Repeatedly compares adjacent elements and swaps them if they’re in the wrong order.
* @param arr - The array to be sorted.
* @returns - The sorted array.
* @author Joshua Jarman
*/
declare function bubbleSort(arr: number[]): number[];
/**
* Bubble Sort Non Mutating Copies the array and calls Bubble Sort on the copy
* @param arr - The input array to be sorted.
* @returns - A new array containing the sorted elements.
*/
declare function bubbleSortNonMutating(arr: number[]): number[];
/**
* Bucket Sort Non Mutating Distributes elements into buckets and sorts each bucket individually.
* @param arr - The input array to be sorted.
* @param size - The size of each bucket (optional, default is 5).
* @returns - The sorted array.
* @author Joshua Jarman
*/
declare function bucketSortNonMutating(arr: number[], size?: number): number[];
/**
* Bucket Sort Mutates the original array with the results from the Non Mutating Bucket Sort
* @param arr - The input array to be sorted.
* @author Joshua Jarman
*/
declare function bucketSort(arr: any[]): any[];
/**
* Comb Sort Similar to bubble sort but with a larger gap between compared elements, which reduces the number of swaps.
* @param arr - The input array to be sorted.
* @param shrinkFactor - The shrink factor (optional, default is 1.3).
* @returns - A new array containing the sorted elements.
* @author Joshua Jarman
*/
declare function combSort(arr: number[], shrinkFactor?: number): number[];
/**
* Comb Sort Non Mutating Copies the array and calls Comb Sort on the copy
* @param arr - The input array to be sorted.
* @returns - A new array containing the sorted elements.
*/
declare function combSortNonMutating(arr: number[]): number[];
/**
* Counting Sort Non Mutating Suitable for non-negative integers with a limited range.
* @param arr - The input array to be sorted.
* @returns - A new array containing the sorted elements.
* @author Joshua Jarman
*/
declare function countingSortNonMutating(arr: number[]): number[];
/**
* Counting Sort Mutates the original array with the results from the Non Mutating Counting Sort
* @param arr - The input array to be sorted.
* @author Joshua Jarman
*/
declare function countingSort(arr: any[]): any[];
/**
* Cycle Sort Minimizes the number of writes to the array by cyclically rotating elements to their correct positions.
* @param arr - The input array to be sorted.
* @returns - A new array containing the sorted elements.
* @author Joshua Jarman
*/
declare function cycleSort(arr: number[]): number[];
/**
* Cycle Sort Non Mutating Copies the array and calls Cycle Sort on the copy
* @param arr - The input array to be sorted.
* @returns - A new array containing the sorted elements.
*/
declare function cycleSortNonMutating(arr: number[]): number[];
/**
* Gnome Sort Non Mutating. Compare adjacent elements. If they are out of order, swap them. Move the gnome one step backward
* @param arr - The input array to be sorted.
* @returns - A new array containing the sorted elements.
* @author Joshua Jarman
*/
declare function gnomeSort(arr: number[]): number[];
/**
* Gnome Sort Non Mutating Copies the array and calls Gnome Sort on the copy
* @param arr - The input array to be sorted.
* @returns - A new array containing the sorted elements.
*/
declare function gnomeSortNonMutating(arr: number[]): number[];
/**
* Heapify Heapify a subtree rooted at index i.
* @param arr - The input array.
* @param n - Size of the heap.
* @param i - Index of the root of the subtree.
* @returns
* @author Joshua Jarman
*/
declare function heapify(arr: number[], n: number, i: number): void;
/**
* Heap Sort Builds a max heap and repeatedly extracts the maximum element.
* @param arr - The input array.
* @returns - Sorted array.
*/
declare function heapSort(arr: number[]): number[];
/**
* Heap Sort Non Mutating Copies the array and calls Heap Sort on the copy
* @param arr - The input array to be sorted.
* @returns - A new array containing the sorted elements.
*/
declare function heapSortNonMutating(arr: number[]): number[];
/**
* Insertion Sort Builds a sorted array by repeatedly inserting unsorted elements into their correct positions.
* @param arr - The input array to be sorted.
* @returns - A new array containing the sorted elements.
* @author Joshua Jarman
*/
declare function insertionSort(arr: number[]): number[];
/**
* Insertion Sort Non Mutating Copies the array and calls Insertion Sort on the copy
* @param arr - The input array to be sorted.
* @returns - A new array containing the sorted elements.
*/
declare function insertionSortNonMutating(arr: number[]): number[];
/**
* Intro Sort Non Mutating Non Mutating. Sorts an array using a combination of Quick Sort and Heap Sort or Insertion Sort
* @param myArray - The input array to be sorted.
* @author Joshua Jarman
*/
declare function introSortNonMutating(myArray: any[]): any[];
/**
* Intro Sort Mutates the original array with the results from the Non Mutating Intro Sort
* @param arr - The input array to be sorted.
* @author Joshua Jarman
*/
declare function introSort(arr: any[]): any[];
/**
* Javascript Sort Non Mutating Non Mutating. Sorts an array using the built in Javascript Sort algorithm, String-Based Lexicographic Sort with Timsort
* @param myArray - The input array to be sorted.
* @author Joshua Jarman
*/
declare function javascriptSortNonMutating(myArray: any[]): any[];
/**
* Merge Sort Mutates the original array with the results from the Non Mutating Merge Javascript
* @param arr - The input array to be sorted.
* @author Joshua Jarman
*/
declare function javascriptSort(arr: any[]): any[];
/**
* Max Sort Non Mutating Performs a Min sort on a given array
* @param arr - The input array to be sorted.
* @author Joshua Jarman
*/
declare function maxSortNonMutating(arr: any[]): any[];
/**
* Max Sort Mutates the original array with the results from the Non Mutating Max Sort
* @param arr - The input array to be sorted.
* @author Joshua Jarman
*/
declare function maxSort(arr: any[]): any[];
/**
* Merge Sort Non Mutating Divides the array into halves until smallest units reached, and merges them back together in a sorted manner.
* @param arr - The input array to be sorted.
* @returns - A new array containing the sorted elements.
* @author Joshua Jarman
*/
declare function mergeSortNonMutating(arr: number[]): number[];