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AAA","sourcesContent":["import { Arch, archFromString, ArchType } from \"builder-util\"\nimport { AllPublishOptions } from \"builder-util-runtime\"\n\n// https://github.com/YousefED/typescript-json-schema/issues/80\nexport type Publish = AllPublishOptions | Array<AllPublishOptions> | null\n\nexport type TargetConfigType = Array<string | TargetConfiguration> | string | TargetConfiguration | null\n\nexport interface TargetConfiguration {\n /**\n * The target name. e.g. `snap`.\n */\n readonly target: string\n\n /**\n * The arch or list of archs.\n */\n readonly arch?: Array<ArchType> | ArchType\n}\n\nexport class Platform {\n static MAC = new Platform(\"mac\", \"mac\", \"darwin\")\n static LINUX = new Platform(\"linux\", \"linux\", \"linux\")\n static WINDOWS = new Platform(\"windows\", \"win\", \"win32\")\n\n constructor(public name: string, public buildConfigurationKey: string, public nodeName: NodeJS.Platform) {}\n\n toString() {\n return this.name\n }\n\n createTarget(type?: string | Array<string> | null, ...archs: Array<Arch>): Map<Platform, Map<Arch, Array<string>>> {\n if (type == null && (archs == null || archs.length === 0)) {\n return new Map([[this, new Map()]])\n }\n\n const archToType = new Map()\n\n for (const arch of archs == null || archs.length === 0 ? [archFromString(process.arch)] : archs) {\n archToType.set(arch, type == null ? [] : Array.isArray(type) ? type : [type])\n }\n return new Map([[this, archToType]])\n }\n\n static current(): Platform {\n return Platform.fromString(process.platform)\n }\n\n static fromString(name: string): Platform {\n name = name.toLowerCase()\n switch (name) {\n case Platform.MAC.nodeName:\n case Platform.MAC.name:\n return Platform.MAC\n\n case Platform.WINDOWS.nodeName:\n case Platform.WINDOWS.name:\n case Platform.WINDOWS.buildConfigurationKey:\n return Platform.WINDOWS\n\n case Platform.LINUX.nodeName:\n return Platform.LINUX\n\n default:\n throw new Error(`Unknown platform: ${name}`)\n }\n }\n}\n\nexport abstract class Target {\n abstract readonly outDir: string\n abstract readonly options: TargetSpecificOptions | null | undefined\n\n protected constructor(readonly name: string, readonly isAsyncSupported: boolean = true) {}\n\n async checkOptions(): Promise<any> {\n // ignore\n }\n\n abstract build(appOutDir: string, arch: Arch): Promise<any>\n\n finishBuild(): Promise<any> {\n return Promise.resolve()\n }\n}\n\nexport interface TargetSpecificOptions {\n /**\n The [artifact file name template](/configuration/configuration#artifact-file-name-template).\n */\n readonly artifactName?: string | null\n\n publish?: Publish\n}\n\nexport const DEFAULT_TARGET = \"default\"\nexport const DIR_TARGET = \"dir\"\n\nexport type CompressionLevel = \"store\" | \"normal\" | \"maximum\"\n\nexport interface BeforeBuildContext {\n readonly appDir: string\n readonly electronVersion: string\n readonly platform: Platform\n readonly arch: string\n}\n\nexport interface SourceRepositoryInfo {\n type?: string\n domain?: string\n user: string\n project: string\n}\n"]}
\No newline at end of file