@medc-com-br/ngx-jaimes-scribe 0.1.8 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -6
- package/fesm2022/medc-com-br-ngx-jaimes-scribe.mjs +566 -312
- package/fesm2022/medc-com-br-ngx-jaimes-scribe.mjs.map +1 -1
- package/lib/components/recorder/recorder.component.d.ts +17 -25
- package/lib/services/playback.service.d.ts +33 -0
- package/lib/services/speaker-identification.service.d.ts +32 -0
- package/package.json +1 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
|
2
|
+
import type { SessionPlaybackData, TranscriptSegment, TranscriptionWord } from '@medc-com-br/jaimes-shared';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class PlaybackService {
|
|
5
|
+
readonly isPlaying: import("@angular/core").WritableSignal<boolean>;
|
|
6
|
+
readonly isLoading: import("@angular/core").WritableSignal<boolean>;
|
|
7
|
+
readonly currentTime: import("@angular/core").WritableSignal<number>;
|
|
8
|
+
readonly duration: import("@angular/core").WritableSignal<number>;
|
|
9
|
+
readonly playbackRate: import("@angular/core").WritableSignal<number>;
|
|
10
|
+
readonly sessionData: import("@angular/core").WritableSignal<SessionPlaybackData>;
|
|
11
|
+
readonly activeSegmentId: import("@angular/core").WritableSignal<string>;
|
|
12
|
+
readonly activeWordIndex: import("@angular/core").WritableSignal<number>;
|
|
13
|
+
private audioElement;
|
|
14
|
+
private audioBlobUrl;
|
|
15
|
+
private elementRef;
|
|
16
|
+
private eventHandlers;
|
|
17
|
+
setElementRef(ref: ElementRef): void;
|
|
18
|
+
get segments(): TranscriptSegment[];
|
|
19
|
+
loadSession(apiUrl: string, sessionId: string, token: string): Promise<void>;
|
|
20
|
+
private loadAudio;
|
|
21
|
+
togglePlayback(): void;
|
|
22
|
+
seekTo(time: number): void;
|
|
23
|
+
seekToSegment(segment: TranscriptSegment): void;
|
|
24
|
+
seekToWord(word: TranscriptionWord): void;
|
|
25
|
+
setRate(rate: number): void;
|
|
26
|
+
formatTime(seconds: number): string;
|
|
27
|
+
private updateActiveSegment;
|
|
28
|
+
private scrollToActiveSegment;
|
|
29
|
+
cleanup(): void;
|
|
30
|
+
reset(): void;
|
|
31
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PlaybackService, never>;
|
|
32
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<PlaybackService>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { SpeakerMapping, SpeakerRole, SpeakerStats } from '@medc-com-br/jaimes-shared';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare const MIN_CHARS_FOR_IDENTIFICATION = 100;
|
|
4
|
+
export declare const MAX_SAMPLE_SIZE = 20;
|
|
5
|
+
export declare const LOW_CONFIDENCE_THRESHOLD = 0.7;
|
|
6
|
+
export declare const IDENTIFICATION_DEBOUNCE_MS = 2000;
|
|
7
|
+
interface TranscriptEntry {
|
|
8
|
+
id: number;
|
|
9
|
+
text: string;
|
|
10
|
+
speaker?: number;
|
|
11
|
+
isFinal: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare class SpeakerIdentificationService {
|
|
14
|
+
readonly speakerMapping: import("@angular/core").WritableSignal<SpeakerMapping>;
|
|
15
|
+
readonly identifiedSpeakers: import("@angular/core").WritableSignal<Set<number>>;
|
|
16
|
+
readonly isIdentifying: import("@angular/core").WritableSignal<boolean>;
|
|
17
|
+
readonly editingSpeaker: import("@angular/core").WritableSignal<number>;
|
|
18
|
+
private debounceTimer;
|
|
19
|
+
hasLowConfidence(speaker: number): boolean;
|
|
20
|
+
getLabel(speaker: number, customLabels: Record<number, string>, doctorName: string, patientName: string, companionName: string): string;
|
|
21
|
+
getSpeakerStats(entries: TranscriptEntry[]): SpeakerStats;
|
|
22
|
+
shouldIdentify(entries: TranscriptEntry[]): boolean;
|
|
23
|
+
scheduleIdentification(callback: () => Promise<void>): void;
|
|
24
|
+
identify(entries: TranscriptEntry[], apiUrl: string, token: string, sessionId: string | null, premium: boolean): Promise<void>;
|
|
25
|
+
setRole(speaker: number, role: SpeakerRole): SpeakerMapping;
|
|
26
|
+
toggleMenu(speaker: number): void;
|
|
27
|
+
closeMenu(): void;
|
|
28
|
+
reset(): void;
|
|
29
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SpeakerIdentificationService, never>;
|
|
30
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SpeakerIdentificationService>;
|
|
31
|
+
}
|
|
32
|
+
export {};
|