kibana/x-pack/typings/query_string.d.ts
Alexey Antonov 9d00427aef
Downgrade to query-string v5.1.1 (#59633)
* Downgrade to query-string v5.1.1

* update lib version for x-pack

* fix JEST

* fix functional tests

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-13 17:27:09 +03:00

34 lines
1 KiB
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
declare module 'query-string' {
type ArrayFormat = 'bracket' | 'index' | 'none';
export interface ParseOptions {
arrayFormat?: ArrayFormat;
sort?: ((itemLeft: string, itemRight: string) => number) | false;
}
export interface ParsedQuery<T = string> {
[key: string]: T | T[] | null | undefined;
}
export function parse(str: string, options?: ParseOptions): ParsedQuery;
export function parseUrl(str: string, options?: ParseOptions): { url: string; query: any };
export interface StringifyOptions {
strict?: boolean;
encode?: boolean;
arrayFormat?: ArrayFormat;
sort?: ((itemLeft: string, itemRight: string) => number) | false;
}
export function stringify(obj: object, options?: StringifyOptions): string;
export function extract(str: string): string;
}