переименования папок

This commit is contained in:
2025-07-21 15:02:10 +03:00
parent d0c79bd334
commit 84f0c9c6aa
72 changed files with 245 additions and 249 deletions

92
src/type/formula-api.ts Normal file
View File

@@ -0,0 +1,92 @@
/**
* Типы для API формул электронных таблиц
*/
export interface FormulaApiConfig {
baseUrl: string
apiKey?: string
timeout?: number
}
export interface FormulaApiError {
code: string
message: string
timestamp: string
}
export interface FormulaApiEvent {
type:
| 'SAVE_START'
| 'SAVE_SUCCESS'
| 'SAVE_ERROR'
| 'LOAD_START'
| 'LOAD_SUCCESS'
| 'LOAD_ERROR'
templateId: string
version?: number
error?: FormulaApiError
}
export interface SaveFormulasRequest {
templateId: string
formulaData: Record<string, Record<string, any>>
timestamp: string
}
export interface SaveFormulasResponse {
success: boolean
templateId: string
version: number
timestamp: string
message: string
}
export interface LoadFormulasRequest {
templateId: string
version?: number
}
export interface LoadFormulasResponse {
success: boolean
notFound?: boolean
data?: TemplateFormulaData
message: string
}
export interface FormulaHistoryRequest {
templateId: string
limit?: number
}
export interface FormulaHistoryResponse {
success: boolean
history: Array<{
version: number
timestamp: string
description?: string
}>
}
export interface SyncStatus {
templateId: string
lastSync: string
isOnline: boolean
pendingChanges: number
}
export interface TemplateFormulaData {
templateId: string
version: number
sheets: Record<string, SheetFormulaData>
timestamp: string
}
export interface SheetFormulaData {
sheetName: string
cells: Record<string, any>
metadata: {
rowCount: number
columnCount: number
lastCalculated: string
}
}

25
src/type/imports.d.ts vendored Normal file
View File

@@ -0,0 +1,25 @@
// Типы для контроля импортов между слоями архитектуры
declare module 'app/*' {
const content: any
export default content
}
declare module 'pages/*' {
const content: any
export default content
}
declare module 'features/*' {
const content: any
export default content
}
declare module 'entities/*' {
const content: any
export default content
}
declare module 'shared/*' {
const content: any
export default content
}

81
src/type/template.ts Normal file
View File

@@ -0,0 +1,81 @@
// Типы элементов интерфейса
export type ElementType =
| 'text'
| 'select'
| 'radio'
| 'checkbox'
| 'number'
| 'textarea'
| 'date'
| 'standards'
| 'calibration-conditions'
| 'button-group'
export interface ElementOption {
value: string
label: string
}
// Расширенный тип для ячейки с указанием листа
export interface CellTarget {
sheet: string // название листа, например "L" или "R"
cell: string // адрес ячейки, например "A2" или "B4"
displayName?: string // отображаемое имя для пользователя
}
// Позиция и размеры элемента в визуальном редакторе
export interface ElementLayout {
x: number // позиция по X в пикселях
y: number // позиция по Y в пикселях
width: number // ширина в пикселях
height: number // высота в пикселях
zIndex?: number // Z-index для наложения элементов
}
// Настройки отображения элементов в форме
export interface FormLayoutSettings {
gridSize: number // размер сетки для привязки (в пикселях)
showGrid: boolean // показывать сетку
}
export interface TemplateElement {
id: string
type: ElementType
name: string
label: string
targetCells: CellTarget[] // множественные ячейки вместо одной targetCell
options?: ElementOption[] // для select и radio
required?: boolean
defaultValue?: string
placeholder?: string
order?: number // порядок отображения в форме
layout?: ElementLayout // позиция и размеры в визуальном редакторе
}
// Информация об объединенных ячейках
export interface MergedCell {
from: string // начальная ячейка (например, "A1")
to: string // конечная ячейка (например, "C3")
value: any // значение объединенной ячейки
}
// Типы шаблонов
export interface Template {
id: string
name: string
description?: string
excelFile?: File
excelData?: Record<string, any> // данные из Excel
mergedCells?: MergedCell[] // информация об объединенных ячейках
elements: TemplateElement[]
layoutSettings?: FormLayoutSettings // настройки отображения формы
createdAt: Date
updatedAt: Date
}
// Типы для работы с данными
export interface TemplateData {
templateId: string
values: Record<string, any> // elementId -> value
calculatedCells?: Record<string, any> // cellName -> value
}

1
src/type/vite-env.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
/// <reference types="vite/client" />