ConceptPortal-public/rsconcept/frontend/src/features/oss/models/oss.ts

66 lines
1.3 KiB
TypeScript
Raw Normal View History

2024-06-04 23:00:22 +03:00
/**
* Module: Schema of Synthesis Operations.
*/
2025-02-12 21:36:25 +03:00
2025-03-12 11:55:43 +03:00
import { type Graph } from '@/models/graph1';
2024-07-21 15:19:57 +03:00
import { type ICstSubstituteInfo, type IOperationDTO, type IOperationSchemaDTO } from '../backend/types';
/**
* Represents Operation.
*/
export interface IOperation extends IOperationDTO {
is_owned: boolean;
is_consolidation: boolean; // aka 'diamond synthesis'
substitutions: ICstSubstituteInfo[];
arguments: number[];
}
2024-07-21 15:19:57 +03:00
2024-07-26 00:34:08 +03:00
/**
* Represents {@link IOperationSchema} statistics.
*/
export interface IOperationSchemaStats {
count_operations: number;
count_inputs: number;
count_synthesis: number;
count_schemas: number;
2024-08-23 21:29:07 +03:00
count_owned: number;
2024-07-26 00:34:08 +03:00
}
2024-07-21 15:19:57 +03:00
/**
* Represents OperationSchema.
2024-06-04 23:00:22 +03:00
*/
export interface IOperationSchema extends IOperationSchemaDTO {
items: IOperation[];
2024-06-04 23:00:22 +03:00
2024-07-21 15:19:57 +03:00
graph: Graph;
2025-02-12 15:13:37 +03:00
schemas: number[];
2024-07-26 00:34:08 +03:00
stats: IOperationSchemaStats;
2025-02-17 15:12:15 +03:00
operationByID: Map<number, IOperation>;
2024-07-21 15:19:57 +03:00
}
2024-08-26 17:25:07 +03:00
/**
* Represents substitution error description.
*/
export interface ISubstitutionErrorDescription {
errorType: SubstitutionErrorType;
params: string[];
}
/**
* Represents Substitution table error types.
*/
export enum SubstitutionErrorType {
invalidIDs,
incorrectCst,
2024-08-26 17:25:07 +03:00
invalidClasses,
invalidBasic,
invalidConstant,
typificationCycle,
baseSubstitutionNotSet,
unequalTypification,
unequalExpressions,
unequalArgsCount,
unequalArgs
2024-08-26 17:25:07 +03:00
}