Disallow any types

This commit is contained in:
2026-03-09 23:02:52 +01:00
parent 3b1aab4985
commit dc6746c882
40 changed files with 961 additions and 476 deletions

View File

@@ -1,4 +1,4 @@
/* eslint-disable @typescript-eslint/member-ordering, @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/member-ordering, */
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import {
@@ -33,10 +33,7 @@ import {
MAX_AUTO_SAVE_SIZE_BYTES
} from '../../../../../core/services/attachment.service';
import { KlipyService } from '../../../../../core/services/klipy.service';
import {
DELETED_MESSAGE_CONTENT,
Message
} from '../../../../../core/models';
import { DELETED_MESSAGE_CONTENT, Message } from '../../../../../core/models';
import {
ChatAudioPlayerComponent,
ChatVideoPlayerComponent,
@@ -81,7 +78,7 @@ const MERMAID_LINE_BREAK_PATTERN = /\r\n?/g;
const REMARK_PROCESSOR = unified()
.use(remarkParse)
.use(remarkGfm)
.use(remarkBreaks) as any;
.use(remarkBreaks);
interface ChatMessageAttachmentViewModel extends Attachment {
isAudio: boolean;
@@ -133,7 +130,7 @@ export class ChatMessageItemComponent {
readonly repliedMessage = input<Message | undefined>();
readonly currentUserId = input<string | null>(null);
readonly isAdmin = input(false);
readonly remarkProcessor: any = REMARK_PROCESSOR;
readonly remarkProcessor = REMARK_PROCESSOR;
readonly replyRequested = output<ChatMessageReplyEvent>();
readonly deleteRequested = output<ChatMessageDeleteEvent>();

View File

@@ -1,4 +1,4 @@
/* eslint-disable @typescript-eslint/member-ordering, id-length, id-denylist, @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/member-ordering, id-length, id-denylist, */
import {
Component,
inject,
@@ -19,6 +19,12 @@ const TYPING_TTL = 3_000;
const PURGE_INTERVAL = 1_000;
const MAX_SHOWN = 4;
interface TypingSignalingMessage {
type: string;
displayName: string;
oderId: string;
}
@Component({
selector: 'app-typing-indicator',
standalone: true,
@@ -38,12 +44,16 @@ export class TypingIndicatorComponent {
const webrtc = inject(WebRTCService);
const destroyRef = inject(DestroyRef);
const typing$ = webrtc.onSignalingMessage.pipe(
filter((msg: any) => msg?.type === 'user_typing' && msg.displayName && msg.oderId),
tap((msg: any) => {
filter((msg): msg is TypingSignalingMessage =>
msg?.type === 'user_typing' &&
typeof msg.displayName === 'string' &&
typeof msg.oderId === 'string'
),
tap((msg) => {
const now = Date.now();
this.typingMap.set(String(msg.oderId), {
name: String(msg.displayName),
this.typingMap.set(msg.oderId, {
name: msg.displayName,
expiresAt: now + TYPING_TTL
});
})