@duongtrungnguyen/next-helper
Version:
Helper library for Next.js 15
25 lines • 1.3 kB
TypeScript
import { ClassValue } from "clsx";
/**
* Parses the provided token and returns it in a formatted string.
*
* @param token - The token to be parsed. This parameter is optional.
* @returns A string in the format of `${libConfig.tokenType} ${token}`.
*/
export declare const parseToken: (token?: string) => string;
/**
* Converts an object representing query parameters into a query string.
*
* @param queryObject - An object where the keys are query parameter names and the values are the corresponding query parameter values.
* Values can be strings, numbers, or undefined. Undefined values will be omitted from the query string.
* @returns A string representing the query parameters in the format `?key1=value1&key2=value2`.
*/
export declare const getQueryString: (queryObject: Record<string, string | number | undefined>) => string;
/**
* Retrieves the value of a specified cookie token.
*
* @param type - The key of the token to retrieve from the cookies.
* @returns A promise that resolves to the value of the specified cookie token, or undefined if the token is not found.
*/
export declare const getCookieToken: (type: string) => Promise<string | undefined>;
export declare function cn(...inputs: ClassValue[]): string;
//# sourceMappingURL=utils.d.ts.map