@bitblit/ratchet-common 4.0.1-alpha

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.
Files changed (108) hide show
  1. package/lib/2d/line-2d.d.ts +5 -0
  2. package/lib/2d/plane-2d.d.ts +6 -0
  3. package/lib/2d/point-2d.d.ts +4 -0
  4. package/lib/2d/poly-line-2d.d.ts +4 -0
  5. package/lib/2d/ratchet-2d.d.ts +37 -0
  6. package/lib/2d/ratchet-2d.spec.d.ts +1 -0
  7. package/lib/build/build-information.d.ts +8 -0
  8. package/lib/build/ratchet-common-info.d.ts +5 -0
  9. package/lib/histogram/histogram-entry.d.ts +4 -0
  10. package/lib/histogram/histogram.d.ts +12 -0
  11. package/lib/histogram/histogram.spec.d.ts +1 -0
  12. package/lib/index.d.ts +73 -0
  13. package/lib/index.mjs +4 -0
  14. package/lib/index.mjs.map +1 -0
  15. package/lib/jwt/common-jwt-token.d.ts +6 -0
  16. package/lib/jwt/expired-jwt-handling.d.ts +5 -0
  17. package/lib/jwt/jwt-ratchet-like.d.ts +15 -0
  18. package/lib/jwt/jwt-ratchet.d.ts +30 -0
  19. package/lib/jwt/jwt-ratchet.spec.d.ts +1 -0
  20. package/lib/jwt/jwt-token-base.d.ts +9 -0
  21. package/lib/lang/array-ratchet.d.ts +14 -0
  22. package/lib/lang/array-ratchet.spec.d.ts +1 -0
  23. package/lib/lang/base64-ratchet.d.ts +10 -0
  24. package/lib/lang/base64-ratchet.spec.d.ts +1 -0
  25. package/lib/lang/boolean-ratchet.d.ts +7 -0
  26. package/lib/lang/boolean-ratchet.spec.d.ts +1 -0
  27. package/lib/lang/composite-last-success-provider.d.ts +7 -0
  28. package/lib/lang/composite-last-success-provider.spec.d.ts +1 -0
  29. package/lib/lang/date-ratchet.d.ts +11 -0
  30. package/lib/lang/date-ratchet.spec.d.ts +1 -0
  31. package/lib/lang/duration-ratchet.d.ts +7 -0
  32. package/lib/lang/duration-ratchet.spec.d.ts +1 -0
  33. package/lib/lang/enum-ratchet.d.ts +5 -0
  34. package/lib/lang/enum-ratchet.spec.d.ts +5 -0
  35. package/lib/lang/error-ratchet.d.ts +6 -0
  36. package/lib/lang/error-ratchet.spec.d.ts +1 -0
  37. package/lib/lang/esm-ratchet.d.ts +4 -0
  38. package/lib/lang/expiring-object.d.ts +20 -0
  39. package/lib/lang/expiring-object.spec.d.ts +1 -0
  40. package/lib/lang/geolocation-ratchet.d.ts +40 -0
  41. package/lib/lang/geolocation-ratchet.spec.d.ts +1 -0
  42. package/lib/lang/global-ratchet.d.ts +6 -0
  43. package/lib/lang/global-ratchet.spec.d.ts +1 -0
  44. package/lib/lang/key-value.d.ts +4 -0
  45. package/lib/lang/last-success-provider.d.ts +3 -0
  46. package/lib/lang/map-ratchet.d.ts +15 -0
  47. package/lib/lang/map-ratchet.spec.d.ts +1 -0
  48. package/lib/lang/no.d.ts +3 -0
  49. package/lib/lang/no.spec.d.ts +1 -0
  50. package/lib/lang/number-ratchet.d.ts +20 -0
  51. package/lib/lang/number-ratchet.spec.d.ts +1 -0
  52. package/lib/lang/parsed-url.d.ts +10 -0
  53. package/lib/lang/promise-ratchet.d.ts +18 -0
  54. package/lib/lang/promise-ratchet.spec.d.ts +1 -0
  55. package/lib/lang/require-ratchet.d.ts +11 -0
  56. package/lib/lang/require-ratchet.spec.d.ts +3 -0
  57. package/lib/lang/stop-watch.d.ts +17 -0
  58. package/lib/lang/string-ratchet.d.ts +28 -0
  59. package/lib/lang/string-ratchet.spec.d.ts +1 -0
  60. package/lib/lang/time-zone-ratchet.d.ts +19 -0
  61. package/lib/lang/time-zone-ratchet.spec.d.ts +1 -0
  62. package/lib/lang/timeout-token.d.ts +9 -0
  63. package/lib/lang/timeout-token.spec.d.ts +1 -0
  64. package/lib/lang/transform-ratchet.d.ts +7 -0
  65. package/lib/lang/transform-ratchet.spec.d.ts +1 -0
  66. package/lib/logger/classic-single-line-log-message-formatter.d.ts +6 -0
  67. package/lib/logger/log-message-builder.d.ts +14 -0
  68. package/lib/logger/log-message-format-type.d.ts +5 -0
  69. package/lib/logger/log-message-formatter.d.ts +5 -0
  70. package/lib/logger/log-message-processor.d.ts +5 -0
  71. package/lib/logger/log-message.d.ts +8 -0
  72. package/lib/logger/log-snapshot.d.ts +5 -0
  73. package/lib/logger/logger-instance.d.ts +46 -0
  74. package/lib/logger/logger-level-name.d.ts +8 -0
  75. package/lib/logger/logger-meta.d.ts +6 -0
  76. package/lib/logger/logger-options.d.ts +13 -0
  77. package/lib/logger/logger-output-function.d.ts +5 -0
  78. package/lib/logger/logger-ring-buffer.d.ts +18 -0
  79. package/lib/logger/logger-util.d.ts +8 -0
  80. package/lib/logger/logger-util.spec.d.ts +1 -0
  81. package/lib/logger/logger.d.ts +43 -0
  82. package/lib/logger/logger.spec.d.ts +1 -0
  83. package/lib/logger/none-log-message-formatter.d.ts +6 -0
  84. package/lib/logger/structured-json-log-message-formatter.d.ts +6 -0
  85. package/lib/network/browser-local-ip-provider.d.ts +7 -0
  86. package/lib/network/browser-local-ip-provider.spec.d.ts +1 -0
  87. package/lib/network/fixed-local-ip-provider.d.ts +6 -0
  88. package/lib/network/local-ip-provider.d.ts +3 -0
  89. package/lib/network/network-ratchet.d.ts +9 -0
  90. package/lib/network/network-ratchet.spec.d.ts +1 -0
  91. package/lib/stream/buffer-writable.d.ts +9 -0
  92. package/lib/stream/multi-stream.d.ts +7 -0
  93. package/lib/stream/stream-ratchet.d.ts +12 -0
  94. package/lib/stream/stream-ratchet.spec.d.ts +1 -0
  95. package/lib/stream/string-writable.d.ts +8 -0
  96. package/lib/stream/string-writable.spec.d.ts +1 -0
  97. package/lib/third-party/google/google-recaptcha-ratchet.d.ts +4 -0
  98. package/lib/third-party/google/google-recaptcha-ratchet.spec.d.ts +1 -0
  99. package/lib/third-party/twilio/twilio-ratchet.d.ts +11 -0
  100. package/lib/transform/built-in-transforms.d.ts +18 -0
  101. package/lib/transform/transform-rule.d.ts +3 -0
  102. package/lib/tx/transaction-configuration.d.ts +7 -0
  103. package/lib/tx/transaction-final-state.d.ts +5 -0
  104. package/lib/tx/transaction-ratchet.d.ts +6 -0
  105. package/lib/tx/transaction-ratchet.spec.d.ts +1 -0
  106. package/lib/tx/transaction-result.d.ts +9 -0
  107. package/lib/tx/transaction-step.d.ts +5 -0
  108. package/package.json +71 -0
