Skip to content

Commit

Permalink
change readme description
Browse files Browse the repository at this point in the history
  • Loading branch information
Foveluy committed Apr 4, 2018
1 parent dba3608 commit 0af8b33
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Routing decorator for eggjs



### For isntall
### For install
```bash
npm install --save egg-blueprint
```
Expand Down
20 changes: 13 additions & 7 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Controller, Context } from 'egg'

interface Decorator {
(target: any, propertyKey: string): void
}
Expand All @@ -8,24 +10,28 @@ interface bpItem {
handler: string
}

interface BeforeFunction {
(ctx: Context, instance: Controller): Boolean | undefined
}

export interface blueprint {
/**
* http post method
* @param url
*/
post(url: string): Decorator
post(url: string, before?: BeforeFunction): Decorator

/**
* http get method
* @param url
*/
get(url: string): Decorator
patch(url: string): Decorator
del(url: string): Decorator
options(url: string): Decorator
put(url: string): Decorator
get(url: string, before?: BeforeFunction): Decorator
patch(url: string, before?: BeforeFunction): Decorator
del(url: string, before?: BeforeFunction): Decorator
options(url: string, before?: BeforeFunction): Decorator
put(url: string, before?: BeforeFunction): Decorator

restfulClass(url: string): any
restfulClass(url: string, before?: BeforeFunction): any

getRoute(): any

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "egg-blueprint",
"version": "1.0.1",
"version": "1.1.0",
"description": "Routing decorator for eggjs",
"main": "./lib/index.js",
"egg": {
Expand Down

0 comments on commit 0af8b33

Please sign in to comment.