xjs-common 8.0.3 → 8.0.4

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,6 +1,17 @@
1
1
  export type IndexSignature = string | number | symbol;
2
2
  export type NormalRecord = Record<IndexSignature, any>;
3
3
  export type MaybeArray<T> = T | T[];
4
+ export type Loggable = {
5
+ log: (msg: any) => void;
6
+ warn: (msg: any) => void;
7
+ error: (msg: any) => void;
8
+ };
9
+ export type Unique<T = number> = {
10
+ id: T;
11
+ };
12
+ export type IdName<T = number> = {
13
+ name: string;
14
+ } & Unique<T>;
4
15
  export declare enum Type {
5
16
  string = "string",
6
17
  number = "number",
@@ -1,3 +1,4 @@
1
+ import { Loggable } from "../../const/types";
1
2
  import { HttpResolverContext } from "./http-resolver-context";
2
3
  import { ClientOption, IHttpClient, RequestOption } from "./i-http-client";
3
4
  export interface ClientMode {
@@ -19,10 +20,7 @@ export declare class HttpResolver implements IHttpClient {
19
20
  * @param _baseCmv chrome major version refered when construct a user agent, and the version will be randomized between `n` to `n-4`.
20
21
  * @param _l custom logger. default is `console`.
21
22
  */
22
- constructor(_baseCmv: number, _l?: {
23
- log: (msg: any) => void;
24
- warn: (msg: any) => void;
25
- });
23
+ constructor(_baseCmv: number, _l?: Loggable);
26
24
  /**
27
25
  * create a http client as new context that keeps some states. (browser type, cookies, ciphers order, etc...)
28
26
  * @param op.mode {@link s_clientMode} that is imitated. default is random between chrome or firefox.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xjs-common",
3
- "version": "8.0.3",
3
+ "version": "8.0.4",
4
4
  "description": "library modules for nodejs + typescript that bundled general-purpose implementations.",
5
5
  "repository": {
6
6
  "type": "git",