InserliSenseとインタフェース

3325 ワード

以下のインターフェイス定義です:
export interface InjectDetails {
        /**
         * Optional.
         * If allFrames is true, implies that the JavaScript or CSS should be injected into all frames of current page. By default, it's false and is only injected into the top frame.
         */
        allFrames?: boolean;
        /**
         * Optional. JavaScript or CSS code to inject.
         * Warning: Be careful using the code parameter. Incorrect use of it may open your extension to cross site scripting attacks.
         */
        code?: string;
        /**
         * Optional. The soonest that the JavaScript or CSS will be injected into the tab.
         * One of: "document_start", "document_end", or "document_idle"
         * @since Chrome 20.
         */
        runAt?: string;
        /** Optional. JavaScript or CSS file to inject. */
        file?: string;
...
ここで説明するように宣言を行います.
let details
  :chrome.tabs.InjectDetails
見つける.しかし、このコードは動作しません.
details.code = "";
'詳細'の名前をホバリングエラーを示しています.

これは、使用する前に値を割り当てることを指示します.
let details
 :chrome.tabs.InjectDetails 
    = {}
details.code="";
我々が現在「詳細」を乗り越えるならば、我々はすべての資産定義を見ます.

我々はコードとして、IntelliSenseは、APIを学ぶための最良の方法です!また、上記のJSDOCをサポートしています.
Typescript Intellisense Reference
インタフェースとインタフェース