Files
klz-cables.com/.pnpm-store/v10/files/3a/d631a180182108517a18a95eec76edd3be421777f641cc75327c5ae02be584a7122713023829175b91b7658d72c9668bfde069c7c210d2355b28176a10acbe
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

34 lines
1.3 KiB
Plaintext

import type { ExtractorMessage, Locale } from '../types.js';
type ExtractorCodecContext = {
locale: Locale;
};
export default interface ExtractorCodec {
/**
* Decode the content of a file into a list of extracted messages. This is used
* to load existing messages from disk.
*/
decode(content: string, context: ExtractorCodecContext): Array<ExtractorMessage>;
/**
* Encode a list of extracted messages into a string that can be written as
* file content to the disk.
*/
encode(messages: Array<ExtractorMessage>, context: ExtractorCodecContext & {
sourceMessagesById: Map</* ID */ string, ExtractorMessage>;
}): string;
/**
* Turns the content of a file into a JSON string that represents extracted
* messages. The returned value will be passed to `JSON.parse`.
*
* @return E.g. `[{"id":"+YJVTi","message":"Hey!"}]`
*
* This is used when loading messages into your application, typically via a
* dynamic import (e.g. `import(`../messages/${locale}.json`)`).
*
* If your file content is JSON and should be used as-is, you can set this to
* an identity function.
*/
toJSONString(content: string, context: ExtractorCodecContext): string;
}
export declare function defineCodec(factory: () => ExtractorCodec): () => ExtractorCodec;
export {};