@uigstudio/uig-nextjs-helper
Version:
``` npm install @uig/uig-nextjs-helper ``` or ``` yarn add -D @uig/uig-nextjs-helper ```
17 lines (16 loc) • 1.1 kB
TypeScript
import { GetServerSidePropsContext, GetStaticPropsContext } from 'next';
import { SeoList } from './types/api';
export declare type QueryParamsType = Record<string, string | boolean | Date | number | undefined>;
export declare const createUrl: (baseUrl: string | undefined, path: string) => string;
export declare const resolveUrl: (baseUrl: string | undefined, path: string, queryParams?: QueryParamsType, bindParams?: QueryParamsType) => string;
export declare const bindUrlParams: (route: string, params: QueryParamsType) => string;
export declare const slugToData: (ctx: GetStaticPropsContext, items: SeoList, defaultSlug?: string, blockList?: string[]) => {
id: string | number;
slug: string;
noIndex?: string | undefined;
noFollow?: string | undefined;
hideInSitemap?: string | undefined;
} | undefined;
export declare const absoluteUrl: (...parts: string[]) => string;
export declare const queryPage: (ctx: GetServerSidePropsContext) => number;
export declare const queryParam: <T>(ctx: GetServerSidePropsContext, key: string, defaultValue: T) => string | T;