@@ -0,0 +1,5 @@
1
+ import { Point2d } from './point-2d.js';
2
+ export interface Line2d {
3
+ p1: Point2d;
4
+ p2: Point2d;
5
+ }
@@ -0,0 +1,6 @@
1
+ export interface Plane2d {
2
+ height: number;
3
+ width: number;
4
+ rightToLeft?: boolean;
5
+ topToBottom?: boolean;
6
+ }
@@ -0,0 +1,4 @@
1
+ export interface Point2d {
2
+ x: number;
3
+ y: number;
4
+ }
@@ -0,0 +1,4 @@
1
+ import { Point2d } from './point-2d.js';
2
+ export interface PolyLine2d {
3
+ pts: Point2d[];
4
+ }
@@ -0,0 +1,37 @@
1
+ import { Point2d } from './point-2d.js';
2
+ import { Plane2d } from './plane-2d.js';
3
+ import { Line2d } from './line-2d.js';
4
+ import { PolyLine2d } from './poly-line-2d.js';
5
+ export declare class Ratchet2d {
6
+ private constructor();
7
+ static translateToOriginVector(points: Point2d[]): Point2d;
8
+ static minimalContainingPlane(points: Point2d[]): Plane2d;
9
+ static scaleVector(src: Plane2d, dst: Plane2d): Point2d;
10
+ static samePoint(p1: Point2d, p2: Point2d): boolean;
11
+ static atLeastOneDimensionShared(p1: Point2d, p2: Point2d): boolean;
12
+ static validPlane(plane: Plane2d): boolean;
13
+ static validLine(line: Line2d): boolean;
14
+ static validLines(lines: Line2d[]): boolean;
15
+ static validPolyLine(pline: PolyLine2d): boolean;
16
+ static polyLineToLines(pline: PolyLine2d): Line2d[];
17
+ static lastPointOnPolyLine(polyLine: PolyLine2d): Point2d;
18
+ static lineToPolyLine(line: Line2d): PolyLine2d;
19
+ static linesToPolyLines(lines: Line2d[]): PolyLine2d[];
20
+ static validPoint(pt: Point2d): boolean;
21
+ static validPoints(pt: Point2d[]): boolean;
22
+ static planeContainsPoint(pt: Point2d, plane: Plane2d): boolean;
23
+ static planeContainsPoints(pt: Point2d[], plane: Plane2d): boolean;
24
+ static linesToPoints(lines: Line2d[]): Point2d[];
25
+ static pointsToLines(points: Point2d[]): Line2d[];
26
+ static rotateRightAboutOrigin90Degrees(points: Point2d[], times?: number): Point2d[];
27
+ static planeContainsLines(lines: Line2d[], plane: Plane2d): boolean;
28
+ static planeContainsPolyLine(pline: PolyLine2d, plane: Plane2d): boolean;
29
+ static planeContainsLine(line: Line2d, plane: Plane2d): boolean;
30
+ static xToY(points: Point2d[]): Point2d[];
31
+ static translate(points: Point2d[], xlate: Point2d): Point2d[];
32
+ static mirrorPointsOnPlane(points: Point2d[], src: Plane2d, mirrorX: boolean, mirrorY: boolean): Point2d[];
33
+ static transformPointsToNewPlane(points: Point2d[], src: Plane2d, dst: Plane2d): Point2d[];
34
+ static transformPointToNewPlane(point: Point2d, src: Plane2d, dst: Plane2d): Point2d;
35
+ static transformLines(lines: Line2d[], src: Plane2d, dst: Plane2d): Line2d[];
36
+ static fitCurve(curveDef: Point2d[], inputX: number): number;
37
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ export interface BuildInformation {
2
+ version?: string;
3
+ hash?: string;
4
+ branch?: string;
5
+ tag?: string;
6
+ timeBuiltISO?: string;
7
+ notes?: string;
8
+ }
@@ -0,0 +1,5 @@
1
+ import { BuildInformation } from './build-information.js';
2
+ export declare class RatchetInfo {
3
+ private constructor();
4
+ static buildInformation(): BuildInformation;
5
+ }
@@ -0,0 +1,4 @@
1
+ export interface HistogramEntry<T> {
2
+ item: T;
3
+ count: number;
4
+ }
@@ -0,0 +1,12 @@
1
+ import { HistogramEntry } from './histogram-entry.js';
2
+ export declare class Histogram<T> {
3
+ private entries;
4
+ update(val: T, addValue?: number): void;
5
+ sort(): void;
6
+ sortKeys(): void;
7
+ reverse(): void;
8
+ getEntries(): HistogramEntry<T>[];
9
+ getTotalCount(): number;
10
+ countForValue(val: T): number;
11
+ percentForValue(val: T): number;
12
+ }
@@ -0,0 +1 @@
1
+ export {};
package/lib/index.d.ts ADDED
@@ -0,0 +1,73 @@
1
+ export * from './2d/line-2d.js';
2
+ export * from './2d/plane-2d.js';
3
+ export * from './2d/point-2d.js';
4
+ export * from './2d/poly-line-2d.js';
5
+ export * from './2d/ratchet-2d.js';
6
+ export * from './build/build-information.js';
7
+ export * from './build/ratchet-common-info.js';
8
+ export * from './histogram/histogram-entry.js';
9
+ export * from './histogram/histogram.js';
10
+ export * from './jwt/common-jwt-token.js';
11
+ export * from './jwt/expired-jwt-handling.js';
12
+ export * from './jwt/jwt-ratchet-like.js';
13
+ export * from './jwt/jwt-ratchet.js';
14
+ export * from './jwt/jwt-token-base.js';
15
+ export * from './lang/array-ratchet.js';
16
+ export * from './lang/base64-ratchet.js';
17
+ export * from './lang/boolean-ratchet.js';
18
+ export * from './lang/composite-last-success-provider.js';
19
+ export * from './lang/date-ratchet.js';
20
+ export * from './lang/duration-ratchet.js';
21
+ export * from './lang/enum-ratchet.js';
22
+ export * from './lang/error-ratchet.js';
23
+ export * from './lang/esm-ratchet.js';
24
+ export * from './lang/expiring-object.js';
25
+ export * from './lang/geolocation-ratchet.js';
26
+ export * from './lang/global-ratchet.js';
27
+ export * from './lang/key-value.js';
28
+ export * from './lang/last-success-provider.js';
29
+ export * from './lang/map-ratchet.js';
30
+ export * from './lang/no.js';
31
+ export * from './lang/number-ratchet.js';
32
+ export * from './lang/parsed-url.js';
33
+ export * from './lang/promise-ratchet.js';
34
+ export * from './lang/require-ratchet.js';
35
+ export * from './lang/stop-watch.js';
36
+ export * from './lang/string-ratchet.js';
37
+ export * from './lang/time-zone-ratchet.js';
38
+ export * from './lang/timeout-token.js';
39
+ export * from './lang/transform-ratchet.js';
40
+ export * from './logger/classic-single-line-log-message-formatter.js';
41
+ export * from './logger/log-message-builder.js';
42
+ export * from './logger/log-message-format-type.js';
43
+ export * from './logger/log-message-formatter.js';
44
+ export * from './logger/log-message-processor.js';
45
+ export * from './logger/log-message.js';
46
+ export * from './logger/log-snapshot.js';
47
+ export * from './logger/logger-instance.js';
48
+ export * from './logger/logger-level-name.js';
49
+ export * from './logger/logger-meta.js';
50
+ export * from './logger/logger-options.js';
51
+ export * from './logger/logger-output-function.js';
52
+ export * from './logger/logger-ring-buffer.js';
53
+ export * from './logger/logger-util.js';
54
+ export * from './logger/logger.js';
55
+ export * from './logger/none-log-message-formatter.js';
56
+ export * from './logger/structured-json-log-message-formatter.js';
57
+ export * from './network/browser-local-ip-provider.js';
58
+ export * from './network/fixed-local-ip-provider.js';
59
+ export * from './network/local-ip-provider.js';
60
+ export * from './network/network-ratchet.js';
61
+ export * from './stream/buffer-writable.js';
62
+ export * from './stream/multi-stream.js';
63
+ export * from './stream/stream-ratchet.js';
64
+ export * from './stream/string-writable.js';
65
+ export * from './third-party/google/google-recaptcha-ratchet.js';
66
+ export * from './third-party/twilio/twilio-ratchet.js';
67
+ export * from './transform/built-in-transforms.js';
68
+ export * from './transform/transform-rule.js';
69
+ export * from './tx/transaction-configuration.js';
70
+ export * from './tx/transaction-final-state.js';
71
+ export * from './tx/transaction-ratchet.js';
72
+ export * from './tx/transaction-result.js';
73
+ export * from './tx/transaction-step.js';