@tstdl/base 0.91.43 → 0.91.44

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 (42) hide show
  1. package/.eslintrc.json +64 -64
  2. package/collections/awaitable/awaitable-map.d.ts +4 -4
  3. package/collections/awaitable/awaitable-set.d.ts +4 -4
  4. package/collections/keyed-set.d.ts +4 -4
  5. package/collections/observable/observable-map.d.ts +5 -5
  6. package/collections/observable/observable-set.d.ts +4 -4
  7. package/data-structures/array-dictionary.d.ts +3 -3
  8. package/data-structures/circular-buffer.d.ts +1 -1
  9. package/data-structures/collection.d.ts +3 -3
  10. package/data-structures/dictionary.d.ts +7 -7
  11. package/data-structures/distinct-collection.d.ts +5 -5
  12. package/data-structures/iterable-weak-map.d.ts +5 -5
  13. package/data-structures/list.d.ts +24 -24
  14. package/data-structures/list.js +10 -10
  15. package/data-structures/map-dictionary.d.ts +3 -3
  16. package/data-structures/multi-key-map.d.ts +3 -3
  17. package/data-structures/multi-key-set.d.ts +1 -1
  18. package/data-structures/set-collection.d.ts +4 -4
  19. package/data-structures/weak-ref-map.d.ts +5 -5
  20. package/decorators/log.js +0 -1
  21. package/examples/orm/user.model.d.ts +2 -2
  22. package/function/log.js +0 -1
  23. package/injector/decorators.js +1 -1
  24. package/injector/type-info.d.ts +8 -8
  25. package/orm/types.d.ts +5 -3
  26. package/package.json +11 -11
  27. package/pdf/pdf.service.js +9 -4
  28. package/pool/pool.d.ts +1 -1
  29. package/search-index/elastic/model/elastic-query.d.ts +16 -16
  30. package/search-index/elastic/model/index-mapping.d.ts +11 -11
  31. package/search-index/elastic/model/sort.d.ts +4 -4
  32. package/search-index/elastic/query-converter.d.ts +2 -2
  33. package/search-index/elastic/search-index.d.ts +4 -4
  34. package/search-index/elastic/types.d.ts +5 -1
  35. package/serializer/serializer.js +1 -1
  36. package/types.js +1 -1
  37. package/utils/equals.js +0 -1
  38. package/utils/factory-map.d.ts +4 -4
  39. package/utils/helpers.js +0 -1
  40. package/utils/object/forward-ref.js +1 -1
  41. package/utils/type-guards.js +0 -1
  42. package/utils/type-of.js +0 -1
package/.eslintrc.json CHANGED
@@ -25,99 +25,99 @@
25
25
  },
26
26
  "plugins": ["@stylistic"],
