/* eslint-disable */
/**
 * This file was automatically generated from schema.json.
 * DO NOT MODIFY IT BY HAND. Instead, modify the JSON schema and regenerate this file.
 */

/**
 * The version of app-builder-lib that ToDesktop should use for building your app. This can be a specific version, a semantic version range, or "latest". This can be useful if you need to use a specific version that includes certain features or fixes.
 */
export type AppBuilderLibVersionProperty = string;
/**
 * Your application ID. Omit this unless you know what you're doing. It's used as the [CFBundleIdentifier](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070) for MacOS and as the [Application User Model ID](<https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx>) for Windows.
 */
export type AppIdProperty = string;
/**
 * This option allows you to decide which files get uploaded to be built on the ToDesktop servers. By default, all files in your app path are included in your app, except for `node_modules` and `.git`. Dependencies are installed on our build servers as there could be platform-specific postinstall steps.
 *
 * @minItems 1
 */
export type AppFilesProperty = [string, ...string[]];
/**
 * If you want to register a protocol for your application (e.g. `example://`) and or support deeplinking, you will need to use this option. If your desired protocol is `example://`, you would set `"appProtocolScheme": "example"`. NOTE: these features also require additional application logic.
 */
export type AppProtocolSchemeProperty = string | [string, ...string[]];
/**
 * This is the path to your Electron application directory. Omit this unless your project setup is complicated. This is the directory that the CLI uploads.
 */
export type AppPathProperty = string;
/**
 * Compile selected source files to .jsc using Bytenode during the build. Provide glob patterns relative to your appPath.
 */
export type BytenodeConfigProperty = {
  [k: string]: unknown;
} & {
  /**
   * Enable Bytenode compilation.
   */
  enabled?: boolean;
  /**
   * Glob patterns relative to appPath for files to compile to Bytenode.
   *
   * @minItems 1
   */
  files?: [string, ...string[]];
};
/**
 * Whether to package your application's source code within an asar archive. You should only turn this off if you have a good reason to.
 */
export type AsarProperty = boolean;
/**
 * This option allows you to decide which files get unpacked from the asar archive. By default we unpack all native `*.node` files.
 */
export type AsarUnpackProperty = boolean | [string, ...string[]];
/**
 * The build version. Maps to the CFBundleVersion on macOS, and FileVersion metadata property on Windows.
 */
export type BuildVersionProperty = string;
/**
 * The human-readable copyright line for the app.
 */
export type CopyrightProperty = string;
/**
 * The base URL of the mirror to download Electron from. This may be a mirror geographically closer to you or even your own mirror which contains custom Electron builds. The version downloaded is the Electron version specified in `devDependencies` in your app's `package.json`. Alternatively you can explicitly specify an `electronVersion` in `todesktop.json` as described below.
 */
export type ElectronMirrorProperty = string;
/**
 * The version of Electron to use. In most cases you should not specify an `electronVersion` property. Only specify this option if you wish to override the version that is specified in `package.json`.
 */
export type ElectronVersionProperty = string;
/**
 * This option allows you specify files to be copied into the application's content directory (`Contents` for MacOS, root directory for Linux and Windows).
 */
export type ExtraContentFilesProperty = {
  from: string;
  to?: string;
}[];
/**
 * This option allows you to specify files to be copied into the application's resources directory (`Contents/Resources` for MacOS, `resources` for Linux and Windows). It works just like the `extraContentFiles` option, except the files go to a different directory.
 */
export type ExtraResourcesProperty = {
  from: string;
  to?: string;
}[];
/**
 * Associate a file type with your Electron app.
 *
 * @minItems 1
 */
