@umijs/plugins
Version:
41 lines (40 loc) • 1.12 kB
TypeScript
import * as t from '@umijs/bundler-utils/compiled/babel/types';
import { IApi } from 'umi';
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 {};