Skip to content

Commit

Permalink
Fix type for 'debug' field in config (#4279)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwalton committed Aug 21, 2021
1 parent b6ce32d commit 1ea75a2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
9 changes: 6 additions & 3 deletions api-extractor/report/hls.js.api.md
Expand Up @@ -123,7 +123,7 @@ export class BaseSegment {
// (undocumented)
get url(): string;
set url(value: string);
}
}

// Warning: (ae-missing-release-tag) "BufferAppendedData" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
Expand Down Expand Up @@ -925,6 +925,7 @@ class Hls implements HlsEventEmitter {
// (undocumented)
static get version(): string;
}

export default Hls;

// Warning: (ae-missing-release-tag) "HlsChunkPerformanceTiming" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
Expand All @@ -941,7 +942,7 @@ export interface HlsChunkPerformanceTiming extends HlsPerformanceTiming {
//
// @public (undocumented)
export type HlsConfig = {
debug: boolean;
debug: boolean | ILogger;
enableWorker: boolean;
enableSoftwareAES: boolean;
minAutoBitrate: number;
Expand Down Expand Up @@ -1425,7 +1426,7 @@ export class LevelKey {
method: string | null;
// (undocumented)
get uri(): string | null;
}
}

// Warning: (ae-missing-release-tag) "LevelLoadedData" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
Expand Down Expand Up @@ -2123,8 +2124,10 @@ export interface UserdataSample {
pts: number;
}


// Warnings were encountered during analysis:
//
// src/config.ts:148:3 - (ae-forgotten-export) The symbol "ILogger" needs to be exported by the entry point hls.d.ts
// src/config.ts:157:3 - (ae-forgotten-export) The symbol "AudioStreamController" needs to be exported by the entry point hls.d.ts
// src/config.ts:158:3 - (ae-forgotten-export) The symbol "AudioTrackController" needs to be exported by the entry point hls.d.ts
// src/config.ts:160:3 - (ae-forgotten-export) The symbol "SubtitleStreamController" needs to be exported by the entry point hls.d.ts
Expand Down
4 changes: 2 additions & 2 deletions src/config.ts
Expand Up @@ -12,7 +12,7 @@ import XhrLoader from './utils/xhr-loader';
import FetchLoader, { fetchSupported } from './utils/fetch-loader';
import Cues from './utils/cues';
import { requestMediaKeySystemAccess } from './utils/mediakeys-helper';
import { logger } from './utils/logger';
import { ILogger, logger } from './utils/logger';

import type { CuesInterface } from './utils/cues';
import type { MediaKeyFunc } from './utils/mediakeys-helper';
Expand Down Expand Up @@ -145,7 +145,7 @@ export type TSDemuxerConfig = {
};

export type HlsConfig = {
debug: boolean;
debug: boolean | ILogger;
enableWorker: boolean;
enableSoftwareAES: boolean;
minAutoBitrate: number;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/logger.ts
Expand Up @@ -2,7 +2,7 @@ interface ILogFunction {
(message?: any, ...optionalParams: any[]): void;
}

interface ILogger {
export interface ILogger {
trace: ILogFunction;
debug: ILogFunction;
log: ILogFunction;
Expand Down

0 comments on commit 1ea75a2

Please sign in to comment.