API
The remaining types specified in `@parcel/types`
AST website/generate-api-docs/example.flow:14
Plugin-specific AST, any
Type
type AST = _AST;
Referenced by:
BaseAsset, MutableAsset, Asset, TransformerResult, Transformer, BundleResultConfigResult website/generate-api-docs/example.flow:16
Plugin-specific config result, any
Type
type ConfigResult = _ConfigResult;
Referenced by:
BaseAsset, Config, MultiThreadValidator, TransformerEnvMap website/generate-api-docs/example.flow:18
process.env
Type
type EnvMap = typeof process.env;
Referenced by:
InitialParcelOptions, PluginOptionsJSONValue website/generate-api-docs/example.flow:21
A JSON value
Type
type JSONValue = null | void | boolean | number | string | Array<JSONValue> | JSONObject;
JSONObject website/generate-api-docs/example.flow:31
A JSON object (as in "map")
type JSONObject = {
}
Referenced by:
JSONValue, MetaPackageName website/generate-api-docs/example.flow:33
Type
type PackageName = string;
Referenced by:
RawParcelConfigPipeline, RawParcelConfig, PackageTargetDescriptor, EnvironmentOpts, Environment, PackageJSON, ConfigFilePath website/generate-api-docs/example.flow:34
Type
type FilePath = string;
Referenced by:
RawParcelConfig, ResolvedParcelConfigFile, Target, PackageTargetDescriptor, TargetDescriptor, PackageJSON, InitialParcelOptions, PluginOptions, HTTPSOptions, File, BaseAsset, Config, TransformerResult, ResolveFn, ResolveConfigFn, ResolveConfigWithPathFn, Bundle, NamedBundle, ResolveResult, Namer, RuntimeAsset, Resolver, TransformingProgressEvent, ValidationEventGlob website/generate-api-docs/example.flow:35
Type
type Glob = string;
Referenced by:
RawParcelConfig, PackageJSONSemver website/generate-api-docs/example.flow:36
Type
type Semver = string;
Referenced by:
PackageJSON, ConfigSemverRange website/generate-api-docs/example.flow:37
Type
type SemverRange = string;
Referenced by:
EnginesModuleSpecifier website/generate-api-docs/example.flow:39
See Dependency
Type
type ModuleSpecifier = string;
Referenced by:
DependencyOptions, DependencyRawParcelConfigPipeline website/generate-api-docs/example.flow:44
A pipeline as specified in the config -> T
Type
type RawParcelConfigPipeline = Array<PackageName>;
Referenced by:
RawParcelConfigHMROptions website/generate-api-docs/example.flow:46
type HMROptions = {
port?: number,
host?: string,
}
Referenced by:
InitialParcelOptions, PluginOptionsRawParcelConfig website/generate-api-docs/example.flow:49
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 website/generate-api-docs/example.flow:63
A .parcelrc where all package names are resolved
type ResolvedParcelConfigFile = {|
...RawParcelConfig,
+filePath: FilePath,
+resolveFrom?: FilePath,
|}
Referenced by:
InitialParcelOptionsEngines website/generate-api-docs/example.flow:70
Corresponds to pkg#engines
type Engines = {
+browsers?: string | Array<string>,
+electron?: SemverRange,
+node?: SemverRange,
+parcel?: SemverRange,
}
Referenced by:
PackageTargetDescriptor, EnvironmentOpts, Environment, PackageJSON, InitialParcelOptionsTargetSourceMapOptions website/generate-api-docs/example.flow:79
Corresponds to pkg#targets.*.sourceMap
type TargetSourceMapOptions = {|
+sourceRoot?: string,
+inline?: boolean,
+inlineSources?: boolean,
|}
Referenced by:
Target, PackageTargetDescriptorTarget website/generate-api-docs/example.flow:91
A parsed version of PackageTargetDescriptor
interface Target {
+distEntry: ?FilePath,
+distDir: FilePath,
+env: Environment,
+sourceMap: ?TargetSourceMapOptions,
+name: string,
+publicUrl: string,
+loc: ?SourceLocation,
}
Referenced by:
PackageTargetDescriptor, DependencyOptions, Dependency, CreateBundleOpts, Bundle, BundleGroup, MutableBundleGraphEnvironmentContext website/generate-api-docs/example.flow:102
In which environment the output should run (influces e.g. loaders)
Type
type EnvironmentContext = "browser" | "web-worker" | "service-worker" | "node" | "electron-main" | "electron-renderer";
Referenced by:
RawParcelConfig, PackageTargetDescriptor, EnvironmentOpts, Environment, BundleGraphOutputFormat website/generate-api-docs/example.flow:111
The JS module format for the bundle output
Type
type OutputFormat = "esmodule" | "commonjs" | "global";
Referenced by:
PackageTargetDescriptor, EnvironmentOpts, EnvironmentPackageTargetDescriptor website/generate-api-docs/example.flow:118
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:
Target, TargetDescriptor, PackageJSONTargetDescriptor website/generate-api-docs/example.flow:139
The target format when using the JS API.
(Same as PackageTargetDescriptor, but distDir
is required.)
type TargetDescriptor = {|
...PackageTargetDescriptor,
+distDir: FilePath,
|}
Referenced by:
InitialParcelOptionsEnvironmentOpts website/generate-api-docs/example.flow:147
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 website/generate-api-docs/example.flow:172
Example:
{
edge: '76',
firefox: '67',
chrome: '63',
safari: '11.1',
opera: '50',
}
type VersionMap = {
}
Referenced by:
EnvironmentEnvironment website/generate-api-docs/example.flow:180
Defines the environment in for the output bundle
interface Environment {
+context: EnvironmentContext,
+engines: Engines,
+includeNodeModules: boolean | Array<PackageName> | {
[PackageName]: boolean,
...
},
+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:
Target, PackageTargetDescriptor, EnvironmentOpts, Dependency, BaseAsset, Config, CreateBundleOpts, BundlePackageDependencies website/generate-api-docs/example.flow:215
Format of pkg#dependencies
, pkg#devDependencies
, pkg#peerDependencies
type PackageDependencies = {|
|}
Referenced by:
PackageJSONPackageJSON website/generate-api-docs/example.flow:222
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 website/generate-api-docs/example.flow:241
Type
type LogLevel = "none" | "error" | "warn" | "info" | "verbose";
Referenced by:
InitialParcelOptions, PluginOptionsBuildMode website/generate-api-docs/example.flow:242
Type
type BuildMode = "development" | "production" | string;
Referenced by:
InitialParcelOptions, PluginOptionsInitialParcelOptions website/generate-api-docs/example.flow:244
type InitialParcelOptions = {|
+entries?: FilePath | Array<FilePath>,
+rootDir?: FilePath,
+config?: ResolvedParcelConfigFile,
+defaultConfig?: ResolvedParcelConfigFile,
+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,
+serve?: ServerOptions | false,
+autoinstall?: boolean,
+logLevel?: LogLevel,
+profile?: boolean,
+patchConsole?: boolean,
+inputFS?: FileSystem,
+outputFS?: FileSystem,
+workerFarm?: WorkerFarm,
+packageManager?: PackageManager,
+defaultEngines?: Engines,
+detailedReport?: number | boolean,
|}
PluginOptions website/generate-api-docs/example.flow:280
interface PluginOptions {
+mode: BuildMode,
+sourceMaps: boolean,
+env: EnvMap,
+hot: ?HMROptions,
+serve: ServerOptions | false,
+autoinstall: boolean,
+logLevel: LogLevel,
+rootDir: FilePath,
+distDir: FilePath,
+projectRoot: FilePath,
+cacheDir: FilePath,
+inputFS: FileSystem,
+outputFS: FileSystem,
+packageManager: PackageManager,
+instanceId: string,
+detailedReport: number,
}
Referenced by:
DedicatedThreadValidator, MultiThreadValidator, Transformer, Bundler, Namer, Runtime, Packager, Optimizer, Resolver, ReporterServerOptions website/generate-api-docs/example.flow:299
type ServerOptions = {|
+host?: string,
+port: number,
+https?: HTTPSOptions | boolean,
+publicUrl?: string,
|}
Referenced by:
InitialParcelOptions, PluginOptionsHTTPSOptions website/generate-api-docs/example.flow:306
type HTTPSOptions = {|
+cert: FilePath,
+key: FilePath,
|}
Referenced by:
ServerOptionsSourceLocation website/generate-api-docs/example.flow:316
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:
Target, CodeSymbols, MutableCodeSymbols, DependencyOptions, Dependency, TransformerResult, SymbolResolutionMeta website/generate-api-docs/example.flow:331
An object that plugins can write arbitatry data to.
Type
type Meta = JSONObject;
Referenced by:
DependencyOptions, Dependency, BaseAsset, TransformerResultCodeSymbol website/generate-api-docs/example.flow:336
An identifier in an asset (likely imported/exported).
Type
type CodeSymbol = string;
Referenced by:
CodeSymbols, MutableCodeSymbols, DependencyOptions, TransformerResult, SymbolResolution, ExportSymbolResolution, BundleGraphCodeSymbols website/generate-api-docs/example.flow:337
interface CodeSymbols extends Iterable<[CodeSymbol, {|
local: CodeSymbol,
loc: ?SourceLocation,
|}]> {
get(exportSymbol: CodeSymbol): ?{|
local: CodeSymbol,
loc: ?SourceLocation,
|},
hasExportSymbol(exportSymbol: CodeSymbol): boolean,
hasLocalSymbol(local: CodeSymbol): boolean,
+isCleared: boolean,
}
Referenced by:
BaseAssetMutableCodeSymbols website/generate-api-docs/example.flow:347
interface MutableCodeSymbols extends CodeSymbols {
clear(): void,
set(exportSymbol: CodeSymbol, local: CodeSymbol, loc: ?SourceLocation): void,
}
Referenced by:
Dependency, MutableAssetFile website/generate-api-docs/example.flow:417
type File = {|
+filePath: FilePath,
+hash?: string,
|}
Referenced by:
BaseAsset, MutableAsset, TransformerResultStats website/generate-api-docs/example.flow:570
type Stats = {|
time: number,
size: number,
|}
Referenced by:
Asset, BundleBlob website/generate-api-docs/example.flow:583
Type
type Blob = string | Buffer | Readable;
Referenced by:
GenerateOutput, TransformerResult, BundleResult, Packager, OptimizerAsync website/generate-api-docs/example.flow:613
Type
type Async<T> = T | Promise<T>;
Referenced by:
DedicatedThreadValidator, MultiThreadValidator, Transformer, Bundler, Namer, Runtime, Packager, Optimizer, Resolver, ReporterErrorWithCode website/generate-api-docs/example.flow:1295
interface ErrorWithCode extends Error {
+code?: string,
}
AsyncSubscription website/generate-api-docs/example.flow:1303
interface AsyncSubscription {
unsubscribe(): Promise<mixed>,
}