@sswroom/sswr 1.6.10 → 1.6.12

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/data.js CHANGED
@@ -297,16 +297,46 @@ export function readMUInt24(arr, index)
297
297
  return arr[index + 2] | (arr[index + 1] << 8) | (arr[index + 0] << 16);
298
298
  }
299
299
 
300
+ /**
301
+ * @param {Uint8Array} arr
302
+ * @param {number} index
303
+ * @returns {number}
304
+ */
300
305
  export function readUInt32(arr, index)
301
306
  {
302
307
  return arr[index] | (arr[index + 1] << 8) | (arr[index + 2] << 16) | (arr[index + 3] << 24);
303
308
  }
304
309
 
310
+ /**
311
+ * @param {Uint8Array} arr
312
+ * @param {number} index
313
+ * @returns {number}
314
+ */
305
315
  export function readMUInt32(arr, index)
306
316
  {
307
317
  return arr[index + 3] | (arr[index + 2] << 8) | (arr[index + 1] << 16) | (arr[index + 0] << 24);
308
318
  }
309
319
 
320
+ /**
321
+ * @param {Uint8Array} arr
322
+ * @param {number} index
323
+ * @returns {bigint}
324
+ */
325
+ export function readUInt64(arr, index)
326
+ {
327
+ return BigInt(readUInt32(arr, index)) + (BigInt(readUInt32(arr, index + 4)) << 32n);
328
+ }
329
+
330
+ /**
331
+ * @param {Uint8Array} arr
332
+ * @param {number} index
333
+ * @returns {bigint}
334
+ */
335
+ export function readMUInt64(arr, index)
336
+ {
337
+ return (BigInt(readUInt32(arr, index)) << 32n) + BigInt(readUInt32(arr, index + 4));
338
+ }
339
+
310
340
  export function rol32(v, n)
311
341
  {
312
342
  if (n == 0)
@@ -2524,16 +2554,27 @@ export class ByteReader
2524
2554
  return new Uint8Array(this.getArrayBuffer(ofst, size));
2525
2555
  }
2526
2556
 
2557
+ /**
2558
+ * @param {number} ofst
2559
+ */
2527
2560
  readUInt8(ofst)
2528
2561
  {
2529
2562
  return this.view.getUint8(ofst);
2530
2563
  }
2531
2564
 
2565
+ /**
2566
+ * @param {number} ofst
2567
+ * @param {boolean | undefined} lsb
2568
+ */
2532
2569
  readUInt16(ofst, lsb)
2533
2570
  {
2534
2571
  return this.view.getUint16(ofst, lsb);
2535
2572
  }
2536
2573
 
2574
+ /**
2575
+ * @param {number} ofst
2576
+ * @param {boolean | undefined} lsb
2577
+ */
2537
2578
  readUInt24(ofst, lsb)
2538
2579
  {
2539
2580
  if (lsb)
@@ -2542,21 +2583,45 @@ export class ByteReader
2542
2583
  return (this.view.getUint16(ofst, false) << 8) | this.view.getUint8(ofst + 2);
2543
2584
  }
2544
2585
 
2586
+ /**
2587
+ * @param {number} ofst
2588
+ * @param {boolean | undefined} lsb
2589
+ */
2545
2590
  readUInt32(ofst, lsb)
2546
2591
  {
2547
2592
  return this.view.getUint32(ofst, lsb);
2548
2593
  }
2549
2594
 
2595
+ /**
2596
+ * @param {number} ofst
2597
+ * @param {boolean | undefined} lsb
2598
+ */
2599
+ readUInt64(ofst, lsb)
2600
+ {
2601
+ return this.view.getBigUint64(ofst, lsb);
2602
+ }
2603
+
2604
+ /**
2605
+ * @param {number} ofst
2606
+ */
2550
2607
  readInt8(ofst)
2551
2608
  {
2552
2609
  return this.view.getInt8(ofst);
2553
2610
  }
2554
2611
 
2612
+ /**
2613
+ * @param {number} ofst
2614
+ * @param {boolean | undefined} lsb
2615
+ */
2555
2616
  readInt16(ofst, lsb)
2556
2617
  {
2557
2618
  return this.view.getInt16(ofst, lsb);
2558
2619
  }
2559
2620
 
2621
+ /**
2622
+ * @param {number} ofst
2623
+ * @param {boolean | undefined} lsb
2624
+ */
2560
2625
  readInt24(ofst, lsb)
2561
2626
  {
2562
2627
  if (lsb)
@@ -2565,11 +2630,24 @@ export class ByteReader
2565
2630
  return (this.view.getInt16(ofst, false) << 8) | this.view.getUint8(ofst + 2);
2566
2631
  }
