import { SignerOptions } from "fast-jwt"; import { APIGatewayProxyStructuredResultV2 } from "aws-lambda"; export interface SessionTypes { public: {}; } export type SessionValue = { [type in keyof SessionTypes]: { type: type; properties: SessionTypes[type]; }; }[keyof SessionTypes]; export declare function useSession(): T; /** * Creates a new session token with provided information * * @example * ```js * Session.create({ * type: "user", * properties: { * userID: "123" * } * }) * ``` */ declare function create(input: { type: T; properties: SessionTypes[T]; options?: Partial; }): string; /** * Verifies a session token and returns the session data * * @example * ```js * Session.verify() * ``` */ declare function verify(token: string): T | { type: string; properties: {}; }; /** * Returns a 302 redirect with an auth-token cookie set with the provided session information * * @example * ```js * Session.cookie({ * type: "user", * properties: { * userID: "123" * }, * redirect: "https://app.example.com/" * }) * ``` */ export declare function cookie(input: { type: T; properties: SessionTypes[T]; redirect: string; options?: Partial; }): APIGatewayProxyStructuredResultV2; /** * Returns a 302 redirect with a query parameter named token set with the jwt value * * @example * ```js * Session.parameter({ * type: "user", * properties: { * userID: "123" * }, * redirect: "https://app.example.com/" * }) * ``` */ export declare function parameter(input: { type: T; redirect: string; properties: SessionTypes[T]; options?: Partial; }): APIGatewayProxyStructuredResultV2; export declare const Session: { create: typeof create; verify: typeof verify; cookie: typeof cookie; parameter: typeof parameter; }; export {};