Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Namespaces

Enumerations

Enumeration members

Classes

Interfaces

Type aliases

Variables

Functions

Enumeration members

DATA = "DATA"
ENABLED = "ENABLED"
MESSAGE = "MESSAGE"
STATE = "STATE"
SUBTASK = "SUBTASK"
TITLE = "TITLE"

Type aliases

AcceptedPlugin: { postcss: Processor_ | TransformCallback } | OldPlugin<any> | Plugin | PluginCreator<any> | Processor_ | TransformCallback
AddonFunction: (chunk: RenderedChunk) => string | Promise<string>

Type declaration

    • (chunk: RenderedChunk): string | Promise<string>
    • Parameters

      • chunk: RenderedChunk

      Returns string | Promise<string>

AddonHook: string | AddonHookFunction
AddonHookFunction: (this: PluginContext, chunk: RenderedChunk) => string | Promise<string>

Type declaration

    • (this: PluginContext, chunk: RenderedChunk): string | Promise<string>
    • Parameters

      Returns string | Promise<string>

AddonHooks: "banner" | "footer" | "intro" | "outro"
AliasOptions: readonly Alias[] | {}

Specifies an Object, or an Array of Object, which defines aliases used to replace values in import or require statements. With either format, the order of the entries is important, in that the first defined rules are applied first.

This is passed to @rollup/plugin-alias as the "entries" field https://github.com/rollup/plugins/tree/master/packages/alias#entries

AmdOptions: ({ autoId?: false; id: string } | { autoId: true; basePath?: string; id?: undefined } | { autoId?: false; id?: undefined }) & { define?: string; forceJsExtensionForImports?: boolean }
AnymatchFn: (testString: string) => boolean

Type declaration

    • (testString: string): boolean
    • Parameters

      • testString: string

      Returns boolean

AnymatchMatcher: AnymatchPattern | AnymatchPattern[]
AnymatchPattern: string | RegExp | AnymatchFn
AppType: "spa" | "mpa" | "custom"

spa: include SPA fallback middleware and configure sirv with single: true in preview

mpa: only include non-SPA HTML middlewares

custom: don't include HTML middlewares

AssignmentOperator: "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "||=" | "&&=" | "??="
AsyncPluginHooks: Exclude<keyof FunctionPluginHooks, SyncPluginHooks>
AtRuleProcessor: (atRule: AtRule_, helper: Helpers) => Promise<void> | void

Type declaration

AwaitedEventListener<T, K>: (...parameters: Parameters<T[K]>) => void | Promise<void>

Type parameters

  • T: {}

  • K: keyof T

Type declaration

    • (...parameters: Parameters<T[K]>): void | Promise<void>
    • Parameters

      • Rest ...parameters: Parameters<T[K]>

      Returns void | Promise<void>

BaseSignOptions: Readonly<{ app: string; identity?: string; keychain?: string; platform?: ElectronMacPlatform }>
BinaryOperator: "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "**" | "|" | "^" | "&" | "in" | "instanceof"
BindCLIShortcutsOptions<Server>: { customShortcuts?: CLIShortcut<Server>[]; print?: boolean }

Type parameters

Type declaration

  • Optional customShortcuts?: CLIShortcut<Server>[]

    Custom shortcuts to run when a key is pressed. These shortcuts take priority over the default shortcuts if they have the same keys (except the h key). To disable a default shortcut, define the same key but with action: undefined.

  • Optional print?: boolean

    Print a one-line shortcuts "help" hint to the terminal

CLIShortcut<Server>: { description: string; key: string; action?: any }

Type parameters

Type declaration

  • description: string
  • key: string
  • action?:function
    • action(server: Server): void | Promise<void>
    • Parameters

      • server: Server

      Returns void | Promise<void>

ChangeEvent: "create" | "update" | "delete"
Charset: "ascii" | "utf8"
CommentProcessor: (comment: Comment_, helper: Helpers) => Promise<void> | void

Type declaration

CorsOrigin: boolean | string | RegExp | (string | RegExp)[]
CreateOptions: { dot?: boolean; globOptions?: IOptions; ordering?: string; pattern?: string; unpack?: string; unpackDir?: string; transform?: any }

