-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
34 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { DocsifyChatSetting } from '@/index.js'; | ||
|
||
declare global { | ||
type Hook<T = void> = T extends unknown[] ? (callback: (...args: T) => void) => void : (callback: () => void) => void; | ||
|
||
interface Docsify {} | ||
|
||
interface DocsifyHook { | ||
/** 初始化完成后调用,只调用一次,没有参数。 */ | ||
init: Hook; | ||
/** 每次开始解析 Markdown 内容时调用。 */ | ||
beforeEach: Hook<[string]>; | ||
/** 解析成 html 后调用。 */ | ||
afterEach: Hook<[string, (html: string) => void]>; | ||
/** 每次路由切换时数据全部加载完成后调用,没有参数。 */ | ||
doneEach: Hook; | ||
/** 初始化并第一次加载完成数据后调用,只触发一次,没有参数。 */ | ||
mounted: Hook; | ||
/** 初始化并第一次加载完成数据后调用,没有参数。 */ | ||
ready: Hook; | ||
} | ||
|
||
interface Window { | ||
$docsify?: { | ||
[k: string]: unknown; | ||
chat?: Partial<DocsifyChatSetting>; | ||
plugins?: Function[]; | ||
}; | ||
Docsify: Docsify; | ||
} | ||
} |
File renamed without changes.