export type FileAssociationsProperty = [
  {
    /**
     * The extension (minus the leading period). e.g. png.
     */
    ext: string | string[];
    /**
     * windows-only. The description.
     */
    description?: string;
    /**
     * The name. e.g. PNG. Defaults to value of `ext`.
     */
    name?: string;
    /**
     * linux-only. The mime-type.
     */
    mimeType?: string;
    /**
     * macOS and windows. Icon file name without extension. It points to ico file for Windows and icns for macOS. For example, if the `icon` value is `"icons/py"` then it will look for both `"icons/py.ico"` and `"icons/py.icns"` in your project directory.
     */
    icon?: string;
    /**
     * macOS-only. The app's role with respect to the type. The value can be `Editor`, `Viewer`, `Shell`, or `None`. Corresponds to `CFBundleTypeRole`.
     */
    role?: string;
    /**
     * macOS-only. Whether the document is distributed as a bundle. If set to true, the bundle directory is treated as a file. Corresponds to `LSTypeIsPackage`.
     */
    isPackage?: boolean;
    /**
     * macOS-only. Determines how Launch Services ranks this app among the apps that declare themselves editors or viewers of files of this type. The possible values are: `Owner` (this app is the primary creator of files of this type), `Default` (this app is an opener of files of this type; this value is also used if no rank is specified), `Alternate` (this app is a secondary viewer of files of this type), and `None` (this app is never selected to open files of this type, but it accepts drops of files of this type).
     */
    rank?: 'Owner' | 'Default' | 'Alternate' | 'None';
  },
  ...{
    /**
     * The extension (minus the leading period). e.g. png.
     */
    ext: string | string[];
    /**
     * windows-only. The description.
     */
    description?: string;
    /**
     * The name. e.g. PNG. Defaults to value of `ext`.
     */
    name?: string;
    /**
     * linux-only. The mime-type.
     */
    mimeType?: string;
    /**
     * macOS and windows. Icon file name without extension. It points to ico file for Windows and icns for macOS. For example, if the `icon` value is `"icons/py"` then it will look for both `"icons/py.ico"` and `"icons/py.icns"` in your project directory.
     */
    icon?: string;
    /**
     * macOS-only. The app's role with respect to the type. The value can be `Editor`, `Viewer`, `Shell`, or `None`. Corresponds to `CFBundleTypeRole`.
     */
    role?: string;
    /**
     * macOS-only. Whether the document is distributed as a bundle. If set to true, the bundle directory is treated as a file. Corresponds to `LSTypeIsPackage`.
     */
    isPackage?: boolean;
    /**
     * macOS-only. Determines how Launch Services ranks this app among the apps that declare themselves editors or viewers of files of this type. The possible values are: `Owner` (this app is the primary creator of files of this type), `Default` (this app is an opener of files of this type; this value is also used if no rank is specified), `Alternate` (this app is a secondary viewer of files of this type), and `None` (this app is never selected to open files of this type, but it accepts drops of files of this type).
     */
    rank?: 'Owner' | 'Default' | 'Alternate' | 'None';
  }[],
];
/**
 * The URL to check for updates. You should only set this if you want to use your own self-hosted update server instead of ToDesktop's built-in update service. See https://www.github.com/ToDesktop/self-hosted for more information.
 */
export type UpdateUrlBaseProperty = string;
/**
 * This option allows you to explicitly exclude or include certain files in the packaged version of your app. These files are filtered _after_ the build step which happens on the ToDesktop servers.
 *
 * @minItems 1
 */
export type FilesForDistributionProperty = [string, ...string[]];
/**
 * Whether to include **all** of the submodules node_modules directories
 */
export type IncludeSubNodeModulesProperty = boolean;
/**
 * The version of Node.js that ToDesktop should use to build your app.
 */
export type NodeVersionProperty = string;
/**
 * The version of NPM that ToDesktop should use for installation.
 */
export type NpmVersionProperty = string;
/**
 * The version of pnpm that ToDesktop should use for installation.
 */
export type PnpmVersionProperty = string;
/**
 * The version of Bun that ToDesktop should use for installation.
 */
export type BunVersionProperty = string;
/**
 * The package manager to use when installing dependencies. Valid values are `npm`, `yarn`, `pnpm` or `bun`.
 */
export type PackageManagerProperty = 'npm' | 'yarn' | 'pnpm' | 'bun';
/**
 * The library that ToDesktop should use for rebuilding native modules. Valid values are `app-builder` or `@electron/rebuild`.
 */