Type declaration

  • Optional dot?: boolean
  • Optional globOptions?: IOptions
  • Optional ordering?: string
  • Optional pattern?: string
  • Optional unpack?: string
  • Optional unpackDir?: string
  • transform?:function
    • transform(filePath: string): void | ReadWriteStream
    • Parameters

      • filePath: string

      Returns void | ReadWriteStream

DeclarationProcessor: (decl: Declaration_, helper: Helpers) => Promise<void> | void

Type declaration

DecodedSourceMapOrMissing: { missing: true; plugin: string } | (ExistingDecodedSourceMap & { missing?: false })
DepOptimizationOptions: DepOptimizationConfig & { entries?: string | string[]; force?: boolean }
DocumentProcessor: (document: Document_, helper: Helpers) => Promise<void> | void

Type declaration

Drop: "console" | "debugger"
ECMA: 5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020
ElectronMacPlatform: "darwin" | "mas"
ElectronProcess: ChildProcess & { restarted: boolean }
EmitFile: (emittedFile: EmittedFile) => string

Type declaration

ErrorCallback: (err: Error, req: http.IncomingMessage, res: http.ServerResponse, target?: ProxyTargetUrl) => void

Type declaration

    • (err: Error, req: http.IncomingMessage, res: http.ServerResponse, target?: ProxyTargetUrl): void
    • Parameters

      • err: Error
      • req: http.IncomingMessage
      • res: http.ServerResponse
      • Optional target: ProxyTargetUrl

      Returns void

ErrorHandleFunction: (err: any, req: IncomingMessage, res: http.ServerResponse, next: NextFunction) => void

Type declaration

ExportsData: { exports: readonly string[]; hasImports: boolean; jsxLoader?: boolean }

Type declaration

  • exports: readonly string[]
  • hasImports: boolean
  • Optional jsxLoader?: boolean
Expression: ExpressionMap[keyof ExpressionMap]
ExternalOption: (string | RegExp)[] | string | RegExp | ((source: string, importer: string | undefined, isResolved: boolean) => boolean | NullValue)
FinalizePackageTargetsHookFunction: (targets: TargetDefinition[], callback: HookFunctionErrorCallback) => void

Type declaration

FirstPluginHooks: "load" | "renderDynamicImport" | "resolveDynamicImport" | "resolveFileUrl" | "resolveId" | "resolveImportMeta" | "shouldTransformCachedModule"
ForgeHookFn<Hook>: Hook extends keyof ForgeSimpleHookSignatures ? ForgeSimpleHookFn<Hook> : Hook extends keyof ForgeMutatingHookSignatures ? ForgeMutatingHookFn<Hook> : never

Type parameters

ForgeHookMap: { [ S in ForgeHookName]?: ForgeHookFn<S> }
ForgeListrTaskDefinition: ListrTask<never>
ForgeMultiHookMap: { [ S in ForgeHookName]?: ForgeHookFn<S> | ForgeHookFn<S>[] }
ForgeMutatingHookFn<Hook>: (forgeConfig: ResolvedForgeConfig, ...args: ForgeMutatingHookSignatures[Hook]) => Promise<ForgeMutatingHookSignatures[Hook][0] | undefined>

Type parameters

Type declaration

ForgePackagerOptions: Omit<Options, "dir" | "arch" | "platform" | "out" | "electronVersion">
ForgeRebuildOptions: Omit<RebuildOptions, "buildPath" | "electronVersion" | "arch">
ForgeSimpleHookFn<Hook>: (forgeConfig: ResolvedForgeConfig, ...args: ForgeSimpleHookSignatures[Hook]) => Promise<void>

Type parameters

Type declaration

Format: "iife" | "cjs" | "esm"
GeneratedCodePreset: "es5" | "es2015"
GetInterop: (id: string | null) => InteropType

Type declaration

GetManualChunk: (id: string, meta: ManualChunkMeta) => string | NullValue

Type declaration

GetModuleInfo: (moduleId: string) => ModuleInfo | null

Type declaration

GlobalsOption: {} | ((name: string) => string)
HasModuleSideEffects: (id: string, external: boolean) => boolean

