Refactoring types / interface in dedicated models

This commit is contained in:
AdamBtech
2025-05-26 20:55:03 +02:00
parent 9ecb429131
commit 105c3f8ba5
8 changed files with 50 additions and 45 deletions

View File

@@ -1,16 +1,6 @@
import { Component, input, signal, computed } from '@angular/core';
import { CommonModule } from '@angular/common';
export interface NeuralProfileNode {
id: string;
title: string;
isExpanded: boolean;
isSelected: boolean;
children?: NeuralProfileNode[];
level: number;
hasChildren: boolean;
visible: boolean;
}
import { type NeuralProfileNode } from '../../../shared/models/about.model';
@Component({
selector: 'app-neural-profile-tree',

View File

@@ -16,14 +16,7 @@ import {
transition,
animate,
} from '@angular/animations';
interface TextItem {
readonly id: number;
readonly text: string;
readonly displayed: string;
readonly isTyping: boolean;
readonly isComplete: boolean;
}
import { type TextItem } from '../../../shared/models/header.model';
// Constants for better maintainability
const TYPING_DELAYS = {

View File

@@ -8,27 +8,7 @@ import {
ElementRef,
} from '@angular/core';
export interface Project {
id: string;
title: string;
status: string;
classification: string;
objective: string;
statusDescription: string;
techStack: string[];
demoUrl?: string;
codeUrl?: string;
isRedacted: boolean;
caseStudy?: {
title: string;
sections: CaseStudySection[];
};
}
export interface CaseStudySection {
title: string;
content: string;
}
import { type Project } from '../../../../shared/models/project.model';
@Component({
selector: 'app-project-card',

View File

@@ -1,11 +1,8 @@
// project-list.component.ts
import { Component, signal, computed, effect, OnInit } from '@angular/core';
import {
ProjectCardComponent,
Project,
CaseStudySection,
} from '../project-card/project-card.component';
import { ProjectCardComponent } from '../project-card/project-card.component';
import { SectionTitleComponent } from '../../../../shared/ui/section-title/section-title.component';
import { type Project } from '../../../../shared/models/project.model';
@Component({
selector: 'app-project-list',

View File

@@ -0,0 +1,12 @@
type NeuralProfileNode = {
id: string;
title: string;
isExpanded: boolean;
isSelected: boolean;
children?: NeuralProfileNode[];
level: number;
hasChildren: boolean;
visible: boolean;
};
export type { NeuralProfileNode };

View File

@@ -0,0 +1,9 @@
type TextItem = {
readonly id: number;
readonly text: string;
readonly displayed: string;
readonly isTyping: boolean;
readonly isComplete: boolean;
};
export { type TextItem };

View File

@@ -0,0 +1,23 @@
type Project = {
id: string;
title: string;
status: string;
classification: string;
objective: string;
statusDescription: string;
techStack: string[];
demoUrl?: string;
codeUrl?: string;
isRedacted: boolean;
caseStudy?: {
title: string;
sections: CaseStudySection[];
};
};
type CaseStudySection = {
title: string;
content: string;
};
export { type Project, type CaseStudySection };

View File

@@ -64,6 +64,7 @@ export class SectionTitleComponent implements OnInit, OnDestroy {
const timeoutId = setTimeout(() => {
revealedLetters[i] = true;
}, i * letterDelay);
// @ts-ignore
this.timeoutIds.push(timeoutId);
} else {
revealedLetters[i] = true; // Spaces are always "revealed"