id
int64
0
3.78k
code
stringlengths
13
37.9k
declarations
stringlengths
16
64.6k
3,700
(options: import("../../declarations/plugins/DllReferencePlugin").DllReferencePluginOptions) => boolean
type DllReferencePluginOptions = | { /** * Context of requests in the manifest (or content property) as absolute path. */ context?: string; /** * Extensions used to resolve modules in the dll bundle (only used when using 'scope'). */ extensions?: string[]; /** * An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation. */ manifest: string | DllReferencePluginOptionsManifest; /** * The name where the dll is exposed (external name, defaults to manifest.name). */ name?: string; /** * Prefix which is used for accessing the content of the dll. */ scope?: string; /** * How the dll is exposed (libraryTarget, defaults to manifest.type). */ sourceType?: DllReferencePluginOptionsSourceType; /** * The way how the export of the dll bundle is used. */ type?: "require" | "object"; } | { /** * The mappings from request to module info. */ content: DllReferencePluginOptionsContent; /** * Context of requests in the manifest (or content property) as absolute path. */ context?: string; /** * Extensions used to resolve modules in the dll bundle (only used when using 'scope'). */ extensions?: string[]; /** * The name where the dll is exposed (external name). */ name: string; /** * Prefix which is used for accessing the content of the dll. */ scope?: string; /** * How the dll is exposed (libraryTarget). */ sourceType?: DllReferencePluginOptionsSourceType; /** * The way how the export of the dll bundle is used. */ type?: "require" | "object"; };
3,701
(options: import("../../declarations/plugins/LoaderOptionsPlugin").LoaderOptionsPluginOptions) => boolean
interface LoaderOptionsPluginOptions { [index: string]: any; /** * Whether loaders should be in debug mode or not. debug will be removed as of webpack 3. */ debug?: boolean; /** * Where loaders can be switched to minimize mode. */ minimize?: boolean; /** * A configuration object that can be used to configure older loaders. */ options?: { [index: string]: any; /** * The context that can be used to configure older loaders. */ context?: string; }; }
3,702
(options: import("../../declarations/plugins/LoaderOptionsPlugin").LoaderOptionsPluginOptions) => boolean
interface LoaderOptionsPluginOptions { /** * Whether loaders should be in debug mode or not. debug will be removed as of webpack 3. */ debug?: boolean; /** * Where loaders can be switched to minimize mode. */ minimize?: boolean; /** * A configuration object that can be used to configure older loaders. */ options?: { /** * The context that can be used to configure older loaders. */ context?: string; [k: string]: any; }; [k: string]: any; }
3,703
(options: import("../../declarations/plugins/HashedModuleIdsPlugin").HashedModuleIdsPluginOptions) => boolean
interface HashedModuleIdsPluginOptions { /** * The context directory for creating names. */ context?: string; /** * The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported. */ hashDigest?: "latin1" | "hex" | "base64"; /** * The prefix length of the hash digest to use, defaults to 4. */ hashDigestLength?: number; /** * The hashing algorithm to use, defaults to 'md4'. All functions from Node.JS' crypto.createHash are supported. */ hashFunction?: string | typeof Hash; }
3,704
(options: import("../../declarations/plugins/HashedModuleIdsPlugin").HashedModuleIdsPluginOptions) => boolean
interface HashedModuleIdsPluginOptions { /** * The context directory for creating names. */ context?: string; /** * The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported. */ hashDigest?: "hex" | "latin1" | "base64"; /** * The prefix length of the hash digest to use, defaults to 4. */ hashDigestLength?: number; /** * The hashing algorithm to use, defaults to 'md4'. All functions from Node.JS' crypto.createHash are supported. */ hashFunction?: HashFunction; }
3,705
(options: import("../../declarations/plugins/WatchIgnorePlugin").WatchIgnorePluginOptions) => boolean
interface WatchIgnorePluginOptions { /** * A list of RegExps or absolute paths to directories or files that should be ignored. */ paths: (string | RegExp)[]; }
3,706
(options: import("../../declarations/plugins/WatchIgnorePlugin").WatchIgnorePluginOptions) => boolean
interface WatchIgnorePluginOptions { /** * A list of RegExps or absolute paths to directories or files that should be ignored. */ paths: (RegExp | string)[]; }
3,707
(options: import("../../declarations/plugins/BannerPlugin").BannerPluginArgument) => boolean
type BannerPluginArgument = | string | BannerPluginOptions | ((data: { hash: string; chunk: Chunk; filename: string }) => string);
3,708
(options: import("../../declarations/plugins/BannerPlugin").BannerPluginArgument) => boolean
type BannerPluginArgument = | string | BannerPluginOptions | BannerFunction;
3,709
(options: import("../../declarations/plugins/SourceMapDevToolPlugin").SourceMapDevToolPluginOptions) => boolean
interface SourceMapDevToolPluginOptions { /** * Appends the given value to the original asset. Usually the #sourceMappingURL comment. [url] is replaced with a URL to the source map file. false disables the appending. */ append?: null | string | false; /** * Indicates whether column mappings should be used (defaults to true). */ columns?: boolean; /** * Exclude modules that match the given value from source map generation. */ exclude?: string | RegExp | Rule[]; /** * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap used only if 'moduleFilenameTemplate' would result in a conflict. */ fallbackModuleFilenameTemplate?: string | Function; /** * Path prefix to which the [file] placeholder is relative to. */ fileContext?: string; /** * Defines the output filename of the SourceMap (will be inlined if no value is provided). */ filename?: null | string | false; /** * Include source maps for module paths that match the given value. */ include?: string | RegExp | Rule[]; /** * Indicates whether SourceMaps from loaders should be used (defaults to true). */ module?: boolean; /** * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap. */ moduleFilenameTemplate?: string | Function; /** * Namespace prefix to allow multiple webpack roots in the devtools. */ namespace?: string; /** * Omit the 'sourceContents' array from the SourceMap. */ noSources?: boolean; /** * Provide a custom public path for the SourceMapping comment. */ publicPath?: string; /** * Provide a custom value for the 'sourceRoot' property in the SourceMap. */ sourceRoot?: string; /** * Include source maps for modules based on their extension (defaults to .js and .css). */ test?: string | RegExp | Rule[]; }
3,710
(options: import("../../declarations/plugins/SourceMapDevToolPlugin").SourceMapDevToolPluginOptions) => boolean
interface SourceMapDevToolPluginOptions { /** * Appends the given value to the original asset. Usually the #sourceMappingURL comment. [url] is replaced with a URL to the source map file. false disables the appending. */ append?: (false | null) | string; /** * Indicates whether column mappings should be used (defaults to true). */ columns?: boolean; /** * Exclude modules that match the given value from source map generation. */ exclude?: Rules; /** * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap used only if 'moduleFilenameTemplate' would result in a conflict. */ fallbackModuleFilenameTemplate?: string | Function; /** * Path prefix to which the [file] placeholder is relative to. */ fileContext?: string; /** * Defines the output filename of the SourceMap (will be inlined if no value is provided). */ filename?: (false | null) | string; /** * Include source maps for module paths that match the given value. */ include?: Rules; /** * Indicates whether SourceMaps from loaders should be used (defaults to true). */ module?: boolean; /** * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap. */ moduleFilenameTemplate?: string | Function; /** * Namespace prefix to allow multiple webpack roots in the devtools. */ namespace?: string; /** * Omit the 'sourceContents' array from the SourceMap. */ noSources?: boolean; /** * Provide a custom public path for the SourceMapping comment. */ publicPath?: string; /** * Provide a custom value for the 'sourceRoot' property in the SourceMap. */ sourceRoot?: string; /** * Include source maps for modules based on their extension (defaults to .js and .css). */ test?: Rules; }
3,711
(options: import("../../declarations/plugins/ProgressPlugin").ProgressPluginArgument) => boolean
type ProgressPluginArgument = | ProgressPluginOptions | ((percentage: number, msg: string, ...args: string[]) => void);
3,712
(options: import("../../declarations/plugins/ProgressPlugin").ProgressPluginArgument) => boolean
type ProgressPluginArgument = ProgressPluginOptions | HandlerFunction;
3,713
(options: import("../../declarations/plugins/JsonModulesPluginParser").JsonModulesPluginParserOptions) => boolean
interface JsonModulesPluginParserOptions { /** * Function that executes for a module source string and should return json-compatible data. */ parse?: (input: string) => any; }
3,714
(options: import("../../declarations/plugins/DllPlugin").DllPluginOptions) => boolean
interface DllPluginOptions { /** * Context of requests in the manifest file (defaults to the webpack context). */ context?: string; /** * If true, only entry points will be exposed (default: true). */ entryOnly?: boolean; /** * If true, manifest json file (output) will be formatted. */ format?: boolean; /** * Name of the exposed dll function (external name, use value of 'output.library'). */ name?: string; /** * Absolute path to the manifest json file (output). */ path: string; /** * Type of the dll bundle (external type, use value of 'output.libraryTarget'). */ type?: string; }
3,715
(options: import("../../declarations/plugins/DllPlugin").DllPluginOptions) => boolean
interface DllPluginOptions { /** * Context of requests in the manifest file (defaults to the webpack context). */ context?: string; /** * If true, only entry points will be exposed (default: true). */ entryOnly?: boolean; /** * If true, manifest json file (output) will be formatted. */ format?: boolean; /** * Name of the exposed dll function (external name, use value of 'output.library'). */ name?: string; /** * Absolute path to the manifest json file (output). */ path: string; /** * Type of the dll bundle (external type, use value of 'output.libraryTarget'). */ type?: string; }
3,716
(options: import("../../../declarations/plugins/sharing/ProvideSharedPlugin").ProvideSharedPluginOptions) => boolean
interface ProvideSharedPluginOptions { /** * Modules that should be provided as shared modules to the share scope. When provided, property name is used to match modules, otherwise this is automatically inferred from share key. */ provides: Provides; /** * Share scope name used for all provided modules (defaults to 'default'). */ shareScope?: string; }
3,717
(options: import("../../../declarations/plugins/sharing/ProvideSharedPlugin").ProvideSharedPluginOptions) => boolean
interface ProvideSharedPluginOptions { /** * Modules that should be provided as shared modules to the share scope. When provided, property name is used to match modules, otherwise this is automatically inferred from share key. */ provides: Provides; /** * Share scope name used for all provided modules (defaults to 'default'). */ shareScope?: string; }
3,718
(options: import("../../../declarations/plugins/sharing/ConsumeSharedPlugin").ConsumeSharedPluginOptions) => boolean
interface ConsumeSharedPluginOptions { /** * Modules that should be consumed from share scope. When provided, property names are used to match requested modules in this compilation. */ consumes: Consumes; /** * Share scope name used for all consumed modules (defaults to 'default'). */ shareScope?: string; }
3,719
(options: import("../../../declarations/plugins/sharing/ConsumeSharedPlugin").ConsumeSharedPluginOptions) => boolean
interface ConsumeSharedPluginOptions { /** * Modules that should be consumed from share scope. When provided, property names are used to match requested modules in this compilation. */ consumes: Consumes; /** * Share scope name used for all consumed modules (defaults to 'default'). */ shareScope?: string; }
3,720
(options: import("../../../declarations/plugins/sharing/SharePlugin").SharePluginOptions) => boolean
interface SharePluginOptions { /** * Share scope name used for all shared modules (defaults to 'default'). */ shareScope?: string; /** * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation. */ shared: Shared; }
3,721
(options: import("../../../declarations/plugins/sharing/SharePlugin").SharePluginOptions) => boolean
interface SharePluginOptions { /** * Share scope name used for all shared modules (defaults to 'default'). */ shareScope?: string; /** * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation. */ shared: Shared; }
3,722
(options: import("../../../declarations/plugins/debug/ProfilingPlugin").ProfilingPluginOptions) => boolean
interface ProfilingPluginOptions { /** * Path to the output file e.g. `path.resolve(__dirname, 'profiling/events.json')`. Defaults to `events.json`. */ outputPath?: string; }
3,723
(options: import("../../../declarations/plugins/debug/ProfilingPlugin").ProfilingPluginOptions) => boolean
interface ProfilingPluginOptions { /** * Path to the output file e.g. `path.resolve(__dirname, 'profiling/events.json')`. Defaults to `events.json`. */ outputPath?: string; }
3,724
(options: import("../../../declarations/plugins/optimize/AggressiveSplittingPlugin").AggressiveSplittingPluginOptions) => boolean
interface AggressiveSplittingPluginOptions { /** * Extra cost for each chunk (Default: 9.8kiB). */ chunkOverhead?: number; /** * Extra cost multiplicator for entry chunks (Default: 10). */ entryChunkMultiplicator?: number; /** * Byte, max size of per file (Default: 50kiB). */ maxSize?: number; /** * Byte, split point. (Default: 30kiB). */ minSize?: number; }
3,725
(options: import("../../../declarations/plugins/optimize/AggressiveSplittingPlugin").AggressiveSplittingPluginOptions) => boolean
interface AggressiveSplittingPluginOptions { /** * Extra cost for each chunk (Default: 9.8kiB). */ chunkOverhead?: number; /** * Extra cost multiplicator for entry chunks (Default: 10). */ entryChunkMultiplicator?: number; /** * Byte, max size of per file (Default: 50kiB). */ maxSize?: number; /** * Byte, split point. (Default: 30kiB). */ minSize?: number; }
3,726
(options: import("../../../declarations/plugins/optimize/MinChunkSizePlugin").MinChunkSizePluginOptions) => boolean
interface MinChunkSizePluginOptions { /** * Constant overhead for a chunk. */ chunkOverhead?: number; /** * Multiplicator for initial chunks. */ entryChunkMultiplicator?: number; /** * Minimum number of characters. */ minChunkSize: number; }
3,727
(options: import("../../../declarations/plugins/optimize/MinChunkSizePlugin").MinChunkSizePluginOptions) => boolean
interface MinChunkSizePluginOptions { /** * Constant overhead for a chunk. */ chunkOverhead?: number; /** * Multiplicator for initial chunks. */ entryChunkMultiplicator?: number; /** * Minimum number of characters. */ minChunkSize: number; }
3,728
(options: import("../../../declarations/plugins/optimize/LimitChunkCountPlugin").LimitChunkCountPluginOptions) => boolean
interface LimitChunkCountPluginOptions { /** * Constant overhead for a chunk. */ chunkOverhead?: number; /** * Multiplicator for initial chunks. */ entryChunkMultiplicator?: number; /** * Limit the maximum number of chunks using a value greater greater than or equal to 1. */ maxChunks: number; }
3,729
(options: import("../../../declarations/plugins/optimize/LimitChunkCountPlugin").LimitChunkCountPluginOptions) => boolean
interface LimitChunkCountPluginOptions { /** * Constant overhead for a chunk. */ chunkOverhead?: number; /** * Multiplicator for initial chunks. */ entryChunkMultiplicator?: number; /** * Limit the maximum number of chunks using a value greater greater than or equal to 1. */ maxChunks: number; }
3,730
(options: import("../../../declarations/plugins/container/ModuleFederationPlugin").ModuleFederationPluginOptions) => boolean
interface ModuleFederationPluginOptions { /** * Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request. */ exposes?: (string | ExposesObject)[] | ExposesObject; /** * The filename of the container as relative path inside the `output.path` directory. */ filename?: string; /** * Options for library. */ library?: LibraryOptions; /** * The name of the container. */ name?: string; /** * The external type of the remote containers. */ remoteType?: | "import" | "var" | "module" | "assign" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "jsonp" | "system" | "promise" | "script" | "node-commonjs"; /** * Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location. */ remotes?: (string | RemotesObject)[] | RemotesObject; /** * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime. */ runtime?: string | false; /** * Share scope name used for all shared modules (defaults to 'default'). */ shareScope?: string; /** * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation. */ shared?: (string | SharedObject)[] | SharedObject; }
3,731
(options: import("../../../declarations/plugins/container/ModuleFederationPlugin").ModuleFederationPluginOptions) => boolean
interface ModuleFederationPluginOptions { /** * Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request. */ exposes?: Exposes; /** * The filename of the container as relative path inside the `output.path` directory. */ filename?: string; /** * Options for library. */ library?: LibraryOptions; /** * The name of the container. */ name?: string; /** * The external type of the remote containers. */ remoteType?: ExternalsType; /** * Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location. */ remotes?: Remotes; /** * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime. */ runtime?: EntryRuntime; /** * Share scope name used for all shared modules (defaults to 'default'). */ shareScope?: string; /** * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation. */ shared?: Shared; }
3,732
(options: import("../../../declarations/plugins/container/ContainerReferencePlugin").ContainerReferencePluginOptions) => boolean
interface ContainerReferencePluginOptions { /** * The external type of the remote containers. */ remoteType: ExternalsType; /** * Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location. */ remotes: Remotes; /** * The name of the share scope shared with all remotes (defaults to 'default'). */ shareScope?: string; }
3,733
(options: import("../../../declarations/plugins/container/ContainerReferencePlugin").ContainerReferencePluginOptions) => boolean
interface ContainerReferencePluginOptions { /** * The external type of the remote containers. */ remoteType: ExternalsType; /** * Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location. */ remotes: Remotes; /** * The name of the share scope shared with all remotes (defaults to 'default'). */ shareScope?: string; }
3,734
(options: import("../../../declarations/plugins/container/ContainerPlugin").ContainerPluginOptions) => boolean
interface ContainerPluginOptions { /** * Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request. */ exposes: Exposes; /** * The filename for this container relative path inside the `output.path` directory. */ filename?: string; /** * Options for library. */ library?: LibraryOptions; /** * The name for this container. */ name: string; /** * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime. */ runtime?: string | false; /** * The name of the share scope which is shared with the host (defaults to 'default'). */ shareScope?: string; }
3,735
(options: import("../../../declarations/plugins/container/ContainerPlugin").ContainerPluginOptions) => boolean
interface ContainerPluginOptions { /** * Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request. */ exposes: Exposes; /** * The filename for this container relative path inside the `output.path` directory. */ filename?: string; /** * Options for library. */ library?: LibraryOptions; /** * The name for this container. */ name: string; /** * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime. */ runtime?: EntryRuntime; /** * The name of the share scope which is shared with the host (defaults to 'default'). */ shareScope?: string; }
3,736
(options: import("../../../declarations/plugins/ids/OccurrenceModuleIdsPlugin").OccurrenceModuleIdsPluginOptions) => boolean
interface OccurrenceModuleIdsPluginOptions { /** * Prioritise initial size over total size. */ prioritiseInitial?: boolean; }
3,737
(options: import("../../../declarations/plugins/ids/OccurrenceModuleIdsPlugin").OccurrenceModuleIdsPluginOptions) => boolean
interface OccurrenceModuleIdsPluginOptions { /** * Prioritise initial size over total size. */ prioritiseInitial?: boolean; }
3,738
(options: import("../../../declarations/plugins/ids/OccurrenceChunkIdsPlugin").OccurrenceChunkIdsPluginOptions) => boolean
interface OccurrenceChunkIdsPluginOptions { /** * Prioritise initial size over total size. */ prioritiseInitial?: boolean; }
3,739
(options: import("../../../declarations/plugins/ids/OccurrenceChunkIdsPlugin").OccurrenceChunkIdsPluginOptions) => boolean
interface OccurrenceChunkIdsPluginOptions { /** * Prioritise initial size over total size. */ prioritiseInitial?: boolean; }
3,740
(options: import("../../../declarations/plugins/schemes/HttpUriPlugin").HttpUriPluginOptions) => boolean
type HttpUriPluginOptions = HttpUriOptions;
3,741
function check(wrap: NodeWrap, parent: NodeWrap | undefined, skip: NodeWrap | undefined) { assert.strictEqual(parent === undefined, wrap.node.kind === ts.SyntaxKind.SourceFile); assert.strictEqual( skip === undefined, wrap.node.kind === ts.SyntaxKind.SourceFile || wrap.node.kind === ts.SyntaxKind.EndOfFileToken, ); assert(wrap.parent === parent, 'parent'); assert(wrap.skip === skip); assert(wrap.kind === wrap.node.kind, 'kind'); assert(wrap.next === (wrap.children.length !== 0 ? wrap.children[0] : wrap.skip), 'next'); const children: ts.Node[] = []; ts.forEachChild(wrap.node, (node) => void children.push(node)); assert(wrap.children.length === children.length, 'children.length'); for (let i = 0; i < wrap.children.length; ++i) { const child = wrap.children[i]; assert(child.node === children[i], 'children[i]'); check(child, wrap, i === wrap.children.length - 1 ? wrap.skip : wrap.children[i + 1]); } }
interface NodeWrap { /** The real AST node. */ node: ts.Node; /** The SyntaxKind of `node`. */ kind: ts.SyntaxKind; /** All immediate children of `node` that would be visited by `ts.forEachChild(node, cb)`. */ children: NodeWrap[]; /** Link to the next NodeWrap, depth-first. */ next?: NodeWrap; /** Link to the next NodeWrap skipping all children of the current node. */ skip?: NodeWrap; /** Link to the parent NodeWrap */ parent?: NodeWrap; }
3,742
function foo({bar: _bar}: Baz) {}
class Baz { public readonly bar?: Baz; }
3,743
function matchBreakOrContinue(current: ControlFlowEnd, pred: typeof isBreakOrContinueStatement) { const result: MutableControlFlowEnd = { statements: [], end: current.end, }; for (const statement of current.statements) { if (pred(statement) && statement.label === undefined) { result.end = false; continue; } result.statements.push(statement); } return result; }
interface ControlFlowEnd { /** * Statements that may end control flow at this statement. * Does not contain control flow statements that jump only inside the statement, for example a `continue` inside a nested for loop. */ readonly statements: ReadonlyArray<ControlFlowStatement>; /** `true` if control flow definitely ends. */ readonly end: boolean; }
3,744
function matchLabel(current: ControlFlowEnd, label: ts.Identifier) { const result: MutableControlFlowEnd = { statements: [], end: current.end, }; const labelText = label.text; for (const statement of current.statements) { switch (statement.kind) { case ts.SyntaxKind.BreakStatement: case ts.SyntaxKind.ContinueStatement: if (statement.label !== undefined && statement.label.text === labelText) { result.end = false; continue; } } result.statements.push(statement); } return result; }
interface ControlFlowEnd { /** * Statements that may end control flow at this statement. * Does not contain control flow statements that jump only inside the statement, for example a `continue` inside a nested for loop. */ readonly statements: ReadonlyArray<ControlFlowStatement>; /** `true` if control flow definitely ends. */ readonly end: boolean; }
3,745
(variable: VariableInfo, key: ts.Identifier, scope: Scope) => void
interface Scope { addVariable( identifier: string, name: ts.PropertyName, selector: ScopeBoundarySelector, exported: boolean, domain: DeclarationDomain, ): void; addUse(use: VariableUse, scope?: Scope): void; getVariables(): Map<string, InternalVariableInfo>; getFunctionScope(): Scope; end(cb: VariableCallback): void; markExported(name: ts.Identifier, as?: ts.Identifier): void; createOrReuseNamespaceScope(name: string, exported: boolean, ambient: boolean, hasExportStatement: boolean): NamespaceScope; createOrReuseEnumScope(name: string, exported: boolean): EnumScope; getDestinationScope(selector: ScopeBoundarySelector): Scope; }
3,746
(variable: VariableInfo, key: ts.Identifier, scope: Scope) => void
interface VariableInfo { domain: DeclarationDomain; exported: boolean; uses: VariableUse[]; inGlobalScope: boolean; declarations: ts.Identifier[]; }
3,747
addUse(use: VariableUse, scope?: Scope): void
interface Scope { addVariable( identifier: string, name: ts.PropertyName, selector: ScopeBoundarySelector, exported: boolean, domain: DeclarationDomain, ): void; addUse(use: VariableUse, scope?: Scope): void; getVariables(): Map<string, InternalVariableInfo>; getFunctionScope(): Scope; end(cb: VariableCallback): void; markExported(name: ts.Identifier, as?: ts.Identifier): void; createOrReuseNamespaceScope(name: string, exported: boolean, ambient: boolean, hasExportStatement: boolean): NamespaceScope; createOrReuseEnumScope(name: string, exported: boolean): EnumScope; getDestinationScope(selector: ScopeBoundarySelector): Scope; }
3,748
addUse(use: VariableUse, scope?: Scope): void
interface VariableUse { domain: UsageDomain; location: ts.Identifier; }
3,749
end(cb: VariableCallback): void
type VariableCallback = (variable: VariableInfo, key: ts.Identifier, scope: Scope) => void;
3,750
public addUse(use: VariableUse) { this._uses.push(use); }
interface VariableUse { domain: UsageDomain; location: ts.Identifier; }
3,751
public end(cb: VariableCallback) { if (this._namespaceScopes !== undefined) this._namespaceScopes.forEach((value) => value.finish(cb)); this._namespaceScopes = this._enumScopes = undefined; this._applyUses(); this._variables.forEach((variable) => { for (const declaration of variable.declarations) { const result: VariableInfo = { declarations: [], domain: declaration.domain, exported: declaration.exported, inGlobalScope: this._global, uses: [], }; for (const other of variable.declarations) if (other.domain & declaration.domain) result.declarations.push(<ts.Identifier>other.declaration); for (const use of variable.uses) if (use.domain & declaration.domain) result.uses.push(use); cb(result, <ts.Identifier>declaration.declaration, this); } }); }
type VariableCallback = (variable: VariableInfo, key: ts.Identifier, scope: Scope) => void;
3,752
protected _applyUse(use: VariableUse, variables = this._variables): boolean { const variable = variables.get(use.location.text); if (variable === undefined || (variable.domain & use.domain) === 0) return false; variable.uses.push(use); return true; }
interface VariableUse { domain: UsageDomain; location: ts.Identifier; }
3,753
protected _addUseToParent(_use: VariableUse) {} // tslint:disable-line:prefer-function-over-method
interface VariableUse { domain: UsageDomain; location: ts.Identifier; }
3,754
public addUse(use: VariableUse, origin?: Scope) { if (origin === this._innerScope) return super.addUse(use); return this._innerScope.addUse(use); }
interface Scope { addVariable( identifier: string, name: ts.PropertyName, selector: ScopeBoundarySelector, exported: boolean, domain: DeclarationDomain, ): void; addUse(use: VariableUse, scope?: Scope): void; getVariables(): Map<string, InternalVariableInfo>; getFunctionScope(): Scope; end(cb: VariableCallback): void; markExported(name: ts.Identifier, as?: ts.Identifier): void; createOrReuseNamespaceScope(name: string, exported: boolean, ambient: boolean, hasExportStatement: boolean): NamespaceScope; createOrReuseEnumScope(name: string, exported: boolean): EnumScope; getDestinationScope(selector: ScopeBoundarySelector): Scope; }
3,755
public addUse(use: VariableUse, origin?: Scope) { if (origin === this._innerScope) return super.addUse(use); return this._innerScope.addUse(use); }
interface VariableUse { domain: UsageDomain; location: ts.Identifier; }
3,756
public end(cb: VariableCallback) { this._innerScope.end((value, key) => { value.exported = value.exported || this._exportAll || this._exports !== undefined && this._exports.includes(key.text); value.inGlobalScope = this._global; return cb(value, key, this); }); return super.end((value, key, scope) => { value.exported = value.exported || scope === this && this._exports !== undefined && this._exports.includes(key.text); return cb(value, key, scope); }); }
type VariableCallback = (variable: VariableInfo, key: ts.Identifier, scope: Scope) => void;
3,757
constructor(protected _parent: Scope, protected _boundary: ScopeBoundary) { super(false); }
interface Scope { addVariable( identifier: string, name: ts.PropertyName, selector: ScopeBoundarySelector, exported: boolean, domain: DeclarationDomain, ): void; addUse(use: VariableUse, scope?: Scope): void; getVariables(): Map<string, InternalVariableInfo>; getFunctionScope(): Scope; end(cb: VariableCallback): void; markExported(name: ts.Identifier, as?: ts.Identifier): void; createOrReuseNamespaceScope(name: string, exported: boolean, ambient: boolean, hasExportStatement: boolean): NamespaceScope; createOrReuseEnumScope(name: string, exported: boolean): EnumScope; getDestinationScope(selector: ScopeBoundarySelector): Scope; }
3,758
protected _addUseToParent(use: VariableUse) { return this._parent.addUse(use, this); }
interface VariableUse { domain: UsageDomain; location: ts.Identifier; }
3,759
constructor(parent: Scope) { super(parent, ScopeBoundary.Function); }
interface Scope { addVariable( identifier: string, name: ts.PropertyName, selector: ScopeBoundarySelector, exported: boolean, domain: DeclarationDomain, ): void; addUse(use: VariableUse, scope?: Scope): void; getVariables(): Map<string, InternalVariableInfo>; getFunctionScope(): Scope; end(cb: VariableCallback): void; markExported(name: ts.Identifier, as?: ts.Identifier): void; createOrReuseNamespaceScope(name: string, exported: boolean, ambient: boolean, hasExportStatement: boolean): NamespaceScope; createOrReuseEnumScope(name: string, exported: boolean): EnumScope; getDestinationScope(selector: ScopeBoundarySelector): Scope; }
3,760
constructor(parent: Scope) { super(parent, ScopeBoundary.ConditionalType); }
interface Scope { addVariable( identifier: string, name: ts.PropertyName, selector: ScopeBoundarySelector, exported: boolean, domain: DeclarationDomain, ): void; addUse(use: VariableUse, scope?: Scope): void; getVariables(): Map<string, InternalVariableInfo>; getFunctionScope(): Scope; end(cb: VariableCallback): void; markExported(name: ts.Identifier, as?: ts.Identifier): void; createOrReuseNamespaceScope(name: string, exported: boolean, ambient: boolean, hasExportStatement: boolean): NamespaceScope; createOrReuseEnumScope(name: string, exported: boolean): EnumScope; getDestinationScope(selector: ScopeBoundarySelector): Scope; }
3,761
public addUse(use: VariableUse) { if (this._state === ConditionalTypeScopeState.TrueType) return void this._uses.push(use); return this._parent.addUse(use, this); }
interface VariableUse { domain: UsageDomain; location: ts.Identifier; }
3,762
public end(cb: VariableCallback) { this._innerScope.end(cb); return cb( { declarations: [this._name], domain: this._domain, exported: false, uses: this._uses, inGlobalScope: false, }, this._name, this, ); }
type VariableCallback = (variable: VariableInfo, key: ts.Identifier, scope: Scope) => void;
3,763
public addUse(use: VariableUse, source?: Scope) { if (source !== this._innerScope) return this._innerScope.addUse(use); if (use.domain & this._domain && use.location.text === this._name.text) { this._uses.push(use); } else { return this._parent.addUse(use, this); } }
interface Scope { addVariable( identifier: string, name: ts.PropertyName, selector: ScopeBoundarySelector, exported: boolean, domain: DeclarationDomain, ): void; addUse(use: VariableUse, scope?: Scope): void; getVariables(): Map<string, InternalVariableInfo>; getFunctionScope(): Scope; end(cb: VariableCallback): void; markExported(name: ts.Identifier, as?: ts.Identifier): void; createOrReuseNamespaceScope(name: string, exported: boolean, ambient: boolean, hasExportStatement: boolean): NamespaceScope; createOrReuseEnumScope(name: string, exported: boolean): EnumScope; getDestinationScope(selector: ScopeBoundarySelector): Scope; }
3,764
public addUse(use: VariableUse, source?: Scope) { if (source !== this._innerScope) return this._innerScope.addUse(use); if (use.domain & this._domain && use.location.text === this._name.text) { this._uses.push(use); } else { return this._parent.addUse(use, this); } }
interface VariableUse { domain: UsageDomain; location: ts.Identifier; }
3,765
constructor(private _functionScope: Scope, parent: Scope) { super(parent, ScopeBoundary.Block); }
interface Scope { addVariable( identifier: string, name: ts.PropertyName, selector: ScopeBoundarySelector, exported: boolean, domain: DeclarationDomain, ): void; addUse(use: VariableUse, scope?: Scope): void; getVariables(): Map<string, InternalVariableInfo>; getFunctionScope(): Scope; end(cb: VariableCallback): void; markExported(name: ts.Identifier, as?: ts.Identifier): void; createOrReuseNamespaceScope(name: string, exported: boolean, ambient: boolean, hasExportStatement: boolean): NamespaceScope; createOrReuseEnumScope(name: string, exported: boolean): EnumScope; getDestinationScope(selector: ScopeBoundarySelector): Scope; }
3,766
public finish(cb: VariableCallback) { return super.end(cb); }
type VariableCallback = (variable: VariableInfo, key: ts.Identifier, scope: Scope) => void;
3,767
public end(cb: VariableCallback) { this._innerScope.end((variable, key, scope) => { if (scope !== this._innerScope || !variable.exported && (!this._ambient || this._exports !== undefined && !this._exports.has(key.text))) return cb(variable, key, scope); const namespaceVar = this._variables.get(key.text); if (namespaceVar === undefined) { this._variables.set(key.text, { declarations: variable.declarations.map(mapDeclaration), domain: variable.domain, uses: [...variable.uses], }); } else { outer: for (const declaration of variable.declarations) { for (const existing of namespaceVar.declarations) if (existing.declaration === declaration) continue outer; namespaceVar.declarations.push(mapDeclaration(declaration)); } namespaceVar.domain |= variable.domain; for (const use of variable.uses) { if (namespaceVar.uses.includes(use)) continue; namespaceVar.uses.push(use); } } }); this._applyUses(); this._innerScope = new NonRootScope(this, ScopeBoundary.Function); }
type VariableCallback = (variable: VariableInfo, key: ts.Identifier, scope: Scope) => void;
3,768
public addUse(use: VariableUse, source?: Scope) { if (source !== this._innerScope) return this._innerScope.addUse(use); this._uses.push(use); }
interface Scope { addVariable( identifier: string, name: ts.PropertyName, selector: ScopeBoundarySelector, exported: boolean, domain: DeclarationDomain, ): void; addUse(use: VariableUse, scope?: Scope): void; getVariables(): Map<string, InternalVariableInfo>; getFunctionScope(): Scope; end(cb: VariableCallback): void; markExported(name: ts.Identifier, as?: ts.Identifier): void; createOrReuseNamespaceScope(name: string, exported: boolean, ambient: boolean, hasExportStatement: boolean): NamespaceScope; createOrReuseEnumScope(name: string, exported: boolean): EnumScope; getDestinationScope(selector: ScopeBoundarySelector): Scope; }
3,769
public addUse(use: VariableUse, source?: Scope) { if (source !== this._innerScope) return this._innerScope.addUse(use); this._uses.push(use); }
interface VariableUse { domain: UsageDomain; location: ts.Identifier; }
3,770
(variable: VariableInfo, key: ts.Identifier) => { this._result.set(key, variable); }
interface VariableInfo { domain: DeclarationDomain; exported: boolean; uses: VariableUse[]; inGlobalScope: boolean; declarations: ts.Identifier[]; }
3,771
<T extends ts.Node>(node: T, scope: Scope, next: (node: T) => void = forEachChild) => { const savedScope = this._scope; this._scope = scope; next(node); this._scope.end(variableCallback); this._scope = savedScope; }
interface Scope { addVariable( identifier: string, name: ts.PropertyName, selector: ScopeBoundarySelector, exported: boolean, domain: DeclarationDomain, ): void; addUse(use: VariableUse, scope?: Scope): void; getVariables(): Map<string, InternalVariableInfo>; getFunctionScope(): Scope; end(cb: VariableCallback): void; markExported(name: ts.Identifier, as?: ts.Identifier): void; createOrReuseNamespaceScope(name: string, exported: boolean, ambient: boolean, hasExportStatement: boolean): NamespaceScope; createOrReuseEnumScope(name: string, exported: boolean): EnumScope; getDestinationScope(selector: ScopeBoundarySelector): Scope; }
3,772
function getWrappedNodeAtPosition(wrap: NodeWrap, pos: number): NodeWrap | undefined { if (wrap.node.pos > pos || wrap.node.end <= pos) return; outer: while (true) { for (const child of wrap.children) { if (child.node.pos > pos) return wrap; if (child.node.end > pos) { wrap = child; continue outer; } } return wrap; } }
interface NodeWrap { /** The real AST node. */ node: ts.Node; /** The SyntaxKind of `node`. */ kind: ts.SyntaxKind; /** All immediate children of `node` that would be visited by `ts.forEachChild(node, cb)`. */ children: NodeWrap[]; /** Link to the next NodeWrap, depth-first. */ next?: NodeWrap; /** Link to the next NodeWrap skipping all children of the current node. */ skip?: NodeWrap; /** Link to the parent NodeWrap */ parent?: NodeWrap; }
3,773
function getPropertyNameOfWellKnownSymbol(node: WellKnownSymbolLiteral): PropertyName { return { displayName: `[Symbol.${node.name.text}]`, symbolName: <ts.__String>('__@' + node.name.text), }; }
interface WellKnownSymbolLiteral extends ts.PropertyAccessExpression { expression: ts.Identifier & {text: 'Symbol', escapedText: 'symbol'}; }
3,774
function terserMinify( input: Input, sourceMap: SourceMapInput | undefined, minimizerOptions: PredefinedOptions & CustomOptions, extractComments: ExtractCommentsOptions | undefined ): Promise<MinimizedResult>;
type Input = import
3,775
function terserMinify( input: Input, sourceMap: SourceMapInput | undefined, minimizerOptions: PredefinedOptions & CustomOptions, extractComments: ExtractCommentsOptions | undefined ): Promise<MinimizedResult>;
type Input = { [file: string]: string; };
3,776
function uglifyJsMinify( input: Input, sourceMap: SourceMapInput | undefined, minimizerOptions: PredefinedOptions & CustomOptions, extractComments: ExtractCommentsOptions | undefined ): Promise<MinimizedResult>;
type Input = import
3,777
function uglifyJsMinify( input: Input, sourceMap: SourceMapInput | undefined, minimizerOptions: PredefinedOptions & CustomOptions, extractComments: ExtractCommentsOptions | undefined ): Promise<MinimizedResult>;
type Input = { [file: string]: string; };
3,778
function swcMinify( input: Input, sourceMap: SourceMapInput | undefined, minimizerOptions: PredefinedOptions & CustomOptions ): Promise<MinimizedResult>;
type Input = import
3,779
function swcMinify( input: Input, sourceMap: SourceMapInput | undefined, minimizerOptions: PredefinedOptions & CustomOptions ): Promise<MinimizedResult>;
type Input = { [file: string]: string; };