Type declaration

    • (id: string, external: boolean): boolean
    • Parameters

      • id: string
      • external: boolean

      Returns boolean

Helpers: { postcss: Postcss; result: Result_ } & Postcss
HookFunction: (buildPath: string, electronVersion: string, platform: TargetArch, arch: TargetArch, callback: HookFunctionErrorCallback) => void

Type declaration

    • A function that is called on the completion of a packaging stage.

      By default, the functions are called in parallel (via Promise.all). If you need the functions called serially, there is a utility function provided. Please note that callback-style functions are not supported by serialHooks. For example:

      const packager = require('@electron/packager')
      const { serialHooks } = require('@electron/packager/src/hooks')

      packager({
      // ...
      afterCopy: [serialHooks([
      (buildPath, electronVersion, platform, arch) => {
      return new Promise((resolve, reject) => {
      setTimeout(() => {
      console.log('first function')
      resolve()
      }, 1000)
      })
      },
      (buildPath, electronVersion, platform, arch) => {
      console.log('second function')
      }
      ])],
      // ...
      })

      For real-world examples of HookFunctions, see the list of related plugins.

      Parameters

      Returns void

HookFunction: (fileToSign: string) => void | Promise<void>

Type declaration

    • (fileToSign: string): void | Promise<void>
    • Parameters

      • fileToSign: string

      Returns void | Promise<void>

HookFunctionErrorCallback: (err?: Error | null) => void

Type declaration

    • (err?: Error | null): void
    • Parameters

      • Optional err: Error | null

      Returns void

HookHandler<T>: T extends ObjectHook<infer H> ? H : T

Type parameters

  • T

HttpServer: http.Server | Http2SecureServer
IgnoreFunction: (path: string) => boolean

Type declaration

    • (path: string): boolean
    • A predicate function that, given an absolute file path, returns true if the file should be ignored, or false if the file should be kept. This does not use any of the default ignored files/directories listed for the ignore option.

      Parameters

      • path: string

      Returns boolean

ImportKind: "entry-point" | "import-statement" | "require-call" | "dynamic-import" | "require-resolve" | "import-rule" | "composes-from" | "url-token"
IndexHtmlTransform: IndexHtmlTransformHook | { enforce?: "pre" | "post"; order?: "pre" | "post" | null; transform: IndexHtmlTransformHook } | { enforce?: "pre" | "post"; handler: IndexHtmlTransformHook; order?: "pre" | "post" | null }
IndexHtmlTransformHook: (this: void, html: string, ctx: IndexHtmlTransformContext) => IndexHtmlTransformResult | void | Promise<IndexHtmlTransformResult | void>

Type declaration

IndexHtmlTransformResult: string | HtmlTagDescriptor[] | { html: string; tags: HtmlTagDescriptor[] }
InferCustomEventPayload<T>: T extends keyof CustomEventMap ? CustomEventMap[T] : any

Type parameters

  • T: string

InnerStartResult: ElectronProcess | string | string[] | false
InputOption: string | string[] | {}
InputPluginOption: MaybePromise<Plugin | NullValue | false | InputPluginOption[]>
InternalModuleFormat: "amd" | "cjs" | "es" | "iife" | "system" | "umd"
InteropType: "compat" | "auto" | "esModule" | "default" | "defaultOnly"
IsExternal: (source: string, importer: string | undefined, isResolved: boolean) => boolean

Type declaration

    • (source: string, importer: string | undefined, isResolved: boolean): boolean
    • Parameters

      • source: string
      • importer: string | undefined
      • isResolved: boolean

      Returns boolean

LibraryFormats: "es" | "cjs" | "umd" | "iife"
LightningCSSOptions: { cssModules?: CSSModulesConfig; drafts?: Drafts; exclude?: number; include?: number; nonStandard?: NonStandard; pseudoClasses?: PseudoClasses; targets?: Targets; unusedSymbols?: string[] }

Options are spread, so you can also use options that are not typed here like visitor (not exposed because it would impact too much the bundle size)

Type declaration

ListrBaseClassOptions<Ctx, Renderer, FallbackRenderer>: ListrOptions<Ctx> & ListrDefaultRendererOptions<Renderer> & ListrDefaultNonTTYRendererOptions<FallbackRenderer>

Parent class options.

Parent class has more options where you can also select the and set renderer and non-tty renderer.

Any subtasks will respect those options so they will be stripped of that properties.

Type parameters

ListrContext: any | undefined

Listr Default Context

ListrDefaultRenderer: typeof DefaultRenderer

Type of default renderer

ListrDefaultRendererValue: "default"

The default renderer value used in Listr2 applications

ListrEvent: { data?: string | boolean; type: Exclude<ListrEventType, "MESSAGE" | "DATA"> } | { data: string; type: DATA } | { data: Task<any, any>["message"]; type: MESSAGE }

The internal communication event.

ListrFallbackRenderer: typeof VerboseRenderer

Type of default fallback renderer

ListrFallbackRendererValue: "verbose"

Name of default fallback renderer

Returns the class type from friendly names of the renderers.

Type parameters

ListrGetRendererOptions<T>: T extends ListrDefaultRendererValue ? ListrDefaultRenderer["rendererOptions"] : T extends ListrSimpleRendererValue ? ListrSimpleRenderer["rendererOptions"] : T extends ListrFallbackRendererValue ? ListrFallbackRenderer["rendererOptions"] : T extends ListrSilentRenderer ? ListrSilentRenderer["rendererOptions"] : T extends ListrRendererFactory ? T["rendererOptions"] : never

Returns renderer global options depending on the renderer type.

Type parameters

ListrGetRendererTaskOptions<T>: T extends ListrDefaultRendererValue ? ListrDefaultRenderer["rendererTaskOptions"] : T extends ListrSimpleRendererValue ? ListrSimpleRenderer : T extends ListrFallbackRendererValue ? ListrFallbackRenderer["rendererTaskOptions"] : T extends ListrSilentRenderer ? ListrSilentRenderer["rendererTaskOptions"] : T extends ListrRendererFactory ? T["rendererTaskOptions"] : never

Returns renderer per task options depending on the renderer type.

Type parameters

ListrRendererFactory: typeof ListrRenderer

A renderer factory from the current type

Listr2 can process either the integrated renderers as string aliases, or utilize a compatible style renderer that extends the ListrRenderer abstract class.

ListrSilentRenderer: typeof SilentRenderer

Typeof silent renderer

ListrSilentRendererValue: "silent"

Silent rendere for internal usage

ListrSimpleRenderer: typeof SimpleRenderer

Typeof simple renderer

ListrSimpleRendererValue: "simple"

Simple renderer that simplifies things

ListrSubClassOptions<Ctx, Renderer>: ListrOptions<Ctx> & Omit<ListrDefaultRendererOptions<Renderer>, "renderer">

Sub class options.

Subtasks has reduced set options where the missing ones are explicitly set by the base class.

Type parameters

ListrTaskResult<Ctx>: string | Promise<any> | Listr<Ctx, ListrRendererValue, any> | Readable | NodeJS.ReadableStream | Observable<any>

Task can be set of sync or async function, an Observable or a stream.

Type parameters

  • Ctx

LoadHook: (this: PluginContext, id: string) => LoadResult

Type declaration

LoadResult: SourceDescription | string | NullValue
Loader: "base64" | "binary" | "copy" | "css" | "dataurl" | "default" | "empty" | "file" | "js" | "json" | "jsx" | "local-css" | "text" | "ts" | "tsx"
LogHandler: (level: LogLevel, log: RollupLog) => void

Type declaration

LogHandlerWithDefault: (level: LogLevel, log: RollupLog, defaultHandler: LogOrStringHandler) => void

Type declaration

LogLevel: LogType | "silent"
LogLevel: "verbose" | "debug" | "info" | "warning" | "error" | "silent"
LogLevel: "warn" | "info" | "debug"
LogLevelOption: LogLevel | "silent"
LogOrStringHandler: (level: LogLevel | "error", log: RollupLog | string) => void

Type declaration

LogType: "error" | "warn" | "info"
LoggingFunction: (log: RollupLog | string | (() => RollupLog | string)) => void

Type declaration

