@xivdyetools/types 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 (115) hide show
  1. package/LICENSE +37 -0
  2. package/README.md +272 -0
  3. package/dist/api/index.d.ts +11 -0
  4. package/dist/api/index.d.ts.map +1 -0
  5. package/dist/api/index.js +9 -0
  6. package/dist/api/index.js.map +1 -0
  7. package/dist/api/moderation.d.ts +53 -0
  8. package/dist/api/moderation.d.ts.map +1 -0
  9. package/dist/api/moderation.js +9 -0
  10. package/dist/api/moderation.js.map +1 -0
  11. package/dist/api/price.d.ts +38 -0
  12. package/dist/api/price.d.ts.map +1 -0
  13. package/dist/api/price.js +9 -0
  14. package/dist/api/price.js.map +1 -0
  15. package/dist/api/response.d.ts +41 -0
  16. package/dist/api/response.d.ts.map +1 -0
  17. package/dist/api/response.js +9 -0
  18. package/dist/api/response.js.map +1 -0
  19. package/dist/auth/discord.d.ts +60 -0
  20. package/dist/auth/discord.d.ts.map +1 -0
  21. package/dist/auth/discord.js +9 -0
  22. package/dist/auth/discord.js.map +1 -0
  23. package/dist/auth/index.d.ts +13 -0
  24. package/dist/auth/index.d.ts.map +1 -0
  25. package/dist/auth/index.js +9 -0
  26. package/dist/auth/index.js.map +1 -0
  27. package/dist/auth/jwt.d.ts +68 -0
  28. package/dist/auth/jwt.d.ts.map +1 -0
  29. package/dist/auth/jwt.js +9 -0
  30. package/dist/auth/jwt.js.map +1 -0
  31. package/dist/auth/provider.d.ts +37 -0
  32. package/dist/auth/provider.d.ts.map +1 -0
  33. package/dist/auth/provider.js +9 -0
  34. package/dist/auth/provider.js.map +1 -0
  35. package/dist/auth/response.d.ts +74 -0
  36. package/dist/auth/response.d.ts.map +1 -0
  37. package/dist/auth/response.js +9 -0
  38. package/dist/auth/response.js.map +1 -0
  39. package/dist/auth/xivauth.d.ts +90 -0
  40. package/dist/auth/xivauth.d.ts.map +1 -0
  41. package/dist/auth/xivauth.js +9 -0
  42. package/dist/auth/xivauth.js.map +1 -0
  43. package/dist/color/branded.d.ts +108 -0
  44. package/dist/color/branded.d.ts.map +1 -0
  45. package/dist/color/branded.js +94 -0
  46. package/dist/color/branded.js.map +1 -0
  47. package/dist/color/colorblind.d.ts +57 -0
  48. package/dist/color/colorblind.d.ts.map +1 -0
  49. package/dist/color/colorblind.js +9 -0
  50. package/dist/color/colorblind.js.map +1 -0
  51. package/dist/color/index.d.ts +12 -0
  52. package/dist/color/index.d.ts.map +1 -0
  53. package/dist/color/index.js +9 -0
  54. package/dist/color/index.js.map +1 -0
  55. package/dist/color/rgb.d.ts +32 -0
  56. package/dist/color/rgb.d.ts.map +1 -0
  57. package/dist/color/rgb.js +9 -0
  58. package/dist/color/rgb.js.map +1 -0
  59. package/dist/dye/database.d.ts +23 -0
  60. package/dist/dye/database.d.ts.map +1 -0
  61. package/dist/dye/database.js +9 -0
  62. package/dist/dye/database.js.map +1 -0
  63. package/dist/dye/dye.d.ts +66 -0
  64. package/dist/dye/dye.d.ts.map +1 -0
  65. package/dist/dye/dye.js +9 -0
  66. package/dist/dye/dye.js.map +1 -0
  67. package/dist/dye/index.d.ts +10 -0
  68. package/dist/dye/index.d.ts.map +1 -0
  69. package/dist/dye/index.js +9 -0
  70. package/dist/dye/index.js.map +1 -0
  71. package/dist/error/app-error.d.ts +52 -0
  72. package/dist/error/app-error.d.ts.map +1 -0
  73. package/dist/error/app-error.js +56 -0
  74. package/dist/error/app-error.js.map +1 -0
  75. package/dist/error/codes.d.ts +37 -0
  76. package/dist/error/codes.d.ts.map +1 -0
  77. package/dist/error/codes.js +40 -0
  78. package/dist/error/codes.js.map +1 -0
  79. package/dist/error/index.d.ts +11 -0
  80. package/dist/error/index.d.ts.map +1 -0
  81. package/dist/error/index.js +10 -0
  82. package/dist/error/index.js.map +1 -0
  83. package/dist/index.d.ts +29 -0
  84. package/dist/index.d.ts.map +1 -0
  85. package/dist/index.js +22 -0
  86. package/dist/index.js.map +1 -0
  87. package/dist/localization/index.d.ts +78 -0
  88. package/dist/localization/index.d.ts.map +1 -0
  89. package/dist/localization/index.js +9 -0
  90. package/dist/localization/index.js.map +1 -0
  91. package/dist/preset/community.d.ts +90 -0
  92. package/dist/preset/community.d.ts.map +1 -0
  93. package/dist/preset/community.js +9 -0
  94. package/dist/preset/community.js.map +1 -0
  95. package/dist/preset/core.d.ts +87 -0
  96. package/dist/preset/core.d.ts.map +1 -0
  97. package/dist/preset/core.js +9 -0
  98. package/dist/preset/core.js.map +1 -0
  99. package/dist/preset/index.d.ts +12 -0
  100. package/dist/preset/index.d.ts.map +1 -0
  101. package/dist/preset/index.js +9 -0
  102. package/dist/preset/index.js.map +1 -0
  103. package/dist/preset/request.d.ts +43 -0
  104. package/dist/preset/request.d.ts.map +1 -0
  105. package/dist/preset/request.js +9 -0
  106. package/dist/preset/request.js.map +1 -0
  107. package/dist/preset/response.d.ts +92 -0
  108. package/dist/preset/response.d.ts.map +1 -0
  109. package/dist/preset/response.js +9 -0
  110. package/dist/preset/response.js.map +1 -0
  111. package/dist/utility/index.d.ts +71 -0
  112. package/dist/utility/index.d.ts.map +1 -0
  113. package/dist/utility/index.js +20 -0
  114. package/dist/utility/index.js.map +1 -0
  115. package/package.json +73 -0
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @xivdyetools/types - Color Types
3
+ *
4
+ * Core color representation types used throughout the xivdyetools ecosystem.
5
+ *
6
+ * @module color/rgb
7
+ */
8
+ /**
9
+ * RGB color representation
10
+ * @example { r: 255, g: 0, b: 0 } // Red
11
+ */
12
+ export interface RGB {
13
+ /** Red channel (0-255) */
14
+ r: number;
15
+ /** Green channel (0-255) */
16
+ g: number;
17
+ /** Blue channel (0-255) */
18
+ b: number;
19
+ }
20
+ /**
21
+ * HSV color representation (Hue, Saturation, Value)
22
+ * @example { h: 0, s: 100, v: 100 } // Bright red
23
+ */
24
+ export interface HSV {
25
+ /** Hue (0-360 degrees) */
26
+ h: number;
27
+ /** Saturation (0-100 percent) */
28
+ s: number;
29
+ /** Value/Brightness (0-100 percent) */
30
+ v: number;
31
+ }
32
+ //# sourceMappingURL=rgb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rgb.d.ts","sourceRoot":"","sources":["../../src/color/rgb.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,MAAM,WAAW,GAAG;IAClB,0BAA0B;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,4BAA4B;IAC5B,CAAC,EAAE,MAAM,CAAC;IACV,2BAA2B;IAC3B,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;;GAGG;AACH,MAAM,WAAW,GAAG;IAClB,0BAA0B;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,iCAAiC;IACjC,CAAC,EAAE,MAAM,CAAC;IACV,uCAAuC;IACvC,CAAC,EAAE,MAAM,CAAC;CACX"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @xivdyetools/types - Color Types
3
+ *
4
+ * Core color representation types used throughout the xivdyetools ecosystem.
5
+ *
6
+ * @module color/rgb
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=rgb.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rgb.js","sourceRoot":"","sources":["../../src/color/rgb.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @xivdyetools/types - Dye Database Types
3
+ *
4
+ * Types for dye database state and operations.
5
+ *
6
+ * @module dye/database
7
+ */
8
+ import type { Dye } from './dye.js';
9
+ /**
10
+ * Dye database state
11
+ *
12
+ * Represents the current state of the loaded dye database,
13
+ * including all dyes and metadata about the load state.
14
+ */
15
+ export interface DyeDatabase {
16
+ /** Array of all loaded dyes */
17
+ dyes: Dye[];
18
+ /** Timestamp when dyes were last loaded (ms since epoch) */
19
+ lastLoaded: number;
20
+ /** True if the database has been successfully loaded */
21
+ isLoaded: boolean;
22
+ }
23
+ //# sourceMappingURL=database.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/dye/database.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,+BAA+B;IAC/B,IAAI,EAAE,GAAG,EAAE,CAAC;IAEZ,4DAA4D;IAC5D,UAAU,EAAE,MAAM,CAAC;IAEnB,wDAAwD;IACxD,QAAQ,EAAE,OAAO,CAAC;CACnB"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @xivdyetools/types - Dye Database Types
3
+ *
4
+ * Types for dye database state and operations.
5
+ *
6
+ * @module dye/database
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=database.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"database.js","sourceRoot":"","sources":["../../src/dye/database.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * @xivdyetools/types - Dye Types
3
+ *
4
+ * FFXIV dye object definitions with color and metadata.
5
+ *
6
+ * @module dye/dye
7
+ */
8
+ import type { RGB, HSV } from '../color/rgb.js';
9
+ /**
10
+ * FFXIV dye object with color and metadata
11
+ *
12
+ * Represents a single dye item from FFXIV, including its color values,
13
+ * acquisition information, and type flags for filtering.
14
+ */
15
+ export interface Dye {
16
+ /** FFXIV item ID */
17
+ itemID: number;
18
+ /** Unique dye ID (1-200) */
19
+ id: number;
20
+ /** English dye name */
21
+ name: string;
22
+ /** Hex color value (#RRGGBB format) */
23
+ hex: string;
24
+ /** RGB color representation */
25
+ rgb: RGB;
26
+ /** HSV color representation */
27
+ hsv: HSV;
28
+ /** Category name (e.g., 'Neutral', 'Red', 'Blue') */
29
+ category: string;
30
+ /** How to obtain the dye (e.g., 'NPC', 'Crafted', 'Achievement') */
31
+ acquisition: string;
32
+ /** Gil cost (0 if not purchasable) */
33
+ cost: number;
34
+ /**
35
+ * Type flags for locale-independent filtering
36
+ * Added in xivdyetools-core v1.3.0
37
+ */
38
+ /** True if this is a metallic dye */
39
+ isMetallic: boolean;
40
+ /** True if this is a pastel dye */
41
+ isPastel: boolean;
42
+ /** True if this is a dark-toned dye */
43
+ isDark: boolean;
44
+ /** True if this is a cosmic (starlight/glittery) dye */
45
+ isCosmic: boolean;
46
+ }
47
+ /**
48
+ * Localized dye with optional translated name
49
+ *
50
+ * Extends Dye with a localized name for display in non-English locales.
51
+ */
52
+ export interface LocalizedDye extends Dye {
53
+ /** Translated dye name (if available) */
54
+ localizedName?: string;
55
+ }
56
+ /**
57
+ * Dye with calculated color distance
58
+ *
59
+ * Used when searching for dyes by color similarity.
60
+ * The distance represents how close this dye is to a target color.
61
+ */
62
+ export interface DyeWithDistance extends Dye {
63
+ /** Color distance from target (lower = more similar) */
64
+ distance: number;
65
+ }
66
+ //# sourceMappingURL=dye.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dye.d.ts","sourceRoot":"","sources":["../../src/dye/dye.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,WAAW,GAAG;IAClB,oBAAoB;IACpB,MAAM,EAAE,MAAM,CAAC;IAEf,4BAA4B;IAC5B,EAAE,EAAE,MAAM,CAAC;IAEX,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAC;IAEb,uCAAuC;IACvC,GAAG,EAAE,MAAM,CAAC;IAEZ,+BAA+B;IAC/B,GAAG,EAAE,GAAG,CAAC;IAET,+BAA+B;IAC/B,GAAG,EAAE,GAAG,CAAC;IAET,qDAAqD;IACrD,QAAQ,EAAE,MAAM,CAAC;IAEjB,oEAAoE;IACpE,WAAW,EAAE,MAAM,CAAC;IAEpB,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IAEH,qCAAqC;IACrC,UAAU,EAAE,OAAO,CAAC;IAEpB,mCAAmC;IACnC,QAAQ,EAAE,OAAO,CAAC;IAElB,uCAAuC;IACvC,MAAM,EAAE,OAAO,CAAC;IAEhB,wDAAwD;IACxD,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAa,SAAQ,GAAG;IACvC,yCAAyC;IACzC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAgB,SAAQ,GAAG;IAC1C,wDAAwD;IACxD,QAAQ,EAAE,MAAM,CAAC;CAClB"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @xivdyetools/types - Dye Types
3
+ *
4
+ * FFXIV dye object definitions with color and metadata.
5
+ *
6
+ * @module dye/dye
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=dye.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dye.js","sourceRoot":"","sources":["../../src/dye/dye.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @xivdyetools/types - Dye Module
3
+ *
4
+ * FFXIV dye type definitions.
5
+ *
6
+ * @module dye
7
+ */
8
+ export type { Dye, LocalizedDye, DyeWithDistance } from './dye.js';
9
+ export type { DyeDatabase } from './database.js';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dye/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,EAAE,GAAG,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AACnE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @xivdyetools/types - Dye Module
3
+ *
4
+ * FFXIV dye type definitions.
5
+ *
6
+ * @module dye
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dye/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * @xivdyetools/types - AppError Class
3
+ *
4
+ * Custom error class with severity and code.
5
+ *
6
+ * @module error/app-error
7
+ */
8
+ /**
9
+ * Severity levels for application errors
10
+ *
11
+ * - `critical`: System-breaking errors requiring immediate attention
12
+ * - `error`: Standard errors that prevent operation completion
13
+ * - `warning`: Non-fatal issues that should be addressed
14
+ * - `info`: Informational messages (not really errors)
15
+ */
16
+ export type ErrorSeverity = 'critical' | 'error' | 'warning' | 'info';
17
+ /**
18
+ * Custom error class with severity and code
19
+ *
20
+ * Provides structured error information for consistent error handling
21
+ * across the xivdyetools ecosystem.
22
+ *
23
+ * @example
24
+ * ```typescript
25
+ * import { AppError, ErrorCode } from '@xivdyetools/types/error';
26
+ *
27
+ * throw new AppError(
28
+ * ErrorCode.DYE_NOT_FOUND,
29
+ * 'Dye with ID 999 not found',
30
+ * 'error'
31
+ * );
32
+ * ```
33
+ */
34
+ export declare class AppError extends Error {
35
+ code: string;
36
+ severity: ErrorSeverity;
37
+ /**
38
+ * Create a new AppError
39
+ *
40
+ * @param code - Error code for programmatic handling
41
+ * @param message - Human-readable error message
42
+ * @param severity - Error severity level (default: 'error')
43
+ */
44
+ constructor(code: string, message: string, severity?: ErrorSeverity);
45
+ /**
46
+ * Convert error to JSON-serializable object
47
+ *
48
+ * Useful for logging and API responses.
49
+ */
50
+ toJSON(): Record<string, unknown>;
51
+ }
52
+ //# sourceMappingURL=app-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-error.d.ts","sourceRoot":"","sources":["../../src/error/app-error.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAEtE;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,QAAS,SAAQ,KAAK;IASxB,IAAI,EAAE,MAAM;IAEZ,QAAQ,EAAE,aAAa;IAVhC;;;;;;OAMG;gBAEM,IAAI,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACR,QAAQ,GAAE,aAAuB;IAQ1C;;;;OAIG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CASlC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * @xivdyetools/types - AppError Class
3
+ *
4
+ * Custom error class with severity and code.
5
+ *
6
+ * @module error/app-error
7
+ */
8
+ /**
9
+ * Custom error class with severity and code
10
+ *
11
+ * Provides structured error information for consistent error handling
12
+ * across the xivdyetools ecosystem.
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * import { AppError, ErrorCode } from '@xivdyetools/types/error';
17
+ *
18
+ * throw new AppError(
19
+ * ErrorCode.DYE_NOT_FOUND,
20
+ * 'Dye with ID 999 not found',
21
+ * 'error'
22
+ * );
23
+ * ```
24
+ */
25
+ export class AppError extends Error {
26
+ /**
27
+ * Create a new AppError
28
+ *
29
+ * @param code - Error code for programmatic handling
30
+ * @param message - Human-readable error message
31
+ * @param severity - Error severity level (default: 'error')
32
+ */
33
+ constructor(code, message, severity = 'error') {
34
+ super(message);
35
+ this.code = code;
36
+ this.severity = severity;
37
+ this.name = 'AppError';
38
+ // Maintain proper prototype chain
39
+ Object.setPrototypeOf(this, AppError.prototype);
40
+ }
41
+ /**
42
+ * Convert error to JSON-serializable object
43
+ *
44
+ * Useful for logging and API responses.
45
+ */
46
+ toJSON() {
47
+ return {
48
+ name: this.name,
49
+ code: this.code,
50
+ message: this.message,
51
+ severity: this.severity,
52
+ stack: this.stack,
53
+ };
54
+ }
55
+ }
56
+ //# sourceMappingURL=app-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-error.js","sourceRoot":"","sources":["../../src/error/app-error.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAYH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,QAAS,SAAQ,KAAK;IACjC;;;;;;OAMG;IACH,YACS,IAAY,EACnB,OAAe,EACR,WAA0B,OAAO;QAExC,KAAK,CAAC,OAAO,CAAC,CAAC;QAJR,SAAI,GAAJ,IAAI,CAAQ;QAEZ,aAAQ,GAAR,QAAQ,CAAyB;QAGxC,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;QACvB,kCAAkC;QAClC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;IAClD,CAAC;IAED;;;;OAIG;IACH,MAAM;QACJ,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @xivdyetools/types - Error Codes
3
+ *
4
+ * Unified error codes from all xivdyetools projects.
5
+ *
6
+ * @module error/codes
7
+ */
8
+ /**
9
+ * Error codes for different failure scenarios
10
+ *
11
+ * Consolidated from xivdyetools-core and xivdyetools-web-app.
12
+ */
13
+ export declare enum ErrorCode {
14
+ /** Invalid hex color format provided */
15
+ INVALID_HEX_COLOR = "INVALID_HEX_COLOR",
16
+ /** RGB value out of valid range (0-255) */
17
+ INVALID_RGB_VALUE = "INVALID_RGB_VALUE",
18
+ /** Requested dye ID not found in database */
19
+ DYE_NOT_FOUND = "DYE_NOT_FOUND",
20
+ /** Failed to load dye database */
21
+ DATABASE_LOAD_FAILED = "DATABASE_LOAD_FAILED",
22
+ /** Invalid input provided to function */
23
+ INVALID_INPUT = "INVALID_INPUT",
24
+ /** External API call failed */
25
+ API_CALL_FAILED = "API_CALL_FAILED",
26
+ /** Failed to load locale data */
27
+ LOCALE_LOAD_FAILED = "LOCALE_LOAD_FAILED",
28
+ /** Unknown or unexpected error */
29
+ UNKNOWN_ERROR = "UNKNOWN_ERROR",
30
+ /** Browser storage quota exceeded */
31
+ STORAGE_QUOTA_EXCEEDED = "STORAGE_QUOTA_EXCEEDED",
32
+ /** Invalid theme name provided */
33
+ INVALID_THEME = "INVALID_THEME",
34
+ /** Failed to load image file */
35
+ IMAGE_LOAD_FAILED = "IMAGE_LOAD_FAILED"
36
+ }
37
+ //# sourceMappingURL=codes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codes.d.ts","sourceRoot":"","sources":["../../src/error/codes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,oBAAY,SAAS;IAEnB,wCAAwC;IACxC,iBAAiB,sBAAsB;IAEvC,2CAA2C;IAC3C,iBAAiB,sBAAsB;IAEvC,6CAA6C;IAC7C,aAAa,kBAAkB;IAE/B,kCAAkC;IAClC,oBAAoB,yBAAyB;IAE7C,yCAAyC;IACzC,aAAa,kBAAkB;IAE/B,+BAA+B;IAC/B,eAAe,oBAAoB;IAEnC,iCAAiC;IACjC,kBAAkB,uBAAuB;IAEzC,kCAAkC;IAClC,aAAa,kBAAkB;IAG/B,qCAAqC;IACrC,sBAAsB,2BAA2B;IAEjD,kCAAkC;IAClC,aAAa,kBAAkB;IAE/B,gCAAgC;IAChC,iBAAiB,sBAAsB;CACxC"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @xivdyetools/types - Error Codes
3
+ *
4
+ * Unified error codes from all xivdyetools projects.
5
+ *
6
+ * @module error/codes
7
+ */
8
+ /**
9
+ * Error codes for different failure scenarios
10
+ *
11
+ * Consolidated from xivdyetools-core and xivdyetools-web-app.
12
+ */
13
+ export var ErrorCode;
14
+ (function (ErrorCode) {
15
+ // Core errors (from xivdyetools-core)
16
+ /** Invalid hex color format provided */
17
+ ErrorCode["INVALID_HEX_COLOR"] = "INVALID_HEX_COLOR";
18
+ /** RGB value out of valid range (0-255) */
19
+ ErrorCode["INVALID_RGB_VALUE"] = "INVALID_RGB_VALUE";
20
+ /** Requested dye ID not found in database */
21
+ ErrorCode["DYE_NOT_FOUND"] = "DYE_NOT_FOUND";
22
+ /** Failed to load dye database */
23
+ ErrorCode["DATABASE_LOAD_FAILED"] = "DATABASE_LOAD_FAILED";
24
+ /** Invalid input provided to function */
25
+ ErrorCode["INVALID_INPUT"] = "INVALID_INPUT";
26
+ /** External API call failed */
27
+ ErrorCode["API_CALL_FAILED"] = "API_CALL_FAILED";
28
+ /** Failed to load locale data */
29
+ ErrorCode["LOCALE_LOAD_FAILED"] = "LOCALE_LOAD_FAILED";
30
+ /** Unknown or unexpected error */
31
+ ErrorCode["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
32
+ // Web-specific errors (from xivdyetools-web-app)
33
+ /** Browser storage quota exceeded */
34
+ ErrorCode["STORAGE_QUOTA_EXCEEDED"] = "STORAGE_QUOTA_EXCEEDED";
35
+ /** Invalid theme name provided */
36
+ ErrorCode["INVALID_THEME"] = "INVALID_THEME";
37
+ /** Failed to load image file */
38
+ ErrorCode["IMAGE_LOAD_FAILED"] = "IMAGE_LOAD_FAILED";
39
+ })(ErrorCode || (ErrorCode = {}));
40
+ //# sourceMappingURL=codes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codes.js","sourceRoot":"","sources":["../../src/error/codes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,MAAM,CAAN,IAAY,SAmCX;AAnCD,WAAY,SAAS;IACnB,sCAAsC;IACtC,wCAAwC;IACxC,oDAAuC,CAAA;IAEvC,2CAA2C;IAC3C,oDAAuC,CAAA;IAEvC,6CAA6C;IAC7C,4CAA+B,CAAA;IAE/B,kCAAkC;IAClC,0DAA6C,CAAA;IAE7C,yCAAyC;IACzC,4CAA+B,CAAA;IAE/B,+BAA+B;IAC/B,gDAAmC,CAAA;IAEnC,iCAAiC;IACjC,sDAAyC,CAAA;IAEzC,kCAAkC;IAClC,4CAA+B,CAAA;IAE/B,iDAAiD;IACjD,qCAAqC;IACrC,8DAAiD,CAAA;IAEjD,kCAAkC;IAClC,4CAA+B,CAAA;IAE/B,gCAAgC;IAChC,oDAAuC,CAAA;AACzC,CAAC,EAnCW,SAAS,KAAT,SAAS,QAmCpB"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @xivdyetools/types - Error Module
3
+ *
4
+ * Error handling types and utilities.
5
+ *
6
+ * @module error
7
+ */
8
+ export { ErrorCode } from './codes.js';
9
+ export { AppError } from './app-error.js';
10
+ export type { ErrorSeverity } from './app-error.js';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/error/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @xivdyetools/types - Error Module
3
+ *
4
+ * Error handling types and utilities.
5
+ *
6
+ * @module error
7
+ */
8
+ export { ErrorCode } from './codes.js';
9
+ export { AppError } from './app-error.js';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/error/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @xivdyetools/types
3
+ *
4
+ * Shared TypeScript type definitions for the xivdyetools ecosystem.
5
+ *
6
+ * This package consolidates types from:
7
+ * - xivdyetools-core
8
+ * - xivdyetools-web-app
9
+ * - xivdyetools-discord-worker
10
+ * - xivdyetools-presets-api
11
+ * - xivdyetools-oauth
12
+ *
13
+ * @packageDocumentation
14
+ */
15
+ export type { RGB, HSV } from './color/index.js';
16
+ export type { HexColor, DyeId, Hue, Saturation } from './color/index.js';
17
+ export { createHexColor, createDyeId, createHue, createSaturation } from './color/index.js';
18
+ export type { VisionType, Matrix3x3, ColorblindMatrices } from './color/index.js';
19
+ export type { Dye, LocalizedDye, DyeWithDistance, DyeDatabase } from './dye/index.js';
20
+ export type { PresetCategory, PresetStatus, PresetSortOption, CategoryMeta, PresetPalette, ResolvedPreset, PresetData, PresetPreviousValues, CommunityPreset, PresetSubmission, AuthenticatedPresetSubmission, PresetFilters, PresetEditRequest, PresetListResponse, PresetSubmitResponse, PresetEditResponse, VoteResponse, ModerationResponse, CategoryListResponse, } from './preset/index.js';
21
+ export type { AuthProvider, AuthSource, AuthContext, PrimaryCharacter, JWTPayload, OAuthState, DiscordTokenResponse, DiscordUser, XIVAuthTokenResponse, XIVAuthCharacter, XIVAuthCharacterRegistration, XIVAuthSocialIdentity, XIVAuthUser, AuthUser, AuthResponse, RefreshResponse, UserInfoResponse, } from './auth/index.js';
22
+ export type { APIResponse, CachedData, ModerationResult, ModerationLogEntry, ModerationStats, PriceData, RateLimitResult, } from './api/index.js';
23
+ export type { LocaleCode, TranslationKey, HarmonyTypeKey, JobKey, GrandCompanyKey, LocaleData, LocalePreference, } from './localization/index.js';
24
+ export { ErrorCode } from './error/index.js';
25
+ export { AppError } from './error/index.js';
26
+ export type { ErrorSeverity } from './error/index.js';
27
+ export type { Result, AsyncResult, Nullable, Optional } from './utility/index.js';
28
+ export { isOk, isErr } from './utility/index.js';
29
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,YAAY,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACjD,YAAY,EAAE,QA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AAE,MAAM,kBAAkB,CAAC;AAKtD,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @xivdyetools/types
3
+ *
4
+ * Shared TypeScript type definitions for the xivdyetools ecosystem.
5
+ *
6
+ * This package consolidates types from:
7
+ * - xivdyetools-core
8
+ * - xivdyetools-web-app
9
+ * - xivdyetools-discord-worker
10
+ * - xivdyetools-presets-api
11
+ * - xivdyetools-oauth
12
+ *
13
+ * @packageDocumentation
14
+ */
15
+ export { createHexColor, createDyeId, createHue, createSaturation } from './color/index.js';
16
+ // ============================================================================
17
+ // Error Types
18
+ // ============================================================================
19
+ export { ErrorCode } from './error/index.js';
20
+ export { AppError } from './error/index.js';
21
+ export { isOk, isErr } from './utility/index.js';
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAkF5F,+EAA+E;AAC/E,cAAc;AACd,+EAA+E;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAO5C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * @xivdyetools/types - Localization Module
3
+ *
4
+ * Localization and translation types.
5
+ *
6
+ * @module localization
7
+ */
8
+ import type { VisionType } from '../color/colorblind.js';
9
+ /**
10
+ * Supported locale codes
11
+ */
12
+ export type LocaleCode = 'en' | 'ja' | 'de' | 'fr' | 'ko' | 'zh';
13
+ /**
14
+ * Translation keys for UI labels
15
+ */
16
+ export type TranslationKey = 'dye' | 'dark' | 'metallic' | 'pastel' | 'cosmic' | 'cosmicExploration' | 'cosmicFortunes';
17
+ /**
18
+ * Harmony type keys for localization
19
+ */
20
+ export type HarmonyTypeKey = 'complementary' | 'analogous' | 'triadic' | 'splitComplementary' | 'tetradic' | 'square' | 'monochromatic' | 'compound' | 'shades';
21
+ /**
22
+ * FFXIV Job keys for localization
23
+ */
24
+ export type JobKey = 'paladin' | 'warrior' | 'darkKnight' | 'gunbreaker' | 'whiteMage' | 'scholar' | 'astrologian' | 'sage' | 'monk' | 'dragoon' | 'ninja' | 'samurai' | 'reaper' | 'viper' | 'bard' | 'machinist' | 'dancer' | 'blackMage' | 'summoner' | 'redMage' | 'pictomancer' | 'blueMage';
25
+ /**
26
+ * FFXIV Grand Company keys for localization
27
+ */
28
+ export type GrandCompanyKey = 'maelstrom' | 'twinAdder' | 'immortalFlames';
29
+ /**
30
+ * Locale data structure matching generated JSON files
31
+ */
32
+ export interface LocaleData {
33
+ /** Locale code */
34
+ locale: LocaleCode;
35
+ /** Metadata about the locale file */
36
+ meta: {
37
+ /** Schema version */
38
+ version: string;
39
+ /** Generation timestamp */
40
+ generated: string;
41
+ /** Number of dyes included */
42
+ dyeCount: number;
43
+ };
44
+ /** UI label translations */
45
+ labels: Record<TranslationKey, string>;
46
+ /** Dye name translations (keyed by dye ID) */
47
+ dyeNames: Record<string, string>;
48
+ /** Category name translations */
49
+ categories: Record<string, string>;
50
+ /** Acquisition method translations */
51
+ acquisitions: Record<string, string>;
52
+ /** IDs of metallic dyes */
53
+ metallicDyeIds: number[];
54
+ /** Harmony type translations */
55
+ harmonyTypes: Record<HarmonyTypeKey, string>;
56
+ /** Vision type translations */
57
+ visionTypes: Record<VisionType, string>;
58
+ /** Job name translations */
59
+ jobNames: Record<JobKey, string>;
60
+ /** Grand Company name translations */
61
+ grandCompanyNames: Record<GrandCompanyKey, string>;
62
+ }
63
+ /**
64
+ * Locale preference for resolving user's preferred language
65
+ *
66
+ * Resolution order: explicit > guild > system > fallback
67
+ */
68
+ export interface LocalePreference {
69
+ /** Explicit user selection (highest priority) */
70
+ explicit?: LocaleCode;
71
+ /** Guild/server preference (Discord only) */
72
+ guild?: string;
73
+ /** User's system language */
74
+ system?: string;
75
+ /** Fallback locale (always 'en') */
76
+ fallback: LocaleCode;
77
+ }
78
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/localization/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEjE;;GAEG;AACH,MAAM,MAAM,cAAc,GACtB,KAAK,GACL,MAAM,GACN,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,mBAAmB,GACnB,gBAAgB,CAAC;AAErB;;GAEG;AACH,MAAM,MAAM,cAAc,GACtB,eAAe,GACf,WAAW,GACX,SAAS,GACT,oBAAoB,GACpB,UAAU,GACV,QAAQ,GACR,eAAe,GACf,UAAU,GACV,QAAQ,CAAC;AAEb;;GAEG;AACH,MAAM,MAAM,MAAM,GACd,SAAS,GACT,SAAS,GACT,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,SAAS,GACT,aAAa,GACb,MAAM,GACN,MAAM,GACN,SAAS,GACT,OAAO,GACP,SAAS,GACT,QAAQ,GACR,OAAO,GACP,MAAM,GACN,WAAW,GACX,QAAQ,GACR,WAAW,GACX,UAAU,GACV,SAAS,GACT,aAAa,GACb,UAAU,CAAC;AAEf;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,WAAW,GAAG,gBAAgB,CAAC;AAE3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ization Module
3
+ *
4
+ * Localization and translation types.
5
+ *
6
+ * @module localization
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/localization/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}