UNPKG

2.28 kBTypeScriptView Raw
1/// <reference types="node" />
2import { Archive } from '@shockpkg/archive-files';
3/**
4 * Projector constructor.
5 *
6 * @param path Output path.
7 */
8export declare abstract class Projector extends Object {
9 /**
10 * Path to hdiutil binary.
11 */
12 hdiutil: string | null;
13 /**
14 * Output path.
15 */
16 readonly path: string;
17 constructor(path: string);
18 /**
19 * The movie appended marker.
20 *
21 * @returns Hex string.
22 */
23 get movieAppendMarker(): string;
24 /**
25 * Get the player file or directory as an Archive instance.
26 *
27 * @param path File path.
28 * @returns Archive instance.
29 */
30 openAsArchive(path: string): Promise<Archive>;
31 /**
32 * Write out projector with player and file.
33 *
34 * @param player Player path.
35 * @param movieFile Movie file.
36 */
37 withFile(player: string, movieFile: string | null): Promise<void>;
38 /**
39 * Write out projector with player and data.
40 *
41 * @param player Player path.
42 * @param movieData Movie data.
43 */
44 withData(player: string, movieData: Readonly<Buffer> | null): Promise<void>;
45 /**
46 * Check that output path is valid, else throws.
47 */
48 protected _checkOutput(): Promise<void>;
49 /**
50 * Append movie data to a file.
51 * Format string characters:
52 * - d: Movie data.
53 * - m: Marker bytes.
54 * - s: Size, 32LE.
55 * - S: Size, 32BE.
56 * - l: Size, 64LE.
57 * - L: Size, 64BE.
58 *
59 * @param file File to append to.
60 * @param data Movie data.
61 * @param format Format string.
62 */
63 protected _appendMovieData(file: string, data: Readonly<Buffer>, format: string): Promise<void>;
64 /**
65 * Projector file extension.
66 *
67 * @returns File extension.
68 */
69 abstract get extension(): string;
70 /**
71 * Write the projector player.
72 *
73 * @param player Player path.
74 */
75 protected abstract _writePlayer(player: string): Promise<void>;
76 /**
77 * Modify the projector player.
78 */
79 protected abstract _modifyPlayer(): Promise<void>;
80 /**
81 * Write out the projector movie file.
82 *
83 * @param movieData Movie data or null.
84 */
85 protected abstract _writeMovie(movieData: Readonly<Buffer> | null): Promise<void>;
86}