選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

querystring.d.ts 1.1KB

1234567891011121314151617181920212223242526272829303132
  1. declare module "querystring" {
  2. interface StringifyOptions {
  3. encodeURIComponent?: (str: string) => string;
  4. }
  5. interface ParseOptions {
  6. maxKeys?: number;
  7. decodeURIComponent?: (str: string) => string;
  8. }
  9. interface ParsedUrlQuery { [key: string]: string | string[]; }
  10. interface ParsedUrlQueryInput {
  11. [key: string]:
  12. // The value type here is a "poor man's `unknown`". When these types support TypeScript
  13. // 3.0+, we can replace this with `unknown`.
  14. {} | null | undefined;
  15. }
  16. function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string;
  17. function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery;
  18. /**
  19. * The querystring.encode() function is an alias for querystring.stringify().
  20. */
  21. const encode: typeof stringify;
  22. /**
  23. * The querystring.decode() function is an alias for querystring.parse().
  24. */
  25. const decode: typeof parse;
  26. function escape(str: string): string;
  27. function unescape(str: string): string;
  28. }