2567
2632
 
2633
+ /**
2634
+ * @param {number} ofst
2635
+ * @param {boolean | undefined} lsb
2636
+ */
2568
2637
  readInt32(ofst, lsb)
2569
2638
  {
2570
2639
  return this.view.getInt32(ofst, lsb);
2571
2640
  }
2572
2641
 
2642
+ /**
2643
+ * @param {number} ofst
2644
+ * @param {boolean | undefined} lsb
2645
+ */
2646
+ readInt64(ofst, lsb)
2647
+ {
2648
+ return this.view.getBigInt64(ofst, lsb);
2649
+ }
2650
+
2573
2651
  readFloat64(ofst, lsb)
2574
2652
  {
2575
2653
  return this.view.getFloat64(ofst, lsb);
@@ -2710,9 +2788,21 @@ export class ByteReader
2710
2788
 
2711
2789
  export class ParsedObject
2712
2790
  {
2791
+ /**
2792
+ * @param {string} sourceName
2793
+ * @param {string} objType
2794
+ */
2713
2795
  constructor(sourceName, objType)
2714
2796
  {
2715
2797
  this.sourceName = sourceName;
2716
2798
  this.objType = objType;
2717
2799
  }
2800
+
2801
+ /**
2802
+ * @param {string} sourceName
2803
+ */
2804
+ setSourceName(sourceName)
2805
+ {
2806
+ this.sourceName = sourceName;
2807
+ }
2718
2808
  }
@@ -0,0 +1,183 @@
1
+ /**
2
+ * The default export of the i18next module is an i18next instance ready to be initialized by calling init. You can create additional instances using the createInstance function.
3
+ *
4
+ * Please read the options page for details on configuration options.
5
+ *
6
+ * The callback will be called after all translations were loaded or with an error when failed (in case of using a backend).
7
+ * @param options
8
+ * @param callback
9
+ */
10
+ export function init(options?: object, callback?: Function): void;
11
+ /**
12
+ * Please have a look at the translation functions like interpolation, formatting and plurals for more details on using it.
13
+ *
14
+ * You can specify either one key as a String or multiple keys as an Array of String. The first one that resolves will be returned.
15
+ */
16
+ export function t(keys: string|string[], options?: object): string;
17
+ /**
18
+ * Uses the same resolve functionality as the t function and returns true if a key exists.
19
+ * @param key
20
+ * @param options
21
+ */
22
+ export function exists(key: string|string[], options?: object): boolean;
23
+ /**
24
+ * Returns a t function that defaults to given language or namespace.
25
+ *
26
+ * All arguments can be optional/null.
27
+ *
28
+ * lng and ns params could be arrays of languages or namespaces and will be treated as fallbacks in that case.
29
+ *
30
+ * The optional keyPrefix will be automatically applied to the returned t function.
31
+ * @param lng
32
+ * @param ns
33
+ * @param keyPrefix
34
+ */
35
+ export function getFixedT(lng?: string|string[]|null, ns?: string|string[]|null, keyPrefix?: string|string[]|null): (keys: string|string[], options?: object) => string;
36
+ /**
37
+ * Changes the language. The callback will be called as soon translations were loaded or an error occurs while loading.
38
+ *
39
+ * Calling changeLanguage without lng uses the language detector to choose the language to set.
40
+ *
41
+ * HINT: For easy testing—setting lng to 'cimode' will cause the t function to always return the key.
42
+ * @param lng
43
+ * @param callback
44
+ */
45
+ export function changeLanguage(lng?: string, callback?: Function): void;
46
+ /**
47
+ * Is set to the current detected or set language.
48
+ *
49
+ * If you need the primary used language depending on your configuration (supportedLngs, load) you will prefer using i18next.resolvedLanguage or i18next.languages[0].
50
+ */
51
+ export let language: string;
52
+ /**
53
+ * Is set to an array of language codes that will be used to look up the translation value.
54
+ *
55
+ * When the language is set, this array is populated with the new language codes. Unless overridden, this array is populated with less-specific versions of that code for fallback purposes, followed by the list of fallback languages.
56
+ */
57
+ export let languages: string[];
58
+ /**
59
+ * Is set to the current resolved language.
60
+ * It can be used as primary used language, for example in a language switcher.
61
+ * @since v21.0.0
62
+ */
63
+ export let resolvedLanguage: string;
64
+ /**
65
+ * Checks if namespace has loaded yet. i.e. used by react-i18next
66
+ * @param ns
67
+ * @param options
68
+ */
69
+ export function hasLoadedNamespace(ns: string, options?: object): boolean;
70
+ /**
71
+ * Loads additional namespaces not defined in init options.
72
+ * @param ns
73
+ * @param callback
74
+ */
75
+ export function loadNamespaces(ns: string, callback?: Function): void;
76
+ /**
77
+ * Loads additional languages not defined in init options (preload).
78
+ * @param lngs
79
+ * @param callback
80
+ */
81
+ export function loadLanguages(lngs: string|string[], callback?: Function): void;
82
+ /**
83
+ * Reloads resources on given state. Optionally you can pass an array of languages and namespaces as params if you don't want to reload all.
84
+ * @param lng
85
+ * @param ns
86
+ * @param callback
87
+ */
88
+ export function reloadResources(lng?: string|string[]|null, ns?: string|string[]|null, callback?: Function): void;
89
+ /**
90
+ * Changes the default namespace.
91
+ * @param ns
92
+ */
93
+ export function setDefaultNamespace(ns: string): void;
94
+ /**
95
+ * Returns rtl or ltr depending on languages read direction.
96
+ * @param lng undefined for current language
97
+ */
98
+ export function dir(lng?: string): string;
99
+ /**
100
+ * @since v8.4.0
101
+ * @deprecated v21.3.0
102
+ * Exposes interpolation.formatt function added on init.
103
+ *
104
+ * For formatting used in translation files checkout the formatting doc.
105
+ * @param data
106
+ * @param format
107
+ * @param lng
108
+ */
109
+ export function format(data: string, format: string, lng?: string): string;
110
+ /**
111
+ * Will return a new i18next instance.
112
+ *
113
+ * Please read the options page for details on configuration options.
114
+ *
115
+ * Providing a callback will automatically call init.
116
+ *
117
+ * The callback will be called after all translations were loaded or with an error when failed (in case of using a backend).
118
+ * @param options
119
+ * @param callback
120
+ */
121
+ export function createInstance(options?: object, callback?: Function): ThisType;
122
+ /**
123
+ * Creates a clone of the current instance. Shares store, plugins and initial configuration. Can be used to create an instance sharing storage but being independent on set language or default namespaces.
124
+ * @param options
125
+ */
126
+ export function cloneInstance(options?: object): ThisType;
127
+ export function on(name: string, callback: Function): void;
128
+ export function off(name: string, callback?: Function): void;
129
+ /**
130
+ * Gets one value by given key.
131
+ * @param lng
132
+ * @param ns
133
+ * @param key
134
+ * @param options
135
+ */
136
+ export function getResource(lng: string, ns: string, key: string, options?: object): string;
137
+ /**
138
+ * Adds one key/value.
139
+ * @param lng
140
+ * @param ns
141
+ * @param key
142
+ * @param value
143
+ * @param options
144
+ */
145
+ export function addResource(lng: string, ns: string, key: string, value: string, options?: object): void;
146
+ /**
147
+ * Adds multiple key/values.
148
+ * @param lng
149
+ * @param ns
150
+ * @param resources
151
+ */
152
+ export function addResources(lng: string, ns: string, resources: any): void;
153
+ /**
154
+ * Adds a complete bundle.
155
+ *
156
+ * Setting deep (default false) param to true will extend existing translations in that file. Setting deep and overwrite (default false) to true it will overwrite existing translations in that file.
157
+ *
158
+ * So omitting deep and overwrite will overwrite all existing translations with the one provided in resources. Using deep you can choose to keep existing nested translation and to overwrite those with the new ones.
159
+ */
160
+ export function addResourceBundle(lng: string, ns: string, resources: any, deep?: boolean, overwrite?: boolean): void;
161
+ /**
162
+ * Checks if a resource bundle exists.
163
+ * @param lng
164
+ * @param ns
165
+ */
166
+ export function hasResourceBundle(lng: string, ns: string): boolean;
167
+ /**
168
+ * Returns a resource data by language.
169
+ * @param lng
170
+ */
171
+ export function getDataByLanguage(lng: string): object;
172
+ /**
173
+ * Returns a resource bundle.
174
+ * @param lng
175
+ * @param ns
176
+ */
177
+ export function getResourceBundle(lng: string, ns: string): object;
178
+ /**
179
+ * Removes an existing bundle.
180
+ * @param lng
181
+ * @param ns
182
+ */
183
+ export function removeResourceBundle(lng: string, ns: string): void;
@@ -0,0 +1,2 @@
1
+ //@ts-ignore
2
+ export default window.i18next;