vike
Version:
The Framework *You* Control - Next.js & Nuxt alternative for unprecedented flexibility and dependability.
102 lines (101 loc) • 3.49 kB
TypeScript
export { resolveVikeConfigPublicGlobal };
export { resolveVikeConfigPublicPageEager };
export { resolveVikeConfigPublicPageLazy };
export type { VikeConfigPublicGlobal };
export type { VikeConfigPublicPageEager };
export type { VikeConfigPublicPageLazy };
export type { Source };
export type { Sources };
export type { From };
export type { ExportsAll };
export type { ConfigEntries };
import type { FileType } from '../getPageFiles/fileTypes.js';
import type { PageFile } from '../getPageFiles/getPageFileObject.js';
import type { ConfigValues, PageConfigBuildTime, PageConfigGlobalRuntime, PageConfigRuntime, PageConfigRuntimeLoaded } from '../../types/PageConfig.js';
import { type ConfigDefinedAtOptional } from './getConfigDefinedAt.js';
import type { ConfigResolved } from '../../types/Config/PageContextConfig.js';
import type { Route } from '../../types/Config.js';
type ExportsAll = Record<string, {
exportValue: unknown;
exportSource: string;
filePath: string | null;
/** @deprecated */
_fileType: FileType | null;
/** @deprecated */
_isFromDefaultExport: boolean | null;
/** @deprecated */
_filePath: string | null;
}[]>;
/** All the config's values (including overridden ones) and where they come from.
*
* https://vike.dev/pageContext
*/
type ConfigEntries = Record<string, {
configValue: unknown;
configDefinedAt: ConfigDefinedAtOptional;
configDefinedByFile: string | null;
}[]>;
type VikeConfigPublicPageLazy = {
config: ConfigResolved;
source: Source;
sources: Sources;
from: From;
configEntries: ConfigEntries;
exports: Record<string, unknown>;
exportsAll: ExportsAll;
/** @deprecated */
pageExports: Record<string, unknown>;
};
type From = {
configsStandard: Record<string, // configName
SourceConfigsStandard>;
configsCumulative: Record<string, // configName
SourceConfigsCumulative>;
configsComputed: Record<string, // configName
SourceConfigsComputed>;
};
type Source = Record<string, // configName
SourceAny>;
type Sources = Record<string, // configName
SourceAny[]>;
type SourceAny = SourceConfigsStandard | SourceConfigsCumulative | SourceConfigsComputed;
type SourceConfigsStandard = {
type: 'configsStandard';
value: unknown;
definedAt: string;
};
type SourceConfigsCumulative = {
type: 'configsCumulative';
definedAt: string;
values: {
value: unknown;
definedAt: string;
}[];
};
type SourceConfigsComputed = {
type: 'configsComputed';
definedAt: 'Vike';
value: unknown;
};
type VikeConfigPublic = {
config: ConfigResolved;
_source: Source;
_sources: Sources;
_from: From;
};
type WithRoute = {
route: Route;
isErrorPage?: undefined;
} | {
route?: undefined;
isErrorPage: true;
};
type VikeConfigPublicPageEager = VikeConfigPublic & WithRoute;
type VikeConfigPublicGlobal = VikeConfigPublic;
declare function resolveVikeConfigPublicPageEager(pageConfigGlobalValues: ConfigValues, pageConfig: PageConfigRuntime | PageConfigBuildTime, pageConfigValues: ConfigValues): [string, VikeConfigPublicPageEager];
declare function resolveVikeConfigPublicGlobal({ pageConfigGlobalValues, }: {
pageConfigGlobalValues: ConfigValues;
}): VikeConfigPublicGlobal;
declare function resolveVikeConfigPublicPageLazy(pageFiles: PageFile[], // V0.4 design
pageConfig: PageConfigRuntimeLoaded | null, // V1 design
pageConfigGlobal: PageConfigGlobalRuntime): VikeConfigPublicPageLazy;