jwt/index.d.ts

22 lines
400 B
TypeScript
Raw Permalink Normal View History

2025-01-02 12:13:27 +08:00
declare module '@gm5/jwt' {
//
2025-01-02 12:13:27 +08:00
interface JwtConfig {
secret: string
2025-01-02 12:13:27 +08:00
ttl?: number
level?: number
}
interface JwtInstance {
ttl: number
sign(data: object, secret: string): string
verify(token: string, secret: string): object | false
2025-01-02 12:13:27 +08:00
}
interface JwtModule {
name: 'jwt'
install(conf?: JwtConfig): JwtInstance
}
2025-01-02 12:13:27 +08:00
export function createJwt(): JwtModule
2025-01-02 12:13:27 +08:00
}