Skip to content

Commit

Permalink
fix: TS linting
Browse files Browse the repository at this point in the history
  • Loading branch information
micmro committed Nov 24, 2021
1 parent 5972205 commit a9969da
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/ts/transformers/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/** Helpers that are not file-fromat specific */
/** Helpers that are not file-format specific */
import type { Chunk } from "har-format";
import { isInStatusCodeRange, toCssClass } from "../helpers/misc";
import { escapeHtml, sanitizeAlphaNumeric } from "../helpers/parse";
import { RequestType, SafeKvTuple } from "../typing/waterfall";
import {
import type { RequestType, SafeKvTuple } from "../typing/waterfall";
import type {
Icon,
KvTuple,
TimingType,
Expand Down Expand Up @@ -107,7 +108,7 @@ export function createWaterfallEntry(url: string,
export function createWaterfallEntryTiming(type: TimingType,
start: number,
end: number,
chunks?: { bytes: number, ts: number }[]): WaterfallEntryTiming {
chunks?: Chunk[]): WaterfallEntryTiming {
const total = (typeof start !== "number" || typeof end !== "number") ? NaN : (end - start);
const typeClean = sanitizeAlphaNumeric(type) as TimingType;
return {
Expand Down
9 changes: 8 additions & 1 deletion src/ts/typing/waterfall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ export interface WaterfallEntryIndicator {
displayType: IndicatorDisplayType;
}

export interface Chunk {
/** float - timestamp of beginning of chunk */
ts: number;
/** integer - encoded data length (sum = _bytesIn) */
bytes: number;
}

/** Time segment of an `WaterfallEntry` */
export interface WaterfallEntryTiming {
/** total duration in ms */
Expand All @@ -77,7 +84,7 @@ export interface WaterfallEntryTiming {
start: number;
/** end time in ms - relative to initial document request */
end: number;
chunks?: Array<object>;
chunks?: Chunk[];
}

export interface WaterfallResponseDetails {
Expand Down

0 comments on commit a9969da

Please sign in to comment.