File tree 3 files changed +4
-5
lines changed
packages/system-client/src/components/FunctionEditor/types
3 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 1
1
import { response_type } from './response_type'
2
- import { websocket_type } from './websocket_type'
3
2
4
3
export const global_declare = `
5
4
${ response_type }
6
- ${ websocket_type }
7
5
8
6
declare class FunctionConsole {
9
7
private _logs;
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ export class ImportParser {
26
26
}
27
27
28
28
/**
29
- * Ts 自动对引入依赖进行类型提示加载
29
+ * Typescript 自动对引入依赖进行类型提示加载
30
30
*/
31
31
export class AutoImportTypings {
32
32
_parser = new ImportParser ( )
@@ -62,8 +62,8 @@ export class AutoImportTypings {
62
62
if ( ! this . isLoaded ( 'axios' ) ) { this . loadDeclaration ( 'axios' ) }
63
63
if ( ! this . isLoaded ( 'cloud-function-engine' ) ) { this . loadDeclaration ( 'cloud-function-engine' ) }
64
64
if ( ! this . isLoaded ( 'mongodb' ) ) { this . loadDeclaration ( 'mongodb' ) }
65
- if ( ! this . isLoaded ( 'ws' ) ) { this . loadDeclaration ( 'ws' ) }
66
65
if ( ! this . isLoaded ( '@types/node' ) ) { this . loadDeclaration ( '@types/node' ) }
66
+ // if (!this.isLoaded('ws')) { this.loadDeclaration('ws') }
67
67
}
68
68
69
69
/**
@@ -81,6 +81,7 @@ export class AutoImportTypings {
81
81
* @returns
82
82
*/
83
83
async loadDeclaration ( packageName ) {
84
+ if ( this . isLoaded ( packageName ) ) return
84
85
try {
85
86
const r = await loadPackageTypings ( packageName ) . catch ( err => console . error ( err ) )
86
87
if ( r ?. code ) {
Original file line number Diff line number Diff line change 1
1
2
2
export const websocket_type = `
3
3
// WebSocket socket.
4
- declare class WebSocket extends EventEmitter {
4
+ declare class CloudWebSocket extends EventEmitter {
5
5
/** The connection is not yet open. */
6
6
static readonly CONNECTING: 0;
7
7
/** The connection is open and ready to communicate. */
You can’t perform that action at this time.
0 commit comments