@rspack/binding
Advanced tools
Comparing version 0.0.0-1bce45e7c0-20221109113710 to 0.0.0-2d61de1089-20221122042420
116
binding.d.ts
@@ -19,2 +19,7 @@ /* tslint:disable */ | ||
} | ||
export interface RawDecoratorOptions { | ||
legacy: boolean | ||
emitMetadata: boolean | ||
useDefineForClassFields: boolean | ||
} | ||
/** | ||
@@ -81,3 +86,7 @@ * It seems napi not support enum well | ||
react?: RawReactOptions | ||
decorator?: RawDecoratorOptions | ||
} | ||
export interface RawDevServer { | ||
hot?: boolean | ||
} | ||
/** | ||
@@ -144,3 +153,3 @@ * `loader` is for js side loader, `builtin_loader` is for rust side loader, | ||
export interface RawSplitChunksOptions { | ||
cacheGroups: Record<string, RawCacheGroupOptions> | ||
cacheGroups?: Record<string, RawCacheGroupOptions> | ||
/** What kind of chunks should be selected. */ | ||
@@ -172,15 +181,8 @@ chunks?: string | ||
stats?: RawStatsOptions | ||
devServer?: RawDevServer | ||
} | ||
export interface AssetContent { | ||
buffer?: Buffer | ||
source?: string | ||
} | ||
export interface UpdateAssetOptions { | ||
asset: AssetContent | ||
filename: string | ||
} | ||
export interface AssetInfoRelated { | ||
export interface JsAssetInfoRelated { | ||
sourceMap?: string | ||
} | ||
export interface AssetInfo { | ||
export interface JsAssetInfo { | ||
/** | ||
@@ -201,20 +203,27 @@ * if the asset can be long term cached forever (contains a hash) | ||
development: boolean | ||
/** when asset ships data for updating an existing application (HMR) */ | ||
hotModuleReplacement: 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 | ||
related: JsAssetInfoRelated | ||
} | ||
export interface Asset { | ||
export interface JsAsset { | ||
name: string | ||
source: JsCompatSource | ||
info: AssetInfo | ||
info: JsAssetInfo | ||
} | ||
export interface PluginCallbacks { | ||
doneCallback: (...args: any[]) => any | ||
processAssetsCallback: (...args: any[]) => any | ||
compilationCallback: (...args: any[]) => any | ||
thisCompilationCallback: (...args: any[]) => any | ||
export interface JsChunk { | ||
files: Array<string> | ||
} | ||
export interface JsChunkGroup { | ||
chunks: Array<JsChunk> | ||
} | ||
export interface JsHooks { | ||
done: (...args: any[]) => any | ||
processAssets: (...args: any[]) => any | ||
compilation: (...args: any[]) => any | ||
thisCompilation: (...args: any[]) => any | ||
} | ||
export interface JsCompatSource { | ||
@@ -228,24 +237,11 @@ /** Whether the underlying data structure is a `RawSource` */ | ||
} | ||
export const enum DiffStatKind { | ||
Changed = 0, | ||
Deleted = 1, | ||
Added = 2 | ||
} | ||
export interface DiffStat { | ||
content: string | ||
kind: DiffStatKind | ||
} | ||
export interface RebuildResult { | ||
diff: Record<string, DiffStat> | ||
stats: StatsCompilation | ||
} | ||
export interface StatsError { | ||
export interface JsStatsError { | ||
message: string | ||
formatted: string | ||
} | ||
export interface StatsWarning { | ||
export interface JsStatsWarning { | ||
message: string | ||
formatted: string | ||
} | ||
export interface StatsAsset { | ||
export interface JsStatsAsset { | ||
type: string | ||
@@ -256,8 +252,9 @@ name: string | ||
chunkNames: Array<string> | ||
info: StatsAssetInfo | ||
info: JsStatsAssetInfo | ||
} | ||
export interface StatsAssetInfo { | ||
export interface JsStatsAssetInfo { | ||
development: boolean | ||
hotModuleReplacement: boolean | ||
} | ||
export interface StatsModule { | ||
export interface JsStatsModule { | ||
type: string | ||
@@ -271,3 +268,3 @@ moduleType: string | ||
} | ||
export interface StatsChunk { | ||
export interface JsStatsChunk { | ||
type: string | ||
@@ -281,23 +278,34 @@ files: Array<string> | ||
} | ||
export interface StatsCompilation { | ||
assets: Array<StatsAsset> | ||
modules: Array<StatsModule> | ||
chunks: Array<StatsChunk> | ||
errors: Array<StatsError> | ||
export interface JsStatsEntrypointAsset { | ||
name: string | ||
size: number | ||
} | ||
export interface JsStatsEntrypoint { | ||
name: string | ||
assets: Array<JsStatsEntrypointAsset> | ||
chunks: Array<string> | ||
assetsSize: number | ||
} | ||
export interface JsStatsCompilation { | ||
assets: Array<JsStatsAsset> | ||
modules: Array<JsStatsModule> | ||
chunks: Array<JsStatsChunk> | ||
entrypoints: Array<JsStatsEntrypoint> | ||
errors: Array<JsStatsError> | ||
errorsCount: number | ||
warnings: Array<StatsWarning> | ||
warnings: Array<JsStatsWarning> | ||
warningsCount: number | ||
} | ||
export interface OnLoadContext { | ||
id: string | ||
} | ||
export function initCustomTraceSubscriber(): 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 | ||
updateAsset(filename: string, newSourceOrFunction: JsCompatSource | ((source: JsCompatSource) => JsCompatSource), assetInfoUpdateOrFunction?: JsAssetInfo | ((assetInfo: JsAssetInfo) => JsAssetInfo)): void | ||
getAssets(): Readonly<JsAsset>[] | ||
getAsset(name: string): JsAsset | null | ||
emitAsset(filename: string, source: JsCompatSource, assetInfo: JsAssetInfo): void | ||
deleteAsset(filename: string): void | ||
get assets(): Record<string, JsCompatSource> | ||
get entrypoints(): Record<string, JsChunkGroup> | ||
} | ||
export class Rspack { | ||
constructor(options: RawOptions, pluginCallbacks?: PluginCallbacks | undefined | null) | ||
constructor(options: RawOptions, jsHooks?: JsHooks | undefined | null) | ||
/** | ||
@@ -309,3 +317,3 @@ * Build with the given option passed to the constructor | ||
*/ | ||
unsafe_build(callback: (err: null | Error, result: StatsCompilation) => void): void | ||
unsafe_build(callback: (err: null | Error, result: JsStatsCompilation) => void): void | ||
/** | ||
@@ -312,0 +320,0 @@ * Rebuild with the given option passed to the constructor |
{ | ||
"name": "@rspack/binding", | ||
"version": "0.0.0-1bce45e7c0-20221109113710", | ||
"version": "0.0.0-2d61de1089-20221122042420", | ||
"description": "Node binding for rspack", | ||
@@ -24,4 +24,7 @@ "main": "binding.js", | ||
"build": "napi build --platform --js false --dts binding.d.ts --config napirs.rc.json", | ||
"build:release": "napi build --release --platform --js false --dts binding.d.ts --config napirs.rc.json" | ||
"build:release:all": "pnpm build:release && pnpm build:release:x64 && pnpm build:release:linux", | ||
"build:release": "napi build --release --platform --js false --dts binding.d.ts --config napirs.rc.json", | ||
"build:release:x64": "napi build --release --platform --js false --dts binding.d.ts --config napirs.rc.json --target x86_64-apple-darwin", | ||
"build:release:linux": "napi build --release --platform --js false --dts binding.d.ts --config napirs.rc.json --zig --target x86_64-unknown-linux-gnu --zig-abi-suffix=2.17" | ||
} | ||
} |
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
33511963
547