jQuery.json的TypeScript声明文件(jquery.json.d.ts)


因用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;
}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM