diff --git a/README.md b/README.md index 849168c..31c1ba1 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,4 @@ scrapbox関連の型定義ファイル -[document](https://doc.deno.land/https/raw.githubusercontent.com%2Fscrapbox-jp%2Ftypes%2F0.0.4%2Fmod.ts) +[document](https://doc.deno.land/https/raw.githubusercontent.com%2Fscrapbox-jp%2Ftypes%2F0.0.5%2Fmod.ts) diff --git a/userscript.ts b/userscript.ts index 176ae5a..434dadc 100644 --- a/userscript.ts +++ b/userscript.ts @@ -35,7 +35,7 @@ export type Scrapbox = removeAllItems: () => void; }; } - & UserScriptEvents + & UserScriptEventTarget & ({ Layout: | "list" @@ -60,8 +60,18 @@ export type Scrapbox = }; }); -export interface UserScriptEvents { +export interface UserScriptEventTarget { + /** Register an event listener to Scrapbox + * + * @param type the event type the event listener registers to + * @param the event listener + */ addListener: (type: string, listener: () => void) => void; + /** Register an event listener to Scrapbox + * + * @param type the event type the event listener registers to + * @param the event listener + */ on: (type: string, listener: () => void) => void; removeListener: (type: string, listener: () => void) => void; off: (type: string, listener: () => void) => void;