1 | import { SeoOptions } from "./seo";
|
2 | import { ExtendedRequest, ExtendedResponse, SiteMeta } from "./common";
|
3 | export interface BablicOptions {
|
4 | siteId: string;
|
5 | rootUrl?: string;
|
6 | locale?: string;
|
7 | subDir?: boolean;
|
8 | subDirBase?: string;
|
9 | subDirOptional?: boolean;
|
10 | onReady?: () => void;
|
11 | seo?: SeoOptions;
|
12 | folders?: {
|
13 | [locale: string]: string;
|
14 | };
|
15 | meta?: SiteMeta;
|
16 | snippet?: string;
|
17 | keywords?: {
|
18 | [urlKeyword: string]: {
|
19 | [locale: string]: string;
|
20 | };
|
21 | };
|
22 | }
|
23 | export interface SiteData {
|
24 | id?: string;
|
25 | error?: string;
|
26 | snippet: string;
|
27 | meta: SiteMeta;
|
28 | keywords?: {
|
29 | [urlKeyword: string]: {
|
30 | [locale: string]: string;
|
31 | };
|
32 | };
|
33 | }
|
34 | export declare const BackwardCompSEOOptions: {
|
35 | useCache: string[];
|
36 | defaultCache: string[];
|
37 | };
|
38 | export declare class BablicMiddleware {
|
39 | meta: SiteMeta;
|
40 | snippet: string;
|
41 | private options;
|
42 | private LOCALE_REGEX;
|
43 | private seoMiddleware;
|
44 | private keywordsByLocale;
|
45 | private reverseKeywordByLocale;
|
46 | constructor(options: BablicOptions);
|
47 | getSiteMeta(cbk: (e?: Error) => void): void;
|
48 | saveSiteMeta(data: SiteData): void;
|
49 | snippetUrl(): string;
|
50 | getLocale(req: ExtendedRequest): string;
|
51 | loadSiteMeta(cbk: (e?: Error) => void): void;
|
52 | handleBablicCallback(req: ExtendedRequest, res: ExtendedResponse): void;
|
53 | getLink(locale: string, url: string): string;
|
54 | altTags(url: string, locale: string): string;
|
55 | private generateOriginalPath(url, locale);
|
56 | private generateTranslatedPath(url, locale);
|
57 | handle(req: ExtendedRequest, res: ExtendedResponse, next: () => void): void;
|
58 | private processKeywords(keywords);
|
59 | }
|