vike
Version:
The Framework *You* Control - Next.js & Nuxt alternative for unprecedented flexibility and dependability.
100 lines (99 loc) • 3.49 kB
TypeScript
export { getPageConfigUserFriendly };
export { getPageConfigUserFriendly_oldDesign };
export { getPageConfigGlobalUserFriendly };
export type { PageConfigsUserFriendly };
export type { PageConfigUserFriendly };
export type { PageConfigUserFriendlyOld };
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 './PageConfig.js';
import { type ConfigDefinedAtOptional } from './getConfigDefinedAt.js';
import type { ConfigResolved } from './Config/PageContextConfig.js';
import type { Route } from './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 overriden ones) and where they come from.
*
* https://vike.dev/pageContext
*/
type ConfigEntries = Record<string, {
configValue: unknown;
configDefinedAt: ConfigDefinedAtOptional;
configDefinedByFile: string | null;
}[]>;
type PageConfigUserFriendlyOld = {
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 = SourceConfigs;
type SourceConfigs = SourceConfigsStandard | SourceConfigsCumulative | SourceConfigsComputed;
type SourceConfigsStandard = {
type: 'configsStandard';
value: unknown;
definedAt: string;
};
type SourceConfigsCumulative = {
type: 'configsCumulative';
values: {
value: unknown;
definedAt: string;
}[];
};
type SourceConfigsComputed = {
type: 'configsComputed';
value: unknown;
};
type PageConfigUserFriendly = {
config: ConfigResolved;
_source: Source;
_sources: Sources;
_from: From;
};
type PageConfigsUserFriendly = Record<string, // pageId
PageConfigUserFriendlyWithRoute>;
type WithRoute = {
route: Route;
isErrorPage?: undefined;
} | {
route?: undefined;
isErrorPage: true;
};
type PageConfigUserFriendlyWithRoute = PageConfigUserFriendly & WithRoute;
declare function getPageConfigUserFriendly(pageConfigGlobalValues: ConfigValues, pageConfig: PageConfigRuntime | PageConfigBuildTime, pageConfigValues: ConfigValues): [string, PageConfigUserFriendlyWithRoute];
declare function getPageConfigGlobalUserFriendly({ pageConfigGlobalValues }: {
pageConfigGlobalValues: ConfigValues;
}): PageConfigUserFriendly;
declare function getPageConfigUserFriendly_oldDesign(pageFiles: PageFile[], pageConfig: PageConfigRuntimeLoaded | null, pageConfigGlobal: PageConfigGlobalRuntime): PageConfigUserFriendlyOld;