generator-begcode
Version:
Spring Boot + Angular/React/Vue in one handy generator
31 lines (30 loc) • 1.77 kB
TypeScript
import type CoreGenerator from '../../base-core/index.js';
import type { CascatedEditFileCallback, EditFileCallback, NeedleCallback } from '../api.js';
export type NeedleInsertion = {
needle: string;
contentToAdd: string | string[] | ((content: string, options: {
needleIndent: number;
indentPrefix: string;
}) => string);
contentToCheck?: string | RegExp;
ignoreWhitespaces?: boolean;
optional?: boolean;
autoIndent?: boolean;
};
type NeedleFileInsertion = NeedleInsertion & {
filePath?: string;
needlesPrefix?: string;
};
type NeedleContentInsertion = NeedleInsertion & {
content: string;
};
export declare const convertToPrettierExpressions: (str: string) => string;
export declare const checkContentIn: (contentToCheck: string | RegExp, content: any, ignoreWhitespaces?: boolean) => boolean;
export declare const insertContentBeforeNeedle: ({ content, contentToAdd, needle, autoIndent }: NeedleContentInsertion) => string | null;
export declare const createNeedleCallback: <Generator extends CoreGenerator = CoreGenerator>({ needle, contentToAdd, contentToCheck, optional, ignoreWhitespaces, autoIndent, }: NeedleInsertion) => EditFileCallback<Generator>;
export declare function createBaseNeedle(options: Omit<NeedleFileInsertion, 'filePath' | 'needle' | 'contentToAdd'>, needles: Record<string, string>): NeedleCallback;
export declare function createBaseNeedle(needles: Record<string, string>): NeedleCallback;
export declare function createBaseNeedle<Generator extends CoreGenerator = CoreGenerator>(this: Generator, options: Omit<NeedleFileInsertion, 'filePath' | 'needle' | 'contentToAdd'> & {
filePath: string;
}, needles: Record<string, string>): CascatedEditFileCallback<Generator>;
export {};