@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,90 @@
1
+ /**
2
+ * @xivdyetools/types - Community Preset Types
3
+ *
4
+ * Types for community-submitted presets with moderation data.
5
+ *
6
+ * @module preset/community
7
+ */
8
+ import type { PresetCategory, PresetStatus } from './core.js';
9
+ /**
10
+ * Stores pre-edit values for moderation revert capability
11
+ *
12
+ * When a preset is edited, the previous values are stored here
13
+ * so moderators can revert if needed.
14
+ */
15
+ export interface PresetPreviousValues {
16
+ /** Previous preset name */
17
+ name: string;
18
+ /** Previous description */
19
+ description: string;
20
+ /** Previous tags array */
21
+ tags: string[];
22
+ /** Previous dye IDs array */
23
+ dyes: number[];
24
+ }
25
+ /**
26
+ * Community preset with voting and moderation data
27
+ *
28
+ * Extended version of PresetPalette for API responses, including
29
+ * author information, vote counts, and moderation status.
30
+ */
31
+ export interface CommunityPreset {
32
+ /** Unique identifier (UUID) */
33
+ id: string;
34
+ /** Display name */
35
+ name: string;
36
+ /** Brief description */
37
+ description: string;
38
+ /** Category this preset belongs to */
39
+ category_id: PresetCategory;
40
+ /** Array of dye item IDs (2-5 dyes) */
41
+ dyes: number[];
42
+ /** Searchable tags */
43
+ tags: string[];
44
+ /** Discord user ID of author (null for curated presets) */
45
+ author_discord_id: string | null;
46
+ /** Display name of author at submission time */
47
+ author_name: string | null;
48
+ /** Number of votes */
49
+ vote_count: number;
50
+ /** Moderation status */
51
+ status: PresetStatus;
52
+ /** True for official/curated presets */
53
+ is_curated: boolean;
54
+ /** ISO 8601 creation timestamp */
55
+ created_at: string;
56
+ /** ISO 8601 last update timestamp */
57
+ updated_at: string;
58
+ /**
59
+ * Sorted dye IDs signature for duplicate detection
60
+ * Format: comma-separated sorted dye IDs (e.g., "1,5,12,45")
61
+ */
62
+ dye_signature?: string;
63
+ /** Previous values for revert capability (if edited) */
64
+ previous_values?: PresetPreviousValues | null;
65
+ }
66
+ /**
67
+ * Data required to submit a new preset
68
+ */
69
+ export interface PresetSubmission {
70
+ /** Name (2-50 characters) */
71
+ name: string;
72
+ /** Description (10-200 characters) */
73
+ description: string;
74
+ /** Category */
75
+ category_id: PresetCategory;
76
+ /** Array of dye item IDs (2-5 dyes) */
77
+ dyes: number[];
78
+ /** Tags (0-10 tags, max 30 chars each) */
79
+ tags: string[];
80
+ }
81
+ /**
82
+ * Extended submission with author info (for authenticated submissions)
83
+ */
84
+ export interface AuthenticatedPresetSubmission extends PresetSubmission {
85
+ /** Submitter's Discord user ID */
86
+ author_discord_id: string;
87
+ /** Submitter's display name */
88
+ author_name: string;
89
+ }
90
+ //# sourceMappingURL=community.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"community.d.ts","sourceRoot":"","sources":["../../src/preset/community.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE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,EAAE,cAAc,CAAC;IAE5B,uCAAuC;IACvC,IAAI,EAAE,MAAM,EAAE,CAAC;IAEf,0CAA0C;IAC1C,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,6BAA8B,SAAQ,gBAAgB;IACrE,kCAAkC;IAClC,iBAAiB,EAAE,MAAM,CAAC;IAE1B,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @xivdyetools/types - Community Preset Types
3
+ *
4
+ * Types for community-submitted presets with moderation data.
5
+ *
6
+ * @module preset/community
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=community.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"community.js","sourceRoot":"","sources":["../../src/preset/community.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * @xivdyetools/types - Preset Core Types
3
+ *
4
+ * Core preset palette type definitions.
5
+ *
6
+ * @module preset/core
7
+ */
8
+ import type { Dye } from '../dye/dye.js';
9
+ /**
10
+ * Preset palette category identifiers
11
+ */
12
+ export type PresetCategory = 'jobs' | 'grand-companies' | 'seasons' | 'events' | 'aesthetics' | 'community';
13
+ /**
14
+ * Status of a preset submission in the moderation workflow
15
+ */
16
+ export type PresetStatus = 'pending' | 'approved' | 'rejected' | 'flagged';
17
+ /**
18
+ * Sort options for preset listings
19
+ */
20
+ export type PresetSortOption = 'popular' | 'recent' | 'name';
21
+ /**
22
+ * Metadata for a preset category
23
+ */
24
+ export interface CategoryMeta {
25
+ /** Category identifier */
26
+ id?: string;
27
+ /** Display name (may be localized) */
28
+ name: string;
29
+ /** Category description */
30
+ description: string;
31
+ /** Optional icon/emoji */
32
+ icon?: string | null;
33
+ /** True if this is a curated (official) category */
34
+ is_curated?: boolean;
35
+ /** Display order for sorting */
36
+ display_order?: number;
37
+ /** Number of presets in this category */
38
+ preset_count?: number;
39
+ }
40
+ /**
41
+ * A preset color palette
42
+ *
43
+ * Represents a curated or user-created color palette using FFXIV dyes.
44
+ */
45
+ export interface PresetPalette {
46
+ /** Unique identifier (e.g., "job-rdm", "season-autumn", or UUID for community) */
47
+ id: string;
48
+ /** Display name (e.g., "Red Mage") */
49
+ name: string;
50
+ /** Category this preset belongs to */
51
+ category: PresetCategory;
52
+ /** Brief description of the palette */
53
+ description: string;
54
+ /** Array of dye itemIDs (2-5 dyes) */
55
+ dyes: number[];
56
+ /** Searchable tags */
57
+ tags: string[];
58
+ /** Credit for community submissions */
59
+ author?: string;
60
+ /** Version for future updates */
61
+ version?: string;
62
+ }
63
+ /**
64
+ * Preset with resolved Dye objects
65
+ *
66
+ * Used when displaying a preset with full dye information.
67
+ */
68
+ export interface ResolvedPreset extends PresetPalette {
69
+ /** Full Dye objects for each dye ID (null if dye not found) */
70
+ resolvedDyes: (Dye | null)[];
71
+ }
72
+ /**
73
+ * Full preset data structure
74
+ *
75
+ * The complete preset database including all categories and palettes.
76
+ */
77
+ export interface PresetData {
78
+ /** Data format version */
79
+ version: string;
80
+ /** Last update timestamp (ISO 8601) */
81
+ lastUpdated: string;
82
+ /** Category metadata */
83
+ categories: Record<PresetCategory, CategoryMeta>;
84
+ /** All preset palettes */
85
+ palettes: PresetPalette[];
86
+ }
87
+ //# sourceMappingURL=core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/preset/core.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEzC;;GAEG;AACH,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,iBAAiB,GACjB,SAAS,GACT,QAAQ,GACR,YAAY,GACZ,WAAW,CAAC;AAEhB;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;AAE3E;;GAEG;AACH,MAAM,MAAM,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0BAA0B;IAC1B,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @xivdyetools/types - Preset Core Types
3
+ *
4
+ * Core preset palette type definitions.
5
+ *
6
+ * @module preset/core
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["../../src/preset/core.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @xivdyetools/types - Preset Module
3
+ *
4
+ * Preset palette type definitions for curated and community presets.
5
+ *
6
+ * @module preset
7
+ */
8
+ export type { PresetCategory, PresetStatus, PresetSortOption, CategoryMeta, PresetPalette, ResolvedPreset, PresetData, } from './core.js';
9
+ export type { PresetPreviousValues, CommunityPreset, PresetSubmission, AuthenticatedPresetSubmission, } from './community.js';
10
+ export type { PresetFilters, PresetEditRequest } from './request.js';
11
+ export type { PresetListResponse, PresetSubmitResponse, PresetEditResponse, VoteResponse, ModerationResponse, CategoryListResponse, } from './response.js';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/preset/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EACV,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,UAAU,GACX,MAAM,WAAW,CAAC;AAGnB,YAAY,EACV,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,6BAA6B,GAC9B,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGrE,YAAY,EACV,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,eAAe,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @xivdyetools/types - Preset Module
3
+ *
4
+ * Preset palette type definitions for curated and community presets.
5
+ *
6
+ * @module preset
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/preset/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * @xivdyetools/types - Preset Request Types
3
+ *
4
+ * Types for preset API requests.
5
+ *
6
+ * @module preset/request
7
+ */
8
+ import type { PresetCategory, PresetStatus, PresetSortOption } from './core.js';
9
+ /**
10
+ * Filters for listing presets
11
+ */
12
+ export interface PresetFilters {
13
+ /** Filter by category */
14
+ category?: PresetCategory;
15
+ /** Search term (searches name, description, tags) */
16
+ search?: string;
17
+ /** Filter by moderation status */
18
+ status?: PresetStatus;
19
+ /** Sort order */
20
+ sort?: PresetSortOption;
21
+ /** Page number (1-indexed) */
22
+ page?: number;
23
+ /** Results per page (default: 20, max: 50) */
24
+ limit?: number;
25
+ /** Filter by curated status */
26
+ is_curated?: boolean;
27
+ }
28
+ /**
29
+ * Request body for editing a preset
30
+ *
31
+ * All fields are optional - only provided fields will be updated.
32
+ */
33
+ export interface PresetEditRequest {
34
+ /** New name (2-50 characters) */
35
+ name?: string;
36
+ /** New description (10-200 characters) */
37
+ description?: string;
38
+ /** New dye IDs (2-5 dyes) */
39
+ dyes?: number[];
40
+ /** New tags (0-10 tags, max 30 chars each) */
41
+ tags?: string[];
42
+ }
43
+ //# sourceMappingURL=request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/preset/request.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAEhF;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,yBAAyB;IACzB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAE1B,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,kCAAkC;IAClC,MAAM,CAAC,EAAE,YAAY,CAAC;IAEtB,iBAAiB;IACjB,IAAI,CAAC,EAAE,gBAAgB,CAAC;IAExB,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,+BAA+B;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,iCAAiC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,0CAA0C;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @xivdyetools/types - Preset Request Types
3
+ *
4
+ * Types for preset API requests.
5
+ *
6
+ * @module preset/request
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/preset/request.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,92 @@
1
+ /**
2
+ * @xivdyetools/types - Preset Response Types
3
+ *
4
+ * Types for preset API responses.
5
+ *
6
+ * @module preset/response
7
+ */
8
+ import type { CategoryMeta } from './core.js';
9
+ import type { CommunityPreset } from './community.js';
10
+ /**
11
+ * Response when listing presets
12
+ */
13
+ export interface PresetListResponse {
14
+ /** Array of presets */
15
+ presets: CommunityPreset[];
16
+ /** Total count (for pagination) */
17
+ total: number;
18
+ /** Current page number */
19
+ page: number;
20
+ /** Results per page */
21
+ limit: number;
22
+ /** True if more pages available */
23
+ has_more: boolean;
24
+ }
25
+ /**
26
+ * Response when submitting a preset
27
+ */
28
+ export interface PresetSubmitResponse {
29
+ /** Whether the operation succeeded */
30
+ success: boolean;
31
+ /** The created preset (if new) */
32
+ preset?: CommunityPreset;
33
+ /** The existing preset (if duplicate found) */
34
+ duplicate?: CommunityPreset;
35
+ /** Whether a vote was added to duplicate */
36
+ vote_added?: boolean;
37
+ /** Moderation result */
38
+ moderation_status?: 'approved' | 'pending';
39
+ /** Error message (if success is false) */
40
+ error?: string;
41
+ }
42
+ /**
43
+ * Response from preset edit endpoint
44
+ */
45
+ export interface PresetEditResponse {
46
+ /** Whether the operation succeeded */
47
+ success: boolean;
48
+ /** The updated preset */
49
+ preset?: CommunityPreset;
50
+ /** Moderation result (if content needed review) */
51
+ moderation_status?: 'approved' | 'pending';
52
+ /** Duplicate info (if edit would create duplicate) */
53
+ duplicate?: {
54
+ id: string;
55
+ name: string;
56
+ author_name: string | null;
57
+ };
58
+ /** Error message (if success is false) */
59
+ error?: string;
60
+ }
61
+ /**
62
+ * Response when voting on a preset
63
+ */
64
+ export interface VoteResponse {
65
+ /** Whether the operation succeeded */
66
+ success: boolean;
67
+ /** Updated vote count */
68
+ new_vote_count: number;
69
+ /** True if user already voted */
70
+ already_voted?: boolean;
71
+ /** Error message (if success is false) */
72
+ error?: string;
73
+ }
74
+ /**
75
+ * Response from moderation actions
76
+ */
77
+ export interface ModerationResponse {
78
+ /** Whether the operation succeeded */
79
+ success: boolean;
80
+ /** The updated preset */
81
+ preset?: CommunityPreset;
82
+ /** Error message (if success is false) */
83
+ error?: string;
84
+ }
85
+ /**
86
+ * Response when listing categories
87
+ */
88
+ export interface CategoryListResponse {
89
+ /** Array of category metadata */
90
+ categories: CategoryMeta[];
91
+ }
92
+ //# sourceMappingURL=response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/preset/response.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,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B,cAAc,EAAE,MAAM,CAAC;IAEvB,iCAAiC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,sCAAsC;IACtC,OAAO,EAAE,OAAO,CAAC;IAEjB,yBAAyB;IACzB,MAAM,CAAC,EAAE,eAAe,CAAC;IAEzB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,iCAAiC;IACjC,UAAU,EAAE,YAAY,EAAE,CAAC;CAC5B"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @xivdyetools/types - Preset Response Types
3
+ *
4
+ * Types for preset API responses.
5
+ *
6
+ * @module preset/response
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.js","sourceRoot":"","sources":["../../src/preset/response.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * @xivdyetools/types - Utility Types
3
+ *
4
+ * Generic utility types for common patterns.
5
+ *
6
+ * @module utility
7
+ */
8
+ import type { AppError } from '../error/app-error.js';
9
+ /**
10
+ * Generic result type for operations that might fail
11
+ *
12
+ * Use this for functions that can return either a value or an error,
13
+ * avoiding exceptions for expected failure cases.
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * function parseColor(hex: string): Result<RGB> {
18
+ * if (!isValidHex(hex)) {
19
+ * return { ok: false, error: new AppError('INVALID_HEX', 'Invalid hex color') };
20
+ * }
21
+ * return { ok: true, value: hexToRgb(hex) };
22
+ * }
23
+ *
24
+ * const result = parseColor('#ff0000');
25
+ * if (result.ok) {
26
+ * console.log(result.value); // RGB object
27
+ * } else {
28
+ * console.error(result.error.message);
29
+ * }
30
+ * ```
31
+ */
32
+ export type Result<T, E = AppError> = {
33
+ ok: true;
34
+ value: T;
35
+ } | {
36
+ ok: false;
37
+ error: E;
38
+ };
39
+ /**
40
+ * Async result type
41
+ *
42
+ * Promise wrapper around Result for async operations.
43
+ */
44
+ export type AsyncResult<T, E = AppError> = Promise<Result<T, E>>;
45
+ /**
46
+ * Nullable type
47
+ *
48
+ * Value that can be T or null.
49
+ */
50
+ export type Nullable<T> = T | null;
51
+ /**
52
+ * Optional type
53
+ *
54
+ * Value that can be T or undefined.
55
+ */
56
+ export type Optional<T> = T | undefined;
57
+ /**
58
+ * Type guard for checking if a Result is successful
59
+ */
60
+ export declare function isOk<T, E>(result: Result<T, E>): result is {
61
+ ok: true;
62
+ value: T;
63
+ };
64
+ /**
65
+ * Type guard for checking if a Result is an error
66
+ */
67
+ export declare function isErr<T, E>(result: Result<T, E>): result is {
68
+ ok: false;
69
+ error: E;
70
+ };
71
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utility/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,QAAQ,IAC9B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GACtB;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAAC;AAE5B;;;;GAIG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,EAAE,CAAC,GAAG,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEjE;;;;GAIG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAEnC;;;;GAIG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;AAExC;;GAEG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,IAAI;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAEjF;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,IAAI;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAEnF"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @xivdyetools/types - Utility Types
3
+ *
4
+ * Generic utility types for common patterns.
5
+ *
6
+ * @module utility
7
+ */
8
+ /**
9
+ * Type guard for checking if a Result is successful
10
+ */
11
+ export function isOk(result) {
12
+ return result.ok;
13
+ }
14
+ /**
15
+ * Type guard for checking if a Result is an error
16
+ */
17
+ export function isErr(result) {
18
+ return !result.ok;
19
+ }
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utility/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAoDH;;GAEG;AACH,MAAM,UAAU,IAAI,CAAO,MAAoB;IAC7C,OAAO,MAAM,CAAC,EAAE,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,KAAK,CAAO,MAAoB;IAC9C,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;AACpB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,73 @@
1
+ {
2
+ "name": "@xivdyetools/types",
3
+ "version": "1.0.0",
4
+ "description": "Shared TypeScript type definitions for the xivdyetools ecosystem",
5
+ "author": "XIV Dye Tools",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "main": "dist/index.js",
9
+ "types": "dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.js"
14
+ },
15
+ "./color": {
16
+ "types": "./dist/color/index.d.ts",
17
+ "import": "./dist/color/index.js"
18
+ },
19
+ "./dye": {
20
+ "types": "./dist/dye/index.d.ts",
21
+ "import": "./dist/dye/index.js"
22
+ },
23
+ "./preset": {
24
+ "types": "./dist/preset/index.d.ts",
25
+ "import": "./dist/preset/index.js"
26
+ },
27
+ "./auth": {
28
+ "types": "./dist/auth/index.d.ts",
29
+ "import": "./dist/auth/index.js"
30
+ },
31
+ "./api": {
32
+ "types": "./dist/api/index.d.ts",
33
+ "import": "./dist/api/index.js"
34
+ },
35
+ "./error": {
36
+ "types": "./dist/error/index.d.ts",
37
+ "import": "./dist/error/index.js"
38
+ },
39
+ "./localization": {
40
+ "types": "./dist/localization/index.d.ts",
41
+ "import": "./dist/localization/index.js"
42
+ }
43
+ },
44
+ "files": [
45
+ "dist",
46
+ "README.md"
47
+ ],
48
+ "sideEffects": false,
49
+ "scripts": {
50
+ "build": "tsc -p tsconfig.build.json",
51
+ "type-check": "tsc --noEmit",
52
+ "clean": "rimraf dist",
53
+ "prepublishOnly": "npm run clean && npm run build"
54
+ },
55
+ "devDependencies": {
56
+ "typescript": "^5.3.2",
57
+ "rimraf": "^5.0.5"
58
+ },
59
+ "engines": {
60
+ "node": ">=18.0.0"
61
+ },
62
+ "keywords": [
63
+ "xivdyetools",
64
+ "ffxiv",
65
+ "dyes",
66
+ "typescript",
67
+ "types"
68
+ ],
69
+ "repository": {
70
+ "type": "git",
71
+ "url": "https://github.com/xivdyetools/xivdyetools-types.git"
72
+ }
73
+ }