@rspack/core 1.3.4 → 1.3.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.
@@ -1,4 +1,4 @@
1
- import type { Tinypool } from "../../compiled/tinypool" with { "resolution-mode": "import" };
1
+ import type { Tinypool } from "../../compiled/tinypool/dist/index.js" with { "resolution-mode": "import" };
2
2
  type RunOptions = Parameters<Tinypool["run"]>[1];
3
3
  export interface WorkerResponseMessage {
4
4
  type: "response";
@@ -3,3 +3,4 @@ import type { LoaderContext } from "../config/adapterRuleUse";
3
3
  export declare function convertArgs(args: any[], raw: boolean): void;
4
4
  export declare const loadLoader: (loaderObject: LoaderObject) => Promise<void>;
5
5
  export declare const runSyncOrAsync: (arg1: Function, arg2: LoaderContext<{}>, arg3: any[]) => Promise<any[]>;
6
+ export declare function extractLoaderName(loaderPath: string, cwd?: string): string;
@@ -11,4 +11,4 @@ interface WorkerOptions {
11
11
  };
12
12
  }
13
13
  declare function worker(workerOptions: WorkerOptions): void;
14
- export = worker;
14
+ export default worker;
@@ -0,0 +1,35 @@
1
+ import inspector from "node:inspector";
2
+ export interface ChromeEvent {
3
+ name: string;
4
+ ph?: string;
5
+ cat?: string;
6
+ ts?: number;
7
+ pid?: number;
8
+ tid?: number;
9
+ id?: number;
10
+ args?: {
11
+ [key: string]: any;
12
+ };
13
+ id2?: {
14
+ local?: string;
15
+ global?: string;
16
+ };
17
+ }
18
+ export declare class JavaScriptTracer {
19
+ static startTime: number;
20
+ static events: ChromeEvent[];
21
+ static layer: string;
22
+ static output: string;
23
+ static session: inspector.Session;
24
+ static initJavaScriptTrace(layer: string, output: string): void;
25
+ static cleanupJavaScriptTrace(): Promise<void>;
26
+ static getTs(): number;
27
+ static getCommonEv(): {
28
+ tid: number;
29
+ pid: number;
30
+ ts: number;
31
+ };
32
+ static pushEvent(event: ChromeEvent): void;
33
+ static startAsync(events: ChromeEvent): void;
34
+ static endAsync(events: ChromeEvent): void;
35
+ }
@@ -20,10 +20,6 @@ export default class BatchedHash extends Hash {
20
20
  * @returns updated hash
21
21
  */
22
22
  update(data: string | Buffer, inputEncoding?: string): this;
23
- /**
24
- * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
25
- * @param encoding encoding of the return value
26
- * @returns digest
27
- */
28
- digest(encoding?: string): string | Buffer;
23
+ digest(): Buffer;
24
+ digest(encoding: string): string;
29
25
  }
@@ -1,17 +1,26 @@
1
1
  export default class Hash {
2
2
  /**
3
- * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
4
- * @abstract
5
3
  * @param data data
6
4
  * @param inputEncoding data encoding
7
5
  * @returns updated hash
8
6
  */
9
- update(data: string | Buffer, inputEncoding?: string): this;
7
+ update(data: string, inputEncoding: string): this;
8
+ /**
9
+ * @param data data
10
+ * @returns updated hash
11
+ */
12
+ update(data: Buffer): this;
13
+ /**
14
+ * Calculates the digest without encoding
15
+ * @abstract
16
+ * @returns {Buffer} digest
17
+ */
18
+ digest(): Buffer;
10
19
  /**
11
- * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
20
+ * Calculates the digest with encoding
12
21
  * @abstract
13
22
  * @param encoding encoding of the return value
14
- * @returns digest
23
+ * @returns {string} digest
15
24
  */
16
- digest(encoding?: string): string | Buffer;
25
+ digest(encoding: string): string;
17
26
  }
@@ -2,5 +2,8 @@ import type { z } from "../../compiled/zod";
2
2
  export declare class ValidationError extends Error {
3
3
  constructor(message: string);
4
4
  }
5
- export declare function validate<T extends z.ZodType>(opts: any, schema: T): void;
5
+ export declare function validate<T extends z.ZodType>(opts: any, schema: T, options?: {
6
+ output?: boolean;
7
+ strategy?: "strict" | "loose-unrecognized-keys" | "loose-silent" | "loose";
8
+ }): string | null;
6
9
  export declare function isValidate<T extends z.ZodType>(opts: any, schema: T): boolean;