///
import Page from './Page.js';
import { inlineSvelteComponent } from '../partialHydration/inlineSvelteComponent.js';
import prepareInlineShortcode from './prepareInlineShortcode.js';
import permalinks from './permalinks.js';
import EventEmitter from 'events';
import { WebSocketServer } from 'ws';
import { WSData } from '../core/getWebsocket.js';
import { makeImport } from '../core/Elder.js';
export declare type ServerOptions = {
prefix: string;
cacheRequests?: boolean;
dataRoutes?: boolean | string;
allRequestsRoute?: boolean | string;
};
declare type BuildOptions = {
numberOfWorkers: number;
shuffleRequests: boolean;
};
export interface SvelteComponentFiles {
ssr: string | undefined;
client: string | undefined;
}
export interface FindSvelteComponent {
(name: any, folder: any): SvelteComponentFiles;
}
export declare type InternalFiles = {
client: string[];
server: string[];
routes: string[];
all: string[];
hooks: string;
shortcodes: string;
publicCssFile: string;
updateFiles: () => void;
};
export declare type Internal = {
reloadHash: string;
ssrComponents: string;
clientComponents: string;
distElder: string;
logPrefix: string;
serverPrefix: string;
findComponent?: FindSvelteComponent;
production: boolean;
files: InternalFiles;
watcher: EventEmitter;
websocket?: {
wss: WebSocketServer;
send: (data: WSData) => void;
};
status: 'bootstrapped' | 'errored' | 'bootstrapping';
};
export declare type DebugOptions = {
stacks: boolean;
hooks: boolean;
performance: boolean;
build: boolean;
shortcodes: boolean;
props: boolean;
reload: boolean;
};
declare type PropOptions = {
compress: boolean;
replacementChars: string;
hydration: 'html' | 'hybrid' | 'file';
};
export declare type InitializationOptions = {
distDir?: string;
srcDir?: string;
rootDir?: string;
origin?: string;
prefix?: string;
lang?: string;
server?: ServerOptions;
build?: BuildOptions;
debug?: DebugOptions;
plugins?: any;
props?: PropOptions;
hooks?: {
disable?: string[];
};
shortcodes?: {
openPattern?: string;
closePattern?: string;
};
context?: string;
worker?: boolean;
css?: 'inline' | 'lazy' | 'file';
};
export interface UserOptions {
css?: 'none' | 'file' | 'inline' | 'lazy';
plugins?: {
[key: string]: any;
};
props?: PropOptions;
hooks?: {
disable?: string[];
};
debug?: DebugOptions;
server?: ServerOptions;
build?: BuildOptions;
lang: string;
prefix?: string;
distDir: string;
srcDir: string;
rootDir: string;
origin: string;
shortcodes?: {
openPattern: string;
closePattern: string;
};
replacements: {
[x: string]: string;
};
}
interface ISettingsOptionsBase extends UserOptions {
version: string;
prefix: string;
$$internal: Internal;
context?: string;
worker?: boolean;
debug: DebugOptions;
shortcodes: {
openPattern: string;
closePattern: string;
};
hooks: {
disable?: string[];
};
props: PropOptions;
css: 'none' | 'file' | 'inline' | 'lazy';
}
export interface SettingsOptions extends ISettingsOptionsBase {
[x: string]: any;
}
export declare type QueryOptions = {
db?: any;
} & {
[x: string]: any;
};
export declare type ReqDetails = {
path?: string;
query?: any;
search?: string;
};
export declare type RequestObject = {
slug?: string;
route: string;
type: string;
permalink?: string;
req?: ReqDetails;
source?: string;
} & {
[x: string]: any | {
[y: string]: any;
};
};
export declare type ServerLookupObject = {
[name: string]: RequestObject;
};
export interface Timing {
name: string;
duration: number;
}
export interface BuildResult {
timings: Array;
errors: any[];
}
export declare type StackItem = {
source: string;
string: string;
priority?: number;
};
export declare type Stack = Array;
export declare type ExcludesFalse = (x: T | false) => x is T;
export declare type HydrateOptions = {
loading?: 'lazy' | 'eager' | 'none';
preload?: boolean;
noPrefetch?: boolean;
threshold?: number;
rootMargin?: string;
element?: string;
};
export interface ComponentPayload {
page: Page;
props: any;
hydrateOptions?: HydrateOptions;
}
export interface RollupDevOptions {
splitComponents: boolean;
}
export interface RollupSettings {
svelteConfig?: any;
replacements?: Record;
dev?: RollupDevOptions;
}
export declare type Helpers = {
permalinks: ReturnType;
inlineSvelteComponent: typeof inlineSvelteComponent;
shortcode: ReturnType;
import: ReturnType;
};
export declare type TUserHelpers = Helpers & {
[x: string]: any | {
[y: string]: any;
};
};
export declare type TErrors = (any | Error)[];
export declare type AllRequests = RequestObject[];
export {};