@umijs/plugins
Version:
43 lines (42 loc) • 1.29 kB
TypeScript
import * as t from '@umijs/bundler-utils/compiled/babel/types';
import { type TransformResult } from '@umijs/bundler-utils/compiled/esbuild';
import { IApi } from 'umi';
export declare function transformSync(content: any, opts: any): TransformResult<any>;
interface IOpts {
contentTest?: (content: string) => Boolean;
astTest?: (opts: {
node: t.Node;
content: string;
}) => Boolean;
}
export declare function getNamespace(absFilePath: string, absSrcPath: string): string;
export declare class Model {
file: string;
namespace: string;
id: string;
exportName: string;
deps: string[];
constructor(file: string, absSrcPath: string, sort: {} | undefined, id: number);
findDeps(sort: object): string[];
}
export declare class ModelUtils {
api: IApi;
opts: IOpts;
count: number;
constructor(api: IApi | null, opts: IOpts);
getAllModels(opts: {
sort?: object;
extraModels: string[];
}): Model[];
getModels(opts: {
base: string;
pattern?: string;
}): string[];
isModelValid(opts: {
content: string;
file: string;
}): boolean;
static topologicalSort: (models: Model[]) => string[];
static getModelsContent(models: Model[]): string;
}
export {};