@logicflow/dumi-theme-simple
Version:
Simple website theme based on dumi2.
43 lines (42 loc) • 1.65 kB
TypeScript
export declare function replaceFetchUrl(sourceCode: string): string;
/**
* 通过代码提取代码片段的 pkg 依赖
* @param sourceCode
*/
export declare function extractImportDeps(sourceCode: string): any;
export declare function getCodeSandboxConfig(title: string, sourceCode: string, fileExtension: string, deps: any, devDependencies: any, playground: any): {
files: {
[key: string]: any;
};
};
export declare function getRiddleConfig(title: string, sourceCode: string, fileExtension: string, deps: any, devDependencies: any, playground: any): {
title: string;
js: string;
html: any;
json: string;
};
export declare function getStackblitzConfig(title: string, sourceCode: string, fileExtension: string, deps: any, devDependencies: any, playground: any): {
title: string;
description: string;
template: any;
dependencies: any;
files: {
[x: string]: any;
'index.html': any;
};
};
export declare function getHtmlCodeTemplate(title: string, sourceCode: string, fileExtension: string, deps: any, devDependencies: any, playground: any): any;
export declare function replaceInsertCss(str: string, lang: string): string;
/**
* 执行代码
* @param code 运行的代码
* @param playgroundScriptContainer 运行的节点
* @param container 代码中 container dom
* @param replaceId rid
* @param cb 回调错误
*/
export declare function execute(code: string, playgroundScriptContainer: string, container: string, replaceId?: string): void;
/**
* 编译代码
*/
export declare function compile(value: string, relativePath: string, es5?: boolean): Promise<any>;