mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-14 03:04:21 +01:00
This commit is contained in:
parent
172b7ed018
commit
df3f444e48
6 changed files with 85 additions and 89 deletions
52
app/src/types/index.d.ts
vendored
52
app/src/types/index.d.ts
vendored
|
|
@ -81,17 +81,45 @@ type TAVFilterOperator =
|
|||
declare module "blueimp-md5"
|
||||
|
||||
interface Window {
|
||||
ABCJS?: IABCJS
|
||||
Viewer?: Function
|
||||
Viz?: IViz
|
||||
echarts?: IECharts
|
||||
hljs?: IHLJS
|
||||
katex?: IKaTeX
|
||||
mermaid?: IMermaid
|
||||
plantumlEncoder?: IPlantumlEncoder
|
||||
|
||||
echarts: {
|
||||
init(element: HTMLElement, theme?: string, options?: { width: number }): {
|
||||
setOption(option: any): void;
|
||||
getZr(): any;
|
||||
on(name: string, event: (e: any) => void): any;
|
||||
containPixel(name: string, position: number[]): any;
|
||||
resize(): void;
|
||||
};
|
||||
dispose(element: Element): void;
|
||||
getInstanceById(id: string): { resize: () => void };
|
||||
}
|
||||
ABCJS: {
|
||||
renderAbc(element: Element, text: string, options: { responsive: string }): void;
|
||||
}
|
||||
hljs: {
|
||||
listLanguages(): string[];
|
||||
highlight(text: string, options: { language?: string, ignoreIllegals: boolean }): { value: string };
|
||||
getLanguage(text: string): { name: string };
|
||||
};
|
||||
katex: {
|
||||
renderToString(math: string, option: {
|
||||
displayMode: boolean;
|
||||
output: string;
|
||||
macros: IObject;
|
||||
trust: boolean;
|
||||
strict: (errorCode: string) => "ignore" | "warn";
|
||||
}): string;
|
||||
}
|
||||
mermaid: {
|
||||
initialize(options: any): void,
|
||||
init(options: any, element: Element): void
|
||||
};
|
||||
plantumlEncoder: {
|
||||
encode(options: string): string,
|
||||
};
|
||||
pdfjsLib: any
|
||||
|
||||
dataLayer: any[]
|
||||
|
||||
siyuan: ISiyuan
|
||||
webkit: any
|
||||
html2canvas: (element: Element, opitons: {
|
||||
|
|
@ -353,11 +381,7 @@ interface ISiyuan {
|
|||
bookmarkLabel?: string[]
|
||||
blockPanels: import("../block/Panel").BlockPanel[],
|
||||
dialogs: import("../dialog").Dialog[],
|
||||
viewer?: {
|
||||
destroyed: boolean,
|
||||
show: () => void,
|
||||
destroy: () => void,
|
||||
}
|
||||
viewer?: Viewer
|
||||
}
|
||||
|
||||
interface IScrollAttr {
|
||||
|
|
|
|||
88
app/src/types/protyle.d.ts
vendored
88
app/src/types/protyle.d.ts
vendored
|
|
@ -1,55 +1,3 @@
|
|||
interface IABCJS {
|
||||
renderAbc(element: Element, text: string, options: { responsive: string }): void;
|
||||
}
|
||||
|
||||
interface IViz {
|
||||
new(worker: { worker: Worker }): IViz;
|
||||
renderSVGElement: (code: string) => Promise<any>;
|
||||
}
|
||||
|
||||
interface IEChartsInstance {
|
||||
setOption(option: any): void;
|
||||
|
||||
getZr(): any;
|
||||
|
||||
on(name: string, event: (e: any) => void): any;
|
||||
|
||||
containPixel(name: string, position: number[]): any;
|
||||
|
||||
resize(): void;
|
||||
}
|
||||
|
||||
interface IECharts {
|
||||
init(element: HTMLElement, theme?: string, options?: { width: number }): IEChartsInstance;
|
||||
dispose(element: Element): void;
|
||||
getInstanceById(id: string): { resize: () => void };
|
||||
}
|
||||
|
||||
interface IHLJS {
|
||||
highlight(text: string, options: { language?: string, ignoreIllegals: boolean }): { value: string };
|
||||
getLanguage(text: string): { name: string };
|
||||
listLanguages(): string[];
|
||||
}
|
||||
|
||||
interface IKaTeX {
|
||||
renderToString(math: string, option: {
|
||||
displayMode: boolean;
|
||||
output: string;
|
||||
macros: IObject;
|
||||
trust: boolean;
|
||||
strict: (errorCode: string) => "ignore" | "warn";
|
||||
}): string;
|
||||
}
|
||||
|
||||
interface IMermaid {
|
||||
initialize(options: any): void;
|
||||
init(options: any, element: Element): void;
|
||||
}
|
||||
|
||||
interface IPlantumlEncoder {
|
||||
encode(options: string): string;
|
||||
}
|
||||
|
||||
interface ILuteNode {
|
||||
TokensStr: () => string;
|
||||
__internal_object__: {
|
||||
|
|
@ -149,6 +97,42 @@ interface ILuteOptions extends IMarkdownConfig {
|
|||
lazyLoadImage?: string;
|
||||
}
|
||||
|
||||
declare class Viz {
|
||||
constructor(worker: { worker: Worker });
|
||||
|
||||
renderSVGElement: (code: string) => Promise<any>;
|
||||
}
|
||||
|
||||
declare class Viewer {
|
||||
public destroyed: boolean;
|
||||
|
||||
constructor(element: Element, options: {
|
||||
title: [number, (image: HTMLImageElement, imageData: IObject) => string],
|
||||
button: boolean,
|
||||
initialViewIndex?: number,
|
||||
transition: boolean,
|
||||
hidden: () => void,
|
||||
toolbar: {
|
||||
zoomIn: boolean,
|
||||
zoomOut: boolean,
|
||||
oneToOne: boolean,
|
||||
reset: boolean,
|
||||
prev: boolean,
|
||||
play: boolean,
|
||||
next: boolean,
|
||||
rotateLeft: boolean,
|
||||
rotateRight: boolean,
|
||||
flipHorizontal: boolean,
|
||||
flipVertical: boolean,
|
||||
close: () => void
|
||||
}
|
||||
})
|
||||
|
||||
public destroy(): void
|
||||
|
||||
public show(): void
|
||||
}
|
||||
|
||||
declare class Lute {
|
||||
public static WalkStop: number;
|
||||
public static WalkSkipChildren: number;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue