import { Asset, Assets, Document, Cache, Logger } from '@stackbit/types'; import { DataModel, PageModel } from '@stackbit/sdk'; export declare const SLUG_FIELD_PREFIX = "_filePath_"; type Context = { /** The document/asset file path relative to project directory. */ filePath: string; }; export type DocumentContext = Context; export type AssetContext = Context; export declare function isPrefixedAssetId(assetId: unknown): boolean; export declare function getAssetDir(assetsConfig: Assets): string; /** * Computes the field value from the asset ID. * * For "static" referenceType assets, the reference to the asset is stored * relative to the {@link Assets.staticDir} prefixed by {@link Assets.publicPath}. * For example, if the assetConfig is: * ```js * { * referenceType: 'static', * staticDir: 'public', * publicPath: '/assets' * } * ``` * and the asset file is located at public/images/example.png, then the stored * value will be '/assets/images/example.png'. * * For "relative" referenceType assets, the reference to the asset is stored * relative to the document containing the asset. For example, if the document * containing the asset is located at content/pages/page.md, and it references an * asset located at content/images/example.png, then the stored field value will * be '../images/example.png'. * * @param assetId The asset ID in ASSET_ID_PREFIX:REFERENCE_TYPE:ASSET_FILE_PATH format. * The ASSET_FILE_PATH is relative to project folder. * @param documentDir The directory of the document containing the asset. * @param assetsConfig The {@link Assets.referenceType}. */ export declare function assetIdToAssetValue(assetId: string, documentDir: string | null, assetsConfig: Assets): string; export declare function replaceAssetIdsWithAssetValues(data: any, documentDir: string, assetsConfig?: Assets): any; /** * Inverse function to assetIdToAssetValue * * @param value The stored asset value * @param documentDir The directory of the document containing the asset. * @param assetsConfig The {@link Assets.referenceType}. */ export declare function assetValueToAssetId(value: string, documentDir: string, assetsConfig: Assets): string; /** * @param assetFilePath Asset file path relative to project directory. * @param absAssetFilePath Absolute asset file path. * @param assetsConfig The {@link Assets} config. */ export declare function convertAsset({ assetFilePath, absProjectDir, assetsConfig }: { assetFilePath: string; absProjectDir: string; assetsConfig: Assets; }): Promise>; type GetModelByName = Cache['getModelByName']; export declare function convertDocument(options: { filePath: string; fullFilePath: string; data: any; getModelByName: GetModelByName; assetsConfig?: Assets; fileIdKey?: string; logger: Logger; }): Promise | null>; export declare function getFilePathFromSlugContext({ model, context, contentDir, locale, generateFallback }: { model: PageModel | DataModel; context: Record; contentDir: string; locale?: string | undefined; generateFallback?: boolean; }): Promise; export declare function generateDocumentId(): string; export declare function getFieldNameFromVirtualSlug(fieldName: string): string; export declare function isVirtualSlug(fieldName: string): boolean; export declare function createVirtualSlugFieldName(fieldName: string): string; export {}; //# sourceMappingURL=content-converter.d.ts.map