@parcel/rust 2.12.1-canary.3261 → 2.12.1-canary.3263

Sign up to get free protection for your applications and to get access to all the features.
package/index.d.ts CHANGED
@@ -15,6 +15,7 @@ export function findNodeModule(module: string, from: string): string | null
15
15
  export function hashString(s: string): string
16
16
  export function hashBuffer(buf: Buffer): string
17
17
  export function optimizeImage(kind: string, buf: Buffer): Buffer
18
+ export function workerCallback(callback: (...args: any[]) => any): void
18
19
  export interface JsFileSystemOptions {
19
20
  canonicalize: (...args: any[]) => any
20
21
  read: (...args: any[]) => any
@@ -73,6 +74,8 @@ export class Hash {
73
74
  }
74
75
  export class ParcelNapi {
75
76
  constructor(options: object)
77
+ build(): Promise<void>
78
+ static defaultThreadCount(): number
76
79
  testingTempFsReadToString(path: string): Promise<string>
77
80
  testingTempFsIsFile(path: string): Promise<boolean>
78
81
  testingTempFsIsDir(path: string): Promise<boolean>
package/index.js CHANGED
@@ -310,7 +310,7 @@ if (!nativeBinding) {
310
310
  throw new Error(`Failed to load native binding`)
311
311
  }
312
312
 
313
- const { initSentry, closeSentry, findAncestorFile, findFirstFile, findNodeModule, hashString, hashBuffer, Hash, optimizeImage, ParcelNapi, Resolver, transform, transformAsync } = nativeBinding
313
+ const { initSentry, closeSentry, findAncestorFile, findFirstFile, findNodeModule, hashString, hashBuffer, Hash, optimizeImage, ParcelNapi, workerCallback, Resolver, transform, transformAsync } = nativeBinding
314
314
 
315
315
  module.exports.initSentry = initSentry
316
316
  module.exports.closeSentry = closeSentry
@@ -322,6 +322,7 @@ module.exports.hashBuffer = hashBuffer
322
322
  module.exports.Hash = Hash
323
323
  module.exports.optimizeImage = optimizeImage
324
324
  module.exports.ParcelNapi = ParcelNapi
325
+ module.exports.workerCallback = workerCallback
325
326
  module.exports.Resolver = Resolver
326
327
  module.exports.transform = transform
327
328
  module.exports.transformAsync = transformAsync
package/index.js.flow CHANGED
@@ -1,5 +1,5 @@
1
1
  // @flow
2
- import type {FileCreateInvalidation} from '@parcel/types';
2
+ import type {FileCreateInvalidation, FileSystem as ParcelFileSystem} from '@parcel/types';
3
3
 
4
4
  declare export var init: void | (() => void);
5
5
 
@@ -16,20 +16,26 @@ export interface ConfigRequest {
16
16
  }
17
17
  export interface RequestOptions {}
18
18
 
19
+ export type RpcCallback = (error: any, id: number, data: any, done: (value: {| Ok: any |} | {| Err: any |}) => any) => any | Promise<any>;
19
20
 
20
21
  export interface ParcelNapiOptions {
21
- fs?: any;
22
- rpc?: (error: any, id: number, data: any, done: (value: {| Ok: any |} | {| Err: any |}) => any) => any | Promise<any>;
22
+ fs?: ParcelFileSystem;
23
+ nodeWorkers?: number;
24
+ rpc?: RpcCallback;
23
25
  }
24
26
 
25
27
  declare export class ParcelNapi {
26
28
  constructor(options: ParcelNapiOptions): ParcelNapi;
29
+ build(): Promise<void>;
30
+ static defaultThreadCount(): number;
27
31
  testingTempFsReadToString(path: string): string;
28
32
  testingTempFsIsDir(path: string): boolean;
29
33
  testingTempFsIsFile(path: string): boolean;
30
34
  testingRpcPing(): void;
31
35
  }
32
36
 
37
+ declare export function workerCallback(callback: RpcCallback): void
38
+
33
39
  declare export function initSentry(): void;
34
40
  declare export function closeSentry(): void;
35
41
  declare export function napiRunConfigRequest(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcel/rust",
3
- "version": "2.12.1-canary.3261+35e936ac2",
3
+ "version": "2.12.1-canary.3263+1fef06a36",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -40,5 +40,5 @@
40
40
  "wasm:build": "cargo build -p parcel-node-bindings --target wasm32-unknown-unknown && cp ../../../target/wasm32-unknown-unknown/debug/parcel_node_bindings.wasm .",
41
41
  "wasm:build-release": "CARGO_PROFILE_RELEASE_LTO=true cargo build -p parcel-node-bindings --target wasm32-unknown-unknown --release && wasm-opt --strip-debug -O ../../../target/wasm32-unknown-unknown/release/parcel_node_bindings.wasm -o parcel_node_bindings.wasm"
42
42
  },
43
- "gitHead": "35e936ac2387833ef0af31647c2b670466345a64"
43
+ "gitHead": "1fef06a3640afbd01f2d4b06327201ebc745e5da"
44
44
  }