update siyuan.d.ts
This commit is contained in:
parent
d536f9b25d
commit
df1363e410
1 changed files with 134 additions and 5 deletions
139
src/siyuan.d.ts
vendored
139
src/siyuan.d.ts
vendored
|
@ -1,14 +1,27 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023, SiYuan, frostime, Terwer . All rights reserved.
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare module "siyuan" {
|
declare module "siyuan" {
|
||||||
type TEventBus = "ws-main"
|
type TEventBus = "ws-main" | "click-blockicon" | "click-editorcontent" | "click-pdf"
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface Window {
|
||||||
|
Lute: Lute
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
interface IObject {
|
interface IObject {
|
||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface ILuteNode {
|
||||||
|
TokensStr: () => string;
|
||||||
|
__internal_object__: {
|
||||||
|
Parent: {
|
||||||
|
Type: number,
|
||||||
|
},
|
||||||
|
HeadingLevel: string,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
interface IWebSocketData {
|
interface IWebSocketData {
|
||||||
cmd: string
|
cmd: string
|
||||||
callback?: string
|
callback?: string
|
||||||
|
@ -93,6 +106,8 @@ declare module "siyuan" {
|
||||||
|
|
||||||
onunload(): void;
|
onunload(): void;
|
||||||
|
|
||||||
|
onLayoutReady(): void;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @param {string} [options.position=right]
|
* @param {string} [options.position=right]
|
||||||
*/
|
*/
|
||||||
|
@ -132,6 +147,14 @@ declare module "siyuan" {
|
||||||
update?: () => void,
|
update?: () => void,
|
||||||
init: () => void
|
init: () => void
|
||||||
}): any
|
}): any
|
||||||
|
|
||||||
|
addFloatLayer(options: {
|
||||||
|
ids: string[],
|
||||||
|
defIds?: string[],
|
||||||
|
x?: number,
|
||||||
|
y?: number,
|
||||||
|
targetElement?: HTMLElement
|
||||||
|
}): void
|
||||||
}
|
}
|
||||||
|
|
||||||
export class EventBus {
|
export class EventBus {
|
||||||
|
@ -182,4 +205,110 @@ declare module "siyuan" {
|
||||||
|
|
||||||
close(): void;
|
close(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
declare class Lute {
|
||||||
|
public static WalkStop: number;
|
||||||
|
public static WalkSkipChildren: number;
|
||||||
|
public static WalkContinue: number;
|
||||||
|
public static Version: string;
|
||||||
|
public static Caret: string;
|
||||||
|
|
||||||
|
public static New(): Lute;
|
||||||
|
|
||||||
|
public static EChartsMindmapStr(text: string): string;
|
||||||
|
|
||||||
|
public static NewNodeID(): string;
|
||||||
|
|
||||||
|
public static Sanitize(html: string): string;
|
||||||
|
|
||||||
|
public static EscapeHTMLStr(str: string): string;
|
||||||
|
|
||||||
|
public static UnEscapeHTMLStr(str: string): string;
|
||||||
|
|
||||||
|
public static GetHeadingID(node: ILuteNode): string;
|
||||||
|
|
||||||
|
public static BlockDOM2Content(html: string): string;
|
||||||
|
|
||||||
|
private constructor();
|
||||||
|
|
||||||
|
public BlockDOM2Content(text: string): string;
|
||||||
|
|
||||||
|
public BlockDOM2EscapeMarkerContent(text: string): string;
|
||||||
|
|
||||||
|
public SetTextMark(enable: boolean): void;
|
||||||
|
|
||||||
|
public SetHeadingID(enable: boolean): void;
|
||||||
|
|
||||||
|
public SetProtyleMarkNetImg(enable: boolean): void;
|
||||||
|
|
||||||
|
public SetSpellcheck(enable: boolean): void;
|
||||||
|
|
||||||
|
public SetFileAnnotationRef(enable: boolean): void;
|
||||||
|
|
||||||
|
public SetSetext(enable: boolean): void;
|
||||||
|
|
||||||
|
public SetYamlFrontMatter(enable: boolean): void;
|
||||||
|
|
||||||
|
public SetChineseParagraphBeginningSpace(enable: boolean): void;
|
||||||
|
|
||||||
|
public SetRenderListStyle(enable: boolean): void;
|
||||||
|
|
||||||
|
public SetImgPathAllowSpace(enable: boolean): void;
|
||||||
|
|
||||||
|
public SetKramdownIAL(enable: boolean): void;
|
||||||
|
|
||||||
|
public BlockDOM2Md(html: string): string;
|
||||||
|
|
||||||
|
public BlockDOM2StdMd(html: string): string;
|
||||||
|
|
||||||
|
public SetGitConflict(enable: boolean): void;
|
||||||
|
|
||||||
|
public SetSuperBlock(enable: boolean): void;
|
||||||
|
|
||||||
|
public SetTag(enable: boolean): void;
|
||||||
|
|
||||||
|
public SetMark(enable: boolean): void;
|
||||||
|
|
||||||
|
public SetSub(enable: boolean): void;
|
||||||
|
|
||||||
|
public SetSup(enable: boolean): void;
|
||||||
|
|
||||||
|
public SetBlockRef(enable: boolean): void;
|
||||||
|
|
||||||
|
public SetSanitize(enable: boolean): void;
|
||||||
|
|
||||||
|
public SetHeadingAnchor(enable: boolean): void;
|
||||||
|
|
||||||
|
public SetImageLazyLoading(imagePath: string): void;
|
||||||
|
|
||||||
|
public SetInlineMathAllowDigitAfterOpenMarker(enable: boolean): void;
|
||||||
|
|
||||||
|
public SetToC(enable: boolean): void;
|
||||||
|
|
||||||
|
public SetIndentCodeBlock(enable: boolean): void;
|
||||||
|
|
||||||
|
public SetParagraphBeginningSpace(enable: boolean): void;
|
||||||
|
|
||||||
|
public SetFootnotes(enable: boolean): void;
|
||||||
|
|
||||||
|
public SetLinkRef(enalbe: boolean): void;
|
||||||
|
|
||||||
|
public SetEmojiSite(emojiSite: string): void;
|
||||||
|
|
||||||
|
public PutEmojis(emojis: IObject): void;
|
||||||
|
|
||||||
|
public SpinBlockDOM(html: string): string;
|
||||||
|
|
||||||
|
public Md2BlockDOM(html: string): string;
|
||||||
|
|
||||||
|
public SetProtyleWYSIWYG(wysiwyg: boolean): void;
|
||||||
|
|
||||||
|
public MarkdownStr(name: string, md: string): string;
|
||||||
|
|
||||||
|
public IsValidLinkDest(text: string): boolean;
|
||||||
|
|
||||||
|
public BlockDOM2InlineBlockDOM(html: string): string;
|
||||||
|
|
||||||
|
public BlockDOM2HTML(html: string): string;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue