API
The remaining types specified in `@parcel/types`
AST parcel/packages/core/types/index.js:14
Plugin-specific AST, any
Type
type AST = _AST;
Referenced by:
Asset, BaseAsset, BundleResult, MutableAsset, Transformer, TransformerResultConfigResult parcel/packages/core/types/index.js:15
Type
type ConfigResult = _ConfigResult;
Referenced by:
BaseAsset, Bundler, Config, ConfigOutput, ConfigResultWithFilePath, MultiThreadValidator, Packager, TransformerConfigResultWithFilePath parcel/packages/core/types/index.js:17
Plugin-specific config result, any
type ConfigResultWithFilePath = {|
contents: ConfigResult,
filePath: FilePath,
|}
Referenced by:
ConfigEnvMap parcel/packages/core/types/index.js:22
process.env
Type
type EnvMap = typeof process.env;
Referenced by:
InitialParcelOptions, PluginOptionsQueryParameters parcel/packages/core/types/index.js:24
type QueryParameters = {
}
Referenced by:
BaseAssetJSONValue parcel/packages/core/types/index.js:26
Type
type JSONValue = null | void | boolean | number | string | Array<JSONValue> | JSONObject;
JSONObject parcel/packages/core/types/index.js:36
A JSON object (as in "map")
type JSONObject = {
}
Referenced by:
JSONValue, MetaPackageName parcel/packages/core/types/index.js:38
Type
type PackageName = string;
Referenced by:
Config, Environment, EnvironmentOpts, PackageJSON, PackageTargetDescriptor, RawParcelConfig, RawParcelConfigPipelineFilePath parcel/packages/core/types/index.js:39
Type
type FilePath = string;
Referenced by:
BaseAsset, Bundle, Config, ConfigResultWithFilePath, Diagnostic, File, HTTPSOptions, InitialParcelOptions, MutableAsset, NamedBundle, Namer, PackageJSON, PackageTargetDescriptor, PluginOptions, RawParcelConfig, ResolveConfigFn, ResolveConfigWithPathFn, ResolveFn, ResolveResult, ResolvedParcelConfigFile, Resolver, RuntimeAsset, ServerOptions, Target, TargetDescriptor, TransformerResult, TransformingProgressEvent, ValidationEventGlob parcel/packages/core/types/index.js:40
Type
type Glob = string;
Referenced by:
PackageJSON, RawParcelConfigSemver parcel/packages/core/types/index.js:41
Type
type Semver = string;
Referenced by:
Config, PackageJSONSemverRange parcel/packages/core/types/index.js:42
Type
type SemverRange = string;
Referenced by:
EnginesModuleSpecifier parcel/packages/core/types/index.js:44
See Dependency
Type
type ModuleSpecifier = string;
Referenced by:
Dependency, DependencyOptions, InitialParcelOptionsGlobMap parcel/packages/core/types/index.js:47
A pipeline as specified in the config mapping to T
type GlobMap<T> = {
}
RawParcelConfigPipeline parcel/packages/core/types/index.js:49
Type
type RawParcelConfigPipeline = Array<PackageName>;
Referenced by:
RawParcelConfigHMROptions parcel/packages/core/types/index.js:51
type HMROptions = {
port?: number,
host?: string,
}
Referenced by:
InitialParcelOptions, PluginOptionsRawParcelConfig parcel/packages/core/types/index.js:54
The format of .parcelrc
type RawParcelConfig = {|
extends?: PackageName | FilePath | Array<PackageName | FilePath>,
resolvers?: RawParcelConfigPipeline,
transformers?: {
[Glob]: RawParcelConfigPipeline,
...
},
bundler?: PackageName,
namers?: RawParcelConfigPipeline,
runtimes?: {
[EnvironmentContext]: RawParcelConfigPipeline,
...
},
packagers?: {
[Glob]: PackageName,
...
},
optimizers?: {
[Glob]: RawParcelConfigPipeline,
...
},
reporters?: RawParcelConfigPipeline,
validators?: {
[Glob]: RawParcelConfigPipeline,
...
},
|}
Referenced by:
ResolvedParcelConfigFileResolvedParcelConfigFile parcel/packages/core/types/index.js:68
A .parcelrc where all package names are resolved
type ResolvedParcelConfigFile = {|
...RawParcelConfig,
+filePath: FilePath,
+resolveFrom?: FilePath,
|}
Engines parcel/packages/core/types/index.js:75
Corresponds to pkg#engines
type Engines = {
+browsers?: string | Array<string>,
+electron?: SemverRange,
+node?: SemverRange,
+parcel?: SemverRange,
}
Referenced by:
Environment, EnvironmentOpts, InitialParcelOptions, PackageJSON, PackageTargetDescriptorTargetSourceMapOptions parcel/packages/core/types/index.js:84
Corresponds to pkg#targets.*.sourceMap
type TargetSourceMapOptions = {|
+sourceRoot?: string,
+inline?: boolean,
+inlineSources?: boolean,
|}
Referenced by:
PackageTargetDescriptor, TargetTarget parcel/packages/core/types/index.js:93
A parsed version of PackageTargetDescriptor
interface Target {
+distEntry: ?FilePath,
+distDir: FilePath,
+env: Environment,
+sourceMap: ?TargetSourceMapOptions,
+name: string,
+publicUrl: string,
+loc: ?SourceLocation,
}
Referenced by:
Bundle, BundleGroup, CreateBundleOpts, Dependency, DependencyOptions, MutableBundleGraph, PackageTargetDescriptorEnvironmentContext parcel/packages/core/types/index.js:107
In which environment the output should run (influces e.g. bundle loaders)
Type
type EnvironmentContext = 'browser' | 'web-worker' | 'service-worker' | 'node' | 'electron-main' | 'electron-renderer';
Referenced by:
BundleGraph, Environment, EnvironmentOpts, PackageTargetDescriptor, RawParcelConfigOutputFormat parcel/packages/core/types/index.js:116
The JS module format for the bundle output
Type
type OutputFormat = 'esmodule' | 'commonjs' | 'global';
Referenced by:
Environment, EnvironmentOpts, PackageTargetDescriptorPackageTargetDescriptor parcel/packages/core/types/index.js:123
The format of pkg#targets.*
See Environment and Target.
type PackageTargetDescriptor = {|
+context?: EnvironmentContext,
+engines?: Engines,
+includeNodeModules?: boolean | Array<PackageName> | {
[PackageName]: boolean,
...
},
+outputFormat?: OutputFormat,
+publicUrl?: string,
+distDir?: FilePath,
+sourceMap?: boolean | TargetSourceMapOptions,
+isLibrary?: boolean,
+minify?: boolean,
+scopeHoist?: boolean,
|}
Referenced by:
PackageJSON, Target, TargetDescriptorTargetDescriptor parcel/packages/core/types/index.js:144
The target format when using the JS API.
(Same as PackageTargetDescriptor, but distDir
is required.)
type TargetDescriptor = {|
...PackageTargetDescriptor,
+distDir: FilePath,
|}
Referenced by:
InitialParcelOptionsEnvironmentOpts parcel/packages/core/types/index.js:152
This is used when creating an Environment (see that).
type EnvironmentOpts = {|
+context?: EnvironmentContext,
+engines?: Engines,
+includeNodeModules?: boolean | Array<PackageName> | {
[PackageName]: boolean,
...
},
+outputFormat?: OutputFormat,
+isLibrary?: boolean,
+minify?: boolean,
+scopeHoist?: boolean,
|}
Referenced by:
DependencyOptions, MutableAsset, TransformerResultVersionMap parcel/packages/core/types/index.js:177
A resolved browserslist, e.g.:
{
edge: '76',
firefox: '67',
chrome: '63',
safari: '11.1',
opera: '50',
}
type VersionMap = {
}
Referenced by:
EnvironmentEnvironment parcel/packages/core/types/index.js:185
Defines the environment in for the output bundle
interface Environment {
+context: EnvironmentContext,
+engines: Engines,
+includeNodeModules: boolean | Array<PackageName> | {
[PackageName]: boolean,
...
},
true / false
), an array of package names to include, or an object (of a package is not specified, it's included).
+outputFormat: OutputFormat,
+isLibrary: boolean,
+minify: boolean,
+scopeHoist: boolean,
isBrowser(): boolean,
context
specifies a browser context.
isNode(): boolean,
context
specifies a node context.
isElectron(): boolean,
context
specifies an electron context.
isWorker(): boolean,
context
specifies a worker context.
isIsolated(): boolean,
context
specifies an isolated context (can't access other loaded ancestor bundles).
matchesEngines(minVersions: VersionMap): boolean,
}
Referenced by:
BaseAsset, Bundle, Config, CreateBundleOpts, Dependency, EnvironmentOpts, PackageTargetDescriptor, TargetPackageDependencies parcel/packages/core/types/index.js:220
Format of pkg#dependencies
, pkg#devDependencies
, pkg#peerDependencies
type PackageDependencies = {|
|}
Referenced by:
PackageJSONPackageJSON parcel/packages/core/types/index.js:227
Format of package.json
type PackageJSON = {
name: PackageName,
version: Semver,
main?: FilePath,
module?: FilePath,
types?: FilePath,
browser?: FilePath | {
[FilePath]: FilePath | boolean,
...
},
source?: FilePath | {
[FilePath]: FilePath,
...
},
alias?: {
[PackageName | FilePath | Glob]: PackageName | FilePath,
...
},
browserslist?: Array<string>,
engines?: Engines,
targets?: {
[string]: PackageTargetDescriptor,
...
},
dependencies?: PackageDependencies,
devDependencies?: PackageDependencies,
peerDependencies?: PackageDependencies,
sideEffects?: boolean | FilePath | Array<FilePath>,
}
Referenced by:
BaseAsset, ConfigLogLevel parcel/packages/core/types/index.js:246
Type
type LogLevel = 'none' | 'error' | 'warn' | 'info' | 'verbose';
Referenced by:
InitialParcelOptions, PluginOptionsBuildMode parcel/packages/core/types/index.js:247
Type
type BuildMode = 'development' | 'production' | string;
Referenced by:
InitialParcelOptions, PluginOptionsInitialParcelOptions parcel/packages/core/types/index.js:249
type InitialParcelOptions = {|
+entries?: FilePath | Array<FilePath>,
+entryRoot?: FilePath,
+config?: ModuleSpecifier,
+defaultConfig?: ModuleSpecifier,
+env?: EnvMap,
+targets?: ?(Array<string> | {
+[string]: TargetDescriptor,
...
}),
+disableCache?: boolean,
+cacheDir?: FilePath,
+killWorkers?: boolean,
+mode?: BuildMode,
+minify?: boolean,
+scopeHoist?: boolean,
+sourceMaps?: boolean,
+publicUrl?: string,
+distDir?: FilePath,
+hot?: ?HMROptions,
+contentHash?: boolean,
+serve?: InitialServerOptions | false,
+autoinstall?: boolean,
+logLevel?: LogLevel,
+profile?: boolean,
+patchConsole?: boolean,
+inputFS?: FileSystem,
+outputFS?: FileSystem,
+workerFarm?: WorkerFarm,
+packageManager?: PackageManager,
+defaultEngines?: Engines,
+detailedReport?: number | boolean,
|}
InitialServerOptions parcel/packages/core/types/index.js:286
type InitialServerOptions = {|
+publicUrl?: string,
+host?: string,
+port: number,
+https?: HTTPSOptions | boolean,
|}
Referenced by:
InitialParcelOptionsPluginOptions parcel/packages/core/types/index.js:293
interface PluginOptions {
+mode: BuildMode,
+sourceMaps: boolean,
+env: EnvMap,
+hot: ?HMROptions,
+serve: ServerOptions | false,
+autoinstall: boolean,
+logLevel: LogLevel,
+entryRoot: FilePath,
+projectRoot: FilePath,
+cacheDir: FilePath,
+inputFS: FileSystem,
+outputFS: FileSystem,
+packageManager: PackageManager,
+instanceId: string,
+detailedReport: number,
}
Referenced by:
Bundler, DedicatedThreadValidator, MultiThreadValidator, Namer, Optimizer, Packager, Reporter, Resolver, Runtime, TransformerServerOptions parcel/packages/core/types/index.js:311
type ServerOptions = {|
+distDir: FilePath,
+host?: string,
+port: number,
+https?: HTTPSOptions | boolean,
+publicUrl?: string,
|}
Referenced by:
PluginOptionsHTTPSOptions parcel/packages/core/types/index.js:319
type HTTPSOptions = {|
+cert: FilePath,
+key: FilePath,
|}
Referenced by:
InitialServerOptions, ServerOptionsSourceLocation parcel/packages/core/types/index.js:327
Source locations are 1-based, meaning lines and columns start at 1
type SourceLocation = {|
+filePath: string,
+start: {|
+line: number,
+column: number,
|},
+end: {|
+line: number,
+column: number,
|},
|}
Referenced by:
Dependency, DependencyOptions, MutableSymbols, SymbolResolution, Symbols, Target, TransformerResultMeta parcel/packages/core/types/index.js:344
An object that plugins can write arbitatry data to.
Type
type Meta = JSONObject;
Referenced by:
BaseAsset, Dependency, DependencyOptions, TransformerResultSymbol parcel/packages/core/types/index.js:349
An identifier in an asset (likely imported/exported).
Type
type Symbol = string;
Referenced by:
BundleGraph, DependencyOptions, ExportSymbolResolution, MutableSymbols, SymbolResolution, Symbols, TransformerResultSymbols parcel/packages/core/types/index.js:350
interface Symbols extends Iterable<[Symbol, {|
local: Symbol,
loc: ?SourceLocation,
|}]> {
get(exportSymbol: Symbol): ?{|
local: Symbol,
loc: ?SourceLocation,
|},
hasExportSymbol(exportSymbol: Symbol): boolean,
hasLocalSymbol(local: Symbol): boolean,
+isCleared: boolean,
}
Referenced by:
BaseAsset, MutableSymbolsMutableSymbols parcel/packages/core/types/index.js:358
interface MutableSymbols extends Symbols {
clear(): void,
set(exportSymbol: Symbol, local: Symbol, loc: ?SourceLocation): void,
}
Referenced by:
Dependency, MutableAssetFile parcel/packages/core/types/index.js:421
type File = {|
+filePath: FilePath,
+hash?: string,
|}
Referenced by:
ConfigOutput, TransformerResultStats parcel/packages/core/types/index.js:574
type Stats = {|
time: number,
size: number,
|}
Referenced by:
Asset, BundleBlob parcel/packages/core/types/index.js:587
Type
type Blob = string | Buffer | Readable;
Referenced by:
BundleResult, GenerateOutput, Optimizer, Packager, TransformerResultAsync parcel/packages/core/types/index.js:614
Type
type Async<T> = T | Promise<T>;
Referenced by:
Bundler, DedicatedThreadValidator, MultiThreadValidator, Namer, Optimizer, Packager, Reporter, Resolver, Runtime, TransformerConfigOutput parcel/packages/core/types/index.js:1024
type ConfigOutput = {|
config: ConfigResult,
files: Array<File>,
|}
Referenced by:
Bundler, PackagerErrorWithCode parcel/packages/core/types/index.js:1315
interface ErrorWithCode extends Error {
+code?: string,
}
AsyncSubscription parcel/packages/core/types/index.js:1323
interface AsyncSubscription {
unsubscribe(): Promise<mixed>,
}