@rspack/binding 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/binding.d.ts ADDED
@@ -0,0 +1,137 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ /* auto-generated by NAPI-RS */
5
+
6
+ export class ExternalObject<T> {
7
+ readonly '': {
8
+ readonly '': unique symbol
9
+ [K: symbol]: T
10
+ }
11
+ }
12
+ export interface RawCssPluginConfig {
13
+ /**
14
+ * ## Example
15
+ * ```rust,ignore
16
+ * RawCssOptions {
17
+ * preset_env: vec!["Firefox > 10".into(), "chrome >=20".into()],
18
+ * }
19
+ * ```
20
+ * The preset_env will finally pass into [`browserslist::resolve`](https://docs.rs/browserslist-rs/latest/browserslist/fn.resolve.html).
21
+ * For detailed configuration, see https://docs.rs/browserslist-rs/latest/browserslist/
22
+ */
23
+ presetEnv: Array<string>
24
+ }
25
+ /**
26
+ * It seems napi not support enum well
27
+ */
28
+ export interface RawHtmlPluginConfig {
29
+ /** emitted file name in output path */
30
+ filename?: string | void
31
+ /** template html file */
32
+ template?: string
33
+ /** `head`, `body` or None */
34
+ inject?: string | void
35
+ /** path or `auto` */
36
+ publicPath?: string
37
+ /** `blocking`, `defer`, or `module` */
38
+ scriptLoading?: string | void
39
+ /** entry_chunk_name (only entry chunks are supported) */
40
+ chunks?: Array<string>
41
+ excludedChunks?: Array<string>
42
+ sri?: string | void
43
+ }
44
+ export interface RawBuiltins {
45
+ html?: Array<RawHtmlPluginConfig>
46
+ css?: RawCssPluginConfig
47
+ }
48
+ /**
49
+ * `loader` is for js side loader, `builtin_loader` is for rust side loader,
50
+ * which is mapped to real rust side loader by [get_builtin_loader].
51
+ *
52
+ * `options` is
53
+ * - a `None` on rust side and handled by js side `getOptions` when
54
+ * using with `loader`.
55
+ * - a `Some(string)` on rust side, deserialized by `serde_json::from_str`
56
+ * and passed to rust side loader in [get_builtin_loader] when using with
57
+ * `builtin_loader`.
58
+ */
59
+ export interface RawModuleRuleUse {
60
+ loader?: (...args: any[]) => any
61
+ builtinLoader?: string
62
+ options?: string
63
+ loaderName?: string
64
+ }
65
+ export interface RawModuleRule {
66
+ test?: string
67
+ resource?: string
68
+ resourceQuery?: string
69
+ func?: (...args: any[]) => any
70
+ uses?: Array<RawModuleRuleUse>
71
+ type?: "js" | "jsx" | "ts" | "tsx" | "css" | "json" | "asset" | "asset/resource" | "asset/source" | "asset/inline"
72
+ }
73
+ export interface RawAssetParserDataUrlOption {
74
+ maxSize?: number
75
+ }
76
+ export interface RawAssetParserOptions {
77
+ dataUrlCondition?: RawAssetParserDataUrlOption
78
+ }
79
+ export interface RawParserOptions {
80
+ asset?: RawAssetParserOptions
81
+ }
82
+ export interface RawModuleOptions {
83
+ rules: Array<RawModuleRule>
84
+ parser?: RawParserOptions
85
+ }
86
+ export interface RawOutputOptions {
87
+ path?: string
88
+ publicPath?: string
89
+ assetModuleFilename?: string
90
+ filename?: string
91
+ chunkFilename?: string
92
+ uniqueName?: string
93
+ }
94
+ export interface RawResolveOptions {
95
+ preferRelative?: boolean
96
+ }
97
+ export interface RawOptions {
98
+ entry?: Record<string, string>
99
+ mode?: string
100
+ target?: string[]
101
+ context?: string
102
+ output?: RawOutputOptions
103
+ resolve?: RawResolveOptions
104
+ module?: RawModuleOptions
105
+ builtins?: RawBuiltins
106
+ define?: Record<string, string>
107
+ external?: Record<string, string>
108
+ }
109
+ export interface OnLoadContext {
110
+ id: string
111
+ }
112
+ export function initCustomTraceSubscriber(): void
113
+ export interface AssetContent {
114
+ buffer?: Buffer
115
+ source?: string
116
+ }
117
+ export interface UpdateAssetOptions {
118
+ asset: AssetContent
119
+ filename: string
120
+ }
121
+ export interface PluginCallbacks {
122
+ doneCallback: (...args: any[]) => any
123
+ processAssetsCallback: (...args: any[]) => any
124
+ }
125
+ export interface RspackError {
126
+ message: string
127
+ }
128
+ export interface Stats {
129
+ errors: Array<RspackError>
130
+ }
131
+ export function initTraceSubscriber(): void
132
+ export function newRspack(options: RawOptions, pluginCallbacks?: PluginCallbacks | undefined | null): ExternalObject<RspackInternal>
133
+ export function build(rspack: ExternalObject<RspackInternal>): Promise<Stats>
134
+ export function rebuild(rspack: ExternalObject<RspackInternal>, changedFile: string[]): Promise<Record<string, string>>
135
+ export interface RspackInternal {
136
+
137
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/binding",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "Node binding for rspack",
5
5
  "main": "binding.js",
6
6
  "types": "binding.d.ts",
Binary file