npm.io
9.0.0 • Published 8 months ago

@types/gettext-parser

Licence
MIT
Version
9.0.0
Deps
1
Size
6 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/gettext-parser

Summary

This package contains type definitions for gettext-parser (https://github.com/smhg/gettext-parser).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/gettext-parser.

index.d.ts

/// <reference types="node" />

import type { Transform, TransformOptions } from "node:stream";

export interface GetTextComment {
    translator?: string;
    reference?: string;
    extracted?: string;
    flag?: string;
    previous?: string;
}

export interface GetTextTranslation {
    msgctxt?: string;
    msgid: string;
    msgid_plural?: string;
    msgstr: string[];
    comments?: GetTextComment;
    obsolete?: boolean;
}

export interface GetTextTranslationRecord {
    [msgctxt: string]: {
        [msgId: string]: GetTextTranslation;
    };
}

export interface GetTextTranslations {
    charset: string;
    headers: { [headerName: string]: string };
    translations: GetTextTranslationRecord;
    obsolete?: GetTextTranslationRecord;
}

export interface GetTextPoParserOptions {
    defaultCharset?: string;
    validation?: boolean;
}

export interface GetTextPoCompilerOptions {
    foldLength?: number;
    escapeCharacters?: boolean;
    sort?: boolean | ((a: GetTextTranslation, b: GetTextTranslation) => number);
    eol?: string;
}

export interface PoParser {
    parse: (buffer: Buffer | string, options?: GetTextPoParserOptions) => GetTextTranslations;
    compile: (table: GetTextTranslations, options?: GetTextPoCompilerOptions) => Buffer;
    createParseStream: (options?: GetTextPoParserOptions, transformOptions?: TransformOptions) => Transform;
}

export interface MoParser {
    parse: (buffer: Buffer | string, defaultCharset?: string) => GetTextTranslations;
    compile: (table: GetTextTranslations) => Buffer;
}

export const po: PoParser;
export const mo: MoParser;

Additional Details

  • Last updated: Wed, 21 Jan 2026 0920 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Lorent Lempereur.