@bililive-tools/huya-recorder
Version:
bililive-tools huya recorder implemention
28 lines (27 loc) • 1.38 kB
TypeScript
import type { StreamResult, SourceProfile } from "./types.js";
/**
* 从数组中按照特定算法提取一些值(允许同个索引重复提取)。
* 算法的行为类似 flex 的 space-between。
*
* examples:
* ```
* console.log(getValuesFromArrayLikeFlexSpaceBetween([1, 2, 3, 4, 5, 6, 7], 1))
* // [1]
* console.log(getValuesFromArrayLikeFlexSpaceBetween([1, 2, 3, 4, 5, 6, 7], 3))
* // [1, 4, 7]
* console.log(getValuesFromArrayLikeFlexSpaceBetween([1, 2, 3, 4, 5, 6, 7], 4))
* // [1, 3, 5, 7]
* console.log(getValuesFromArrayLikeFlexSpaceBetween([1, 2, 3, 4, 5, 6, 7], 11))
* // [1, 1, 2, 3, 3, 4, 5, 5, 6, 7, 7]
* ```
*/
export declare function getValuesFromArrayLikeFlexSpaceBetween<T>(array: T[], columnCount: number): T[];
export declare function ensureFolderExist(fileOrFolderPath: string): void;
export declare function assert(assertion: unknown, msg?: string): asserts assertion;
export declare function assertStringType(data: unknown, msg?: string): asserts data is string;
export declare function assertNumberType(data: unknown, msg?: string): asserts data is number;
export declare function assertObjectType(data: unknown, msg?: string): asserts data is object;
export declare function getFormatSources(sources: StreamResult, formatPriorities?: Array<"flv" | "hls">): {
sources: SourceProfile[];
formatName: "flv" | "hls";
} | null;