social-kit / types / text.d.ts
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/**
 * GENERATED by scripts/gen-text-dts.mjs from src/ardegazu/social/text.cljs —
 * do not edit by hand. `npm run check` fails when this file drifts from the
 * implementation's EN table.
 */

/** Every chip/toast string the kit renders — the i18n contract app catalogs
 *  mirror as `Record<SocialTextKey, …>` so tsc catches drift after a bump. */
export type SocialTextKey =
  | "social.chip.invite"
  | "social.chip.invite.title"
  | "social.chip.join"
  | "social.chip.join.title"
  | "social.home.title"
  | "social.invite.join"
  | "social.paste.chip"
  | "social.paste.chip.title"
  | "social.paste.error"
  | "social.paste.join"
  | "social.paste.placeholder"
  | "social.sheet.drop"
  | "social.sheet.here-now"
  | "social.sheet.hub"
  | "social.sheet.invite"
  | "social.sheet.nofriends"
  | "social.sheet.parked"
  | "social.sheet.sent"
  | "social.sheet.share"
  | "social.sheet.title"
  | "social.toast.come-play"
  | "social.toast.come-to"
  | "social.toast.copied"
  | "social.toast.copy"
  | "social.toast.invites-you"
  | "social.toast.join"
  | "social.toast.not-now"
  | "social.toast.share";

export type SocialVars = Record<string, string | number>;

/** An app-supplied translator. Returning the key itself (or nothing) means
 *  "not translated" and falls back to the built-in EN table. */
export type SocialT = (key: string, vars?: SocialVars) => string | undefined;

/** The built-in EN text — also what senders put on the wire as the legacy
 *  invite label, which must stay English-stable for old receivers. */
export declare function enText(key: SocialTextKey, vars?: SocialVars): string;

/** Wrap an optional app translator with the EN fallback. */
export declare function mkT(userT?: SocialT): (key: SocialTextKey, vars?: SocialVars) => string;

static mirror of HEAD · about · clone: git clone https://git.ardegazu.ro/social-kit.git