export type RebuildLibraryProperty = 'app-builder' | '@electron/rebuild';
/**
 * The max upload size (in MB). Before uploading your files to our servers, we check that the total file size is less than this number. If you are accidentally including unneccesary files in your app, check out the `appPath` and `appFiles` options.
 */
export type UploadSizeLimitProperty = number;

export interface Schema {
  /**
   * To enable JSON validation and IntelliSense for your `todesktop.json` file in compatible code editors, your editor needs to know where the schema file is located. You can add a `$schema` property to the top of your `todesktop.json` file, pointing to a version of the schema. This can be a local path or a hosted URL.
   */
  $schema?: string;
  appBuilderLibVersion?: AppBuilderLibVersionProperty;
  appId?: AppIdProperty;
  appFiles?: AppFilesProperty;
  appProtocolScheme?: AppProtocolSchemeProperty;
  appPath?: AppPathProperty;
  /**
   * Useful when your application is a monorepo (e.g. pnpm workspaces). You can configure whether the CLI bundles workspace packages alongside the app upload. When enabled, workspace dependencies referenced via `workspace:` or local `file:` specifiers are bundled with your application upload and dependency ranges are rewritten to `file:` paths so they install deterministically on the build servers.
   */
  bundleWorkspacePackages?: {
    /**
     * Enable automatic bundling of workspace packages for this project.
     */
    enabled?: boolean;
  };
  bytenode?: BytenodeConfigProperty;
  fuses?: FusesConfigProperty;
  asar?: AsarProperty;
  asarUnpack?: AsarUnpackProperty;
  buildVersion?: BuildVersionProperty;
  copyright?: CopyrightProperty;
  electronMirror?: ElectronMirrorProperty;
  electronVersion?: ElectronVersionProperty;
  /**
   * This is the path to a base configuration file (`.json` or `.js`). This is especially useful for configuration sharing between different environments (e.g., staging and production). The base configuration file can be a relative path from the project root or an absolute path.
   */
  extends?: string;
  extraContentFiles?: ExtraContentFilesProperty;
  extraResources?: ExtraResourcesProperty;
  fileAssociations?: FileAssociationsProperty;
  updateUrlBase?: UpdateUrlBaseProperty;
  filesForDistribution?: FilesForDistributionProperty;
  /**
   * The path to your application's desktop icon. It must be an ICNS or PNG.
   */
  icon?: string;
  linux?: LinuxConfigProperty;
  /**
   * Your ToDesktop application ID. This is used to identify your app. This would have been generated when you first created your ToDesktop application via the web interface.
   */
  id?: string;
  includeSubNodeModules?: IncludeSubNodeModulesProperty;
  mac?: MacConfigProperty;
  mas?: MasConfigProperty;
  dmg?: DmgConfigProperty;
  nodeVersion?: NodeVersionProperty;
  npmVersion?: NpmVersionProperty;
  pnpmVersion?: PnpmVersionProperty;
  bunVersion?: BunVersionProperty;
  packageJson?: PackageJsonProperty;
  packageManager?: PackageManagerProperty;
  rebuildLibrary?: RebuildLibraryProperty;
  /**
   * This is the `todesktop.json` schema version. This must be `1`.
   */
  schemaVersion?: number;
  snap?: SnapConfigProperty;
  uploadSizeLimit?: UploadSizeLimitProperty;
  windows?: WindowsConfigProperty;
  /**
   * This option allows you to specify platform-specific configurations for Windows, macOS, and Linux builds. Most top-level configuration fields available in `todesktop.json` can be overridden within the `windows`, `mac`, or `linux` objects under `platformOverrides`.
   */
  platformOverrides?: {
    windows?: PlatformOverridableProperties;
    mac?: PlatformOverridableProperties;
    linux?: PlatformOverridableProperties;
  };
}
/**
 * Configure Electron Fuses to enable or disable certain Electron features at package time. Fuses are compile-time feature flags that cannot be changed at runtime, providing security benefits. See https://www.electronjs.org/docs/latest/tutorial/fuses for more information.
 */
