-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
//统一到处入口 | ||
export * from './main'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
enum NapCatCorePlatform { | ||
Node = 'Node',//命令行模式加载 | ||
LiteLoader = 'LiteLoader',//LL插件模式加载 | ||
} | ||
class NewNapCatCore { | ||
platform: NapCatCorePlatform; // 平台 | ||
constructor(platform: NapCatCorePlatform) { | ||
this.platform = platform; | ||
} | ||
} | ||
export class NapCatCoreManger { | ||
static core: NewNapCatCore | undefined = undefined; | ||
static defaultPlatform: NapCatCorePlatform = NapCatCorePlatform.Node; | ||
static SetDefaultCore(platform: NapCatCorePlatform) { | ||
if (this.core !== undefined) { | ||
return; | ||
} | ||
this.defaultPlatform = platform; | ||
} | ||
static GetPlatform(): NapCatCorePlatform { | ||
return NapCatCoreManger.defaultPlatform; | ||
} | ||
static GetInstance(): NewNapCatCore { | ||
if (this.core === undefined) { | ||
this.core = new NewNapCatCore(NapCatCoreManger.defaultPlatform); | ||
} | ||
return this.core; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
//拦截proxy到会话 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
//初始化跟之前一样 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
//proxy封装工具类 |