@nkardaz/typography-rules 1.0.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.
Files changed (49) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +911 -0
  3. package/dist/api/blacklist.d.ts +72 -0
  4. package/dist/api/htmlNodes.d.ts +30 -0
  5. package/dist/api/index.d.ts +6 -0
  6. package/dist/api/newRule.d.ts +51 -0
  7. package/dist/api/registerRule.d.ts +27 -0
  8. package/dist/api/rulesInit.d.ts +49 -0
  9. package/dist/functions/chemNotation.d.ts +10 -0
  10. package/dist/functions/clearSpaces.d.ts +16 -0
  11. package/dist/functions/index.cjs +514 -0
  12. package/dist/functions/index.d.ts +8 -0
  13. package/dist/functions/index.mjs +491 -0
  14. package/dist/functions/rubyText.d.ts +11 -0
  15. package/dist/functions/runt.d.ts +3 -0
  16. package/dist/functions/smartNumberGrouping.d.ts +25 -0
  17. package/dist/functions/smartQuotes.d.ts +29 -0
  18. package/dist/functions/wrapWithTag.d.ts +42 -0
  19. package/dist/glyphs/index.cjs +737 -0
  20. package/dist/glyphs/index.d.ts +53 -0
  21. package/dist/glyphs/index.mjs +714 -0
  22. package/dist/glyphs/proto.d.ts +11 -0
  23. package/dist/glyphs/registry.d.ts +728 -0
  24. package/dist/glyphs/types.d.ts +151 -0
  25. package/dist/helpers/index.cjs +268 -0
  26. package/dist/helpers/index.d.ts +133 -0
  27. package/dist/helpers/index.mjs +245 -0
  28. package/dist/helpers/types.d.ts +71 -0
  29. package/dist/index.cjs +985 -0
  30. package/dist/index.d.ts +5 -0
  31. package/dist/index.mjs +977 -0
  32. package/dist/style/index.d.ts +2 -0
  33. package/dist/style/main.css +16 -0
  34. package/dist/types.d.ts +223 -0
  35. package/dist/typography/aliases.d.ts +129 -0
  36. package/dist/typography/expressions/common.d.ts +29 -0
  37. package/dist/typography/expressions/en.d.ts +25 -0
  38. package/dist/typography/expressions/ru.d.ts +29 -0
  39. package/dist/typography/markup/common.d.ts +17 -0
  40. package/dist/typography/markup/en.d.ts +3 -0
  41. package/dist/typography/markup/index.d.ts +4 -0
  42. package/dist/typography/markup/ru.d.ts +3 -0
  43. package/dist/typography/sets/ang.d.ts +3 -0
  44. package/dist/typography/sets/common.d.ts +17 -0
  45. package/dist/typography/sets/en.d.ts +14 -0
  46. package/dist/typography/sets/index.d.ts +5 -0
  47. package/dist/typography/sets/ru.d.ts +16 -0
  48. package/dist/typography/store.d.ts +63 -0
  49. package/package.json +92 -0
@@ -0,0 +1,53 @@
1
+ import type { GlyphData, GlyphSet, GlyphSetInterface, ProtoSet } from './types';
2
+ export type * from './types';
3
+ export * from './registry';
4
+ /**
5
+ * Creates a glyph set with prototype utilities attached.
6
+ *
7
+ * This function wraps a plain glyph dictionary and attaches shared
8
+ * prototype methods (e.g. `join`) without modifying the original data.
9
+ *
10
+ * Used as the base building block for all character registries.
11
+ *
12
+ * @template T - Glyph dictionary shape
13
+ * @param data - Raw glyph key-value map
14
+ * @returns A glyph set with prototype methods enabled
15
+ */
16
+ export declare function createCharacters<T extends GlyphData>(data: T): GlyphSet<T>;
17
+ /**
18
+ * Creates a prototype set for grouped glyph access.
19
+ *
20
+ * Provides a `get` method that merges:
21
+ * - shared `common` glyphs
22
+ * - locale-specific glyph overrides
23
+ *
24
+ * This enables hierarchical glyph resolution:
25
+ * common → locale → final glyph set
26
+ *
27
+ * @template T - Structure containing optional `common` and locale groups
28
+ * @returns Prototype object with grouped access logic
29
+ */
30
+ export declare function createProtoSet<T extends {
31
+ common?: Record<string, GlyphSetInterface>;
32
+ }>(): ProtoSet<T>;
33
+ /**
34
+ * Creates a full character registry with grouped access support.
35
+ *
36
+ * Combines:
37
+ * - raw character data groups (e.g. common, en, ru, fr)
38
+ * - prototype-based access layer
39
+ * - hierarchical resolution via ProtoSet
40
+ *
41
+ * This is the main entry point for building locale-aware
42
+ * glyph/typography registries.
43
+ *
44
+ * @template T - Character set structure with optional `common` group
45
+ * and locale-specific groups
46
+ *
47
+ * @param data - Structured glyph registry
48
+ * @returns Character set with grouped access methods
49
+ */
50
+ export declare function createCharacterSet<T extends {
51
+ common?: Record<string, GlyphSetInterface>;
52
+ } & Record<string, Record<string, GlyphSetInterface>>>(data: T): T & ProtoSet<T>;
53
+ //# sourceMappingURL=index.d.ts.map