-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(types): import types from egg-core (#3545)
- Loading branch information
Showing
16 changed files
with
459 additions
and
151 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
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
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
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 |
---|---|---|
@@ -1,15 +1,7 @@ | ||
{ | ||
"extends": "../app-ts/tsconfig.json", | ||
"compilerOptions": { | ||
"target": "es2017", | ||
"baseUrl": ".", | ||
"paths": { | ||
"egg": [ | ||
"../../../../index" | ||
] | ||
}, | ||
"module": "commonjs", | ||
"strict": true, | ||
"noImplicitAny": false, | ||
"esModuleInterop": true | ||
"esModuleInterop": true, | ||
"baseUrl": "." | ||
} | ||
} |
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,48 @@ | ||
import { | ||
BaseContextClass, | ||
Context, | ||
Application, | ||
Agent, | ||
Controller, | ||
Service, | ||
} from 'egg'; | ||
|
||
new BaseContextClass({} as Context).ctx; | ||
|
||
class MyController extends Controller { | ||
async test() { | ||
this.ctx.locals.test.localsCheckAny(); | ||
this.app.config.keys.configKeysCheckAny(); | ||
this.app.appCheckAny(); | ||
} | ||
} | ||
new MyController(); | ||
|
||
// service | ||
class MyService extends Service { | ||
async test() { | ||
this.ctx.locals.test.serviceLocalCheckAny(); | ||
this.app.config.keys.serviceConfigCheckAny(); | ||
this.app.serviceAppCheckAny(); | ||
} | ||
} | ||
new MyService(); | ||
|
||
const app = new Application({ baseDir: __dirname, plugins: {}, type: 'application' }); | ||
new app.ContextHttpClient(); | ||
new app.HttpClient(); | ||
|
||
new Agent(undefined, 1123); | ||
|
||
// test error in yadan | ||
import { | ||
BaseContextClass as YadanBaseContextClass, | ||
Application as YadanApplication, | ||
Agent as YadanAgent, | ||
} from 'yadan'; | ||
|
||
new YadanBaseContextClass(); | ||
const yadan = new YadanApplication({ baseDir: __dirname, plugins: {}, type: 'application' }); | ||
new yadan.ContextHttpClient(); | ||
new yadan.HttpClient(); | ||
new YadanAgent(undefined, 1123); |
Oops, something went wrong.