因用TypeScript时,NuGet没有jquery.json的声明文件下载,自己写了一个。分享一下。

interface JQueryStatic {
    /**
     * Converts the given argument into a JSON representation.
     *
     * @param o {Mixed} The json-serializable *thing* to be converted
     *
     * If an object has a toJSON prototype, that will be used to get the representation.
     * Non-integer/string keys are skipped in the object, as are keys that point to a
     * function.
     *
     */
    toJSON(o: any): string;

    /**
     * Evaluates a given json string.
     *
     * @param str {String}
     */
    evalJSON(str: string): boolean;

    /**
     * Evals JSON in a way that is *more* secure.
     *
     * @param str {String}
     */
    secureEvalJSON(str: string): boolean;

    /**
     * Returns a string-repr of a string, escaping quotes intelligently.
     * Mostly a support function for toJSON.
     * Examples:
     * >>> jQuery.quoteString('apple')
     * "apple"
     *
     * >>> jQuery.quoteString('"Where are we going?", she asked.')
     * "\"Where are we going?\", she asked."
     */
    quoteString(str: string): string;
}

 

相关文章:

  • 2022-01-26
  • 2022-01-08
  • 2021-10-20
  • 2022-01-22
  • 2022-12-23
  • 2021-11-01
  • 2021-06-26
猜你喜欢
  • 2021-09-24
  • 2022-12-23
  • 2021-10-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
相关资源
相似解决方案