@yandjin-mikro-orm/core 6.1.4-rc-sti-changes-1

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 (264) hide show
  1. package/EntityManager.d.ts +553 -0
  2. package/EntityManager.js +1736 -0
  3. package/LICENSE +21 -0
  4. package/MikroORM.d.ts +102 -0
  5. package/MikroORM.js +258 -0
  6. package/README.md +383 -0
  7. package/cache/CacheAdapter.d.ts +40 -0
  8. package/cache/CacheAdapter.js +2 -0
  9. package/cache/FileCacheAdapter.d.ts +31 -0
  10. package/cache/FileCacheAdapter.js +90 -0
  11. package/cache/GeneratedCacheAdapter.d.ts +25 -0
  12. package/cache/GeneratedCacheAdapter.js +38 -0
  13. package/cache/MemoryCacheAdapter.d.ts +24 -0
  14. package/cache/MemoryCacheAdapter.js +44 -0
  15. package/cache/NullCacheAdapter.d.ts +19 -0
  16. package/cache/NullCacheAdapter.js +30 -0
  17. package/cache/index.d.ts +5 -0
  18. package/cache/index.js +21 -0
  19. package/connections/Connection.d.ts +85 -0
  20. package/connections/Connection.js +128 -0
  21. package/connections/index.d.ts +1 -0
  22. package/connections/index.js +17 -0
  23. package/decorators/Check.d.ts +3 -0
  24. package/decorators/Check.js +17 -0
  25. package/decorators/CreateRequestContext.d.ts +2 -0
  26. package/decorators/CreateRequestContext.js +31 -0
  27. package/decorators/Embeddable.d.ts +8 -0
  28. package/decorators/Embeddable.js +15 -0
  29. package/decorators/Embedded.d.ts +13 -0
  30. package/decorators/Embedded.js +21 -0
  31. package/decorators/EnsureRequestContext.d.ts +2 -0
  32. package/decorators/EnsureRequestContext.js +26 -0
  33. package/decorators/Entity.d.ts +18 -0
  34. package/decorators/Entity.js +17 -0
  35. package/decorators/Enum.d.ts +9 -0
  36. package/decorators/Enum.js +20 -0
  37. package/decorators/Filter.d.ts +2 -0
  38. package/decorators/Filter.js +12 -0
  39. package/decorators/Formula.d.ts +5 -0
  40. package/decorators/Formula.js +19 -0
  41. package/decorators/Indexed.d.ts +12 -0
  42. package/decorators/Indexed.js +25 -0
  43. package/decorators/ManyToMany.d.ts +21 -0
  44. package/decorators/ManyToMany.js +17 -0
  45. package/decorators/ManyToOne.d.ts +15 -0
  46. package/decorators/ManyToOne.js +17 -0
  47. package/decorators/OneToMany.d.ts +18 -0
  48. package/decorators/OneToMany.js +21 -0
  49. package/decorators/OneToOne.d.ts +12 -0
  50. package/decorators/OneToOne.js +11 -0
  51. package/decorators/PrimaryKey.d.ts +8 -0
  52. package/decorators/PrimaryKey.js +24 -0
  53. package/decorators/Property.d.ts +218 -0
  54. package/decorators/Property.js +35 -0
  55. package/decorators/Subscriber.d.ts +1 -0
  56. package/decorators/Subscriber.js +2 -0
  57. package/decorators/hooks.d.ts +16 -0
  58. package/decorators/hooks.js +60 -0
  59. package/decorators/index.d.ts +17 -0
  60. package/decorators/index.js +36 -0
  61. package/drivers/DatabaseDriver.d.ts +72 -0
  62. package/drivers/DatabaseDriver.js +358 -0
  63. package/drivers/IDatabaseDriver.d.ts +193 -0
  64. package/drivers/IDatabaseDriver.js +4 -0
  65. package/drivers/index.d.ts +2 -0
  66. package/drivers/index.js +18 -0
  67. package/entity/ArrayCollection.d.ts +113 -0
  68. package/entity/ArrayCollection.js +386 -0
  69. package/entity/BaseEntity.d.ts +22 -0
  70. package/entity/BaseEntity.js +47 -0
  71. package/entity/Collection.d.ts +104 -0
  72. package/entity/Collection.js +373 -0
  73. package/entity/EntityAssigner.d.ts +28 -0
  74. package/entity/EntityAssigner.js +226 -0
  75. package/entity/EntityFactory.d.ts +41 -0
  76. package/entity/EntityFactory.js +302 -0
  77. package/entity/EntityHelper.d.ts +29 -0
  78. package/entity/EntityHelper.js +250 -0
  79. package/entity/EntityIdentifier.d.ts +10 -0
  80. package/entity/EntityIdentifier.js +19 -0
  81. package/entity/EntityLoader.d.ts +65 -0
  82. package/entity/EntityLoader.js +579 -0
  83. package/entity/EntityRepository.d.ts +161 -0
  84. package/entity/EntityRepository.js +207 -0
  85. package/entity/EntityValidator.d.ts +19 -0
  86. package/entity/EntityValidator.js +152 -0
  87. package/entity/Reference.d.ts +89 -0
  88. package/entity/Reference.js +242 -0
  89. package/entity/WrappedEntity.d.ts +67 -0
  90. package/entity/WrappedEntity.js +146 -0
  91. package/entity/index.d.ts +13 -0
  92. package/entity/index.js +29 -0
  93. package/entity/wrap.d.ts +15 -0
  94. package/entity/wrap.js +26 -0
  95. package/enums.d.ts +160 -0
  96. package/enums.js +169 -0
  97. package/errors.d.ts +65 -0
  98. package/errors.js +222 -0
  99. package/events/EventManager.d.ts +17 -0
  100. package/events/EventManager.js +77 -0
  101. package/events/EventSubscriber.d.ts +39 -0
  102. package/events/EventSubscriber.js +2 -0
  103. package/events/TransactionEventBroadcaster.d.ts +11 -0
  104. package/events/TransactionEventBroadcaster.js +17 -0
  105. package/events/index.d.ts +3 -0
  106. package/events/index.js +19 -0
  107. package/exceptions.d.ts +104 -0
  108. package/exceptions.js +130 -0
  109. package/hydration/Hydrator.d.ts +23 -0
  110. package/hydration/Hydrator.js +51 -0
  111. package/hydration/ObjectHydrator.d.ts +24 -0
  112. package/hydration/ObjectHydrator.js +332 -0
  113. package/hydration/index.d.ts +2 -0
  114. package/hydration/index.js +18 -0
  115. package/index.d.ts +25 -0
  116. package/index.js +50 -0
  117. package/index.mjs +192 -0
  118. package/logging/DefaultLogger.d.ts +32 -0
  119. package/logging/DefaultLogger.js +90 -0
  120. package/logging/Logger.d.ts +56 -0
  121. package/logging/Logger.js +2 -0
  122. package/logging/SimpleLogger.d.ts +17 -0
  123. package/logging/SimpleLogger.js +31 -0
  124. package/logging/colors.d.ts +9 -0
  125. package/logging/colors.js +20 -0
  126. package/logging/index.d.ts +4 -0
  127. package/logging/index.js +20 -0
  128. package/metadata/EntitySchema.d.ts +74 -0
  129. package/metadata/EntitySchema.js +293 -0
  130. package/metadata/MetadataDiscovery.d.ts +71 -0
  131. package/metadata/MetadataDiscovery.js +1244 -0
  132. package/metadata/MetadataProvider.d.ts +11 -0
  133. package/metadata/MetadataProvider.js +23 -0
  134. package/metadata/MetadataStorage.d.ts +22 -0
  135. package/metadata/MetadataStorage.js +87 -0
  136. package/metadata/MetadataValidator.d.ts +24 -0
  137. package/metadata/MetadataValidator.js +213 -0
  138. package/metadata/ReflectMetadataProvider.d.ts +8 -0
  139. package/metadata/ReflectMetadataProvider.js +48 -0
  140. package/metadata/index.d.ts +6 -0
  141. package/metadata/index.js +22 -0
  142. package/naming-strategy/AbstractNamingStrategy.d.ts +18 -0
  143. package/naming-strategy/AbstractNamingStrategy.js +48 -0
  144. package/naming-strategy/EntityCaseNamingStrategy.d.ts +12 -0
  145. package/naming-strategy/EntityCaseNamingStrategy.js +32 -0
  146. package/naming-strategy/MongoNamingStrategy.d.ts +9 -0
  147. package/naming-strategy/MongoNamingStrategy.js +25 -0
  148. package/naming-strategy/NamingStrategy.d.ts +52 -0
  149. package/naming-strategy/NamingStrategy.js +2 -0
  150. package/naming-strategy/UnderscoreNamingStrategy.d.ts +10 -0
  151. package/naming-strategy/UnderscoreNamingStrategy.js +28 -0
  152. package/naming-strategy/index.d.ts +5 -0
  153. package/naming-strategy/index.js +21 -0
  154. package/package.json +70 -0
  155. package/platforms/ExceptionConverter.d.ts +5 -0
  156. package/platforms/ExceptionConverter.js +11 -0
  157. package/platforms/Platform.d.ts +201 -0
  158. package/platforms/Platform.js +452 -0
  159. package/platforms/index.d.ts +2 -0
  160. package/platforms/index.js +18 -0
  161. package/serialization/EntitySerializer.d.ts +34 -0
  162. package/serialization/EntitySerializer.js +206 -0
  163. package/serialization/EntityTransformer.d.ts +8 -0
  164. package/serialization/EntityTransformer.js +192 -0
  165. package/serialization/SerializationContext.d.ts +30 -0
  166. package/serialization/SerializationContext.js +111 -0
  167. package/serialization/index.d.ts +3 -0
  168. package/serialization/index.js +19 -0
  169. package/types/ArrayType.d.ts +13 -0
  170. package/types/ArrayType.js +47 -0
  171. package/types/BigIntType.d.ts +16 -0
  172. package/types/BigIntType.js +45 -0
  173. package/types/BlobType.d.ts +10 -0
  174. package/types/BlobType.js +27 -0
  175. package/types/BooleanType.d.ts +8 -0
  176. package/types/BooleanType.js +16 -0
  177. package/types/DateTimeType.d.ts +8 -0
  178. package/types/DateTimeType.js +16 -0
  179. package/types/DateType.d.ts +8 -0
  180. package/types/DateType.js +16 -0
  181. package/types/DecimalType.d.ts +11 -0
  182. package/types/DecimalType.js +22 -0
  183. package/types/DoubleType.d.ts +11 -0
  184. package/types/DoubleType.js +22 -0
  185. package/types/EnumArrayType.d.ts +9 -0
  186. package/types/EnumArrayType.js +32 -0
  187. package/types/EnumType.d.ts +8 -0
  188. package/types/EnumType.js +16 -0
  189. package/types/FloatType.d.ts +8 -0
  190. package/types/FloatType.js +16 -0
  191. package/types/IntegerType.d.ts +8 -0
  192. package/types/IntegerType.js +16 -0
  193. package/types/IntervalType.d.ts +8 -0
  194. package/types/IntervalType.js +16 -0
  195. package/types/JsonType.d.ts +13 -0
  196. package/types/JsonType.js +34 -0
  197. package/types/MediumIntType.d.ts +6 -0
  198. package/types/MediumIntType.js +10 -0
  199. package/types/SmallIntType.d.ts +8 -0
  200. package/types/SmallIntType.js +16 -0
  201. package/types/StringType.d.ts +8 -0
  202. package/types/StringType.js +16 -0
  203. package/types/TextType.d.ts +8 -0
  204. package/types/TextType.js +16 -0
  205. package/types/TimeType.d.ts +9 -0
  206. package/types/TimeType.js +23 -0
  207. package/types/TinyIntType.d.ts +8 -0
  208. package/types/TinyIntType.js +16 -0
  209. package/types/Type.d.ts +64 -0
  210. package/types/Type.js +84 -0
  211. package/types/Uint8ArrayType.d.ts +11 -0
  212. package/types/Uint8ArrayType.js +37 -0
  213. package/types/UnknownType.d.ts +7 -0
  214. package/types/UnknownType.js +13 -0
  215. package/types/UuidType.d.ts +7 -0
  216. package/types/UuidType.js +13 -0
  217. package/types/index.d.ts +75 -0
  218. package/types/index.js +77 -0
  219. package/typings.d.ts +767 -0
  220. package/typings.js +198 -0
  221. package/unit-of-work/ChangeSet.d.ts +34 -0
  222. package/unit-of-work/ChangeSet.js +62 -0
  223. package/unit-of-work/ChangeSetComputer.d.ts +26 -0
  224. package/unit-of-work/ChangeSetComputer.js +153 -0
  225. package/unit-of-work/ChangeSetPersister.d.ts +50 -0
  226. package/unit-of-work/ChangeSetPersister.js +361 -0
  227. package/unit-of-work/CommitOrderCalculator.d.ts +62 -0
  228. package/unit-of-work/CommitOrderCalculator.js +113 -0
  229. package/unit-of-work/IdentityMap.d.ts +17 -0
  230. package/unit-of-work/IdentityMap.js +84 -0
  231. package/unit-of-work/UnitOfWork.d.ts +124 -0
  232. package/unit-of-work/UnitOfWork.js +1013 -0
  233. package/unit-of-work/index.d.ts +6 -0
  234. package/unit-of-work/index.js +22 -0
  235. package/utils/AbstractSchemaGenerator.d.ts +38 -0
  236. package/utils/AbstractSchemaGenerator.js +101 -0
  237. package/utils/Configuration.d.ts +390 -0
  238. package/utils/Configuration.js +357 -0
  239. package/utils/ConfigurationLoader.d.ts +29 -0
  240. package/utils/ConfigurationLoader.js +282 -0
  241. package/utils/Cursor.d.ts +77 -0
  242. package/utils/Cursor.js +169 -0
  243. package/utils/DataloaderUtils.d.ts +43 -0
  244. package/utils/DataloaderUtils.js +194 -0
  245. package/utils/EntityComparator.d.ts +73 -0
  246. package/utils/EntityComparator.js +568 -0
  247. package/utils/NullHighlighter.d.ts +4 -0
  248. package/utils/NullHighlighter.js +9 -0
  249. package/utils/QueryHelper.d.ts +28 -0
  250. package/utils/QueryHelper.js +228 -0
  251. package/utils/RawQueryFragment.d.ts +96 -0
  252. package/utils/RawQueryFragment.js +188 -0
  253. package/utils/RequestContext.d.ts +34 -0
  254. package/utils/RequestContext.js +54 -0
  255. package/utils/TransactionContext.d.ts +19 -0
  256. package/utils/TransactionContext.js +34 -0
  257. package/utils/Utils.d.ts +274 -0
  258. package/utils/Utils.js +1073 -0
  259. package/utils/clone.d.ts +6 -0
  260. package/utils/clone.js +127 -0
  261. package/utils/index.d.ts +13 -0
  262. package/utils/index.js +29 -0
  263. package/utils/upsert-utils.d.ts +6 -0
  264. package/utils/upsert-utils.js +33 -0
