search-params
Version:
A module to manipulate search part of URLs (querystring)
19 lines (18 loc) • 886 B
TypeScript
export declare type arrayFormat = 'none' | 'brackets' | 'index';
export declare type booleanFormat = 'none' | 'string' | 'unicode' | 'empty-true';
export declare type nullFormat = 'default' | 'string' | 'hidden';
export interface IOptions {
arrayFormat?: arrayFormat;
booleanFormat?: booleanFormat;
nullFormat?: nullFormat;
}
export interface IFinalOptions {
arrayFormat: arrayFormat;
booleanFormat: booleanFormat;
nullFormat: nullFormat;
}
export declare const makeOptions: (opts?: IOptions) => IFinalOptions;
export declare const decodeValue: (value: string) => string;
export declare const encodeArray: (name: string, arr: any[], opts: IFinalOptions) => string;
export declare const encode: (name: string, value: any, opts: IFinalOptions) => string;
export declare const decode: (value: any, opts: IFinalOptions) => string | boolean | null;