export interface FusesConfigProperty {
  /**
   * Controls whether the ELECTRON_RUN_AS_NODE environment variable is respected. When disabled, the env variable will be ignored. Default: true (enabled).
   */
  runAsNode?: boolean;
  /**
   * Controls whether the cookie store on disk is encrypted using OS-level cryptography. Default: false (disabled).
   */
  enableCookieEncryption?: boolean;
  /**
   * Controls whether the NODE_OPTIONS environment variable is respected. When disabled, the env variable will be ignored. Default: true (enabled).
   */
  enableNodeOptionsEnvironmentVariable?: boolean;
  /**
   * Controls whether command line arguments like --inspect are respected. When disabled, these arguments will be ignored. Default: true (enabled).
   */
  enableNodeCliInspectArguments?: boolean;
  /**
   * Controls whether Electron validates the integrity of the app.asar file. Requires the integrity block in the asar header. Default: false (disabled).
   */
  enableEmbeddedAsarIntegrityValidation?: boolean;
  /**
   * Controls whether Electron only loads the app from an asar archive. When enabled, Electron will not search for loose files. Default: false (disabled).
   */
  onlyLoadAppFromAsar?: boolean;
  /**
   * Controls whether the browser process uses a V8 snapshot file located at browser_v8_context_snapshot.bin. Default: false (disabled).
   */
  loadBrowserProcessSpecificV8Snapshot?: boolean;
  /**
   * Controls whether pages loaded via file:// protocol get extra privileges. When disabled, file:// pages are more restricted. Requires Electron 29+. Default: true (enabled).
   */
  grantFileProtocolExtraPrivileges?: boolean;
}
/**
 * This object contains some options that only apply to the building & releasing for Linux.
 */
export interface LinuxConfigProperty {
  /**
   * The [application category](https://specifications.freedesktop.org/menu-spec/latest/apa.html#main-category-registry).
   */
  category?: string;
  /**
   * The path to your application's Linux desktop icon. It must be an ICNS or PNG.
   */
  icon?: string;
  /**
   * The version of the Linux image that ToDesktop should use to build your app.
   */
  imageVersion?: string;
  /**
   * Additional command-line arguments to pass to the executable in the Linux .desktop file Exec line.
   */
  executableArgs?: string[];
  /**
   * Configuration for Debian (.deb) packaging.
   */
  deb?: {
    /**
     * Additional package dependencies to append to ToDesktop's default .deb dependencies.
     */
    additionalDepends?: string[];
    /**
     * The list of package dependencies for the .deb package. This overwrites ToDesktop's default dependency list and linux.deb.additionalDepends.
     */
    depends?: string[];
  };
  /**
   * This option allows you to configure whether your app should run in a sandboxed environment.
   */
  noSandbox?: boolean;
}
/**
 * This object contains some options that only apply to the building & releasing for MacOS.
 */
export interface MacConfigProperty {
  /**
   * The application category type, as shown in the Finder via _View -> Arrange by Application Category_ when viewing the Applications directory.
   */
  category?: string;
  /**
   * Paths of any extra binaries that need to be signed. These could be files in your own app code or `node_modules`.
   */
  additionalBinariesToSign?: string[];
  /**
   * The path to an entitlements file for signing your application. It must be a plist file.
   */
  entitlements?: string;
  /**
   * The path to a child entitlements file for signing your application. It must be a plist file.
   */
  entitlementsInherit?: string;
  /**
   * Extra entries for `Info.plist`.
   */
  extendInfo?: {};
  /**
   * The path to your application's Mac desktop icon. It must be an ICNS, PNG, or Apple `.icon` package directory.
   */
  icon?: string;
  /**
   * The path to the [requirements file](https://developer.apple.com/library/archive/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html) used when signing your application.
   */
  requirements?: string;
}
/**
 * This object contains options that only apply to building the application for Mac App Store.
 */