@@ -0,0 +1,274 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { type GlobbyOptions } from 'globby';
4
+ import { type URL } from 'url';
5
+ import type { Dictionary, EntityData, EntityDictionary, EntityKey, EntityMetadata, EntityName, EntityProperty, IMetadataStorage, Primary } from '../typings';
6
+ import type { Collection } from '../entity/Collection';
7
+ import type { Platform } from '../platforms';
8
+ import type { ScalarReference } from '../entity/Reference';
9
+ export declare const ObjectBindingPattern: unique symbol;
10
+ export declare function compareObjects(a: any, b: any): boolean;
11
+ export declare function compareArrays(a: any[] | string, b: any[] | string): boolean;
12
+ export declare function compareBooleans(a: unknown, b: unknown): boolean;
13
+ export declare function compareBuffers(a: Uint8Array, b: Uint8Array): boolean;
14
+ /**
15
+ * Checks if arguments are deeply (but not strictly) equal.
16
+ */
17
+ export declare function equals(a: any, b: any): boolean;
18
+ export declare function parseJsonSafe<T = unknown>(value: unknown): T;
19
+ export declare class Utils {
20
+ static readonly PK_SEPARATOR = "~~~";
21
+ static dynamicImportProvider: (id: string) => Promise<any>;
22
+ /**
23
+ * Checks if the argument is not undefined
24
+ */
25
+ static isDefined<T = Record<string, unknown>>(data: any): data is T;
26
+ /**
27
+ * Checks if the argument is instance of `Object`. Returns false for arrays.
28
+ */
29
+ static isObject<T = Dictionary>(o: any): o is T;
30
+ /**
31
+ * Relation decorators allow using two signatures
32
+ * - using first parameter as options object
33
+ * - using all parameters
34
+ *
35
+ * This function validates those two ways are not mixed and returns the final options object.
36
+ * If the second way is used, we always consider the last parameter as options object.
37
+ * @internal
38
+ */
39
+ static processDecoratorParameters<T>(params: Dictionary): T;
40
+ /**
41
+ * Checks if the argument is instance of `Object`, but not one of the blacklisted types. Returns false for arrays.
42
+ */
43
+ static isNotObject<T = Dictionary>(o: any, not: any[]): o is T;
44
+ /**
45
+ * Removes `undefined` properties (recursively) so they are not saved as nulls
46
+ */
47
+ static dropUndefinedProperties<T = Dictionary | unknown[]>(o: any, value?: undefined | null, visited?: Set<unknown>): void;
48
+ /**
49
+ * Returns the number of properties on `obj`. This is 20x faster than Object.keys(obj).length.
50
+ * @see https://github.com/deepkit/deepkit-framework/blob/master/packages/core/src/core.ts
51
+ */
52
+ static getObjectKeysSize(object: Dictionary): number;
53
+ /**
54
+ * Returns true if `obj` has at least one property. This is 20x faster than Object.keys(obj).length.
55
+ * @see https://github.com/deepkit/deepkit-framework/blob/master/packages/core/src/core.ts
56
+ */
57
+ static hasObjectKeys(object: Dictionary): boolean;
58
+ /**
59
+ * Checks if the argument is string
60
+ */
61
+ static isString(s: any): s is string;
62
+ /**
63
+ * Checks if the argument is number
64
+ */
65
+ static isNumber<T = number>(s: any): s is T;
66
+ /**
67
+ * Checks if arguments are deeply (but not strictly) equal.
68
+ */
69
+ static equals(a: any, b: any): boolean;
70
+ /**
71
+ * Gets array without duplicates.
72
+ */
73
+ static unique<T = string>(items: T[]): T[];
74
+ /**
75
+ * Gets array without duplicates, comparing using the provided key
76
+ */
77
+ static uniqueBy<T extends Dictionary<any>>(items: T[], key: keyof T): T[];
78
+ /**
79
+ * Merges all sources into the target recursively.
80
+ */
81
+ static merge(target: any, ...sources: any[]): any;
82
+ /**
83
+ * Merges all sources into the target recursively. Ignores `undefined` values.
84
+ */
85
+ static mergeConfig(target: any, ...sources: any[]): any;
86
+ /**
87
+ * Merges all sources into the target recursively.
88
+ */
89
+ private static _merge;
90
+ static getRootEntity(metadata: IMetadataStorage, meta: EntityMetadata): EntityMetadata;
91
+ /**
92
+ * Computes difference between two objects, ignoring items missing in `b`.
93
+ */
94
+ static diff(a: Dictionary, b: Dictionary): Record<keyof (typeof a & typeof b), any>;
95
+ /**
96
+ * Creates deep copy of given object.
97
+ */
98
+ static copy<T>(entity: T, respectCustomCloneMethod?: boolean): T;
99
+ /**
100
+ * Normalize the argument to always be an array.
101
+ */
102
+ static asArray<T>(data?: T | readonly T[] | Iterable<T>, strict?: boolean): T[];
103
+ /**
104
+ * Checks if the value is iterable, but considers strings and buffers as not iterable.
105
+ */
106
+ static isIterable<T>(value: unknown): value is Iterable<T>;
107
+ /**
108
+ * Renames object key, keeps order of properties.
109
+ */
110
+ static renameKey<T>(payload: T, from: string | keyof T, to: string): void;
111
+ /**
112
+ * Returns array of functions argument names. Uses `esprima` for source code analysis.
113
+ */
114
+ static tokenize(func: {
115
+ toString(): string;
116
+ } | string | {
117
+ type: string;
118
+ value: string;
119
+ }[]): {
120
+ type: string;
121
+ value: string;
122
+ }[];
123
+ /**
124
+ * Returns array of functions argument names. Uses `esprima` for source code analysis.
125
+ */
126
+ static getParamNames(func: {
127
+ toString(): string;
128
+ } | string | {
129
+ type: string;
130
+ value: string;
131
+ }[], methodName?: string): string[];
132
+ /**
133
+ * Checks whether the argument looks like primary key (string, number or ObjectId).
134
+ */
135
+ static isPrimaryKey<T>(key: any, allowComposite?: boolean): key is Primary<T>;
136
+ /**
137
+ * Extracts primary key from `data`. Accepts objects or primary keys directly.
138
+ */
139
+ static extractPK<T extends object>(data: any, meta?: EntityMetadata<T>, strict?: boolean): Primary<T> | string | null;
140
+ static getCompositeKeyValue<T>(data: EntityData<T>, meta: EntityMetadata<T>, convertCustomTypes?: boolean | 'convertToDatabaseValue' | 'convertToJSValue', platform?: Platform): Primary<T>;
141
+ static getCompositeKeyHash<T>(data: EntityData<T>, meta: EntityMetadata<T>, convertCustomTypes?: boolean, platform?: Platform, flat?: boolean): string;
142
+ static getPrimaryKeyHash(pks: (string | Buffer)[]): string;
143
+ static splitPrimaryKeys<T extends object>(key: string): EntityKey<T>[];
144
+ static getPrimaryKeyValues<T>(entity: T, primaryKeys: string[], allowScalar?: boolean, convertCustomTypes?: boolean): any;
145
+ static getPrimaryKeyCond<T>(entity: T, primaryKeys: EntityKey<T>[]): Record<string, Primary<T>> | null;
146
+ /**
147
+ * Maps nested FKs from `[1, 2, 3]` to `[1, [2, 3]]`.
148
+ */
149
+ static mapFlatCompositePrimaryKey(fk: Primary<any>[], prop: EntityProperty, fieldNames?: string[], idx?: number): Primary<any> | Primary<any>[];
150
+ static getPrimaryKeyCondFromArray<T extends object>(pks: Primary<T>[], meta: EntityMetadata<T>): Record<string, Primary<T>>;
151
+ static getOrderedPrimaryKeys<T>(id: Primary<T> | Record<string, Primary<T>>, meta: EntityMetadata<T>): Primary<T>[];
152
+ /**
153
+ * Checks whether given object is an entity instance.
154
+ */
155
+ static isEntity<T = unknown>(data: any, allowReference?: boolean): data is T & {};
156
+ /**
157
+ * Checks whether given object is a scalar reference.
158
+ */
159
+ static isScalarReference<T = unknown>(data: any, allowReference?: boolean): data is ScalarReference<any> & {};
160
+ /**
161
+ * Checks whether the argument is ObjectId instance
162
+ */
163
+ static isObjectID(key: any): boolean;
164
+ /**
165
+ * Checks whether the argument is empty (array without items, object without keys or falsy value).
166
+ */
167
+ static isEmpty(data: any): boolean;
168
+ /**
169
+ * Gets string name of given class.
170
+ */
171
+ static className<T>(classOrName: EntityName<T>): string;
172
+ static extractChildElements(items: string[], prefix: string, allSymbol?: string): string[];
173
+ /**
174
+ * Tries to detect `ts-node` runtime.
175
+ */
176
+ static detectTsNode(): boolean;
177
+ /**
178
+ * Uses some dark magic to get source path to caller where decorator is used.
179
+ * Analyses stack trace of error created inside the function call.
180
+ */
181
+ static lookupPathFromDecorator(name: string, stack?: string[]): string;
182
+ /**
183
+ * Gets the type of the argument.
184
+ */
185
+ static getObjectType(value: any): string;
186
+ /**
187
+ * Checks whether the value is POJO (e.g. `{ foo: 'bar' }`, and not instance of `Foo`)
188
+ */
189
+ static isPlainObject<T extends Dictionary>(value: any): value is T;
190
+ /**
191
+ * Executes the `cb` promise serially on every element of the `items` array and returns array of resolved values.
192
+ */
193
+ static runSerial<T = any, U = any>(items: Iterable<U>, cb: (item: U) => Promise<T>): Promise<T[]>;
194
+ static isCollection<T extends object, O extends object = object>(item: any): item is Collection<T, O>;
195
+ static fileURLToPath(url: string | URL): string;
196
+ /**
197
+ * Resolves and normalizes a series of path parts relative to each preceeding part.
198
+ * If any part is a `file:` URL, it is converted to a local path. If any part is an
199
+ * absolute path, it replaces preceeding paths (similar to `path.resolve` in NodeJS).
200
+ * Trailing directory separators are removed, and all directory separators are converted
201
+ * to POSIX-style separators (`/`).
202
+ */
203
+ static normalizePath(...parts: string[]): string;
204
+ /**
205
+ * Determines the relative path between two paths. If either path is a `file:` URL,
206
+ * it is converted to a local path.
207
+ */
208
+ static relativePath(path: string, relativeTo: string): string;
209
+ /**
210
+ * Computes the absolute path to for the given path relative to the provided base directory.
211
+ * If either `path` or `baseDir` are `file:` URLs, they are converted to local paths.
212
+ */
213
+ static absolutePath(path: string, baseDir?: string): string;
214
+ static hash(data: string, length?: number): string;
215
+ static runIfNotEmpty(clause: () => any, data: any): void;
216
+ static defaultValue<T extends Dictionary>(prop: T, option: keyof T, defaultValue: any): void;
217
+ static findDuplicates<T>(items: T[]): T[];
218
+ static removeDuplicates<T>(items: T[]): T[];
219
+ static randomInt(min: number, max: number): number;
220
+ static pathExists(path: string, options?: GlobbyOptions): Promise<boolean>;
221
+ /**
222
+ * Extracts all possible values of a TS enum. Works with both string and numeric enums.
223
+ */
224
+ static extractEnumValues(target: Dictionary): (string | number)[];
225
+ static flatten<T>(arrays: T[][]): T[];
226
+ static isOperator(key: PropertyKey, includeGroupOperators?: boolean): boolean;
227
+ static isGroupOperator(key: PropertyKey): boolean;
228
+ static isArrayOperator(key: PropertyKey): boolean;
229
+ static hasNestedKey(object: unknown, key: string): boolean;
230
+ static getGlobalStorage(namespace: string): Dictionary;
231
+ /**
232
+ * Require a module from a specific location
233
+ * @param id The module to require
234
+ * @param [from] Location to start the node resolution
235
+ */
236
+ static requireFrom<T extends Dictionary>(id: string, from?: string): T;
237
+ /**
238
+ * Hack to keep dynamic imports even when compiling to CJS.
239
+ * We can't use it always, as it would break ts-node.
240
+ * @see https://github.com/microsoft/TypeScript/issues/43329#issuecomment-922544562
241
+ */
242
+ static dynamicImport<T = any>(id: string): Promise<T>;
243
+ static setDynamicImportProvider(provider: (id: string) => Promise<unknown>): void;
244
+ static getORMVersion(): string;
245
+ static createFunction(context: Map<string, any>, code: string): any;
246
+ static callCompiledFunction<T extends unknown[], R>(fn: (...args: T) => R, ...args: T): R;
247
+ /**
248
+ * @see https://github.com/mikro-orm/mikro-orm/issues/840
249
+ */
250
+ static propertyDecoratorReturnValue(): any;
251
+ static unwrapProperty<T>(entity: T, meta: EntityMetadata<T>, prop: EntityProperty<T>, payload?: boolean): [unknown, number[]][];
252
+ static setPayloadProperty<T>(entity: EntityDictionary<T>, meta: EntityMetadata<T>, prop: EntityProperty<T>, value: unknown, idx: number[]): void;
253
+ static tryRequire<T extends Dictionary = any>({ module, from, allowError, warning }: {
254
+ module: string;
255
+ warning: string;
256
+ from?: string;
257
+ allowError?: string;
258
+ }): T | undefined;
259
+ static stripRelativePath(str: string): string;
260
+ /**
261
+ * simple process.argv parser, supports only properties with long names, prefixed with `--`
262
+ */
263
+ static parseArgs<T extends Dictionary = Dictionary>(): T;
264
+ static xor(a: boolean, b: boolean): boolean;
265
+ static keys<T extends object>(obj: T): (keyof T)[];
266
+ static values<T extends object>(obj: T): T[keyof T][];
267
+ static entries<T extends object>(obj: T): [keyof T, T[keyof T]][];
268
+ static isRawSql(value: unknown): value is {
269
+ sql: string;
270
+ params: unknown[];
271
+ use: () => void;
272
+ };
273
+ static primaryKeyToObject<T>(meta: EntityMetadata<T>, primaryKey: Primary<T> | T, visible?: (keyof T)[]): T;
274
+ }