Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export * from './interfaces/document';
export * from './interfaces/protocol';
export * from './interfaces/uicomponent';
export * from './interfaces/editor';
export * from './interfaces/papi';

export const DocHub: IDocHubCore = window['DocHub'];
export const Vue2: any = window['Vue'];
Expand Down
67 changes: 67 additions & 0 deletions interfaces/papi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
export type IClipboardValue = string

export interface IGotoParams {
id: string;
source: string;
entity: string;
}

export interface IProjectMode {
mode: string
}

export interface IUmlSourceCode {
uml: string
}

export interface ISourceDownloadParams {
content: string;
title: string;
description: string;
extension: string;
}

export interface ISourceSchema {
schema: string;
}

export interface IClipboardData<T = IClipboardValue> {
data: T
}

export interface IFileContent<T = string> {
source: string;
content: T
}

export interface ICodeMetadata {
code: string;
metadata: string;
}

export interface BasePapiEvents {
goTo(params: IGotoParams): void
applyEntitySchema(schema: ISourceSchema): void
registerLazyLoadedDiagrams(): void
}
export interface RenderPapiEvents {
renderPlantUml(uml: IUmlSourceCode): Promise<void>
}

export interface FileWorker {
initProject(mode: IProjectMode): void
download(source: ISourceDownloadParams): void
}

export interface IdeaPapiPlugin extends BasePapiEvents, RenderPapiEvents, FileWorker {
messagePull(): Promise<void>
pushFile(content: IFileContent): Promise<void>
pushCode(metadata: ICodeMetadata): Promise<void>
copyToClipboard(data: IClipboardData): void
}

export interface VsCodePapiPlugin extends BasePapiEvents, RenderPapiEvents, FileWorker {
loadingHtmlDocumentEvent(): void
checkIsRootManifest(): void
}