27
27
  "rules": {
28
- "camelcase": ["off"],
28
+ "camelcase": "off",
29
29
  "capitalized-comments": ["warn", "always", { "ignorePattern": "noop" }],
30
- "class-methods-use-this": ["off"],
31
- "complexity": ["off"],
32
- "consistent-type-definitions": ["off"],
33
- "eqeqeq": ["off"],
34
- "explicit-function-return-type": ["off"],
35
- "explicit-member-accessibility": ["off"],
30
+ "class-methods-use-this": "off",
31
+ "complexity": "off",
32
+ "consistent-type-definitions": "off",
33
+ "eqeqeq": "off",
34
+ "explicit-function-return-type": "off",
35
+ "explicit-member-accessibility": "off",
36
36
  "func-style": ["warn", "declaration", { "allowArrowFunctions": true }],
37
- "id-length": ["off"],
38
- "init-declarations": ["off"],
39
- "line-comment-position": ["off"],
40
- "max-classes-per-file": ["off"],
37
+ "id-length": "off",
38
+ "init-declarations": "off",
39
+ "line-comment-position": "off",
40
+ "max-classes-per-file": "off",
41
41
  "max-lines-per-function": ["warn", { "max": 100, "skipBlankLines": true, "skipComments": true }],
42
- "max-lines": ["off"],
43
- "max-params": ["off"],
44
- "max-statements": ["off"],
45
- "new-cap": ["off"],
46
- "no-await-in-loop": ["off"],
47
- "no-bitwise": ["off"],
42
+ "max-lines": "off",
43
+ "max-params": "off",
44
+ "max-statements": "off",
45
+ "new-cap": "off",
46
+ "no-await-in-loop": "off",
47
+ "no-bitwise": "off",
48
48
  "no-case-declarations": ["warn"],
49
- "no-confusing-void-expression": ["off"],
49
+ "no-confusing-void-expression": "off",
50
50
  "no-constant-condition": ["warn", { "checkLoops": false }],
51
- "no-continue": ["off"],
52
- "no-duplicate-imports": ["off"],
53
- "no-empty-interface": ["off"],
54
- "no-explicit-any": ["off"],
55
- "no-inferrable-types": ["off"],
56
- "no-inline-comments": ["off"],
57
- "no-magic-numbers": ["off"],
51
+ "no-continue": "off",
52
+ "no-duplicate-imports": "off",
53
+ "no-empty-interface": "off",
54
+ "no-explicit-any": "off",
55
+ "no-inferrable-types": "off",
56
+ "no-inline-comments": "off",
57
+ "no-magic-numbers": "off",
58
58
  "no-negated-condition": ["warn"],
59
- "no-nested-ternary": ["off"],
60
- "no-plusplus": ["off"],
61
- "no-promise-executor-return": ["off"],
62
- "no-restricted-imports": ["off"],
63
- "no-ternary": ["off"],
64
- "no-undefined": ["off"],
65
- "no-underscore-dangle": ["off"],
66
- "no-unnecessary-condition": ["off"],
67
- "no-unused-vars": ["off"],
68
- "no-use-before-define": ["off"],
59
+ "no-nested-ternary": "off",
60
+ "no-plusplus": "off",
61
+ "no-promise-executor-return": "off",
62
+ "no-restricted-imports": "off",
63
+ "no-ternary": "off",
64
+ "no-undefined": "off",
65
+ "no-underscore-dangle": "off",
66
+ "no-unnecessary-condition": "off",
67
+ "no-unused-vars": "off",
68
+ "no-use-before-define": "off",
69
69
  "no-void": ["warn", { "allowAsStatement": true }],
70
70
  "one-var": ["warn", "never"],
71
71
  "prefer-arrow-callback": ["warn"],
72
- "prefer-destructuring": ["off"],
72
+ "prefer-destructuring": "off",
73
73
  "prefer-named-capture-group": ["warn"],
74
- "restrict-template-expressions": ["off"],
74
+ "restrict-template-expressions": "off",
75
75
  "sort-imports": ["off", { "ignoreCase": true }],
76
- "sort-keys": ["off"],
77
- "sort-type-constituents": ["off"],
76
+ "sort-keys": "off",
77
+ "sort-type-constituents": "off",
78
78
 
79
- "@typescript-eslint/ban-types": ["warn"],
80
79
  "@typescript-eslint/class-methods-use-this": ["warn", { "ignoreOverrideMethods": true, "ignoreClassesThatImplementAnInterface": true }],
81
- "@typescript-eslint/consistent-type-definitions": ["off"],
80
+ "@typescript-eslint/consistent-type-definitions": "off",
82
81
  "@typescript-eslint/consistent-type-imports": ["warn", { "prefer": "type-imports", "fixStyle": "inline-type-imports", "disallowTypeAnnotations": false }],
83
82
  "@typescript-eslint/explicit-function-return-type": ["warn", { "allowExpressions": true, "allowFunctionsWithoutTypeParameters": true }],
84
83
  "@typescript-eslint/explicit-member-accessibility": ["warn", { "accessibility": "no-public" }],
85
- "@typescript-eslint/init-declarations": ["off"],
84
+ "@typescript-eslint/init-declarations": "off",
86
85
  "@typescript-eslint/max-params": ["warn", { "max": 5 }],
87
86
  "@typescript-eslint/no-confusing-void-expression": ["warn", { "ignoreArrowShorthand": true, "ignoreVoidOperator": true }],
88
87
  "@typescript-eslint/no-empty-interface": ["warn", { "allowSingleExtends": true }],
89
- "@typescript-eslint/no-explicit-any": ["off"],
88
+ "@typescript-eslint/no-explicit-any": "off",
90
89
  "@typescript-eslint/no-inferrable-types": ["warn", { "ignoreParameters": true, "ignoreProperties": true }],
91
90
  "@typescript-eslint/no-invalid-void-type": ["warn", { "allowInGenericTypeArguments": true }],
92
91
  "@typescript-eslint/no-magic-numbers": ["warn", { "ignoreEnums": true, "ignoreNumericLiteralTypes": true, "ignoreReadonlyClassProperties": true, "ignoreArrayIndexes": true, "ignoreTypeIndexes": true, "ignore": [0, 1, 2, 4, 8, 16, 32, 64, 128, 192, 255, 256, 512, 1024, 2048, 4096, 8192] }],
93
92
  "@typescript-eslint/no-restricted-imports": ["warn"],
94
93
  "@typescript-eslint/no-unnecessary-condition": ["warn", { "allowConstantLoopConditions": true }],
95
- "@typescript-eslint/no-unsafe-assignment": ["off"],
94
+ "@typescript-eslint/no-unsafe-assignment": "off",
95
+ "@typescript-eslint/no-unsafe-type-assertion": "off",
96
96
  "@typescript-eslint/no-unused-vars": ["warn", { "varsIgnorePattern": "^_", "argsIgnorePattern": "^_" }],
97
- "@typescript-eslint/no-use-before-define": ["off"],
98
- "@typescript-eslint/prefer-destructuring": ["off"],
97
+ "@typescript-eslint/no-use-before-define": "off",
98
+ "@typescript-eslint/prefer-destructuring": "off",
99
99
  "@typescript-eslint/restrict-template-expressions": ["warn", { "allowNumber": true, "allowBoolean": true, "allowNullish": true }],
100
- "@typescript-eslint/sort-type-constituents": ["off"],
101
- "@typescript-eslint/method-signature-style": ["off"],
100
+ "@typescript-eslint/sort-type-constituents": "off",
101
+ "@typescript-eslint/method-signature-style": "off",
102
102
 
103
103
  /* deprecated */
104
- "@typescript-eslint/no-non-null-assertion": ["off"],
105
- "@typescript-eslint/prefer-readonly-parameter-types": ["off"],
106
- "@typescript-eslint/explicit-module-boundary-types": ["off"],
104
+ "@typescript-eslint/no-non-null-assertion": "off",
105
+ "@typescript-eslint/prefer-readonly-parameter-types": "off",
106
+ "@typescript-eslint/explicit-module-boundary-types": "off",
107
107
 
108
108
  "@stylistic/brace-style": ["warn", "stroustrup", { "allowSingleLine": true }],
109
- "@stylistic/explicit-module-boundary-types": ["off"],
110
- "@stylistic/newline-per-chained-call": ["off"],
111
- "@stylistic/no-extra-parens": ["off"],
112
- "@stylistic/no-extraneous-class": ["off"],
113
- "@stylistic/no-non-null-assertion": ["off"],
114
- "@stylistic/no-type-alias": ["off"],
115
- "@stylistic/no-unused-vars-experimental": ["off"],
116
- "@stylistic/no-useless-constructor": ["off"],
109
+ "@stylistic/explicit-module-boundary-types": "off",
110
+ "@stylistic/newline-per-chained-call": "off",
111
+ "@stylistic/no-extra-parens": "off",
112
+ "@stylistic/no-extraneous-class": "off",
113
+ "@stylistic/no-non-null-assertion": "off",
114
+ "@stylistic/no-type-alias": "off",
115
+ "@stylistic/no-unused-vars-experimental": "off",
116
+ "@stylistic/no-useless-constructor": "off",
117
117
  "@stylistic/prefer-readonly-parameter-types": ["off", { "checkParameterProperties": false }],
118
- "@stylistic/sort-type-union-intersection-members": ["off"],
118
+ "@stylistic/sort-type-union-intersection-members": "off",
119
119
  "@stylistic/space-before-function-paren": ["warn", { "anonymous": "never", "named": "never", "asyncArrow": "always" }],
120
- "@stylistic/typedef": ["off"],
120
+ "@stylistic/typedef": "off",
121
121
 
122
122
  "import/consistent-type-specifier-style": ["off", "prefer-inline"],
123
123
  "import/newline-after-import": ["warn"],
@@ -149,13 +149,13 @@
149
149
  "@stylistic/quotes": ["warn", "single"],
150
150
  "@stylistic/semi": ["warn", "always"],
151
151
  "@stylistic/multiline-ternary": ["warn", "always-multiline"],
152
- "@stylistic/generator-star-spacing": ["error", {
152
+ "@stylistic/generator-star-spacing": ["warn", {
153
153
  "named": "before",
154
154
  "anonymous": "neither",
155
155
  "method": "before"
156
156
  }],
157
- "@stylistic/indent": ["off"],
158
- "@stylistic/max-len": ["off"],
157
+ "@stylistic/indent": "off",
158
+ "@stylistic/max-len": "off",
159
159
  "@stylistic/object-curly-spacing": ["warn", "always"],
160
160
 
161
161
  "@stylistic/member-delimiter-style": ["warn", {
@@ -11,10 +11,10 @@ export declare class AwaitableMap<K, V> implements Map<K, V> {
11
11
  constructor(backingMap?: Map<K, V>);
12
12
  static from<K, V>(map: Map<K, V>, clone?: boolean): AwaitableMap<K, V>;
13
13
  static fromIterable<K, V>(map: Iterable<[K, V]>): AwaitableMap<K, V>;
14
- [Symbol.iterator](): IterableIterator<[K, V]>;
15
- entries(): IterableIterator<[K, V]>;
16
- keys(): IterableIterator<K>;
17
- values(): IterableIterator<V>;
14
+ [Symbol.iterator](): MapIterator<[K, V]>;
15
+ entries(): MapIterator<[K, V]>;
16
+ keys(): MapIterator<K>;
17
+ values(): MapIterator<V>;
18
18
  clear(): void;
19
19
  delete(key: K): boolean;
20
20
  forEach(callback: (value: V, key: K, map: AwaitableMap<K, V>) => void, thisArg?: any): void;
@@ -21,8 +21,8 @@ export declare class AwaitableSet<T> implements Set<T> {
21
21
  isDisjointFrom(other: ReadonlySetLike<unknown>): boolean;
22
22
  forEach(callback: (value: T, value2: T, set: AwaitableSet<T>) => void, thisArg?: any): void;
23
23
  has(value: T): boolean;
24
- entries(): IterableIterator<[T, T]>;
25
- keys(): IterableIterator<T>;
26
- values(): IterableIterator<T>;
27
- [Symbol.iterator](): IterableIterator<T>;
24
+ entries(): SetIterator<[T, T]>;
25
+ keys(): SetIterator<T>;
26
+ values(): SetIterator<T>;
27
+ [Symbol.iterator](): SetIterator<T>;
28
28
  }
@@ -22,8 +22,8 @@ export declare class KeyedSet<T> implements Set<T> {
22
22
  isDisjointFrom(_other: ReadonlySetLike<unknown>): boolean;
23
23
  forEach(callback: (value: T, value2: T, set: KeyedSet<T>) => void, thisArg?: any): void;
24
24
  has(value: T): boolean;
25
- [Symbol.iterator](): IterableIterator<T>;
26
- entries(): IterableIterator<[T, T]>;
27
- keys(): IterableIterator<T>;
28
- values(): IterableIterator<T>;
25
+ [Symbol.iterator](): SetIterator<T>;
26
+ entries(): SetIterator<[T, T]>;
27
+ keys(): SetIterator<T>;
28
+ values(): SetIterator<T>;
29
29
  }
@@ -1,4 +1,4 @@
1
- import type { Observable } from 'rxjs';
1
+ import { type Observable } from 'rxjs';
2
2
  export declare class ObservableMap<K, V> implements Map<K, V> {
3
3
  private readonly backingMap;
4
4
  private readonly subject;
@@ -12,9 +12,9 @@ export declare class ObservableMap<K, V> implements Map<K, V> {
12
12
  delete(key: K): boolean;
13
13
  forEach(callback: (value: V, key: K, map: ObservableMap<K, V>) => void, thisArg?: any): void;
14
14
  has(key: K): boolean;
15
- entries(): IterableIterator<[K, V]>;
16
- keys(): IterableIterator<K>;
17
- values(): IterableIterator<V>;
18
- [Symbol.iterator](): IterableIterator<[K, V]>;
15
+ entries(): MapIterator<[K, V]>;
16
+ keys(): MapIterator<K>;
17
+ values(): MapIterator<V>;
18
+ [Symbol.iterator](): MapIterator<[K, V]>;
19
19
  private next;
20
20
  }
@@ -22,8 +22,8 @@ export declare class ObservableSet<T> extends ObservableCollectionBase<T, Observ
22
22
  isDisjointFrom(other: ReadonlySetLike<unknown>): boolean;
23
23
  forEach(callback: (value: T, value2: T, set: ObservableSet<T>) => void, thisArg?: any): void;
24
24
  has(value: T): boolean;
25
- entries(): IterableIterator<[T, T]>;
26
- keys(): IterableIterator<T>;
27
- values(): IterableIterator<T>;
28
- [Symbol.iterator](): IterableIterator<T>;
25
+ entries(): SetIterator<[T, T]>;
26
+ keys(): SetIterator<T>;
27
+ values(): SetIterator<T>;
28
+ [Symbol.iterator](): SetIterator<T>;
29
29
  }
@@ -12,9 +12,9 @@ export declare class ArrayDictionary<K, V> extends Dictionary<K, V, ArrayDiction
12
12
  add(item: [K, V]): void;
13
13
  addMany(items: Iterable<readonly [K, V]>): void;
14
14
  clone(): ArrayDictionary<K, V>;
15
- items(): IterableIterator<[K, V]>;
16
- keys(): IterableIterator<K>;
17
- values(): IterableIterator<V>;
15
+ items(): MapIterator<[K, V]>;
16
+ keys(): MapIterator<K>;
17
+ values(): MapIterator<V>;
18
18
  protected _clear(): void;
19
19
  private updateSize;
20
20
  }
@@ -1,7 +1,7 @@
1
1
  import { type Observable } from 'rxjs';
2
2
  import { type CancellationSignal } from '../cancellation/token.js';
3
3
  import { Collection } from './collection.js';
4
- export declare class CircularBuffer<T> extends Collection<T, CircularBuffer<T>> {
4
+ export declare class CircularBuffer<T> extends Collection<T, IterableIterator<T>, CircularBuffer<T>> {
5
5
  private readonly maxBufferSizeSubject;
6
6
  private readonly overflowSubject;
7
7
  private backingArray;
@@ -1,7 +1,7 @@
1
1
  import { type Observable } from 'rxjs';
2
2
  import type { ToJson } from '../interfaces.js';
3
3
  import { type Signal } from '../signals/index.js';
4
- export declare abstract class Collection<T, TThis extends Collection<T, TThis> = Collection<T, any>> implements Iterable<T>, ToJson {
4
+ export declare abstract class Collection<T, TItemsIterator extends IterableIterator<any>, TThis extends Collection<T, TItemsIterator, TThis> = Collection<T, TItemsIterator, any>> implements Iterable<T>, ToJson {
5
5
  private readonly sizeSubject;
6
6
  private readonly changeSubject;
7
7
  private readonly clearSubject;
@@ -39,7 +39,7 @@ export declare abstract class Collection<T, TThis extends Collection<T, TThis> =
39
39
  /** Whether the collection has items */
40
40
  get hasItems(): boolean;
41
41
  constructor();
42
- [Symbol.iterator](): IterableIterator<T>;
42
+ [Symbol.iterator](): TItemsIterator;
43
43
  toArray(): T[];
44
44
  toJSON(): T[];
45
45
  /** Remove all items */
@@ -59,7 +59,7 @@ export declare abstract class Collection<T, TThis extends Collection<T, TThis> =
59
59
  /** Clone collection */
60
60
  abstract clone(): TThis;
61
61
  /** Yields all items from the collection */
62
- abstract items(): IterableIterator<T>;
62
+ abstract items(): TItemsIterator;
63
63
  /** Clear all data - size is set to 0 automatically */
64
64
  protected abstract _clear(): void;
65
65
  }
@@ -1,5 +1,5 @@
1
1
  import { Collection } from './collection.js';
2
- export declare abstract class Dictionary<K, V, TThis extends Dictionary<K, V, TThis> = Dictionary<K, V, any>> extends Collection<[K, V], TThis> {
2
+ export declare abstract class Dictionary<K, V, TThis extends Dictionary<K, V, TThis> = Dictionary<K, V, any>> extends Collection<[K, V], MapIterator<[K, V]>, TThis> {
3
3
  /** Creates a new map and copies the items */
4
4
  toMap(): Map<K, V>;
5
5
  /** Returns an adapter that has the same interface as {@link Map}. No copying of data involved. */
@@ -8,8 +8,8 @@ export declare abstract class Dictionary<K, V, TThis extends Dictionary<K, V, TT
8
8
  abstract get(key: K): V | undefined;
9
9
  abstract set(key: K, value: V): void;
10
10
  abstract delete(key: K): boolean;
11
- abstract keys(): IterableIterator<K>;
12
- abstract values(): IterableIterator<V>;
11
+ abstract keys(): MapIterator<K>;
12
+ abstract values(): MapIterator<V>;
13
13
  }
14
14
  export declare class DictionaryAdapter<K, V> implements Map<K, V> {
15
15
  private readonly dictionary;
@@ -22,8 +22,8 @@ export declare class DictionaryAdapter<K, V> implements Map<K, V> {
22
22
  get(key: K): V | undefined;
23
23
  has(key: K): boolean;
24
24
  set(key: K, value: V): this;
25
- entries(): IterableIterator<[K, V]>;
26
- keys(): IterableIterator<K>;
27
- values(): IterableIterator<V>;
28
- [Symbol.iterator](): IterableIterator<[K, V]>;
25
+ entries(): MapIterator<[K, V]>;
26
+ keys(): MapIterator<K>;
27
+ values(): MapIterator<V>;
28
+ [Symbol.iterator](): MapIterator<[K, V]>;
29
29
  }
@@ -1,5 +1,5 @@
1
1
  import { Collection } from './collection.js';
2
- export declare abstract class DistinctCollection<T, TThis extends DistinctCollection<T, TThis> = DistinctCollection<T, any>> extends Collection<T, TThis> {
2
+ export declare abstract class DistinctCollection<T, TThis extends DistinctCollection<T, TThis> = DistinctCollection<T, any>> extends Collection<T, SetIterator<T>, TThis> {
3
3
  /** Creates a new set and copies the items */
4
4
  toSet(): Set<T>;
5
5
  /** Returns an adapter that has the same interface as {@link Set}. No copying of data involved. */
@@ -26,8 +26,8 @@ export declare class SetAdapter<T> implements Set<T> {
26
26
  isDisjointFrom(other: ReadonlySetLike<unknown>): boolean;
27
27
  forEach(callbackfn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any): void;
28
28
  has(value: T): boolean;
29
- entries(): IterableIterator<[T, T]>;
30
- keys(): IterableIterator<T>;
31
- values(): IterableIterator<T>;
32
- [Symbol.iterator](): IterableIterator<T>;
29
+ entries(): SetIterator<[T, T]>;
30
+ keys(): SetIterator<T>;
31
+ values(): SetIterator<T>;
32
+ [Symbol.iterator](): SetIterator<T>;
33
33
  }
@@ -1,5 +1,5 @@
1
1
  import { Collection } from './collection.js';
2
- export declare class IterableWeakMap<K extends object, V> extends Collection<[K, V], IterableWeakMap<K, V>> implements Map<K, V> {
2
+ export declare class IterableWeakMap<K extends object, V> extends Collection<[K, V], MapIterator<[K, V]>, IterableWeakMap<K, V>> implements Map<K, V> {
3
3
  private weakMap;
4
4
  private refMap;
5
5
  private finalizationRegistry;
@@ -21,10 +21,10 @@ export declare class IterableWeakMap<K extends object, V> extends Collection<[K,
21
21
  cleanup(): void;
22
22
  clone(): IterableWeakMap<K, V>;
23
23
  forEach(callback: (value: V, key: K, map: IterableWeakMap<K, V>) => void, thisArg?: any): void;
24
- entries(): IterableIterator<[K, V]>;
25
- keys(): IterableIterator<K>;
26
- values(): IterableIterator<V>;
27
- items(): IterableIterator<[K, V]>;
24
+ entries(): MapIterator<[K, V]>;
25
+ keys(): MapIterator<K>;
26
+ values(): MapIterator<V>;
27
+ items(): MapIterator<[K, V]>;
28
28
  protected _clear(): void;
29
29
  private updateSize;
30
30
  }
@@ -1,76 +1,76 @@
1
1
  import type { Predicate } from '../utils/iterable-helpers/types.js';
2
2
  import { Collection } from './collection.js';
3
- export declare abstract class List<T, TThis extends Collection<T, TThis>> extends Collection<T, TThis> {
4
- /** get item at index */
3
+ export declare abstract class List<T, TThis extends Collection<T, IterableIterator<T>, TThis>> extends Collection<T, IterableIterator<T>, TThis> {
4
+ /** Get item at index */
5
5
  at(index: number): T;
6
6
  /**
7
- * find index of first occurrence of item
7
+ * Find index of first occurrence of item
8
8
  * @param item item to search for
9
9
  * @param fromIndex index to start search at
10
10
  */
11
11
  indexOf(item: T, fromIndex?: number): number | undefined;
12
- /** index of item (last occurrence) */
12
+ /** Index of item (last occurrence) */
13
13
  /**
14
- * find index of last occurrence of item
14
+ * Find index of last occurrence of item
15
15
  * @param item item to search for
16
16
  * @param fromIndex index to start from (backwards)
17
17
  */
18
18
  lastIndexOf(item: T, fromIndex?: number): number | undefined;
19
- /** set item at index */
19
+ /** Set item at index */
20
20
  set(index: number, item: T): void;
21
- /** remove item at index */
21
+ /** Remove item at index */
22
22
  removeAt(index: number): T;
23
- /** remove first item */
23
+ /** Remove first item */
24
24
  removeFirst(): T;
25
- /** remove last item */
25
+ /** Remove last item */
26
26
  removeLast(): T;
27
27
  /**
28
- * remove many items at index
28
+ * Remove many items at index
29
29
  * @param index index to start removing at
30
30
  * @param count how many items to remove. If not defined, all items starting at `index` are removed
31
31
  */
32
32
  removeManyAt(index: number, count?: number): T[];
33
33
  /**
34
- * remove range of items at `fromIndex` to `toIndex`
34
+ * Remove range of items at `fromIndex` to `toIndex`
35
35
  * @param fromIndex index to start removing at
36
36
  * @param toIndex index to remove to
37
37
  */
38
38
  removeRange(fromIndex: number, toIndex: number): T[];
39
39
  protected ensureBounds(index: number, count?: number): void;
40
40
  protected normalizeIndex(index: number): number;
41
- /** yields all items from the list in reverse */
41
+ /** Yields all items from the list in reverse */
42
42
  abstract itemsReverse(): IterableIterator<T>;
43
- /** get item at index */
43
+ /** Get item at index */
44
44
  protected abstract _at(index: number): T;
45
45
  /**
46
- * find index of first occurrence of item
46
+ * Find index of first occurrence of item
47
47
  * @param item item to search for
48
48
  * @param fromIndex index to start search at
49
49
  */
50
50
  protected abstract _indexOf(item: T, fromIndex?: number): number | undefined;
51
- /** index of match (first occurrence) */
51
+ /** Index of match (first occurrence) */
52
52
  protected abstract findIndex(predicate: Predicate<T>): number | undefined;
53
- /** index of item (last occurrence) */
53
+ /** Index of item (last occurrence) */
54
54
  /**
55
- * find index of last occurrence of item
55
+ * Find index of last occurrence of item
56
56
  * @param item item to search for
57
57
  * @param fromIndex index to start from (backwards)
58
58
  */
59
59
  protected abstract _lastIndexOf(item: T, fromIndex?: number): number | undefined;
60
- /** index of match (last occurrence) */
60
+ /** Index of match (last occurrence) */
61
61
  protected abstract findLastIndex(predicate: Predicate<T>): number | undefined;
62
- /** set item at index */
62
+ /** Set item at index */
63
63
  protected abstract _set(index: number, item: T): void;
64
- /** add item to start of list */
64
+ /** Add item to start of list */
65
65
  protected abstract prepend(item: T): void;
66
- /** add many items to start of list */
66
+ /** Add many items to start of list */
67
67
  protected abstract prependMany(items: Iterable<T>): void;
68
- /** remove item */
68
+ /** Remove item */
69
69
  protected abstract remove(item: T): boolean;
70
- /** remove item at index */
70
+ /** Remove item at index */
71
71
  protected abstract _removeAt(index: number): T;
72
72
  /**
73
- * remove many items at index
73
+ * Remove many items at index
74
74
  * @param index index to start removing at
75
75
  * @param count how many items to remove. If not defined, all items starting at `index` are removed
76
76
  */
@@ -2,51 +2,51 @@ import { isDefined } from '../utils/type-guards.js';
2
2
  import { Collection } from './collection.js';
3
3
  import { IndexOutOfBoundsError } from './index-out-of-bounds.error.js';
4
4
  export class List extends Collection {
5
- /** get item at index */
5
+ /** Get item at index */
6
6
  at(index) {
7
7
  const normalizedIndex = this.normalizeIndex(index);
8
8
  this.ensureBounds(normalizedIndex);
9
9
  return this._at(normalizedIndex);
10
10
  }
11
11
  /**
12
- * find index of first occurrence of item
12
+ * Find index of first occurrence of item
13
13
  * @param item item to search for
14
14
  * @param fromIndex index to start search at
15
15
  */
16
16
  indexOf(item, fromIndex) {
17
17
  return this._indexOf(item, isDefined(fromIndex) ? this.normalizeIndex(fromIndex) : fromIndex);
18
18
  }
19
- /** index of item (last occurrence) */
19
+ /** Index of item (last occurrence) */
20
20
  /**
21
- * find index of last occurrence of item
21
+ * Find index of last occurrence of item
22
22
  * @param item item to search for
23
23
  * @param fromIndex index to start from (backwards)
24
24
  */
25
25
  lastIndexOf(item, fromIndex) {
26
26
  return this._lastIndexOf(item, isDefined(fromIndex) ? this.normalizeIndex(fromIndex) : fromIndex);
27
27
  }
28
- /** set item at index */
28
+ /** Set item at index */
29
29
  set(index, item) {
30
30
  const normalizedIndex = this.normalizeIndex(index);
31
31
  this.ensureBounds(normalizedIndex);
32
32
  this._set(normalizedIndex, item);
33
33
  }
34
- /** remove item at index */
34
+ /** Remove item at index */
35
35
  removeAt(index) {
36
36
  const normalizedIndex = this.normalizeIndex(index);
37
37
  this.ensureBounds(normalizedIndex);
38
38
  return this._removeAt(normalizedIndex);
39
39
  }
40
- /** remove first item */
40
+ /** Remove first item */
41
41
  removeFirst() {
42
42
  return this.removeAt(0);
43
43
  }
44
- /** remove last item */
44
+ /** Remove last item */
45
45
  removeLast() {
46
46
  return this.removeAt(-1);
47
47
  }
48
48
  /**
49
- * remove many items at index
49
+ * Remove many items at index
50
50
  * @param index index to start removing at
51
51
  * @param count how many items to remove. If not defined, all items starting at `index` are removed
52
52
  */
@@ -56,7 +56,7 @@ export class List extends Collection {
56
56
  return this._removeManyAt(normalizedIndex, count);
57
57
  }
58
58
  /**
59
- * remove range of items at `fromIndex` to `toIndex`
59
+ * Remove range of items at `fromIndex` to `toIndex`
60
60
  * @param fromIndex index to start removing at
61
61
  * @param toIndex index to remove to
62
62
  */
@@ -11,9 +11,9 @@ export declare class MapDictionary<K, V> extends Dictionary<K, V, MapDictionary<
11
11
  add(item: [K, V]): void;
12
12
  addMany(items: Iterable<readonly [K, V]>): void;
13
13
  clone(): MapDictionary<K, V>;
14
- items(): IterableIterator<[K, V]>;
15
- keys(): IterableIterator<K>;
16
- values(): IterableIterator<V>;
14
+ items(): MapIterator<[K, V]>;
15
+ keys(): MapIterator<K>;
16
+ values(): MapIterator<V>;
17
17
  protected _clear(): void;
18
18
  private updateSize;
19
19
  }
@@ -24,9 +24,9 @@ export declare class MultiKeyMap<K extends any[], V> extends Dictionary<K, V, Mu
24
24
  deleteFlat(...key: K): boolean;
25
25
  delete(key: K): boolean;
26
26
  clone(): MultiKeyMap<K, V>;
27
- keys(): IterableIterator<K>;
28
- values(): IterableIterator<V>;
29
- items(): IterableIterator<[K, V]>;
27
+ keys(): MapIterator<K>;
28
+ values(): MapIterator<V>;
29
+ items(): MapIterator<[K, V]>;
30
30
  protected _clear(): void;
31
31
  private getNode;
32
32
  private deleteNodeIfEmpty;
@@ -13,7 +13,7 @@ export declare class MultiKeySet<T extends any[]> extends DistinctCollection<T>
13
13
  deleteFlat(...value: T): boolean;
14
14
  delete(value: T): boolean;
15
15
  clone(): MultiKeySet<T>;
16
- items(): IterableIterator<T>;
16
+ items(): SetIterator<T>;
17
17
  protected _clear(): void;
18
18
  protected _getBackingSet(): ReadonlySet<T> | undefined;
19
19
  private updateSize;
@@ -8,7 +8,7 @@ export declare class SetCollection<T> extends DistinctCollection<T, SetCollectio
8
8
  add(item: T): this;
9
9
  addMany(items: Iterable<T>): void;
10
10
  clone(): SetCollection<T>;
11
- items(): IterableIterator<T>;
11
+ items(): SetIterator<T>;
12
12
  delete(item: T): boolean;
13
13
  union<U>(other: ReadonlySetLike<U>): SetCollection<T | U>;
14
14
  intersection<U>(other: ReadonlySetLike<U>): SetCollection<T & U>;
@@ -19,9 +19,9 @@ export declare class SetCollection<T> extends DistinctCollection<T, SetCollectio
19
19
  isDisjointFrom(other: ReadonlySetLike<unknown>): boolean;
20
20
  forEach(callbackfn: (value: T, value2: T, set: globalThis.Set<T>) => void, thisArg?: any): void;
21
21
  has(item: T): boolean;
22
- entries(): IterableIterator<[T, T]>;
23
- keys(): IterableIterator<T>;
24
- values(): IterableIterator<T>;
22
+ entries(): SetIterator<[T, T]>;
23
+ keys(): SetIterator<T>;
24
+ values(): SetIterator<T>;
25
25
  protected _clear(): void;
26
26
  protected _getBackingSet(): ReadonlySet<T> | undefined;
27
27
  private updateSize;
@@ -1,5 +1,5 @@
1
1
  import { Collection } from './collection.js';
2
- export declare class WeakRefMap<K, V extends object> extends Collection<[K, V], WeakRefMap<K, V>> implements Map<K, V> {
2
+ export declare class WeakRefMap<K, V extends object> extends Collection<[K, V], MapIterator<[K, V]>, WeakRefMap<K, V>> implements Map<K, V> {
3
3
  private readonly backingMapProvider;
4
4
  private backingMap;
5
5
  private finalizationRegistry;
@@ -21,9 +21,9 @@ export declare class WeakRefMap<K, V extends object> extends Collection<[K, V],
21
21
  cleanup(): void;
22
22
  clone(): WeakRefMap<K, V>;
23
23
  forEach(callback: (value: V, key: K, map: WeakRefMap<K, V>) => void, thisArg?: any): void;
24
- entries(): IterableIterator<[K, V]>;
25
- keys(): IterableIterator<K>;
26
- values(): IterableIterator<V>;
27
- items(): IterableIterator<[K, V]>;
24
+ entries(): MapIterator<[K, V]>;
25
+ keys(): MapIterator<K>;
26
+ values(): MapIterator<V>;
27
+ items(): MapIterator<[K, V]>;
28
28
  protected _clear(): void;
29
29
  }
package/decorators/log.js CHANGED
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/ban-types */
2
1
  import { wrapLog } from '../function/log.js';
3
2
  import { createDecorator } from '../reflection/utils.js';
4
3
  import { objectKeys } from '../utils/object/object.js';
@@ -1,4 +1,4 @@
1
- import { Entity, Integer } from '../../orm/index.js';
1
+ import { Entity, Enum, Integer } from '../../orm/index.js';
2
2
  export declare enum Foo {
3
3
  Bar = 0,
4
4
  Baz = 1
@@ -10,5 +10,5 @@ export declare class User extends Entity {
10
10
  age: Integer | null;
11
11
  hasAge: boolean;
12
12
  mail: string;
13
- foo: Foo;
13
+ foo: Enum<typeof Foo>;
14
14
  }
package/function/log.js CHANGED
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/ban-types */
2
1
  import { isArray, isPrimitive, isString } from '../utils/type-guards.js';
3
2
  import { typeOf } from '../utils/type-of.js';
4
3
  export function wrapLog(fn, { fnName = fn.name, logResult = true, logger, trace = false } = {}) {
@@ -1,4 +1,4 @@
1
- /* eslint-disable @typescript-eslint/ban-types, @typescript-eslint/naming-convention */
1
+ /* eslint-disable @typescript-eslint/naming-convention */
2
2
  import { createClassDecorator, createDecorator } from '../reflection/index.js';
3
3
  import { toArray } from '../utils/array/array.js';
4
4
  import { isDefined, isFunction } from '../utils/type-guards.js';
@@ -2,21 +2,21 @@ import type { ForwardRefTypeHint } from '../utils/object/forward-ref.js';
2
2
  import type { InjectionToken } from './token.js';
3
3
  import type { ArgumentProvider, ForwardRefInjectionToken, Mapper } from './types.js';
4
4
  export type InjectMetadata = {
5
- /** token overwrite by inject decorator */
5
+ /** Token overwrite by inject decorator */
6
6
  injectToken?: InjectionToken;
7
- /** if defined, resolve the token or ForwardRefToken using ForwardRef strategy instead of resolving the token directly */
7
+ /** If defined, resolve the token or ForwardRefToken using ForwardRef strategy instead of resolving the token directly */
8
8
  forwardRef?: boolean | ForwardRefInjectionToken;
9
9
  forwardRefTypeHint?: ForwardRefTypeHint;
10
- /** whether injection is optional if token is not registered. Set by optional decorator */
10
+ /** Whether injection is optional if token is not registered. Set by optional decorator */
11
11
  optional?: boolean;
12
- /** whether injection should resolve all providers */
12
+ /** Whether injection should resolve all providers */
13
13
  resolveAll?: boolean;
14
- /** mapper to map resolved value */
14
+ /** Mapper to map resolved value */
15
15
  mapper?: Mapper;
16
- /** provider to get resolve argument */
16
+ /** Provider to get resolve argument */
17
17
  resolveArgumentProvider?: ArgumentProvider;
18
- /** if defined, map the resolve argument and use the returned value as the value to inject */
18
+ /** If defined, map the resolve argument and use the returned value as the value to inject */
19
19
  injectArgumentMapper?: Mapper;
20
- /** if defined, use the provided argument, map it and pass it to the resolution of the token */
20
+ /** If defined, use the provided argument, map it and pass it to the resolution of the token */
21
21
  forwardArgumentMapper?: Mapper;
22
22
  };
package/orm/types.d.ts CHANGED
@@ -1,19 +1,21 @@
1
1
  import type { HasDefault as DrizzleHasDefault, IsPrimaryKey as DrizzleIsPrimaryKey } from 'drizzle-orm';
2
- import type { boolean, doublePrecision, integer, PgColumnBuilder, PgColumnBuilderBase, text, uuid } from 'drizzle-orm/pg-core';
2
+ import type { boolean, doublePrecision, integer, PgColumnBuilder, PgColumnBuilderBase, PgEnumColumnBuilderInitial, text, uuid } from 'drizzle-orm/pg-core';
3
3
  import type { GetTagMetadata, Tagged, UnwrapTagged } from 'type-fest';
4
4
  import { Array, Integer } from '../schema/index.js';
5
- import type { ObjectLiteral, Record } from '../types.js';
5
+ import type { EnumerationObject, EnumerationValue, ObjectLiteral, Record, UnionToTuple } from '../types.js';
6
6
  import { Uuid } from './schemas/index.js';
7
7
  export type IsPrimaryKey<T> = T extends Tagged<unknown, 'column', PgColumnBuilderBase> ? Tagged<UnwrapTagged<T>, 'column', DrizzleIsPrimaryKey<GetTagMetadata<T, 'column'>>> : Tagged<T, 'column', ColumnBuilder<T>>;
8
8
  export type HasDefault<T> = T extends Tagged<unknown, 'column', PgColumnBuilderBase> ? Tagged<UnwrapTagged<T>, 'column', DrizzleHasDefault<GetTagMetadata<T, 'column'>>> : Tagged<T, 'column', ColumnBuilder<T>>;
9
9
  export type Nested<T extends Record> = Tagged<T, 'column', {
10
10
  nested: T;
11
11
  }>;
12
- export type ColumnBuilder<T, ColumnName extends string = never> = T extends Tagged<T, 'column', any> ? GetTagMetadata<T, 'column'> : T extends string ? string extends ColumnName ? ReturnType<typeof text<ColumnName, string, [string, ...string[]]>> : ReturnType<typeof text<string, [string, ...string[]]>> : T extends number ? string extends ColumnName ? ReturnType<typeof doublePrecision<ColumnName>> : ReturnType<typeof doublePrecision> : T extends boolean ? string extends ColumnName ? ReturnType<typeof boolean<ColumnName>> : ReturnType<typeof boolean> : T extends (infer U)[] ? string extends ColumnName ? ReturnType<ColumnBuilder<U, ColumnName>['array']> : ReturnType<ColumnBuilder<U>['array']> : never;
12
+ type EnumColumn<T extends EnumerationObject, ColumnName extends string = ''> = PgEnumColumnBuilderInitial<ColumnName, UnionToTuple<`${EnumerationValue<T>}`> extends [string, ...string[]] ? UnionToTuple<`${EnumerationValue<T>}`> : ['NO_VALUES_PROVIDED']>;
13
+ export type ColumnBuilder<T, ColumnName extends string = never> = T extends Tagged<T, 'column', any> ? GetTagMetadata<T, 'column'> : T extends string ? string extends ColumnName ? ReturnType<typeof text<ColumnName, string, [string, ...string[]]>> : ReturnType<typeof text<string, [string, ...string[]]>> : T extends number ? string extends ColumnName ? ReturnType<typeof doublePrecision<ColumnName>> : ReturnType<typeof doublePrecision> : T extends boolean ? string extends ColumnName ? ReturnType<typeof boolean<ColumnName>> : ReturnType<typeof boolean> : T extends EnumerationObject ? string extends ColumnName ? EnumColumn<T, ColumnName> : EnumColumn<T> : T extends (infer U)[] ? string extends ColumnName ? ReturnType<ColumnBuilder<U, ColumnName>['array']> : ReturnType<ColumnBuilder<U>['array']> : never;
13
14
  export type TypeBuilder<T, ColumnName extends string = never> = [
14
15
  ColumnName
15
16
  ] extends [never] ? T extends Tagged<any, 'column', PgColumnBuilderBase> ? T : T extends infer U ? Tagged<U, 'column', ColumnBuilder<U>> : never : never;
16
17
  export type Array<T extends Tagged<ObjectLiteral, 'column', PgColumnBuilder<any>>> = Tagged<UnwrapTagged<T>[], 'column', ReturnType<GetTagMetadata<T, 'column'>['array']>>;
18
+ export type Enum<T extends EnumerationObject> = Tagged<EnumerationValue<T>, 'column', EnumColumn<T>>;
17
19
  export type Text = Tagged<string, 'column', ReturnType<typeof text<string, [string, ...string[]]>>>;
18
20
  export type Uuid = Tagged<string, 'column', ReturnType<typeof uuid>>;
19
21
  export type Integer = Tagged<number, 'column', ReturnType<typeof integer>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tstdl/base",
3
- "version": "0.91.43",
3
+ "version": "0.91.44",
4
4
  "author": "Patrick Hein",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -115,11 +115,11 @@
115
115
  "luxon": "^3.5",
116
116
  "reflect-metadata": "^0.2",
117
117
  "rxjs": "^7.8",
118
- "type-fest": "4.26"
118
+ "type-fest": "4.28"
119
119
  },
120
120
  "devDependencies": {
121
121
  "@mxssfd/typedoc-theme": "1.1",
122
- "@stylistic/eslint-plugin": "2.10",
122
+ "@stylistic/eslint-plugin": "2.11",
123
123
  "@types/chroma-js": "2.4",
124
124
  "@types/koa__router": "12.0",
125
125
  "@types/luxon": "3.4",
@@ -128,7 +128,7 @@
128
128
  "@types/node": "22",
129
129
  "@types/nodemailer": "6.4",
130
130
  "@types/pg": "8.11",
131
- "@typescript-eslint/eslint-plugin": "7.17",
131
+ "@typescript-eslint/eslint-plugin": "8.15",
132
132
  "concurrently": "9.1",
133
133
  "drizzle-kit": "0.28",
134
134
  "eslint": "8.57",
@@ -136,11 +136,11 @@
136
136
  "eslint-plugin-import": "2.31",
137
137
  "tsc-alias": "1.8",
138
138
  "typedoc": "0.26",
139
- "typedoc-plugin-missing-exports": "3.0",
140
- "typescript": "5.5"
139
+ "typedoc-plugin-missing-exports": "3.1",
140
+ "typescript": "5.6"
141
141
  },
142
142
  "peerDependencies": {
143
- "@elastic/elasticsearch": "^8.15",
143
+ "@elastic/elasticsearch": "^8.16",
144
144
  "@koa/router": "^13.1",
145
145
  "@tstdl/angular": "^0.91",
146
146
  "@zxcvbn-ts/core": "^3.0",
@@ -153,13 +153,13 @@
153
153
  "koa": "^2.15",
154
154
  "minio": "^8.0",
155
155
  "mjml": "^4.15",
156
- "mongodb": "^6.10",
156
+ "mongodb": "^6.11",
157
157
  "nodemailer": "^6.9",
158
158
  "pg": "8.13",
159
- "playwright": "^1.48",
160
- "preact": "^10.24",
159
+ "playwright": "^1.49",
160
+ "preact": "^10.25",
161
161
  "preact-render-to-string": "^6.5",
162
- "undici": "^6.20",
162
+ "undici": "^6.21",
163
163
  "urlpattern-polyfill": "^10.0"
164
164
  },
165
165
  "peerDependenciesMeta": {
@@ -40,17 +40,22 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
40
40
  env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
41
41
  env.hasError = true;
42
42
  }
43
+ var r, s = 0;
43
44
  function next() {
44
- while (env.stack.length) {
45
- var rec = env.stack.pop();
45
+ while (r = env.stack.pop()) {
46
46
  try {
47
- var result = rec.dispose && rec.dispose.call(rec.value);
48
- if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
47
+ if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
48
+ if (r.dispose) {
49
+ var result = r.dispose.call(r.value);
50
+ if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
51
+ }
52
+ else s |= 1;
49
53
  }
50
54
  catch (e) {
51
55
  fail(e);
52
56
  }
53
57
  }
58
+ if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
54
59
  if (env.hasError) throw env.error;
55
60
  }
56
61
  return next();
package/pool/pool.d.ts CHANGED
@@ -3,7 +3,7 @@ import { disposeAsync } from '../disposable/disposable.js';
3
3
  import type { Logger } from '../logger/index.js';
4
4
  export type PoolOptions = {
5
5
  /**
6
- * maximum number of instances
6
+ * Maximum number of instances
7
7
  * @default number of cpu cores
8
8
  */
9
9
  size?: number;
@@ -1,16 +1,16 @@
1
- import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types.js';
2
- export type ElasticQuery = QueryDslQueryContainer;
3
- export type ElasticBooleanQuery = Required<Pick<QueryDslQueryContainer, 'bool'>>;
4
- export type ElasticIdsQuery = Required<Pick<QueryDslQueryContainer, 'ids'>>;
5
- export type ElasticMatchAllQuery = Required<Pick<QueryDslQueryContainer, 'match_all'>>;
6
- export type ElasticRangeQuery = Required<Pick<QueryDslQueryContainer, 'range'>>;
7
- export type ElasticRegexQuery = Required<Pick<QueryDslQueryContainer, 'regexp'>>;
8
- export type ElasticTermQuery = Required<Pick<QueryDslQueryContainer, 'term'>>;
9
- export type ElasticTermsQuery = Required<Pick<QueryDslQueryContainer, 'terms'>>;
10
- export type ElasticMatchQuery = Required<Pick<QueryDslQueryContainer, 'match'>>;
11
- export type ElasticExistsQuery = Required<Pick<QueryDslQueryContainer, 'exists'>>;
12
- export type ElasticMultiMatchQuery = Required<Pick<QueryDslQueryContainer, 'multi_match'>>;
13
- export type ElasticGeoBoundingBoxQuery = Required<Pick<QueryDslQueryContainer, 'geo_bounding_box'>>;
14
- export type ElasticGeoDistanceQuery = Required<Pick<QueryDslQueryContainer, 'geo_distance'>>;
15
- export type ElasticGeoPolygonQuery = Required<Pick<QueryDslQueryContainer, 'geo_polygon'>>;
16
- export type ElasticGeoShapeQuery = Required<Pick<QueryDslQueryContainer, 'geo_shape'>>;
1
+ import type { estypes } from '@elastic/elasticsearch';
2
+ export type ElasticQuery = estypes.QueryDslQueryContainer;
3
+ export type ElasticBooleanQuery = Required<Pick<estypes.QueryDslQueryContainer, 'bool'>>;
4
+ export type ElasticIdsQuery = Required<Pick<estypes.QueryDslQueryContainer, 'ids'>>;
5
+ export type ElasticMatchAllQuery = Required<Pick<estypes.QueryDslQueryContainer, 'match_all'>>;
6
+ export type ElasticRangeQuery = Required<Pick<estypes.QueryDslQueryContainer, 'range'>>;
7
+ export type ElasticRegexQuery = Required<Pick<estypes.QueryDslQueryContainer, 'regexp'>>;
8
+ export type ElasticTermQuery = Required<Pick<estypes.QueryDslQueryContainer, 'term'>>;
9
+ export type ElasticTermsQuery = Required<Pick<estypes.QueryDslQueryContainer, 'terms'>>;
10
+ export type ElasticMatchQuery = Required<Pick<estypes.QueryDslQueryContainer, 'match'>>;
11
+ export type ElasticExistsQuery = Required<Pick<estypes.QueryDslQueryContainer, 'exists'>>;
12
+ export type ElasticMultiMatchQuery = Required<Pick<estypes.QueryDslQueryContainer, 'multi_match'>>;
13
+ export type ElasticGeoBoundingBoxQuery = Required<Pick<estypes.QueryDslQueryContainer, 'geo_bounding_box'>>;
14
+ export type ElasticGeoDistanceQuery = Required<Pick<estypes.QueryDslQueryContainer, 'geo_distance'>>;
15
+ export type ElasticGeoPolygonQuery = Required<Pick<estypes.QueryDslQueryContainer, 'geo_polygon'>>;
16
+ export type ElasticGeoShapeQuery = Required<Pick<estypes.QueryDslQueryContainer, 'geo_shape'>>;
@@ -1,26 +1,26 @@
1
1
  import type { Entity } from '../../../database/index.js';
2
2
  import type { DeepFlatten, StringMap, TypedOmit } from '../../../types.js';
3
- import type { MappingBooleanProperty, MappingByteNumberProperty, MappingDateProperty, MappingDoubleNumberProperty, MappingFloatNumberProperty, MappingGeoPointProperty, MappingHalfFloatNumberProperty, MappingIntegerNumberProperty, MappingKeywordProperty, MappingLongNumberProperty, MappingNestedProperty, MappingObjectProperty, MappingPropertyBase, MappingScaledFloatNumberProperty, MappingShortNumberProperty, MappingTextProperty, MappingTypeMapping, MappingUnsignedLongNumberProperty } from '@elastic/elasticsearch/lib/api/types.js';
4
- export type ElasticIndexMapping<T extends Entity = Entity> = TypedOmit<MappingTypeMapping, 'properties'> & ElasticNestedIndexMapping<TypedOmit<T, 'id'>>;
3
+ import type { estypes } from '@elastic/elasticsearch';
4
+ export type ElasticIndexMapping<T extends Entity = Entity> = TypedOmit<estypes.MappingTypeMapping, 'properties'> & ElasticNestedIndexMapping<TypedOmit<T, 'id'>>;
5
5
  export type ElasticNestedIndexMapping<T> = {
6
6
  properties: {
7
7
  [P in keyof Required<T>]: ElasticIndexMappingItem<DeepFlatten<Required<T>[P]>>;
8
8
  };
9
9
  };
10
- type StrippedBaseType<T extends MappingPropertyBase> = TypedOmit<T, 'properties' | 'fields'>;
10
+ type StrippedBaseType<T extends estypes.MappingPropertyBase> = TypedOmit<T, 'properties' | 'fields'>;
11
11
  type ElasticIndexMappingItemBase = {
12
12
  index?: boolean;
13
13
  fields?: StringMap<ElasticIndexMappingItem>;
14
14
  };
15
- export type MappingNumberProperty = MappingByteNumberProperty | MappingDoubleNumberProperty | MappingFloatNumberProperty | MappingHalfFloatNumberProperty | MappingIntegerNumberProperty | MappingLongNumberProperty | MappingShortNumberProperty | MappingScaledFloatNumberProperty | MappingUnsignedLongNumberProperty;
16
- export type ElasticKeywordIndexMappingItem = ElasticIndexMappingItemBase & StrippedBaseType<MappingKeywordProperty>;
17
- export type ElasticTextIndexMappingItem = ElasticIndexMappingItemBase & StrippedBaseType<MappingTextProperty>;
15
+ export type MappingNumberProperty = estypes.MappingByteNumberProperty | estypes.MappingDoubleNumberProperty | estypes.MappingFloatNumberProperty | estypes.MappingHalfFloatNumberProperty | estypes.MappingIntegerNumberProperty | estypes.MappingLongNumberProperty | estypes.MappingShortNumberProperty | estypes.MappingScaledFloatNumberProperty | estypes.MappingUnsignedLongNumberProperty;
16
+ export type ElasticKeywordIndexMappingItem = ElasticIndexMappingItemBase & StrippedBaseType<estypes.MappingKeywordProperty>;
17
+ export type ElasticTextIndexMappingItem = ElasticIndexMappingItemBase & StrippedBaseType<estypes.MappingTextProperty>;
18
18
  export type ElasticNumberIndexMappingItem = ElasticIndexMappingItemBase & StrippedBaseType<MappingNumberProperty>;
19
- export type ElasticBooleanIndexMappingItem = ElasticIndexMappingItemBase & StrippedBaseType<MappingBooleanProperty>;
20
- export type ElasticDateIndexMappingItem = ElasticIndexMappingItemBase & StrippedBaseType<MappingDateProperty>;
21
- export type ElasticGeoPointIndexMappingItem = ElasticIndexMappingItemBase & StrippedBaseType<MappingGeoPointProperty>;
22
- export type ElasticObjectIndexMappingItem<T> = ElasticIndexMappingItemBase & StrippedBaseType<MappingObjectProperty> & ElasticNestedIndexMapping<T>;
23
- export type ElasticNestedIndexMappingItem<T> = ElasticIndexMappingItemBase & StrippedBaseType<MappingNestedProperty> & ElasticNestedIndexMapping<T>;
19
+ export type ElasticBooleanIndexMappingItem = ElasticIndexMappingItemBase & StrippedBaseType<estypes.MappingBooleanProperty>;
20
+ export type ElasticDateIndexMappingItem = ElasticIndexMappingItemBase & StrippedBaseType<estypes.MappingDateProperty>;
21
+ export type ElasticGeoPointIndexMappingItem = ElasticIndexMappingItemBase & StrippedBaseType<estypes.MappingGeoPointProperty>;
22
+ export type ElasticObjectIndexMappingItem<T> = ElasticIndexMappingItemBase & StrippedBaseType<estypes.MappingObjectProperty> & ElasticNestedIndexMapping<T>;
23
+ export type ElasticNestedIndexMappingItem<T> = ElasticIndexMappingItemBase & StrippedBaseType<estypes.MappingNestedProperty> & ElasticNestedIndexMapping<T>;
24
24
  export type ElasticIndexMappingItem<T = any> = ElasticKeywordIndexMappingItem | ElasticTextIndexMappingItem | ElasticNumberIndexMappingItem | ElasticBooleanIndexMappingItem | ElasticDateIndexMappingItem | ElasticGeoPointIndexMappingItem | ElasticObjectIndexMappingItem<T> | ElasticNestedIndexMappingItem<T>;
25
25
  export declare function mergeElasticSearchMappings<T extends Entity>(mappings: ElasticIndexMapping<T>[]): ElasticIndexMapping<T>;
26
26
  export {};
@@ -1,8 +1,8 @@
1
1
  import type { Entity } from '../../../database/index.js';
2
- import type { SortOptions as ElasticSortOptions, SortOptionsKeys } from '@elastic/elasticsearch/lib/api/types.js';
3
- export type { SortOrder } from '@elastic/elasticsearch/lib/api/types.js';
2
+ import type { estypes } from '@elastic/elasticsearch';
3
+ export type SortOrder = estypes.SortOrder;
4
4
  export type Sort<T extends Entity = Entity> = SortCombinations<T> | SortCombinations<T>[];
5
5
  export type SortCombinations<T extends Entity = Entity> = keyof T | SortOptions<T>;
6
- export type SortOptions<T extends Entity = Entity> = SortOptionsKeys & {
7
- [P in keyof T]?: ElasticSortOptions[string];
6
+ export type SortOptions<T extends Entity = Entity> = estypes.SortOptionsKeys & {
7
+ [P in keyof T]?: estypes.SortOptions[string];
8
8
  };
@@ -1,9 +1,9 @@
1
1
  import type { Entity } from '../../database/index.js';
2
2
  import type { LogicalAndQuery, LogicalNorQuery, LogicalOrQuery, Query, TextSpanQueryMode } from '../../database/query.js';
3
- import type { QueryDslTextQueryType } from '@elastic/elasticsearch/lib/api/types.js';
3
+ import type { estypes } from '@elastic/elasticsearch';
4
4
  import type { ElasticQuery } from './model/index.js';
5
5
  export declare function convertQuery<T extends Entity>(query: Query<T>): ElasticQuery;
6
6
  export declare function convertLogicalAndQuery<T extends Entity>(andQuery: LogicalAndQuery<T>['$and']): ElasticQuery;
7
7
  export declare function convertLogicalOrQuery<T extends Entity>(orQuery: LogicalOrQuery<T>['$or']): ElasticQuery;
8
8
  export declare function convertLogicalNorQuery<T extends Entity>(norQuery: LogicalNorQuery<T>['$nor']): ElasticQuery;
9
- export declare function convertTextSpanQueryMode(mode: TextSpanQueryMode | undefined): QueryDslTextQueryType | undefined;
9
+ export declare function convertTextSpanQueryMode(mode: TextSpanQueryMode | undefined): estypes.QueryDslTextQueryType | undefined;
@@ -1,11 +1,11 @@
1
+ import type { Client } from '@elastic/elasticsearch';
1
2
  import type { Entity, Query, QueryOptions } from '../../database/index.js';
2
3
  import type { AfterResolve } from '../../injector/interfaces.js';
3
4
  import { afterResolve } from '../../injector/interfaces.js';
4
5
  import type { Logger } from '../../logger/index.js';
5
6
  import type { SearchResult } from '../../search-index/index.js';
6
7
  import { SearchIndex } from '../../search-index/index.js';
7
- import type { Client } from '@elastic/elasticsearch';
8
- import type { IndicesIndexSettings } from '@elastic/elasticsearch/lib/api/types.js';
8
+ import type { estypes } from '@elastic/elasticsearch';
9
9
  import type { ElasticSearchIndexConfig } from './config.js';
10
10
  import { KeywordRewriter } from './keyword-rewriter.js';
11
11
  import type { ElasticIndexMapping } from './model/index.js';
@@ -13,10 +13,10 @@ export declare class ElasticSearchIndex<T extends Entity> extends SearchIndex<T>
13
13
  private readonly logger;
14
14
  readonly client: Client;
15
15
  readonly indexName: string;
16
- readonly indexSettings: IndicesIndexSettings;
16
+ readonly indexSettings: estypes.IndicesIndexSettings;
17
17
  readonly indexMapping: ElasticIndexMapping<T>;
18
18
  readonly keywordRewriter: KeywordRewriter;
19
- constructor(client: Client, config: ElasticSearchIndexConfig<T>, indexSettings: IndicesIndexSettings, indexMapping: ElasticIndexMapping<T>, keywordRewrites: Iterable<string>, logger: Logger);
19
+ constructor(client: Client, config: ElasticSearchIndexConfig<T>, indexSettings: estypes.IndicesIndexSettings, indexMapping: ElasticIndexMapping<T>, keywordRewrites: Iterable<string>, logger: Logger);
20
20
  [afterResolve](): Promise<void>;
21
21
  initialize(): Promise<void>;
22
22
  refresh(): Promise<void>;
@@ -1 +1,5 @@
1
- export type { AnalysisAnalyzer, AnalysisTokenFilter, AnalysisTokenizer, IndicesIndexSettings } from '@elastic/elasticsearch/lib/api/types.js';
1
+ import type { estypes } from '@elastic/elasticsearch';
2
+ export type AnalysisAnalyzer = estypes.AnalysisAnalyzer;
3
+ export type AnalysisTokenFilter = estypes.AnalysisTokenFilter;
4
+ export type AnalysisTokenizer = estypes.AnalysisTokenizer;
5
+ export type IndicesIndexSettings = estypes.IndicesIndexSettings;
@@ -1,4 +1,4 @@
1
- /* eslint-disable @typescript-eslint/no-unsafe-return, @typescript-eslint/ban-types, max-lines-per-function, max-statements, complexity */
1
+ /* eslint-disable @typescript-eslint/no-unsafe-return, max-lines-per-function, max-statements, complexity */
2
2
  import { CircularBuffer } from '../data-structures/circular-buffer.js';
3
3
  import { SortedArrayList } from '../data-structures/sorted-array-list.js';
4
4
  import { compareByValueSelection } from '../utils/comparison.js';
package/types.js CHANGED
@@ -1,2 +1,2 @@
1
- /* eslint-disable @typescript-eslint/ban-types, @typescript-eslint/consistent-indexed-object-style */
1
+ /* eslint-disable @typescript-eslint/consistent-indexed-object-style */
2
2
  export {};
package/utils/equals.js CHANGED
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/ban-types */
2
1
  import { toArray } from './array/array.js';
3
2
  import { toUint8Array } from './binary.js';
4
3
  import { compareByValue } from './comparison.js';
@@ -19,8 +19,8 @@ export declare class FactoryMap<K, V, I = K> implements Map<K, V> {
19
19
  set(key: K, value: V): this;
20
20
  delete(key: K): boolean;
21
21
  forEach(callback: (value: V, key: K, map: FactoryMap<K, V, I>) => void, thisArg?: any): void;
22
- [Symbol.iterator](): IterableIterator<[K, V]>;
23
- entries(): IterableIterator<[K, V]>;
24
- keys(): IterableIterator<K>;
25
- values(): IterableIterator<V>;
22
+ [Symbol.iterator](): MapIterator<[K, V]>;
23
+ entries(): MapIterator<[K, V]>;
24
+ keys(): MapIterator<K>;
25
+ values(): MapIterator<V>;
26
26
  }
package/utils/helpers.js CHANGED
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/ban-types */
2
1
  import { supportsNotification } from '../supports.js';
3
2
  import { DetailsError } from '../errors/details.error.js';
4
3
  import { decycle } from './object/decycle.js';
@@ -1,4 +1,4 @@
1
- /* eslint-disable @typescript-eslint/no-unsafe-argument, @typescript-eslint/ban-types */
1
+ /* eslint-disable @typescript-eslint/no-unsafe-argument */
2
2
  import { propertyReflectMethods, reflectMethods } from '../proxy.js';
3
3
  import { assert, isDefined, isUndefined } from '../type-guards.js';
4
4
  import { lazyObject } from './lazy-property.js';
@@ -1,5 +1,4 @@
1
1
  /* eslint-disable @typescript-eslint/no-unsafe-function-type */
2
- /* eslint-disable @typescript-eslint/ban-types */
3
2
  /* eslint-disable @typescript-eslint/no-invalid-void-type */
4
3
  /* eslint-disable @typescript-eslint/no-unnecessary-type-parameters */
5
4
  import { supportsBlob, supportsReadableStream } from '../supports.js';
package/utils/type-of.js CHANGED
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/ban-types */
2
1
  import { isNull } from './type-guards.js';
3
2
  /**
4
3
  * Get the type of value. Returns 'null' instead of 'object' for null, tries to distinguish between function and class and to get their names