qs definitions

This commit is contained in:
Roman
2015-09-14 15:10:27 +03:00
parent 7a3ca1f0b8
commit 446099f04a
2 changed files with 44 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
/// <reference path="./qs.d.ts" />
import qs = require('qs');
qs.stringify({ a: 'b' });
qs.stringify({ a: 'b', c: 'd' }, { delimiter: '&' });
qs.parse('a=b');
qs.parse('a=b&c=d', { delimiter: '&' });
Vendored
+35
View File
@@ -0,0 +1,35 @@
// Type definitions for qs
// Project: https://github.com/hapijs/qs
// Definitions by: Roman Korneev <https://github.com/RWander>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module QueryString {
interface IStringifyOptions {
delimiter?: string;
strictNullHandling?: boolean;
skipNulls?: boolean;
encode?: boolean;
filter?: any;
arrayFormat?: any;
indices?: string;
}
interface IParseOptions {
delimiter?: string;
depth?: number;
arrayLimit?: number;
parseArrays?: boolean;
allowDots?: boolean;
plainObjects?: boolean;
allowPrototypes?: boolean;
parameterLimit?: number;
strictNullHandling?: boolean;
}
export function stringify(obj: any, options?: IStringifyOptions): string;
export function parse(str: string, options?: IParseOptions): any;
}
declare module "qs" {
export = QueryString;
}