UNPKG

@n1k1t/unit-generator

Version:

Coverage based unit tests AI generator

36 lines 1.67 kB
import { DataObject } from 'json2md'; import { TContentType } from './kinds/model'; import { SetPartialKeys } from '../../../types'; import { Project } from '../project'; import * as kinds from './kinds'; type TContentKind<K extends TContentType> = { attachment: kinds.AttachmentContent; sources: kinds.SourcesContent; article: kinds.ArticleContent; tasks: kinds.TasksContent; rules: kinds.RulesContent; group: kinds.GroupContent; plain: kinds.PlainContent; }[K]; export declare class ContentFactory { private project?; constructor(project?: Project | undefined); /** Creates `## Article` with nested content */ article(title: string, content: DataObject[]): kinds.ArticleContent; /** Creates rules list */ rules(list: string[]): kinds.RulesContent; /** Creates tasks list */ tasks(list: string[]): kinds.TasksContent; /** Creates sources links list */ sources(list: kinds.SourcesContent['TSchema']): kinds.SourcesContent; /** Creates plain markdown */ plain(payload: string): kinds.PlainContent; attachment(title: string, payload: Omit<SetPartialKeys<kinds.AttachmentContent['TSchema'], 'extension' | 'path' | 'isVirtual'>, 'title'>): kinds.AttachmentContent; file(title: string, location: string | string[]): Promise<kinds.AttachmentContent>; /** Reads files by pattern and creates attachments for each file */ glob(title: string, pattern: string): Promise<kinds.GroupContent>; static build(project?: Project): ContentFactory; static is<K extends TContentType>(type: K, content: unknown): content is TContentKind<K>; } export {}; //# sourceMappingURL=factory.d.ts.map