LoggingFunctionWithPosition: (log: RollupLog | string | (() => RollupLog | string), pos?: number | { column: number; line: number }) => void

Type declaration

    • (log: RollupLog | string | (() => RollupLog | string), pos?: number | { column: number; line: number }): void
    • Parameters

      • log: RollupLog | string | (() => RollupLog | string)
      • Optional pos: number | { column: number; line: number }

      Returns void

LogicalOperator: "||" | "&&" | "??"
MakeAsync<Function_>: Function_ extends (this: infer This, ...parameters: infer Arguments) => infer Return ? (this: This, ...parameters: Arguments) => Return | Promise<Return> : never

Type parameters

  • Function_

MakeUniversalOpts: Parameters<typeof makeUniversalApp>[0]
MakeUniversalOpts: { arm64AppPath: string; force?: boolean; infoPlistsToIgnore?: string; mergeASARs?: boolean; outAppPath: string; singleArchFiles?: string; x64AppPath: string; x64ArchFiles?: string }

Type declaration

  • arm64AppPath: string

    Absolute file system path to the arm64 version of your application. E.g. /Foo/bar/MyApp_arm64.app

  • Optional force?: boolean

    Forcefully overwrite any existing files that are in the way of generating the universal application

  • Optional infoPlistsToIgnore?: string

    Minimatch pattern of paths that should not receive an injected ElectronAsarIntegrity value

  • Optional mergeASARs?: boolean

    Merge x64 and arm64 ASARs into one.

  • outAppPath: string

    Absolute file system path you want the universal app to be written to. E.g. /Foo/var/MyApp_universal.app

    If this file exists it will be overwritten ONLY if "force" is set to true

  • Optional singleArchFiles?: string

    Minimatch pattern of paths that are allowed to be present in one of the ASAR files, but not in the other.

  • x64AppPath: string

    Absolute file system path to the x64 version of your application. E.g. /Foo/bar/MyApp_x64.app

  • Optional x64ArchFiles?: string

    Minimatch pattern of binaries that are expected to be the same x64 binary in both of the ASAR files.

ManualChunksOption: {} | GetManualChunk
MaybePromise<T>: T | Promise<T>

Type parameters

  • T

ModuleFormat: InternalModuleFormat | "commonjs" | "esm" | "module" | "systemjs"
ModuleParsedHook: (this: PluginContext, info: ModuleInfo) => void

Type declaration

ModuleSideEffectsOption: boolean | "no-external" | string[] | HasModuleSideEffects
ModuleType: "prod" | "dev" | "optional"
NextFunction: (err?: any) => void

Type declaration

    • (err?: any): void
    • Parameters

      • Optional err: any

      Returns void

NextHandleFunction: (req: IncomingMessage, res: http.ServerResponse, next: NextFunction) => void

Type declaration

NormalizedAmdOptions: ({ autoId: false; id?: string } | { autoId: true; basePath: string }) & { define: string; forceJsExtensionForImports: boolean }
NullValue: null | undefined | void
ObjectHook<T, O>: T | ({ handler: T; order?: "pre" | "post" | null } & O)

Type parameters

  • T

  • O = {}

OfficialArch: "ia32" | "x64" | "armv7l" | "arm64" | "mips64el" | "universal"

Architectures that have been supported by the official Electron prebuilt binaries, past and present.

OfficialPlatform: "linux" | "win32" | "darwin" | "mas"

Platforms that have been supported by the official Electron prebuilt binaries, past and present.

OnlySignOptions: { binaries?: string[]; identityValidation?: boolean; ignore?: string | string[] | ((file: string) => boolean); preAutoEntitlements?: boolean; preEmbedProvisioningProfile?: boolean; provisioningProfile?: string; strictVerify?: boolean; type?: SigningDistributionType; version?: string; optionsForFile?: any }

Type declaration

  • Optional binaries?: string[]
  • Optional identityValidation?: boolean
  • Optional ignore?: string | string[] | ((file: string) => boolean)
  • Optional preAutoEntitlements?: boolean
  • Optional preEmbedProvisioningProfile?: boolean
  • Optional provisioningProfile?: string
  • Optional strictVerify?: boolean
  • Optional type?: SigningDistributionType
  • Optional version?: string
  • optionsForFile?:function
    • Parameters

      • filePath: string

      Returns PerFileSignOptions

