textmode.js 0.2.1-beta.4 → 0.2.1-beta.6

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 (34) hide show
  1. package/dist/textmode.esm.js +2142 -1840
  2. package/dist/textmode.esm.min.js +1854 -1551
  3. package/dist/textmode.umd.js +9 -9
  4. package/dist/textmode.umd.min.js +8 -7
  5. package/dist/types/assets/shaders-minified/frag/image-to-mrt.d.ts +14 -0
  6. package/dist/types/assets/shaders-minified/frag/present.d.ts +14 -0
  7. package/dist/types/assets/shaders-minified/index.d.ts +2 -0
  8. package/dist/types/index.d.ts +1 -0
  9. package/dist/types/rendering/index.d.ts +0 -2
  10. package/dist/types/rendering/webgl/DrawQueue.d.ts +9 -7
  11. package/dist/types/rendering/webgl/InstanceData.d.ts +15 -15
  12. package/dist/types/rendering/webgl/RenderPipeline.d.ts +1 -0
  13. package/dist/types/rendering/webgl/RenderState.d.ts +13 -19
  14. package/dist/types/rendering/webgl/Renderer.d.ts +13 -2
  15. package/dist/types/rendering/webgl/Shader.d.ts +3 -4
  16. package/dist/types/rendering/webgl/ShaderManager.d.ts +12 -11
  17. package/dist/types/rendering/webgl/geometries/BaseGeometry.d.ts +2 -1
  18. package/dist/types/rendering/webgl/types/DrawCommand.d.ts +2 -2
  19. package/dist/types/textmode/Canvas.d.ts +6 -0
  20. package/dist/types/textmode/TextmodeImage.d.ts +92 -0
  21. package/dist/types/textmode/Textmodifier.d.ts +18 -2
  22. package/dist/types/textmode/font/CharacterExtractor.d.ts +14 -14
  23. package/dist/types/textmode/font/MetricsCalculator.d.ts +1 -21
  24. package/dist/types/textmode/font/typr/Typr.d.ts +2 -0
  25. package/dist/types/textmode/font/typr/types.d.ts +6 -0
  26. package/dist/types/textmode/font/utils/index.d.ts +0 -1
  27. package/dist/types/textmode/mixins/AnimationMixin.d.ts +6 -0
  28. package/dist/types/textmode/mixins/FontMixin.d.ts +43 -3
  29. package/dist/types/textmode/mixins/KeyboardMixin.d.ts +2 -3
  30. package/dist/types/textmode/mixins/MouseMixin.d.ts +6 -6
  31. package/dist/types/textmode/mixins/RenderingMixin.d.ts +23 -5
  32. package/package.json +1 -1
  33. package/dist/types/rendering/webgl/types/ShaderTypes.d.ts +0 -35
  34. package/dist/types/textmode/font/utils/CmapParser.d.ts +0 -47
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "textmode.js",
3
- "version": "0.2.1-beta.4",
3
+ "version": "0.2.1-beta.6",
4
4
  "description": "textmode.js is a lightweight creative coding library for creating real-time ASCII art on the web.",
5
5
  "type": "module",
6
6
  "types": "./dist/types/index.d.ts",
@@ -1,35 +0,0 @@
1
- /**
2
- * Interface for shader data with minification support
3
- */
4
- export interface ShaderData {
5
- /** The shader source code (minified in production, original in development) */
6
- sourceCode: string;
7
- /** Original unminified source code (available in development builds) */
8
- originalCode?: string;
9
- /** Mapping of original uniform names to minified names and types */
10
- uniforms: Record<string, {
11
- /** Minified uniform name used in the shader */
12
- variableName: string;
13
- /** GLSL type of the uniform (vec2, sampler2D, etc.) */
14
- variableType: string;
15
- }>;
16
- /** Mapping of const variables (if any) */
17
- consts: Record<string, {
18
- /** Substitution value for the const */
19
- variableName: string;
20
- /** GLSL type of the const */
21
- variableType: string;
22
- }>;
23
- }
24
- /**
25
- * Union type for shader imports - either ShaderData or plain string (for backward compatibility)
26
- */
27
- export type ShaderSource = ShaderData | string;
28
- /**
29
- * Helper to normalize shader source to ShaderData format
30
- */
31
- export declare function normalizeShaderData(source: ShaderSource): ShaderData;
32
- /**
33
- * Extract just the source code from ShaderSource
34
- */
35
- export declare function getShaderCode(source: ShaderSource): string;
@@ -1,47 +0,0 @@
1
- import type { TyprFont } from '../typr/types.ts';
2
- import { FontTableReader } from './FontTableReader.ts';
3
- /**
4
- * Specialized utility for character mapping operations.
5
- * Provides high-level character extraction and validation functions.
6
- */
7
- export declare class CmapParser {
8
- private _tableReader;
9
- constructor(tableReader: FontTableReader);
10
- /**
11
- * Extracts all available characters from a font's cmap tables.
12
- * Returns an array of unique character strings.
13
- */
14
- $extractAllCharacters(font: TyprFont): string[];
15
- /**
16
- * Validates whether a character exists in the font.
17
- */
18
- $characterExists(font: TyprFont, character: string): boolean;
19
- /**
20
- * Validates whether all characters in a string exist in the font.
21
- */
22
- $allCharactersExist(font: TyprFont, text: string): boolean;
23
- /**
24
- * Filters out characters that don't exist in the font.
25
- */
26
- $filterExistingCharacters(font: TyprFont, characters: string[]): string[];
27
- /**
28
- * Filters out problematic characters that might cause rendering issues.
29
- */
30
- $filterProblematicCharacters(characters: string[]): string[];
31
- /**
32
- * Extracts characters from a Format 4 cmap table (Basic Multilingual Plane).
33
- */
34
- private _extractCharactersFromFormat4;
35
- /**
36
- * Extracts characters from a Format 12 cmap table (Extended Unicode ranges).
37
- */
38
- private _extractCharactersFromFormat12;
39
- /**
40
- * Calculates the glyph index for a character in a Format 4 cmap table.
41
- */
42
- private _calculateGlyphIndexFormat4;
43
- /**
44
- * Checks if a character is valid for rendering.
45
- */
46
- private _isValidCharacter;
47
- }