remult 0.25.6-exp.3 → 0.25.6-exp.4

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.
@@ -173,7 +173,18 @@ export class Filter {
173
173
  __applyToConsumer(add) {
174
174
  this.apply(add);
175
175
  }
176
- //@internal
176
+ /**
177
+ * Resolves an entity filter.
178
+ *
179
+ * This method takes a filter which can be either an instance of `EntityFilter`
180
+ * or a function that returns an instance of `EntityFilter` or a promise that
181
+ * resolves to an instance of `EntityFilter`. It then resolves the filter if it
182
+ * is a function and returns the resulting `EntityFilter`.
183
+ *
184
+ * @template entityType The type of the entity that the filter applies to.
185
+ * @param {EntityFilter<entityType> | (() => EntityFilter<entityType> | Promise<EntityFilter<entityType>>)} filter The filter to resolve.
186
+ * @returns {Promise<EntityFilter<entityType>>} The resolved entity filter.
187
+ */
177
188
  static async resolve(filter) {
178
189
  if (typeof filter === 'function')
179
190
  return await filter();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remult",
3
- "version": "0.25.6-exp.3",
3
+ "version": "0.25.6-exp.4",
4
4
  "description": "A CRUD framework for full-stack TypeScript",
5
5
  "homepage": "https://remult.dev",
6
6
  "repository": {
@@ -122,6 +122,19 @@ export declare class Filter {
122
122
  static fromEntityFilter<T>(entity: EntityMetadata<T>, whereItem: EntityFilter<T>): Filter;
123
123
  constructor(apply: (add: FilterConsumer) => void);
124
124
  __applyToConsumer(add: FilterConsumer): void;
125
+ /**
126
+ * Resolves an entity filter.
127
+ *
128
+ * This method takes a filter which can be either an instance of `EntityFilter`
129
+ * or a function that returns an instance of `EntityFilter` or a promise that
130
+ * resolves to an instance of `EntityFilter`. It then resolves the filter if it
131
+ * is a function and returns the resulting `EntityFilter`.
132
+ *
133
+ * @template entityType The type of the entity that the filter applies to.
134
+ * @param {EntityFilter<entityType> | (() => EntityFilter<entityType> | Promise<EntityFilter<entityType>>)} filter The filter to resolve.
135
+ * @returns {Promise<EntityFilter<entityType>>} The resolved entity filter.
136
+ */
137
+ static resolve<entityType>(filter: EntityFilter<entityType> | (() => EntityFilter<entityType> | Promise<EntityFilter<entityType>>)): Promise<EntityFilter<entityType>>;
125
138
  }
126
139
  export interface FilterConsumer {
127
140
  or(orElements: Filter[]): any;
@@ -181,7 +181,18 @@ var Filter = /** @class */ (function () {
181
181
  Filter.prototype.__applyToConsumer = function (add) {
182
182
  this.apply(add);
183
183
  };
184
- //@internal
184
+ /**
185
+ * Resolves an entity filter.
186
+ *
187
+ * This method takes a filter which can be either an instance of `EntityFilter`
188
+ * or a function that returns an instance of `EntityFilter` or a promise that
189
+ * resolves to an instance of `EntityFilter`. It then resolves the filter if it
190
+ * is a function and returns the resulting `EntityFilter`.
191
+ *
192
+ * @template entityType The type of the entity that the filter applies to.
193
+ * @param {EntityFilter<entityType> | (() => EntityFilter<entityType> | Promise<EntityFilter<entityType>>)} filter The filter to resolve.
194
+ * @returns {Promise<EntityFilter<entityType>>} The resolved entity filter.
195
+ */
185
196
  Filter.resolve = function (filter) {
186
197
  return tslib_1.__awaiter(this, void 0, void 0, function () {
187
198
  return tslib_1.__generator(this, function (_a) {