1 |
|
2 | import { IncomingMessage, ServerResponse } from "http";
|
3 | import * as UrlParser from 'url';
|
4 | export interface ExtendedRequest extends IncomingMessage {
|
5 | originalUrl?: string;
|
6 | forceLocale?: string;
|
7 | bablic?: {
|
8 | locale: string;
|
9 | proxied?: boolean;
|
10 | };
|
11 | }
|
12 | export interface ExtendedResponse extends ServerResponse {
|
13 | locals?: any;
|
14 | }
|
15 | export declare type Middleware = (req: IncomingMessage, res: ServerResponse, next: () => void) => void;
|
16 | export interface KeywordMapper {
|
17 | [locale: string]: {
|
18 | [keyword: string]: string;
|
19 | };
|
20 | }
|
21 | export declare function getLocaleByURL(parsedUrl: any, locale_detection: any, localeConfigs: any, cookieLocale: any, siteDefaultLocale: any, detectedLocale: any, isProxy: any, explicitLocale: any, subDirBase: any, folders: any, locales: any): any;
|
22 | export interface SiteMeta {
|
23 | localeDetection: string;
|
24 | original: string;
|
25 | customUrls: {
|
26 | [locale: string]: string;
|
27 | };
|
28 | default: string;
|
29 | autoDetect: boolean;
|
30 | localeKeys: string[];
|
31 | timestamp: number;
|
32 | includeQueryString: boolean;
|
33 | includeHash: boolean;
|
34 | singlePageApp: boolean;
|
35 | qsParams: string[];
|
36 | domain: string;
|
37 | mountSubs: string[];
|
38 | }
|
39 | export interface LastModifiedByLocale {
|
40 | [locale: string]: Date;
|
41 | }
|
42 | export interface BablicLinkOptions {
|
43 | subDir?: boolean;
|
44 | subDirBase?: string;
|
45 | subDirOptional?: boolean;
|
46 | returnFull?: boolean;
|
47 | folders?: {
|
48 | [locale: string]: string;
|
49 | };
|
50 | }
|
51 | export declare function getLink(locale: string, parsed: UrlParser.Url, meta: SiteMeta, options?: BablicLinkOptions): string;
|