OptionsPaths: Record<string, string> | ((id: string) => string)
OsxSignOptions: Omit<SignOptions, "app" | "binaries" | "platform" | "version">

See the documentation for @electron/osx-sign for details.

OsxUniversalOptions: Omit<MakeUniversalOpts, "x64AppPath" | "arm64AppPath" | "outAppPath" | "force">

See the documentation for @electron/universal for details.

OutputPluginHooks: "augmentChunkHash" | "generateBundle" | "outputOptions" | "renderChunk" | "renderDynamicImport" | "renderError" | "renderStart" | "resolveFileUrl" | "resolveImportMeta" | "writeBundle"
OutputPluginOption: MaybePromise<OutputPlugin | NullValue | false | OutputPluginOption[]>
PackageCache: Map<string, PackageData>

Cache for package.json resolution and package.json contents

ParallelPluginHooks: Exclude<keyof FunctionPluginHooks | AddonHooks, FirstPluginHooks | SequentialPluginHooks>
ParseAst: (input: string, options?: { allowReturnOutsideFunction?: boolean }) => ProgramNode

Type declaration

    • (input: string, options?: { allowReturnOutsideFunction?: boolean }): ProgramNode
    • Parameters

      • input: string
      • Optional options: { allowReturnOutsideFunction?: boolean }
        • Optional allowReturnOutsideFunction?: boolean

      Returns ProgramNode

PartialNull<T>: { [ P in keyof T]: T[P] | null }

Type parameters

  • T

PerFileSignOptions: { entitlements?: string | string[]; hardenedRuntime?: boolean; requirements?: string; signatureFlags?: string | string[]; timestamp?: string }

Any missing options will use the default values, providing a partial structure will shallow merge with the default values.

Type declaration

  • Optional entitlements?: string | string[]

    The entitlements file to use when signing this file

  • Optional hardenedRuntime?: boolean

    Whether to enable hardened runtime for this file. Enabled by default.

  • Optional requirements?: string

    The designated requirements to embed when signing this file

  • Optional signatureFlags?: string | string[]

    See --options of the "codesign" command.

  • Optional timestamp?: string

    The timestamp server to use when signing, by default uses the Apple provided timestamp server.

Platform: "browser" | "node" | "neutral"
PluginHooks: { [ K in keyof FunctionPluginHooks]: ObjectHook<K extends AsyncPluginHooks ? MakeAsync<FunctionPluginHooks[K]> : FunctionPluginHooks[K], K extends ParallelPluginHooks ? { sequential?: boolean } : {}> }
PluginOption: Plugin | false | null | undefined | PluginOption[] | Promise<Plugin | false | null | undefined | PluginOption[]>
PluginWithRequiredHook<K>: Plugin & { [ P in K]: NonNullable<Plugin[P]> }

Type parameters

Postcss: typeof postcss
PreserveEntrySignaturesOption: false | "strict" | "allow-extension" | "exports-only"
PreviewServerHook: (this: void, server: PreviewServer) => (() => void) | void | Promise<(() => void) | void>

Type declaration

    • (this: void, server: PreviewServer): (() => void) | void | Promise<(() => void) | void>
    • Parameters

      Returns (() => void) | void | Promise<(() => void) | void>

ProgramNode: Program & AstNode
PromptOptions<T>: Unionize<{ [ K in PromptTypes]-?: T extends true ? { type: K } & PromptOptionsType<K> & { name: string | (() => string) } : { type: K } & PromptOptionsType<K> }> | (({ type: string } & T) extends true ? PromptOptionsType<string> & { name: string | (() => string) } : PromptOptionsType<string>)

Returns all the prompt options depending on the type selected.

Type parameters

  • T: boolean = false

PromptOptionsType<T>: T extends keyof PromptOptionsMap ? PromptOptionsMap[T] : T extends string ? BasePromptOptions & Record<PropertyKey, unknown> : any

Type parameters

  • T

