export declare const queryCases: string[]; export declare const supportOrders: string[]; /** * Convert query string (snake case or camel case) to DB order array * Support convert: * id => [['id', 'ASC']] * -created_at => [['createdAt', 'DESC']] * -id,created_at => [['id', 'DESC'], ['createdAt', 'ASC']] */ export declare class OrderScaffold { queryCase: string; fieldCase: string; fields: string[]; defaultOrderField: string | null; defaultOrder: string; constructor(queryCase?: string, fieldCase?: string); setFields(fields?: string[], defaultOrderField?: string | null, defaultOrder?: string): void; getAvailableOrders(): Record; /** * Return sequelize order array */ getOrderByQuery(queryString?: string | null): [string, string][]; } export declare const filterTypes: { string: string; number: string; }; export declare const supportOperators: Record; type FilterSchemaOptions = { format?: string | null; description?: string | null; defaultValue?: unknown; enumerate?: unknown[] | null; operators?: string[] | null; }; type FilterSchemaEntry = { type: string; description: string | null; operators: string[]; defaultValue: unknown; enumerate: unknown[] | null; }; /** * Filter Schema: { * name: 'id', * description: 'foo', * type: 'string', * format: 'date', * operators: ['$like'], * defaultValue: 0, * enumerate: [1, 2, 3] * } */ /** * Convert url queries to DB where conditions (JSON object) * DB where conditions format as same as sequelize where querying: * http://docs.sequelizejs.com/en/latest/docs/querying/#where * * URL query could be: * Key-Value object */ export declare class FilterScaffold { queryCase: string; fieldCase: string; schema: Record; constructor(queryCase?: string, fieldCase?: string); addFilterSchema(name: string, type?: string, options?: FilterSchemaOptions): this; getFilterSchema(): Record; setFilterSchema(schema: Record): this; getFieldAndOperator(key: string): [string, string | null]; getConditions(query: Record): Record; getConditionsByString(queryString: string, baseWhere?: Record): Record; } export {};