* GAS "December 13, 2018" update
* Update google-apps-script.forms.d.ts
* add data-studio, rename card-service, order as per ref page
* January 4, 2019
* Add types for bdapi
* Fix typings for bdapi
* Fix typings and project url
* Add documentation link to index.d.ts
* Add bandagedbd scope to bdapi
* Fix bandagedbd_bdapi version
* Rename test file for bandagedbd__bdapi
* Add scope to comment in bandagedbd__bdapi
* Update tsconfig file list for bdapi
After #31704 it would be useful to specify what is `Context.State` and
`Context` inside the `Router`'s handlers. For that, we could provide
a way to parameterize `Router` (also fallbacking to default `any` and
`{}` in case the generic type params are omitted).
So it would work like that:
```ts
type MyState = {foo: string}
type MyContext = {bar: string}
const app = new Koa<{}, {}>();
const router = new Router<MyState, MyContext>();
router.get('/', (ctx, next) => {
// ctx here is Koa.ParameterizedContext<MyState, MyContext & IRouterContext<MyState, MyContext>>
console.log(ctx.state.foo);
ctx.body = 'Hello World!';
});
app.use<MyState, MyContext>(async (ctx, next) => {
ctx.state.foo = "foo"
ctx.bar = "bar";
await next();
})
.use(router.routes())
.use(router.allowedMethods())
.use(async (ctx, next) => {
// ctx here is Koa.ParameterizedContext<MyState, MyContext & IRouterContext<MyState, MyContext>>
console.log(ctx.router);
console.log(ctx.bar);
await next();
})
.listen(3000);
```
But if we don't parameterize `Router`, it will work as before:
```ts
const app = new Koa();
const router = new Router();
router.get('/', (ctx, next) => {
// ctx here is Koa.ParameterizedContext<any, IRouterContext>
ctx.body = 'Hello World!';
});
app.use(async (ctx, next) => {
ctx.state.foo = "foo"
ctx.bar = "bar";
await next();
})
.use(router.routes())
.use(router.allowedMethods())
.listen(3000);
```
What do you think?