@rspack/binding
Advanced tools
Comparing version 0.0.0-20221108071754 to 0.0.0-20221108072654
@@ -178,6 +178,47 @@ /* tslint:disable */ | ||
} | ||
export interface AssetInfoRelated { | ||
sourceMap?: string | ||
} | ||
export interface AssetInfo { | ||
/** | ||
* if the asset can be long term cached forever (contains a hash) | ||
* whether the asset is minimized | ||
*/ | ||
minimized: boolean | ||
/** | ||
* the value(s) of the full hash used for this asset | ||
* the value(s) of the chunk hash used for this asset | ||
* the value(s) of the module hash used for this asset | ||
* the value(s) of the content hash used for this asset | ||
* when asset was created from a source file (potentially transformed), the original filename relative to compilation context | ||
* size in bytes, only set after asset has been emitted | ||
* when asset is only used for development and doesn't count towards user-facing assets | ||
*/ | ||
development: boolean | ||
/** | ||
* when asset ships data for updating an existing application (HMR) | ||
* when asset is javascript and an ESM | ||
* related object to other assets, keyed by type of relation (only points from parent to child) | ||
*/ | ||
related: AssetInfoRelated | ||
} | ||
export interface Asset { | ||
name: string | ||
source: JsCompatSource | ||
info: AssetInfo | ||
} | ||
export interface PluginCallbacks { | ||
doneCallback: (...args: any[]) => any | ||
processAssetsCallback: (...args: any[]) => any | ||
compilationCallback: (...args: any[]) => any | ||
thisCompilationCallback: (...args: any[]) => any | ||
} | ||
export interface JsCompatSource { | ||
/** Whether the underlying data structure is a `RawSource` */ | ||
isRaw: boolean | ||
/** Whether the underlying value is a buffer or string */ | ||
isBuffer: boolean | ||
source: Buffer | ||
map?: Buffer | ||
} | ||
export const enum DiffStatKind { | ||
@@ -246,5 +287,7 @@ Changed = 0, | ||
export function initCustomTraceSubscriber(): void | ||
export class RspackCompilation { | ||
getAssets(): Record<string, Buffer> | ||
emitAsset(options: UpdateAssetOptions): void | ||
export class JsCompilation { | ||
updateAsset(filename: string, newSourceOrFunction: JsCompatSource | ((source: JsCompatSource) => JsCompatSource), assetInfoUpdateOrFunction?: AssetInfo | ((assetInfo: AssetInfo) => AssetInfo)): void | ||
getAssets(): Readonly<Asset>[] | ||
emitAsset(filename: string, source: JsCompatSource, assetInfo: AssetInfo): void | ||
get assets(): Record<string, JsCompatSource> | ||
} | ||
@@ -274,5 +317,5 @@ export class Rspack { | ||
* | ||
* **Note** that this method is not safe if you cache the _RspackCompilation_ on the Node side, as it will be invalidated by the next build and accessing a dangling ptr is a UB. | ||
* **Note** that this method is not safe if you cache the _JsCompilation_ on the Node side, as it will be invalidated by the next build and accessing a dangling ptr is a UB. | ||
*/ | ||
unsafe_last_compilation(f: (arg0: RspackCompilation) => void): void | ||
unsafe_last_compilation(f: (arg0: JsCompilation) => void): void | ||
/** | ||
@@ -279,0 +322,0 @@ * Destroy the compiler |
{ | ||
"name": "@rspack/binding", | ||
"version": "0.0.0-20221108071754", | ||
"version": "0.0.0-20221108072654", | ||
"description": "Node binding for rspack", | ||
@@ -5,0 +5,0 @@ "main": "binding.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32781490
539