jwt/index.d.ts

28 lines
539 B
TypeScript
Raw Normal View History

2025-01-02 12:13:27 +08:00
import Request from '@gm5/request'
import Response from '@gm5/response'
declare module '@gm5/jwt' {
interface JwtConfig {
ttl?: number
level?: number
secret: string
}
interface JwtModule {
name: string
install(conf?: JwtConfig): {
ttl: number
sign(data: object, secret: string): string
verify(token: string, secret: string): object | false
}
}
export const JwtModule: JwtModule
export function createJwt(): (
req: Request,
res: Response,
next: () => void
) => void
}