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