PromptTypes: "AutoComplete" | "BasicAuth" | "Confirm" | "Editable" | "Form" | "Input" | "Invisible" | "List" | "MultiSelect" | "Numeral" | "Password" | "Quiz" | "Scale" | "Select" | "Snippet" | "Sort" | "Survey" | "Text" | "Toggle"
ProxyTargetUrl: string | Partial<url.Url>
RawData: Buffer | ArrayBuffer | Buffer[]

Data represents the raw message payload received over the WebSocket.

RebuildMode: "sequential" | "parallel"
RenderBuiltAssetUrl: (filename: string, type: { hostId: string; hostType: "js" | "css" | "html"; ssr: boolean; type: "asset" | "public" }) => string | { relative?: boolean; runtime?: string } | undefined

Type declaration

    • (filename: string, type: { hostId: string; hostType: "js" | "css" | "html"; ssr: boolean; type: "asset" | "public" }): string | { relative?: boolean; runtime?: string } | undefined
    • Parameters

      • filename: string
      • type: { hostId: string; hostType: "js" | "css" | "html"; ssr: boolean; type: "asset" | "public" }
        • hostId: string
        • hostType: "js" | "css" | "html"
        • ssr: boolean
        • type: "asset" | "public"

      Returns string | { relative?: boolean; runtime?: string } | undefined

RenderChunkHook: (this: PluginContext, code: string, chunk: RenderedChunk, options: NormalizedOutputOptions, meta: { chunks: Record<string, RenderedChunk> }) => { code: string; map?: SourceMapInput } | string | NullValue

Type declaration

ResolveDynamicImportHook: (this: PluginContext, specifier: string | AstNode, importer: string, options: { attributes: Record<string, string> }) => ResolveIdResult

Type declaration

ResolveFileUrlHook: (this: PluginContext, options: { chunkId: string; fileName: string; format: InternalModuleFormat; moduleId: string; referenceId: string; relativePath: string }) => string | NullValue

Type declaration

ResolveFn: (id: string, importer?: string, aliasOnly?: boolean, ssr?: boolean) => Promise<string | undefined>

Type declaration

    • (id: string, importer?: string, aliasOnly?: boolean, ssr?: boolean): Promise<string | undefined>
    • Parameters

      • id: string
      • Optional importer: string
      • Optional aliasOnly: boolean
      • Optional ssr: boolean

      Returns Promise<string | undefined>

ResolveIdHook: (this: PluginContext, source: string, importer: string | undefined, options: { attributes: Record<string, string>; custom?: CustomPluginOptions; isEntry: boolean }) => ResolveIdResult

Type declaration

ResolveIdResult: string | NullValue | false | PartialResolvedId
ResolveImportMetaHook: (this: PluginContext, property: string | null, options: { chunkId: string; format: InternalModuleFormat; moduleId: string }) => string | NullValue

Type declaration

ResolveModulePreloadDependenciesFn: (filename: string, deps: string[], context: { hostId: string; hostType: "html" | "js" }) => string[]

Type declaration

    • (filename: string, deps: string[], context: { hostId: string; hostType: "html" | "js" }): string[]
    • Parameters

      • filename: string
      • deps: string[]
      • context: { hostId: string; hostType: "html" | "js" }
        • hostId: string
        • hostType: "html" | "js"

      Returns string[]

ResolvedCSSOptions: Omit<CSSOptions, "lightningcss"> & { lightningcss?: LightningCSSOptions & { targets: LightningCSSOptions["targets"] } }
ResolvedUrl: [url: string, resolvedId: string, meta: object | null | undefined]
RollupWatcher: AwaitingEventEmitter<{ change: any; close: any; event: any; restart: any }>
RollupWatcherEvent: { code: "START" } | { code: "BUNDLE_START"; input?: InputOption; output: readonly string[] } | { code: "BUNDLE_END"; duration: number; input?: InputOption; output: readonly string[]; result: RollupBuild } | { code: "END" } | { code: "ERROR"; error: RollupError; result: RollupBuild | null }
RootProcessor: (root: Root_, helper: Helpers) => Promise<void> | void

Type declaration

RuleProcessor: (rule: Rule_, helper: Helpers) => Promise<void> | void

Type declaration

