import type { log } from './log'; export interface FileRecord { file: string; body?: Buffer | string; // This could be improved a bit. making this stricter opens up a lot of // changes that need to be made throughout the code though // eslint-disable-next-line @typescript-eslint/no-explicit-any [key: number]: any; } export type FileRecords = Record; type License = | string | { type: string; }; export type Patches = Record< string, string & { do: 'erase' | 'prepend' | 'append' }[] >; export type ConfigDictionary = Record< string, { pkg?: { dependencies?: Record; }; dependencies?: Record; } >; export interface PkgOptions { scripts?: string[]; log?: (logger: typeof log, context: Record) => void; assets?: string[]; deployFiles?: string[]; patches?: Patches; dictionary: ConfigDictionary; } export interface PackageJson { name?: string; private?: boolean; licenses?: License; license?: License; main?: string; dependencies?: Record; files?: string[]; pkg?: PkgOptions; } export const platform = { macos: 'darwin', win: 'win32', linux: 'linux', }; export interface NodeTarget { nodeRange: string; arch: string; platform: keyof typeof platform; forceBuild?: boolean; } export interface Target extends NodeTarget { binaryPath: string; output: string; fabricator: Target; } export type SymLinks = Record;