Skip to content

Commit

Permalink
Fix #2467: Typescript use enums for options (#2488)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Dec 13, 2021
1 parent 203b429 commit 4100afd
Showing 1 changed file with 26 additions and 32 deletions.
58 changes: 26 additions & 32 deletions src/components/api/Api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,45 +283,39 @@ export interface PrimeIconsOptions {
export declare const PrimeIcons: PrimeIconsOptions;

// Severity
export interface MessageSeverityOptions {
readonly SUCCESS: string;
readonly INFO: string;
readonly WARN: string;
readonly ERROR: string;
export declare enum MessageSeverity {
SUCCESS = 'success',
INFO = 'info',
WARN = 'warn',
ERROR = 'error'
}

export declare const MessageSeverity: MessageSeverityOptions;

// Filter
export interface FilterMatchModeOptions {
readonly STARTS_WITH: string;
readonly CONTAINS: string;
readonly NOT_CONTAINS: string;
readonly ENDS_WITH: string;
readonly EQUALS: string;
readonly NOT_EQUALS: string;
readonly IN: string;
readonly LESS_THAN: string;
readonly LESS_THAN_OR_EQUAL_TO: string;
readonly GREATER_THAN: string;
readonly GREATER_THAN_OR_EQUAL_TO: string;
readonly BETWEEN: string;
readonly DATE_IS: string;
readonly DATE_IS_NOT: string;
readonly DATE_BEFORE: string;
readonly DATE_AFTER: string;
readonly CUSTOM: string;
export declare enum FilterMatchMode {
STARTS_WITH = 'startsWith',
CONTAINS = 'contains',
NOT_CONTAINS = 'notContains',
ENDS_WITH = 'endsWith',
EQUALS = 'equals',
NOT_EQUALS = 'notEquals',
IN = 'in',
LESS_THAN = 'lt',
LESS_THAN_OR_EQUAL_TO = 'lte',
GREATER_THAN = 'gt',
GREATER_THAN_OR_EQUAL_TO = 'gte',
BETWEEN = 'between',
DATE_IS = 'dateIs',
DATE_IS_NOT = 'dateIsNot',
DATE_BEFORE = 'dateBefore',
DATE_AFTER = 'dateAfter',
CUSTOM = 'custom'
}

export declare const FilterMatchMode: FilterMatchModeOptions;

export interface FilterOperatorOptions {
readonly AND: string;
readonly OR: string;
export declare enum FilterOperator {
AND = 'and',
OR = 'or'
}

export declare const FilterOperator: FilterOperatorOptions;

export declare namespace FilterService {
export function filter(value: any, fields: string[], filterValue: any, filterMatchMode: string, filterLocale?: string): any[];
export interface filters {
Expand Down

0 comments on commit 4100afd

Please sign in to comment.