mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-11 18:42:56 +00:00
38 lines
920 B
TypeScript
38 lines
920 B
TypeScript
// interface UtilsMetadata {
|
|
// name: string;
|
|
// npm: {
|
|
// package: string;
|
|
// version?: string;
|
|
// exportName: string;
|
|
// subName?: string;
|
|
// destructuring?: boolean;
|
|
// main?: string;
|
|
// };
|
|
// }
|
|
|
|
// invalid code
|
|
|
|
// interface LibrayMap {
|
|
// [key: string]: string;
|
|
// }
|
|
|
|
// export function getProjectUtils(librayMap: LibrayMap, utilsMetadata: UtilsMetadata[]) {
|
|
|
|
// const projectUtils: { [packageName: string]: any } = {};
|
|
// if (utilsMetadata) {
|
|
// utilsMetadata.forEach(meta => {
|
|
// if (librayMap[meta?.npm.package]) {
|
|
// const lib = window[librayMap[meta?.npm.package] as any];
|
|
// }
|
|
// });
|
|
// }
|
|
// }
|
|
|
|
/**
|
|
* judges if current simulator renderer deteched or not
|
|
* @returns detached or not
|
|
*/
|
|
export function isRendererDetached() {
|
|
// if current iframe detached from host document, the `window.parent` will be undefined.
|
|
return !window.parent;
|
|
} |