mochitako 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,56 @@
1
+ //#region src/types.d.ts
2
+ type Vibe = "sleepy" | "fluffy" | "happy" | "nature" | "weather" | "motion" | "sweet" | "mysterious" | "tiny" | "weird";
3
+ type Kind = "texture" | "mood" | "motion" | "sound" | "nature" | "food" | "creature" | "object" | "concept" | "trait";
4
+ /** Which slug slot a word can occupy. */
5
+ type WordRole = "prefix" | "suffix";
6
+ interface Word {
7
+ /** Lowercase ASCII romaji form, safe for slugs and identifiers. */
8
+ value: string;
9
+ /** Japanese orthography (hiragana for native words, katakana for loanwords). */
10
+ reading: string;
11
+ /** Lexical category — what the word denotes. */
12
+ kind: Kind;
13
+ /** Mood tags used by `vibe` filtering. */
14
+ vibes: Vibe[];
15
+ /** 0.0–1.0; how out-of-place the word feels. Boosted by chaos. */
16
+ weirdness?: number;
17
+ /** Slots this word may occupy when composing a slug. */
18
+ roles: WordRole[];
19
+ }
20
+ interface GenerateOptions {
21
+ /** Restrict picks to words carrying this vibe (subject to `chaos`). */
22
+ vibe?: Vibe;
23
+ /** 0.0–1.0. Probability that each pick ignores the vibe filter. Default 0. */
24
+ chaos?: number;
25
+ /** Deterministic output when set. */
26
+ seed?: string;
27
+ /** Injectable RNG. Takes precedence over `seed`. */
28
+ random?: () => number;
29
+ }
30
+ //#endregion
31
+ //#region src/dictionary.d.ts
32
+ /** The full curated vocabulary. */
33
+ export declare const words: Word[];
34
+ /** Words that can occupy the leading slot of a slug. */
35
+ export declare const prefixes: Word[];
36
+ /** Words that can occupy the trailing slot of a slug. */
37
+ export declare const suffixes: Word[];
38
+ //#endregion
39
+ //#region src/generator.d.ts
40
+ export declare function generate(options?: GenerateOptions): string;
41
+ export declare function generateMany(count: number, options?: GenerateOptions): string[];
42
+ /**
43
+ * A generator with shared options. A bound `seed`/`random` produces a
44
+ * deterministic stream: successive calls advance the same RNG sequence.
45
+ */
46
+ export declare function createGenerator(defaults?: GenerateOptions): (options?: GenerateOptions) => string;
47
+ //#endregion
48
+ //#region src/kinds.d.ts
49
+ export declare const KINDS: readonly ["texture", "mood", "motion", "sound", "nature", "food", "creature", "object", "concept", "trait"];
50
+ export declare function isKind(value: string): value is Kind;
51
+ //#endregion
52
+ //#region src/vibes.d.ts
53
+ export declare const VIBES: readonly ["sleepy", "fluffy", "happy", "nature", "weather", "motion", "sweet", "mysterious", "tiny", "weird"];
54
+ export declare function isVibe(value: string): value is Vibe;
55
+ //#endregion
56
+ export type { GenerateOptions, Kind, Vibe, Word, WordRole };