File tree Expand file tree Collapse file tree 3 files changed +11
-10
lines changed Expand file tree Collapse file tree 3 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { toArray } from "./util";
6
6
export default class Client {
7
7
public config : Types . ClientConfig ;
8
8
9
- constructor ( config : Types . Config & Types . ClientConfig ) {
9
+ constructor ( config : Types . ClientConfig ) {
10
10
if ( ! config . channelAccessToken ) {
11
11
throw new Error ( "no channel access token" ) ;
12
12
}
Original file line number Diff line number Diff line change @@ -14,9 +14,7 @@ export type Middleware = (
14
14
next : NextCallback ,
15
15
) => void ;
16
16
17
- export default function middleware (
18
- config : Types . Config & Types . MiddlewareConfig ,
19
- ) : Middleware {
17
+ export default function middleware ( config : Types . MiddlewareConfig ) : Middleware {
20
18
if ( ! config . channelSecret ) {
21
19
throw new Error ( "no channel secret" ) ;
22
20
}
Original file line number Diff line number Diff line change 1
- export type ClientConfig = {
1
+ export interface Config {
2
+ channelAccessToken ?: string ;
3
+ channelSecret ?: string ;
4
+ }
5
+
6
+ export interface ClientConfig extends Config {
2
7
channelAccessToken : string ;
3
- } ;
8
+ }
4
9
5
- export type MiddlewareConfig = {
10
+ export interface MiddlewareConfig extends Config {
6
11
channelSecret : string ;
7
- } ;
8
-
9
- export type Config = ClientConfig | MiddlewareConfig ;
12
+ }
10
13
11
14
export type Profile = {
12
15
displayName : string ;
You can’t perform that action at this time.
0 commit comments