export interface MasConfigProperty {
  /**
   * The path to an entitlements file for signing your application. It must be a plist file.
   */
  entitlements?: string;
  /**
   * The path to a child entitlements file for signing your application. It must be a plist file.
   */
  entitlementsInherit?: string;
  /**
   * The path to a provisioning profile for authorizing your application.
   */
  provisioningProfile?: string;
  /**
   * Whether to sign app for development or for distribution.
   */
  type?: 'development' | 'distribution';
  /**
   * The minimum macOS version required to run the app. Set to '12.0' or higher for arm64-only Mac App Store submissions.
   */
  minimumSystemVersion?: string;
  /**
   * Minimatch pattern of paths that are allowed to be x64 binaries in both ASAR files.
   */
  x64ArchFiles?: string;
}
/**
 * Options for customizing the macOS DMG (disk image) installer.
 */
export interface DmgConfigProperty {
  /**
   * The path to the DMG installer's background image. It must be a `.tiff` file. The resolution of this file determines the resolution of the installer window. Typically, backgrounds are 540x380.
   */
  background?: string;
  /**
   * The artifact name of the DMG file. Macros ${productName}, ${version}, ${name} are supported.
   */
  artifactName?: string;
  /**
   * The background color (accepts css colors). Defaults to "`#ffffff`" (white) if no background image.
   */
  backgroundColor?: string;
  /**
   * The size of all the icons inside the DMG. Defaults to `80`.
   */
  iconSize?: number;
  /**
   * The size of all the icon texts inside the DMG. Defaults to `12`.
   */
  iconTextSize?: number;
  /**
   * The title of the produced DMG, which will be shown when mounted (volume name). Macro `${productName}`, `${version}` and `${name}` are supported.
   */
  title?: string;
  /**
   * Customize icon locations. The x and y coordinates refer to the position of the center of the icon (at 1x scale), and do not take the label into account.
   */
  contents?: {
    /**
     * The device-independent pixel offset from the left of the window to the center of the icon.
     */
    x?: number;
    /**
     * The device-independent pixel offset from the top of the window to the center of the icon.
     */
    y?: number;
  }[];
  /**
   * The DMG windows position and size. In most cases, you will only want to specify a `height` and `width` value but not `x` and `y`.
   */
  window?: {
    /**
     * The X position relative to left of the screen.
     */
    x?: number;
    /**
     * The Y position relative to top of the screen.
     */
    y?: number;
    /**
     * The width. Defaults to background image width or 540.
     */
    width?: number;
    /**
     * The height. Defaults to background image height or 380.
     */
    height?: number;
  };
}
/**
 * If you want to override the default `package.json` configuration, use the `packageJson` property. For example, you can use this to override the `productName` or `version` properties.
 */
export interface PackageJsonProperty {}
/**
 * This object contains some options that only apply to the building for the [Snap Store](https://snapcraft.io/store).
 */
