web-background 0.0.6 → 0.0.8

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/README.md CHANGED
@@ -5,12 +5,13 @@ This module is implemented as a Web Worker and is available in web browsers.
5
5
  It runs in isolation, cannot be access external variables and modules
6
6
  격리된 환경에서 실행되므로 외부 모듈 및 외부 변수에 접근할 수 없습니다.
7
7
 
8
- In most cases, this module is not required.
8
+ In most cases, You don't have to use it
9
9
  Recommended for long task
10
10
  대부분의 경우 이 모듈을 사용할 필요는 없으나, long task를 처리해야 할 경우 사용할 것을 추천합니다.
11
11
 
12
12
  Most WebAPIs including DOM APIs are cannot be used Becuase they are run in Web Worker.
13
- WebWorker에서 실행되므로 DOM API를 포함한 WebAPI를 사용하지 못합니다.
13
+ WebWorker에서 실행되므로 DOM API를 포함한 대부분의 WebAPI를 사용하지 못합니다.
14
+ [Read More](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API)
14
15
 
15
16
  ## Example
16
17
 
@@ -1 +1,5 @@
1
- export declare function background<Payload = never, ReturnValue = void>(fn: (payload: Payload) => ReturnValue): any;
1
+ type ReturnFn<ReturnValue> = () => ReturnValue;
2
+ type ReturnFnWithPayload<Payload, ReturnValue> = (payload: Payload) => ReturnValue;
3
+ type Result<Payload, ReturnValue> = Payload extends never ? ReturnFn<ReturnValue> : ReturnFnWithPayload<Payload, ReturnValue>;
4
+ export declare function background<Payload = never, ReturnValue = void>(fn: (payload: Payload) => ReturnValue): Result<Payload, ReturnValue>;
5
+ export {};
package/package.json CHANGED
@@ -3,10 +3,11 @@
3
3
  "description": "Running background in browser Worker",
4
4
  "keywords": [
5
5
  "Web Worker",
6
- "Worker",
7
- "Background"
6
+ "Worker Thread",
7
+ "Background",
8
+ "Web Background"
8
9
  ],
9
- "version": "0.0.6",
10
+ "version": "0.0.8",
10
11
  "main": "dist/index.js",
11
12
  "module": "dist/index.js",
12
13
  "type": "module",
@@ -1,3 +0,0 @@
1
- {
2
- "typescript.tsdk": "node_modules/typescript/lib"
3
- }