Skip to content

Commit

Permalink
Merge pull request #111 from dxfrontier/fix/readme
Browse files Browse the repository at this point in the history
docs(readme): fixed readme
  • Loading branch information
dragolea authored Jan 9, 2025
2 parents d5b52c2 + 3cd4bbc commit a173887
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1847,13 +1847,18 @@ Use `Filter` to create complex `WHERE QUERY` filters.

# Overloads

| # | Method | Parameters | Description |
|----|-----------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 1 | `new Filter<T>(options: FilterOptions<T>)` | `options ({`field`: keyof T (string), `operator`: FilterOperator, `value`: string | number | boolean | null | string[] | number[] })` | Creates a new filter. `T` should be generated using [CDS-Typer](#generate-cds-typed-entities). <br /><br /> `FilterOperator` values: `'EQUALS'`, `'NOT EQUAL'`, `'LIKE'`, `'STARTS_WITH'`, `'ENDS_WITH'`, `'LESS THAN'`, `'LESS THAN OR EQUALS'`, `'GREATER THAN'`, `'GREATER THAN OR EQUALS'`, `'IN'`, `'NOT IN'`. `'IS NULL'`, `'IS NOT NULL'` |
| 2 | `new Filter<T>(options: FilterOptions<T>)` | `options ({`field` : keyof T (string), `operator` : FilterOperator, `value1`: string | number | boolean | null | string[] | number[] }, `value2`: string | number | boolean | null | string[] | number[] })` | Creates a new filter. `T` should be generated using [CDS-Typer](#generate-cds-typed-entities). <br /><br /> `FilterOperator` values: `'BETWEEN'`, `'NOT BETWEEN'` |
| 3 | `new Filter<T>(options: FilterOptions<T>)` | `options ({`field`: keyof T (string), `operator`: FilterOperator})` | Creates a new filter. `T` should be generated using [CDS-Typer](#generate-cds-typed-entities). <br /><br /> `FilterOperator` values: `'IS NULL'`, `'IS NOT NULL'` |
| 4 | `new Filter(operator: LogicalOperator, ...filters: Filter<T>)` | `operator (string)`, `filters Array<Filter>` | Creates a new Filter instance that combines 2 ... n **filters** with a Logical operator `'AND'`, `'OR'`. |
| 5 | `new Filter<T>(filters: (Filter<T> | LogicalOperator | Filter<T>)[])` | `filters (Array)` | Creates a multidimensional filter combining nested filters, logical operators `'AND'`, `'OR'`, and arrays of other filters. |
| # | Method | Parameters | Description |
|----|-----------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 1 | `new Filter<T>(options: FilterOptions<T>)` | `options`:<br />- `field`: `keyof T` (string)<br />- `operator`: `FilterOperator`<br />- `value`: `string`, `number`, `boolean`, `null`, `string[]`, `number[]` | Creates a new filter based on a field, operator, and value. <br /><br /> `FilterOperator` values: `'EQUALS'`, `'NOT EQUAL'`, `'LIKE'`, `'STARTS_WITH'`, `'ENDS_WITH'`, `'LESS THAN'`, `'LESS THAN OR EQUALS'`, `'GREATER THAN'`, `'GREATER THAN OR EQUALS'`, `'IN'`, `'NOT IN'`. |
| 2 | `new Filter<T>(options: FilterOptions<T>)` | `options`:<br />- `field`: `keyof T` (string)<br />- `operator`: `FilterOperator`<br />- `value1`: `string`, `number`, `string[]`, `number[]`<br />- `value2`: `string`, `number`, `string[]`, `number[]` | Creates a new filter for range operations. <br /><br /> `FilterOperator` values: `'BETWEEN'`, `'NOT BETWEEN'`. |
| 3 | `new Filter<T>(options: FilterOptions<T>)` | `options`:<br />- `field`: `keyof T` (string)<br />- `operator`: `FilterOperator` | Creates a new filter for null checks. <br /><br /> `FilterOperator` values: `'IS NULL'`, `'IS NOT NULL'`. |
| 4 | `new Filter(operator: LogicalOperator, ...filters: Filter<T>)` | `operator`: `LogicalOperator` (`'AND'`, `'OR'`)<br />`filters`: `Array<Filter<T>>` | Combines two or more filters with a logical operator. |
| 5 | `new Filter<T>(filters: (Filter<T> | LogicalOperator | Filter<T>)[])` | `filters`: `Array<Filter<T> | LogicalOperator>` | Creates a multidimensional filter combining nested filters and logical operators (`'AND'`, `'OR'`) with arrays of other filters. |

> [!NOTE]
> - `T` should be a type generated using [CDS-Typer](#generate-cds-typed-entities).
> - `FilterOperator` values are predefined operators for filtering.
> - `LogicalOperator` values are `'AND'` and `'OR'`, used to combine multiple filters.
`Example 1` : Single filter

Expand Down

0 comments on commit a173887

Please sign in to comment.