export interface SnapConfigProperty {
  /**
   * Ensures that all the part names listed are staged before the app part begins its [lifecycle](https://snapcraft.io/docs/parts-lifecycle#heading--steps).
   */
  after?: string[];
  /**
   * Specifies which files from the app part to stage and which to exclude. Individual files, directories, wildcards, globstars, and exclusions are accepted. See [Snapcraft filesets](https://snapcraft.io/docs/snapcraft-filesets) to learn more about the format.
   */
  appPartStage?: string & string[];
  /**
   * The list of features that must be supported by the core in order for this snap to install. To learn more, see the [Snapcraft docs](https://snapcraft.io/docs/snapcraft-top-level-metadata#heading--assumes).
   */
  assumes?: string | string[];
  /**
   * Whether or not the snap should automatically start on login.
   */
  autoStart?: boolean;
  /**
   * The base snap to use for building this snap.
   */
  base?: string;
  /**
   * The list of debian packages needs to be installed for building this snap.
   */
  buildPackages?: string[];
  /**
   * The type of [confinement](https://snapcraft.io/docs/reference/confinement) supported by the snap. `devmode`, `strict`, or `classic`.
   */
  confinement?: 'classic' | 'devmode' | 'strict';
  /**
   * The custom environment. If you set this, it will be merged with the default.
   */
  environment?: {};
  /**
   * The quality grade of the snap. It can be either `devel` (i.e. a development version of the snap, so not to be published to the "stable" or "candidate" channels) or `stable` (i.e. a stable release or release candidate, which can be released to all channels).
   */
  grade?: 'devel' | 'stable';
  /**
   * Specifies any files to make accessible from locations such as `/usr`, `/var`, and `/etc`. See [snap layouts](https://snapcraft.io/docs/snap-layouts) to learn more.
   */
  layout?: string;
  /**
   * The list of [plugs](https://snapcraft.io/docs/reference/interfaces). If list contains `default`, it will be replaced with the default list, so, `["default", "foo"]` can be used to add a custom plug `foo` in addition to the default list.
   */
  plugs?: (string | {})[];
  /**
   * The list of Ubuntu packages to use that are needed to support the app part creation. Like `depends` for deb. If list contains `default`, it will be replaced with the default list, so, `["default", "foo"]` can be used to add custom package `foo` in addition to the defaults.
   */
  stagePackages?: string[];
  /**
   * A sentence summarising the snap. Max len. 78 characters, describing the snap in short and simple terms.
   */
  summary?: string;
  /**
   * Whether to use a template snap.
   */
  useTemplateApp?: boolean & string;
}
/**
 * This object contains some options that only apply to the building & releasing for Windows.
 */
export interface WindowsConfigProperty {
  /**
   * The path to your application's Windows desktop icon. It must be an ICO, ICNS, or PNG.
   */
  icon?: string;
  /**
   * Allows you to provide your own makensis, such as one with support for debug logging via LogSet and LogText. (Logging also requires option debugLogging = true). It's not recommended to use it for production build.
   */
  nsisCustomBinary?: string;
  /**
   * The path to NSIS script to customize installer.
   */
  nsisInclude?: string;
  /**
   * The publisher name, exactly as in your code signing certificate. Several names can be provided. Defaults to common name from your code signing certificate. You should typically not include this property in your configuration unless you wish to transition to a new certificate in the future.
   */
  publisherName?: string & string[];
}
/**
 * Defines properties that can be overridden on a per-platform basis under the 'platformOverrides' field.
 */
export interface PlatformOverridableProperties {
  appBuilderLibVersion?: AppBuilderLibVersionProperty;
  appId?: AppIdProperty;
  appFiles?: AppFilesProperty;
  appProtocolScheme?: AppProtocolSchemeProperty;
  appPath?: AppPathProperty;
  bytenode?: BytenodeConfigProperty;
  fuses?: FusesConfigProperty;
  asar?: AsarProperty;
  asarUnpack?: AsarUnpackProperty;
  buildVersion?: BuildVersionProperty;
  copyright?: CopyrightProperty;
  electronMirror?: ElectronMirrorProperty;
  electronVersion?: ElectronVersionProperty;
  extraContentFiles?: ExtraContentFilesProperty;
  extraResources?: ExtraResourcesProperty;
  fileAssociations?: FileAssociationsProperty;
  updateUrlBase?: UpdateUrlBaseProperty;
  filesForDistribution?: FilesForDistributionProperty;
  linux?: LinuxConfigProperty;
  includeSubNodeModules?: IncludeSubNodeModulesProperty;
  mac?: MacConfigProperty;
  mas?: MasConfigProperty;
  dmg?: DmgConfigProperty;
  nodeVersion?: NodeVersionProperty;
  npmVersion?: NpmVersionProperty;
  pnpmVersion?: PnpmVersionProperty;
  bunVersion?: BunVersionProperty;
  packageJson?: PackageJsonProperty;
  packageManager?: PackageManagerProperty;
  rebuildLibrary?: RebuildLibraryProperty;
  snap?: SnapConfigProperty;
  uploadSizeLimit?: UploadSizeLimitProperty;
  windows?: WindowsConfigProperty;
}
