import type { Directory, Project } from 'ts-morph'; import type { PluginProps } from '@stackpress/idea-transformer/types'; import type { SchemaConfig, Data } from '@stackpress/idea-parser'; export type { EnumConfig, ModelConfig, TypeConfig, PropConfig, PluginConfig, SchemaConfig } from '@stackpress/idea-parser/types'; import type Terminal from 'stackpress-server/Terminal'; import type DefinitionInterface from './interface/DefinitionInterface.js'; import type SchemaInterface from './interface/SchemaInterface.js'; export type AttributeData = Record> = { type: Array; name: string; description?: string; args: Array<{ spread: boolean; type: Array>; name?: string; required: boolean; description: string; examples: Array; }>; data?: D; }; export type AttributeDataMap = Record> = Record>>; export type AttributeDataComponent = { name: string; import: { from: string; default: boolean; }; attributes: Record; }; export type AttributeDataAssertion = { name: string; message: string; }; export type TypeAssertionMap = Record; export type DefinitionBook = Map>; export type AttributeDefinitionInput = { method: boolean; flag: boolean; description: string; args: Array<{ spread: boolean; type: Array>; required: boolean; description: string; examples: Array; }>; }; export type AttributeDefinitionToken = AttributeDefinitionInput & { kind: string; }; export type AttributeComponentInput = AttributeDataComponent & { props: Record; }; export type AttributeComponentToken = AttributeComponentInput & { kind: string; }; export type AttributeAssertionInput = AttributeDataAssertion; export type AttributeAssertionToken = AttributeAssertionInput; export type AttributeMapToken = Record; export type AttributesEntriesToken = Array<[string, Data[] | boolean]>; export type AttributesToken = AttributesEntriesToken | AttributeMapToken; export type ColumnTypeToken = { name: string; required: boolean; multiple: boolean; }; export type ColumnToken = { name: string; type: ColumnTypeToken; attributes?: AttributesToken; }; export type ColumnAssertionToken = AttributeAssertionToken & { args: unknown[]; }; export type ColumnRelationProps = { local: string; foreign: string; name?: string; }; export type IsArrayOrObject = T extends any[] ? true : T extends object ? (T extends Function ? false : true) : false; export type DefinitionInterfaceMap = { [key: string]: DefinitionInterface; }; export type AssertInterfaceMap = { [K in keyof C]: C[K] extends DefinitionInterface ? A : unknown; }; export type SerializeInterfaceMap = { [K in keyof C]: C[K] extends DefinitionInterface ? (IsArrayOrObject extends true ? string : S) : unknown; }; export type UnserializeInterfaceMap = { [K in keyof C]: C[K] extends DefinitionInterface ? U : unknown; }; export type ErrorReport = string | ErrorReport[] | { [key: string]: ErrorReport; }; export type ClientProjectProps = { terminal: Terminal; project: Project; directory: Directory; }; export type ClientPluginProps = PluginProps; export type ClientFieldset = Record, C extends DefinitionInterfaceMap = DefinitionInterfaceMap> = { Schema: { new (seed?: string): SchemaInterface; }; columns: C; }; export type Client = Record> = { config: SchemaConfig; model: F; fieldset: F; }; export type ClientPlugin = Record> = (nullable?: boolean) => Promise>; export type ClientConfig = { build?: string; lang?: string; module: string; package: string; revisions?: string; tsconfig: string; prettier?: { semi?: boolean; singleQuote?: boolean; jsxSingleQuote?: boolean; trailingComma?: 'none' | 'es5' | 'all'; bracketSpacing?: boolean; objectWrap?: 'preserve' | 'collapse'; bracketSameLine?: boolean; requirePragma?: boolean; insertPragma?: boolean; checkIgnorePragma?: boolean; proseWrap?: 'always' | 'never' | 'preserve'; arrowParens?: 'avoid' | 'always'; htmlWhitespaceSensitivity?: 'css' | 'strict' | 'ignore'; endOfLine?: 'auto' | 'lf' | 'crlf' | 'cr'; quoteProps?: 'as-needed' | 'consistent' | 'preserve'; embeddedLanguageFormatting?: 'auto' | 'off'; singleAttributePerLine?: boolean; experimentalOperatorPosition?: 'start' | 'end'; experimentalTernaries?: boolean; jsxBracketSameLine?: boolean; }; };