SSRTarget: "node" | "webworker"
SameShape<Out, In>: In & { [ Key in Exclude<keyof In, keyof Out>]: never }

Type parameters

  • Out

  • In: Out

SequentialPluginHooks: "augmentChunkHash" | "generateBundle" | "onLog" | "options" | "outputOptions" | "renderChunk" | "transform"
ServerHandle: HandleFunction | http.Server
ServerHook: (this: void, server: ViteDevServer) => (() => void) | void | Promise<(() => void) | void>

Type declaration

    • (this: void, server: ViteDevServer): (() => void) | void | Promise<(() => void) | void>
    • Parameters

      Returns (() => void) | void | Promise<(() => void) | void>

ShouldTransformCachedModuleHook: (this: PluginContext, options: { ast: ProgramNode; code: string; id: string; meta: CustomPluginOptions; moduleSideEffects: boolean | "no-treeshake"; resolvedSources: ResolvedIdMap; syntheticNamedExports: boolean | string }) => boolean | NullValue

Type declaration

SignOptions: Readonly<OnlySignOptions & BaseSignOptions>
SigningDistributionType: "development" | "distribution"
SimpleHandleFunction: (req: IncomingMessage, res: http.ServerResponse) => void

Type declaration

SourceMap: SourceMapGenerator & { toJSON: any }
SourceMapInput: ExistingRawSourceMap | string | null | { mappings: "" }
SourceMapSegment: [number] | [number, number, number, number] | [number, number, number, number, number]
SourcemapIgnoreListOption: (relativeSourcePath: string, sourcemapPath: string) => boolean

Type declaration

    • (relativeSourcePath: string, sourcemapPath: string): boolean
    • Parameters

      • relativeSourcePath: string
      • sourcemapPath: string

      Returns boolean

SourcemapPathTransformOption: (relativeSourcePath: string, sourcemapPath: string) => string

Type declaration

    • (relativeSourcePath: string, sourcemapPath: string): string
    • Parameters

      • relativeSourcePath: string
      • sourcemapPath: string

      Returns string

StartResult: InnerStartResult | { result: InnerStartResult; tasks: ForgeListrTaskDefinition[] }
SyncPluginHooks: "augmentChunkHash" | "onLog" | "outputOptions" | "renderDynamicImport" | "resolveFileUrl" | "resolveImportMeta"
TargetArch: OfficialArch | string
TargetDefinition: { arch: TargetArch; platform: TargetPlatform }

Type declaration

TargetPlatform: OfficialPlatform | string
TeardownLogic: Subscription | Unsubscribable | (() => void) | void
TraceOptions: { category: string; extraDetails?: Record<string, string>; name: string; newRoot?: boolean }

Type declaration

  • category: string
  • Optional extraDetails?: Record<string, string>
  • name: string
  • Optional newRoot?: boolean
TransformHook: (this: TransformPluginContext, code: string, id: string) => TransformResult

Type declaration

TransformResult: string | NullValue | Partial<SourceDescription>
TreeshakingPreset: "smallest" | "safest" | "recommended"
UnaryOperator: "-" | "+" | "!" | "~" | "typeof" | "void" | "delete"
Unionize<T>: { [ P in keyof T]: T[P] }[keyof T]

Type parameters

  • T: Record<PropertyKey, unknown>

UpdateOperator: "++" | "--"
WarningHandlerWithDefault: (warning: RollupLog, defaultHandler: LoggingFunction) => void

Type declaration

WatchChangeHook: (this: PluginContext, id: string, change: { event: ChangeEvent }) => void

Type declaration

WebSocketCustomListener<T>: (data: T, client: WebSocketClient) => void

Type parameters

  • T

Type declaration

Variables

WebSocket: typeof WebSocketAlias
WebSocketAlias: typeof WebSocket

Functions

  • Parameters

    Returns Promise<void>

  • Create a new Processor instance that will apply plugins as CSS processors.

    let postcss = require('postcss')

    postcss(plugins).process(css, { from, to }).then(result => {
    console.log(result.css)
    })

    Parameters

    Returns Processor_

    Processor to process multiple CSS.

  • Parameters

    Returns Processor_