import { GardState } from 'wordgard/state';

/**
A phrase set defines a number of text phrases to display in the
user interface, and makes translation of those phrases possible.
It associates each phrase with a tag. The type parameter to this
class is the set of tag names it defines.
*/
declare class PhraseSet<Tags extends string> {
    readonly phrases: {
        [tag in Tags]: string;
    };
    private constructor();
    /**
    Look up a translation for phrase with the given tag.
    
    If additional arguments are passed, they will be inserted in
    place of markers like `$1` (for the first value) and `$2`, etc.
    A single `$` is equivalent to `$1`, and `$$` will produce a
    literal dollar sign.
    */
    get<Tag extends Tags>(state: GardState, tag: Tag, ...insert: any[]): string;
    /**
    Create a reference to a phrase. Returns a function that can be
    called with an editor state to get the phrase text.
    */
    ref<Tag extends Tags>(tag: Tag): PhraseSet.Ref;
    /**
    Create a translation of this set. Adding the resulting extension
    to an editor configuration will cause access to the phrases in
    the set to return the translated text.
    */
    translate(phrases: {
        [tag in Tags]: string;
    }): GardState.Extension;
    /**
    Create a partial translation of this set. The only difference
    with {@link PhraseSet.translate} is that this method won't cause
    a type error when you omit some tags.
    */
    translatePartial(phrases: {
        [tag in Tags]?: string;
    }): GardState.Extension;
    /**
    Define a new phrase set. Takes an object as argument that
    defines the default (usually English) text for all the tags in
    the set.
    */
    static define<Tags extends string>(phrases: {
        [tag in Tags]: string;
    }): PhraseSet<Tags>;
    /**
    Check whether the phrase set configuration changed between the
    two given states. Can be useful to check whether some part of
    the interface needs to be redrawn.
    */
    static didChange(a: GardState, b: GardState): boolean;
}
declare namespace PhraseSet {
    /**
    A reference to a specific phrase. Call it with a state and,
    optionally, the inserted values you'd pass to {@link
    PhraseSet.get `PhraseSet.get`} to get a phrase.
    */
    type Ref = (state: GardState, ...insert: any[]) => string;
    /**
    Get the set of tags defined by a given phrase set, as a type.
    */
    type Tag<Set extends PhraseSet<any>> = Set extends PhraseSet<infer T> ? T : never;
}

/**
The phrase set for the core package and basic menu items.
*/
declare const phrases: PhraseSet<"dialog_close" | "overflow_more" | "block_style" | "toggle_strong" | "toggle_em" | "toggle_code" | "toggle_underline" | "toggle_strikethrough" | "toggle_super" | "toggle_sub" | "link_target" | "create_link" | "text_color" | "background_color" | "undo" | "redo" | "paragraph" | "code_block" | "heading_1" | "heading_2" | "heading_3" | "toggle_bullet_list" | "toggle_ordered_list" | "toggle_quote" | "alignment" | "align_start" | "align_end" | "align_center" | "text_dir" | "text_dir_ltr" | "text_dir_rtl" | "text_dir_auto">;
/**
Phrases used by the {@link schema.image.button image dialog}.
*/
declare const imagePhrases: PhraseSet<"inline" | "auto" | "width" | "cancel" | "figure" | "update" | "insert" | "insert_image" | "update_image" | "figure_center" | "figure_end" | "captioned" | "image_style" | "uploading" | "upload_failed" | "upload_image" | "image_source" | "alt_text" | "describe_image">;
/**
Phrases (mostly color names) used by the {@link schema.ColorPicker
color picker}.
*/
declare const colorNames: PhraseSet<"none" | "lighter" | "black" | "white" | "grey" | "red_berry" | "red" | "orange" | "yellow" | "green" | "cyan" | "cornflower" | "blue" | "purple" | "magenta" | "dark" | "darker" | "darkest" | "light" | "lightest">;
/**
Phrases used by [wordgard/table](#table).
*/
declare const tablePhrases: PhraseSet<"dimensions_title" | "dimensions_live" | "insert_table" | "modify_table" | "toggle_header" | "add_row_above" | "add_row_below" | "delete_row" | "add_col_before" | "add_col_after" | "delete_col" | "merge_cells" | "split_cell">;

export { PhraseSet, colorNames, imagePhrases, phrases, tablePhrases };
