import { CodeRW } from '@iteria-app/generator'; import ts from 'typescript'; import { BUNDLER_ERROR, TRANSPILER_ERROR } from './messaging/messageTypes'; import { DirectoryFiles } from './watcher/WriterFetchFS'; export interface DevtoolsTreeNode { children: number[]; depth: number; displayName: string | null; hocDisplayNames: string[] | null; id: number; isCollapsed: boolean; key: number | null; ownerID: number; parentID: number; type: number; weight: number; } export interface BrowserCaches { readonly transpiledCache: CodeRW; readonly sourcesCache: CodeRW; } export interface IFiles { [path: string]: string; } export interface EditorPosition { lineNumber: number; columnNumber: number; } export interface ElementHighlightOffset { top: number; right: number; left: number; bottom: number; height: number; width: number; } export interface ErrorData { err: Error; } export interface TransferableError { type: typeof BUNDLER_ERROR | typeof TRANSPILER_ERROR; error: Error; } export interface Translations { langs: {}; } export interface EnvObject { [key: string]: string; } export interface FeatureFlags { tippy?: boolean; generator?: boolean; addFields?: boolean; translations?: boolean; themeEditor?: boolean; graphQLEndpoint?: boolean; erd?: boolean; commit?: boolean; save?: boolean; } export interface TemplateField { id: string; multipleFields: boolean; name: string; required: boolean; validTypes: string[]; } export interface TemplateVariables { entities: { id: string; minValues: number; name: string; required: boolean; }[]; components: { name: string; props: []; fields: TemplateField[]; }[]; generatePagePreviewUrl?: string; } export interface FieldTemplate extends DirectoryFiles { templateName: string; runtimeComponents?: DirectoryFiles[]; type: string[]; } export interface TemplateEntityFields { [variableName: string]: TemplateEntityField[]; } export interface TemplateEntity { [entityName: string]: TemplateComponents; } export interface TemplateComponents { [componentName: string]: TemplateEntityFields; } export interface TemplateEntityField { name: string; type: string; } export interface ArrayLookup { name: string; path: string; ast: ts.Node; }