# All files / src/transcription Transcription.ts

100% Statements 6/6
50% Branches 1/2
100% Functions 6/6
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26

    13x

    6x

    3x

    6x

    2x

    1x

     import { TranscriptionResponse, TranscriptionSegment } from "../providers/Provider.js";

    export class Transcription {
      constructor(private readonly response: TranscriptionResponse) {}

      get text(): string {
        return this.response.text;
      }

      get model(): string {
        return this.response.model;
      }

      get segments(): TranscriptionSegment[] {
        return this.response.segments || [];
      }

      get duration(): number | undefined {
        return this.response.duration;
      }

      toString(): string {
        return this.text;
      }
    }