@cloudbase/types 2.17.5 → 2.17.7

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.
Files changed (2) hide show
  1. package/index.d.ts +38 -34
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -3,61 +3,65 @@ import { ICloudbaseComponent, ICloudbaseHook } from './component'
3
3
  import { ICloudbaseRequest } from './request'
4
4
  import { ICloudbaseCache } from './cache'
5
5
  import { ICloudbaseAuth } from './auth'
6
+ import { CaptchaOptions } from '../oauth/src/captcha/captcha'
6
7
 
7
- export type Persistence = 'local' | 'session' | 'none';
8
+ export type Persistence = 'local' | 'session' | 'none'
8
9
 
9
10
  export interface KV<T> {
10
- [key: string]: T;
11
+ [key: string]: T
11
12
  }
12
13
 
13
14
  export interface KVstring {
14
- [key: string]: string;
15
+ [key: string]: string
15
16
  }
16
17
 
17
-
18
18
  export interface ICloudbaseConfig {
19
- env: string;
20
- region?: string;
21
- timeout?: number;
22
- persistence?: Persistence;
19
+ env: string
20
+ region?: string
21
+ timeout?: number
22
+ persistence?: Persistence
23
23
  oauthClient?: any
24
- debug?: boolean;
25
- _fromApp?: ICloudbase;
24
+ debug?: boolean
25
+ _fromApp?: ICloudbase
26
26
  clientId?: string
27
- oauthInstance?: any;
28
- wxCloud?: any;
27
+ oauthInstance?: any
28
+ wxCloud?: any
29
29
  }
30
30
  // 可更新的配置字段
31
- export type ICloudbaseUpgradedConfig = Pick<ICloudbaseConfig, 'persistence' | 'region' | 'debug'>;
31
+ export type ICloudbaseUpgradedConfig = Pick<ICloudbaseConfig, 'persistence' | 'region' | 'debug'>
32
32
 
33
33
  export interface ICloudbaseExtension {
34
- name: string;
35
- invoke: (opts: any, app: ICloudbase) => Promise<any>;
34
+ name: string
35
+ invoke: (opts: any, app: ICloudbase) => Promise<any>
36
36
  }
37
37
 
38
38
  export interface ICloudbase {
39
- config: ICloudbaseConfig;
40
- platform: ICloudbasePlatformInfo;
41
- cache: ICloudbaseCache;
42
- request: ICloudbaseRequest;
43
- oauthClient: any;
44
- localCache: ICloudbaseCache;
45
- authInstance?: ICloudbaseAuth;
46
- oauthInstance?: any;
47
- init: (config: ICloudbaseConfig) => ICloudbase;
48
- updateConfig: (config: ICloudbaseUpgradedConfig) => void;
49
- registerExtension: (ext: ICloudbaseExtension) => void;
50
- invokeExtension: (name: string, opts: any) => Promise<any>;
51
- useAdapters: (adapters: CloudbaseAdapter | CloudbaseAdapter[]) => void;
52
- registerComponent: (component: ICloudbaseComponent) => void;
53
- registerHook: (hook: ICloudbaseHook) => void;
54
- registerVersion: (version: string) => void;
55
- fire?: (...args: any[]) => void;
39
+ config: ICloudbaseConfig
40
+ platform: ICloudbasePlatformInfo
41
+ cache: ICloudbaseCache
42
+ request: ICloudbaseRequest
43
+ oauthClient: any
44
+ localCache: ICloudbaseCache
45
+ authInstance?: ICloudbaseAuth
46
+ oauthInstance?: any
47
+ init: (config: ICloudbaseConfig) => ICloudbase
48
+ updateConfig: (config: ICloudbaseUpgradedConfig) => void
49
+ registerExtension: (ext: ICloudbaseExtension) => void
50
+ invokeExtension: (name: string, opts: any) => Promise<any>
51
+ useAdapters: (adapters: CloudbaseAdapter | CloudbaseAdapter[]) => void
52
+ registerComponent: (component: ICloudbaseComponent) => void
53
+ registerHook: (hook: ICloudbaseHook) => void
54
+ registerVersion: (version: string) => void
55
+ fire?: (...args: any[]) => void
56
+ }
57
+
58
+ export interface IAdapter extends SDKAdapterInterface {
59
+ captchaOptions?: Partial<CaptchaOptions>
56
60
  }
57
61
 
58
62
  export interface ICloudbasePlatformInfo {
59
- adapter?: SDKAdapterInterface;
60
- runtime?: string;
63
+ adapter?: IAdapter
64
+ runtime?: string
61
65
  }
62
66
 
63
67
  export interface IGenericError<T extends string, P = any> extends Error {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/types",
3
- "version": "2.17.5",
3
+ "version": "2.17.7",
4
4
  "description": "cloudbase javascript sdk types",
5
5
  "files": [
6
6
  "index.js",
@@ -43,5 +43,5 @@
43
43
  "lint": "eslint --fix \"./**/*.ts\"",
44
44
  "precommit": "npm run lint"
45
45
  },
46
- "gitHead": "dbd072af44bd549c779bcd647c8a4474418e2f52"
46
+ "gitHead": "4b7306f0a65e905de77c9e0a0b0a01961a914fbe"
47
47
  }