@xivdyetools/types 1.6.1 → 1.9.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.
- package/LICENSE +37 -37
- package/README.md +290 -291
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/response.d.ts +1 -16
- package/dist/api/response.d.ts.map +1 -1
- package/dist/api/response.js +1 -1
- package/dist/auth/discord-snowflake.d.ts +71 -0
- package/dist/auth/discord-snowflake.d.ts.map +1 -0
- package/dist/auth/discord-snowflake.js +70 -0
- package/dist/auth/discord-snowflake.js.map +1 -0
- package/dist/auth/index.d.ts +3 -1
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +1 -1
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/response.d.ts +93 -34
- package/dist/auth/response.d.ts.map +1 -1
- package/dist/character/index.d.ts +4 -0
- package/dist/character/index.d.ts.map +1 -1
- package/dist/character/index.js.map +1 -1
- package/dist/color/colorblind.d.ts +1 -0
- package/dist/color/colorblind.d.ts.map +1 -1
- package/dist/color/index.d.ts +1 -1
- package/dist/color/index.d.ts.map +1 -1
- package/dist/color/rgb.d.ts +70 -0
- package/dist/color/rgb.d.ts.map +1 -1
- package/dist/dye/database.d.ts +1 -0
- package/dist/dye/database.d.ts.map +1 -1
- package/dist/dye/dye.d.ts +1 -0
- package/dist/dye/dye.d.ts.map +1 -1
- package/dist/error/app-error.js +2 -0
- package/dist/error/app-error.js.map +1 -1
- package/dist/index.d.ts +7 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/preset/community.d.ts +0 -9
- package/dist/preset/community.d.ts.map +1 -1
- package/dist/preset/core.d.ts +0 -10
- package/dist/preset/core.d.ts.map +1 -1
- package/dist/preset/index.d.ts +3 -3
- package/dist/preset/index.d.ts.map +1 -1
- package/dist/preset/response.d.ts +126 -40
- package/dist/preset/response.d.ts.map +1 -1
- package/package.json +81 -82
- package/dist/utility/index.d.ts +0 -71
- package/dist/utility/index.d.ts.map +0 -1
- package/dist/utility/index.js +0 -20
- package/dist/utility/index.js.map +0 -1
package/dist/api/response.d.ts
CHANGED
|
@@ -1,25 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @xivdyetools/types - API Response Types
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Caching types for API data.
|
|
5
5
|
*
|
|
6
6
|
* @module api/response
|
|
7
7
|
*/
|
|
8
|
-
/**
|
|
9
|
-
* Generic API response wrapper
|
|
10
|
-
*
|
|
11
|
-
* Provides a consistent structure for all API responses.
|
|
12
|
-
*/
|
|
13
|
-
export interface APIResponse<T> {
|
|
14
|
-
/** Whether the operation succeeded */
|
|
15
|
-
success: boolean;
|
|
16
|
-
/** Response data (if successful) */
|
|
17
|
-
data?: T;
|
|
18
|
-
/** Error message (if unsuccessful) */
|
|
19
|
-
error?: string;
|
|
20
|
-
/** Response timestamp (ms since epoch) */
|
|
21
|
-
timestamp: number;
|
|
22
|
-
}
|
|
23
8
|
/**
|
|
24
9
|
* Cached data wrapper with TTL and integrity checking
|
|
25
10
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/api/response.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/api/response.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,sBAAsB;IACtB,IAAI,EAAE,CAAC,CAAC;IAER,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAC;IAElB,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAC;IAEZ,qCAAqC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
package/dist/api/response.js
CHANGED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @xivdyetools/types - Discord Snowflake Validation
|
|
3
|
+
*
|
|
4
|
+
* Discord Snowflake branded type and validation utility.
|
|
5
|
+
* Consolidates the inline `/^\d{17,19}$/` regex previously duplicated
|
|
6
|
+
* across env-validation files in presets-api, discord-worker, and moderation-worker.
|
|
7
|
+
*
|
|
8
|
+
* Discord Snowflakes are Twitter-style 64-bit IDs composed of:
|
|
9
|
+
* - 42 bits: milliseconds since Discord epoch (2015-01-01)
|
|
10
|
+
* - 5 bits: internal worker ID
|
|
11
|
+
* - 5 bits: internal process ID
|
|
12
|
+
* - 12 bits: per-process increment
|
|
13
|
+
*
|
|
14
|
+
* In practice, current snowflakes are 17-19 digits. The range 17-20 is used
|
|
15
|
+
* to allow for future growth (20-digit snowflakes won't appear until ~2090).
|
|
16
|
+
*
|
|
17
|
+
* @see https://discord.com/developers/docs/reference#snowflakes
|
|
18
|
+
* @see FINDING-002 in docs/audits/2026-02-18/findings/FINDING-002.md
|
|
19
|
+
*
|
|
20
|
+
* @module auth/discord-snowflake
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Discord Snowflake ID (branded type for type safety)
|
|
24
|
+
*
|
|
25
|
+
* Prevents accidental use of arbitrary strings as Discord IDs.
|
|
26
|
+
* Use `isValidSnowflake()` to validate and `createSnowflake()` to create validated instances.
|
|
27
|
+
*
|
|
28
|
+
* @internal Not yet adopted by consumers — use `isValidSnowflake()` for validation instead
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* const userId: DiscordSnowflake = createSnowflake('123456789012345678');
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export type DiscordSnowflake = string & {
|
|
36
|
+
readonly __brand: 'DiscordSnowflake';
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Validate whether a string is a valid Discord snowflake format.
|
|
40
|
+
*
|
|
41
|
+
* This is a pure format check — it does not verify that the ID
|
|
42
|
+
* corresponds to an actual Discord entity.
|
|
43
|
+
*
|
|
44
|
+
* @param id - The string to validate
|
|
45
|
+
* @returns true if the string matches Discord snowflake format
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* isValidSnowflake('123456789012345678'); // true
|
|
50
|
+
* isValidSnowflake('abc'); // false
|
|
51
|
+
* isValidSnowflake(''); // false
|
|
52
|
+
* isValidSnowflake('12345'); // false (too short)
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare function isValidSnowflake(id: string): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Create a validated Discord Snowflake branded type.
|
|
58
|
+
*
|
|
59
|
+
* @internal Not yet adopted by consumers
|
|
60
|
+
*
|
|
61
|
+
* @param id - The snowflake string to validate
|
|
62
|
+
* @returns The validated DiscordSnowflake
|
|
63
|
+
* @throws {Error} If the string is not a valid snowflake format
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```typescript
|
|
67
|
+
* const userId = createSnowflake('123456789012345678');
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
export declare function createSnowflake(id: string): DiscordSnowflake;
|
|
71
|
+
//# sourceMappingURL=discord-snowflake.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discord-snowflake.d.ts","sourceRoot":"","sources":["../../src/auth/discord-snowflake.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAA;CAAE,CAAC;AAWjF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,gBAAgB,CAO5D"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @xivdyetools/types - Discord Snowflake Validation
|
|
3
|
+
*
|
|
4
|
+
* Discord Snowflake branded type and validation utility.
|
|
5
|
+
* Consolidates the inline `/^\d{17,19}$/` regex previously duplicated
|
|
6
|
+
* across env-validation files in presets-api, discord-worker, and moderation-worker.
|
|
7
|
+
*
|
|
8
|
+
* Discord Snowflakes are Twitter-style 64-bit IDs composed of:
|
|
9
|
+
* - 42 bits: milliseconds since Discord epoch (2015-01-01)
|
|
10
|
+
* - 5 bits: internal worker ID
|
|
11
|
+
* - 5 bits: internal process ID
|
|
12
|
+
* - 12 bits: per-process increment
|
|
13
|
+
*
|
|
14
|
+
* In practice, current snowflakes are 17-19 digits. The range 17-20 is used
|
|
15
|
+
* to allow for future growth (20-digit snowflakes won't appear until ~2090).
|
|
16
|
+
*
|
|
17
|
+
* @see https://discord.com/developers/docs/reference#snowflakes
|
|
18
|
+
* @see FINDING-002 in docs/audits/2026-02-18/findings/FINDING-002.md
|
|
19
|
+
*
|
|
20
|
+
* @module auth/discord-snowflake
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Regex pattern for Discord snowflake validation.
|
|
24
|
+
* Matches 17-20 digit numeric strings.
|
|
25
|
+
*
|
|
26
|
+
* Current Discord snowflakes are 17-19 digits (as of 2026).
|
|
27
|
+
* The upper bound of 20 allows for future growth through ~2090.
|
|
28
|
+
*/
|
|
29
|
+
const SNOWFLAKE_PATTERN = /^\d{17,20}$/;
|
|
30
|
+
/**
|
|
31
|
+
* Validate whether a string is a valid Discord snowflake format.
|
|
32
|
+
*
|
|
33
|
+
* This is a pure format check — it does not verify that the ID
|
|
34
|
+
* corresponds to an actual Discord entity.
|
|
35
|
+
*
|
|
36
|
+
* @param id - The string to validate
|
|
37
|
+
* @returns true if the string matches Discord snowflake format
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* isValidSnowflake('123456789012345678'); // true
|
|
42
|
+
* isValidSnowflake('abc'); // false
|
|
43
|
+
* isValidSnowflake(''); // false
|
|
44
|
+
* isValidSnowflake('12345'); // false (too short)
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export function isValidSnowflake(id) {
|
|
48
|
+
return SNOWFLAKE_PATTERN.test(id);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Create a validated Discord Snowflake branded type.
|
|
52
|
+
*
|
|
53
|
+
* @internal Not yet adopted by consumers
|
|
54
|
+
*
|
|
55
|
+
* @param id - The snowflake string to validate
|
|
56
|
+
* @returns The validated DiscordSnowflake
|
|
57
|
+
* @throws {Error} If the string is not a valid snowflake format
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```typescript
|
|
61
|
+
* const userId = createSnowflake('123456789012345678');
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export function createSnowflake(id) {
|
|
65
|
+
if (!isValidSnowflake(id)) {
|
|
66
|
+
throw new Error(`Invalid Discord snowflake format: "${id}". Expected a 17-20 digit numeric string.`);
|
|
67
|
+
}
|
|
68
|
+
return id;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=discord-snowflake.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discord-snowflake.js","sourceRoot":"","sources":["../../src/auth/discord-snowflake.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAiBH;;;;;;GAMG;AACH,MAAM,iBAAiB,GAAG,aAAa,CAAC;AAExC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAAU;IACzC,OAAO,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACpC,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,eAAe,CAAC,EAAU;IACxC,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CACb,sCAAsC,EAAE,2CAA2C,CACpF,CAAC;IACJ,CAAC;IACD,OAAO,EAAsB,CAAC;AAChC,CAAC"}
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
export type { AuthProvider, AuthSource, AuthContext } from './provider.js';
|
|
9
9
|
export type { PrimaryCharacter, JWTPayload, OAuthState } from './jwt.js';
|
|
10
10
|
export type { DiscordTokenResponse, DiscordUser } from './discord.js';
|
|
11
|
+
export type { DiscordSnowflake } from './discord-snowflake.js';
|
|
12
|
+
export { isValidSnowflake, createSnowflake } from './discord-snowflake.js';
|
|
11
13
|
export type { XIVAuthTokenResponse, XIVAuthCharacter, XIVAuthCharacterRegistration, XIVAuthSocialIdentity, XIVAuthUser, } from './xivauth.js';
|
|
12
|
-
export type { AuthUser, AuthResponse, RefreshResponse, UserInfoResponse, } from './response.js';
|
|
14
|
+
export type { AuthUser, AuthSuccessResponse, AuthErrorResponse, AuthResponse, RefreshSuccessResponse, RefreshErrorResponse, RefreshResponse, UserInfoData, UserInfoSuccessResponse, UserInfoErrorResponse, UserInfoResponse, } from './response.js';
|
|
13
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/auth/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG3E,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGzE,YAAY,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGtE,YAAY,EACV,oBAAoB,EACpB,gBAAgB,EAChB,4BAA4B,EAC5B,qBAAqB,EACrB,WAAW,GACZ,MAAM,cAAc,CAAC;AAGtB,YAAY,EACV,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,gBAAgB,GACjB,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG3E,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGzE,YAAY,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGtE,YAAY,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAG3E,YAAY,EACV,oBAAoB,EACpB,gBAAgB,EAChB,4BAA4B,EAC5B,qBAAqB,EACrB,WAAW,GACZ,MAAM,cAAc,CAAC;AAGtB,YAAY,EACV,QAAQ,EACR,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,YAAY,EACZ,uBAAuB,EACvB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,eAAe,CAAC"}
|
package/dist/auth/index.js
CHANGED
package/dist/auth/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAaH,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/auth/response.d.ts
CHANGED
|
@@ -27,48 +27,107 @@ export interface AuthUser {
|
|
|
27
27
|
primary_character?: PrimaryCharacter;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* Successful authentication response
|
|
31
|
+
* @internal Not for direct consumer import — use `AuthResponse` union instead
|
|
31
32
|
*/
|
|
32
|
-
export interface
|
|
33
|
-
/**
|
|
34
|
-
success:
|
|
35
|
-
/** JWT token
|
|
36
|
-
token
|
|
37
|
-
/** User information
|
|
38
|
-
user
|
|
33
|
+
export interface AuthSuccessResponse {
|
|
34
|
+
/** Authentication succeeded */
|
|
35
|
+
success: true;
|
|
36
|
+
/** JWT token */
|
|
37
|
+
token: string;
|
|
38
|
+
/** User information */
|
|
39
|
+
user: AuthUser;
|
|
39
40
|
/** Token expiration timestamp (ms since epoch) */
|
|
40
|
-
expires_at
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
expires_at: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Failed authentication response
|
|
45
|
+
* @internal Not for direct consumer import — use `AuthResponse` union instead
|
|
46
|
+
*/
|
|
47
|
+
export interface AuthErrorResponse {
|
|
48
|
+
/** Authentication failed */
|
|
49
|
+
success: false;
|
|
50
|
+
/** Error message describing the failure */
|
|
51
|
+
error: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Response from authentication endpoints
|
|
55
|
+
*
|
|
56
|
+
* Uses discriminated union for type-safe handling:
|
|
57
|
+
* ```typescript
|
|
58
|
+
* if (response.success) {
|
|
59
|
+
* // TypeScript knows: token, user, expires_at exist
|
|
60
|
+
* console.log(response.user.username);
|
|
61
|
+
* } else {
|
|
62
|
+
* // TypeScript knows: error exists
|
|
63
|
+
* console.error(response.error);
|
|
64
|
+
* }
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export type AuthResponse = AuthSuccessResponse | AuthErrorResponse;
|
|
68
|
+
/**
|
|
69
|
+
* Successful token refresh response
|
|
70
|
+
* @internal Not for direct consumer import — use `RefreshResponse` union instead
|
|
71
|
+
*/
|
|
72
|
+
export interface RefreshSuccessResponse {
|
|
73
|
+
/** Refresh succeeded */
|
|
74
|
+
success: true;
|
|
75
|
+
/** New JWT token */
|
|
76
|
+
token: string;
|
|
77
|
+
/** New token expiration timestamp (ms since epoch) */
|
|
78
|
+
expires_at: number;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Failed token refresh response
|
|
82
|
+
* @internal Not for direct consumer import — use `RefreshResponse` union instead
|
|
83
|
+
*/
|
|
84
|
+
export interface RefreshErrorResponse {
|
|
85
|
+
/** Refresh failed */
|
|
86
|
+
success: false;
|
|
87
|
+
/** Error message describing the failure */
|
|
88
|
+
error: string;
|
|
43
89
|
}
|
|
44
90
|
/**
|
|
45
91
|
* Response from token refresh endpoint
|
|
92
|
+
*
|
|
93
|
+
* Uses discriminated union for type-safe handling.
|
|
46
94
|
*/
|
|
47
|
-
export
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
95
|
+
export type RefreshResponse = RefreshSuccessResponse | RefreshErrorResponse;
|
|
96
|
+
/**
|
|
97
|
+
* User info data returned in UserInfoResponse
|
|
98
|
+
* @internal Not for direct consumer import — use `UserInfoResponse` union instead
|
|
99
|
+
*/
|
|
100
|
+
export interface UserInfoData {
|
|
101
|
+
id: string;
|
|
102
|
+
username: string;
|
|
103
|
+
global_name: string | null;
|
|
104
|
+
avatar: string | null;
|
|
105
|
+
avatar_url: string | null;
|
|
56
106
|
}
|
|
57
107
|
/**
|
|
58
|
-
*
|
|
108
|
+
* Successful user info response
|
|
109
|
+
* @internal Not for direct consumer import — use `UserInfoResponse` union instead
|
|
59
110
|
*/
|
|
60
|
-
export interface
|
|
61
|
-
/**
|
|
62
|
-
success:
|
|
63
|
-
/** User information
|
|
64
|
-
user
|
|
65
|
-
id: string;
|
|
66
|
-
username: string;
|
|
67
|
-
global_name: string | null;
|
|
68
|
-
avatar: string | null;
|
|
69
|
-
avatar_url: string | null;
|
|
70
|
-
};
|
|
71
|
-
/** Error message (if unsuccessful) */
|
|
72
|
-
error?: string;
|
|
111
|
+
export interface UserInfoSuccessResponse {
|
|
112
|
+
/** Request succeeded */
|
|
113
|
+
success: true;
|
|
114
|
+
/** User information */
|
|
115
|
+
user: UserInfoData;
|
|
73
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Failed user info response
|
|
119
|
+
* @internal Not for direct consumer import — use `UserInfoResponse` union instead
|
|
120
|
+
*/
|
|
121
|
+
export interface UserInfoErrorResponse {
|
|
122
|
+
/** Request failed */
|
|
123
|
+
success: false;
|
|
124
|
+
/** Error message describing the failure */
|
|
125
|
+
error: string;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Response from user info endpoint
|
|
129
|
+
*
|
|
130
|
+
* Uses discriminated union for type-safe handling.
|
|
131
|
+
*/
|
|
132
|
+
export type UserInfoResponse = UserInfoSuccessResponse | UserInfoErrorResponse;
|
|
74
133
|
//# sourceMappingURL=response.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/auth/response.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,uBAAuB;IACvB,EAAE,EAAE,MAAM,CAAC;IAEX,uBAAuB;IACvB,QAAQ,EAAE,MAAM,CAAC;IAEjB,kCAAkC;IAClC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B,kBAAkB;IAClB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB,sBAAsB;IACtB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B,8CAA8C;IAC9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,EAAE,IAAI,CAAC;IAEd,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IAEd,sDAAsD;IACtD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,qBAAqB;IACrB,OAAO,EAAE,KAAK,CAAC;IAEf,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,sBAAsB,GAAG,oBAAoB,CAAC;AAE5E;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,wBAAwB;IACxB,OAAO,EAAE,IAAI,CAAC;IAEd,uBAAuB;IACvB,IAAI,EAAE,YAAY,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,qBAAqB;IACrB,OAAO,EAAE,KAAK,CAAC;IAEf,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,uBAAuB,GAAG,qBAAqB,CAAC"}
|
|
@@ -37,14 +37,17 @@ export interface CharacterColorMatch {
|
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
39
|
* Category of shared (race-agnostic) character colors
|
|
40
|
+
* @internal Used by core's CharacterColorService — not needed by app consumers
|
|
40
41
|
*/
|
|
41
42
|
export type SharedColorCategory = 'eyeColors' | 'highlightColors' | 'lipColorsDark' | 'lipColorsLight' | 'tattooColors' | 'facePaintColorsDark' | 'facePaintColorsLight';
|
|
42
43
|
/**
|
|
43
44
|
* Category of race-specific character colors
|
|
45
|
+
* @internal Used by core's CharacterColorService — not needed by app consumers
|
|
44
46
|
*/
|
|
45
47
|
export type RaceSpecificColorCategory = 'hairColors' | 'skinColors';
|
|
46
48
|
/**
|
|
47
49
|
* All character color categories
|
|
50
|
+
* @internal Convenience union — consumers use SharedColorCategory or RaceSpecificColorCategory directly
|
|
48
51
|
*/
|
|
49
52
|
export type CharacterColorCategory = SharedColorCategory | RaceSpecificColorCategory;
|
|
50
53
|
/**
|
|
@@ -60,6 +63,7 @@ export type SubRace = 'Midlander' | 'Highlander' | 'Wildwood' | 'Duskwight' | 'P
|
|
|
60
63
|
export type Gender = 'Male' | 'Female';
|
|
61
64
|
/**
|
|
62
65
|
* FFXIV playable races (parent of subraces)
|
|
66
|
+
* @internal Used by core's CharacterColorService — apps use SubRace directly
|
|
63
67
|
*/
|
|
64
68
|
export type Race = 'Hyur' | 'Elezen' | 'Lalafell' | "Miqo'te" | 'Roegadyn' | 'AuRa' | 'Hrothgar' | 'Viera';
|
|
65
69
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/character/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAC;IAEd,uCAAuC;IACvC,GAAG,EAAE,MAAM,CAAC;IAEZ,+BAA+B;IAC/B,GAAG,EAAE,GAAG,CAAC;IAET,4DAA4D;IAC5D,GAAG,CAAC,EAAE,GAAG,CAAC;CACX;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,2CAA2C;IAC3C,cAAc,EAAE,cAAc,CAAC;IAE/B,uBAAuB;IACvB,GAAG,EAAE,GAAG,CAAC;IAET,4CAA4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M,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEvC;;;GAGG;AACH,MAAM,MAAM,IAAI,GACZ,MAAM,GACN,QAAQ,GACR,UAAU,GACV,SAAS,GACT,UAAU,GACV,MAAM,GACN,UAAU,GACV,OAAO,CAAC;AAEZ;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAS1D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,OAAO,EAAE,IAAI,CAiBjD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CACxC,sBAAsB,EACtB;IAAE,OAAO,EAAE,CAAC,CAAC;IAAC,IAAI,EAAE,EAAE,GAAG,EAAE,CAAA;CAAE,CAW9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/character/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/character/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAqHH;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAqC;IAC7D,IAAI,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC;IACjC,MAAM,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC;IACjC,QAAQ,EAAE,CAAC,YAAY,EAAE,WAAW,CAAC;IACrC,SAAS,EAAE,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;IAChD,QAAQ,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC;IACnC,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC/B,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,M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21
21
|
* Used for RGB to RGB transformation using matrix multiplication.
|
|
22
22
|
* [row][column] indexing: result[r] = matrix[0] * input, etc.
|
|
23
|
+
* @internal Used by core's colorblind simulation — not needed by app consumers
|
|
23
24
|
*/
|
|
24
25
|
export type Matrix3x3 = [
|
|
25
26
|
[
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colorblind.d.ts","sourceRoot":"","sources":["../../src/color/colorblind.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;GAQG;AACH,MAAM,MAAM,UAAU,GAClB,QAAQ,GACR,cAAc,GACd,YAAY,GACZ,YAAY,GACZ,eAAe,CAAC;AAEpB
|
|
1
|
+
{"version":3,"file":"colorblind.d.ts","sourceRoot":"","sources":["../../src/color/colorblind.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;GAQG;AACH,MAAM,MAAM,UAAU,GAClB,QAAQ,GACR,cAAc,GACd,YAAY,GACZ,YAAY,GACZ,eAAe,CAAC;AAEpB;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB;QAAC,MAAM;QAAE,MAAM;QAAE,MAAM;KAAC;IACxB;QAAC,MAAM;QAAE,MAAM;QAAE,MAAM;KAAC;IACxB;QAAC,MAAM;QAAE,MAAM;QAAE,MAAM;KAAC;CACzB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,yCAAyC;IACzC,YAAY,EAAE,SAAS,CAAC;IACxB,uCAAuC;IACvC,UAAU,EAAE,SAAS,CAAC;IACtB,uCAAuC;IACvC,UAAU,EAAE,SAAS,CAAC;IACtB,0CAA0C;IAC1C,aAAa,EAAE,SAAS,CAAC;CAC1B"}
|
package/dist/color/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @module color
|
|
7
7
|
*/
|
|
8
|
-
export type { RGB, HSV, LAB } from './rgb.js';
|
|
8
|
+
export type { RGB, HSV, LAB, OKLAB, OKLCH, LCH, HSL } from './rgb.js';
|
|
9
9
|
export type { HexColor, DyeId, Hue, Saturation } from './branded.js';
|
|
10
10
|
export { createHexColor, createDyeId, createHue, createSaturation } from './branded.js';
|
|
11
11
|
export type { VisionType, Matrix3x3, ColorblindMatrices } from './colorblind.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/color/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/color/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAGtE,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGxF,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/color/rgb.d.ts
CHANGED
|
@@ -42,4 +42,74 @@ export interface LAB {
|
|
|
42
42
|
/** Blue-Yellow axis (approximately -128 to 127) */
|
|
43
43
|
b: number;
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* OKLAB color representation (modern perceptually uniform color space)
|
|
47
|
+
*
|
|
48
|
+
* OKLAB (Björn Ottosson, 2020) fixes issues with CIELAB, particularly
|
|
49
|
+
* for blue colors. It provides more consistent perceptual uniformity
|
|
50
|
+
* and is now part of CSS Color Level 4.
|
|
51
|
+
*
|
|
52
|
+
* Key advantages over LAB:
|
|
53
|
+
* - Blue + Yellow = Green (not pink like LAB)
|
|
54
|
+
* - More uniform hue spacing
|
|
55
|
+
* - Better gradient interpolation
|
|
56
|
+
*
|
|
57
|
+
* @example { L: 0.628, a: 0.225, b: -0.126 } // Red
|
|
58
|
+
*/
|
|
59
|
+
export interface OKLAB {
|
|
60
|
+
/** Perceived lightness (0 to 1) */
|
|
61
|
+
L: number;
|
|
62
|
+
/** Green-Red axis (approximately -0.4 to 0.4) */
|
|
63
|
+
a: number;
|
|
64
|
+
/** Blue-Yellow axis (approximately -0.4 to 0.4) */
|
|
65
|
+
b: number;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* OKLCH color representation (cylindrical form of OKLAB)
|
|
69
|
+
*
|
|
70
|
+
* OKLCH expresses OKLAB in cylindrical coordinates for intuitive
|
|
71
|
+
* hue manipulation. Ideal for gradient interpolation and color mixing.
|
|
72
|
+
*
|
|
73
|
+
* @example { L: 0.628, C: 0.258, h: 29.23 } // Red
|
|
74
|
+
*/
|
|
75
|
+
export interface OKLCH {
|
|
76
|
+
/** Perceived lightness (0 to 1) */
|
|
77
|
+
L: number;
|
|
78
|
+
/** Chroma - colorfulness (0 to ~0.4) */
|
|
79
|
+
C: number;
|
|
80
|
+
/** Hue angle (0-360 degrees) */
|
|
81
|
+
h: number;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* LCH color representation (cylindrical form of CIE LAB)
|
|
85
|
+
*
|
|
86
|
+
* LCH expresses LAB in cylindrical coordinates (Lightness, Chroma, Hue).
|
|
87
|
+
* Useful for hue-based interpolation with control over direction.
|
|
88
|
+
*
|
|
89
|
+
* @example { L: 53.23, C: 104.55, h: 40.0 } // Red
|
|
90
|
+
*/
|
|
91
|
+
export interface LCH {
|
|
92
|
+
/** Lightness (0-100) */
|
|
93
|
+
L: number;
|
|
94
|
+
/** Chroma - colorfulness (0 to ~150) */
|
|
95
|
+
C: number;
|
|
96
|
+
/** Hue angle (0-360 degrees) */
|
|
97
|
+
h: number;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* HSL color representation (Hue, Saturation, Lightness)
|
|
101
|
+
*
|
|
102
|
+
* Similar to HSV but with Lightness instead of Value.
|
|
103
|
+
* Common in design tools (Photoshop, Figma, CSS).
|
|
104
|
+
*
|
|
105
|
+
* @example { h: 0, s: 100, l: 50 } // Bright red
|
|
106
|
+
*/
|
|
107
|
+
export interface HSL {
|
|
108
|
+
/** Hue (0-360 degrees) */
|
|
109
|
+
h: number;
|
|
110
|
+
/** Saturation (0-100 percent) */
|
|
111
|
+
s: number;
|
|
112
|
+
/** Lightness (0-100 percent) */
|
|
113
|
+
l: number;
|
|
114
|
+
}
|
|
45
115
|
//# sourceMappingURL=rgb.d.ts.map
|
package/dist/color/rgb.d.ts.map
CHANGED
|
@@ -1 +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;AAED;;;;GAIG;AACH,MAAM,WAAW,GAAG;IAClB,wBAAwB;IACxB,CAAC,EAAE,MAAM,CAAC;IACV,iDAAiD;IACjD,CAAC,EAAE,MAAM,CAAC;IACV,mDAAmD;IACnD,CAAC,EAAE,MAAM,CAAC;CACX"}
|
|
1
|
+
{"version":3,"file":"rgb.d.ts","sourceRoot":"","sources":["../../src/color/rgb.ts"],"names":[],"mappings":"AAAA;;;;;;G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,CAAC;CACX"}
|
package/dist/dye/database.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import type { Dye } from './dye.js';
|
|
|
11
11
|
*
|
|
12
12
|
* Represents the current state of the loaded dye database,
|
|
13
13
|
* including all dyes and metadata about the load state.
|
|
14
|
+
* @internal Apps use core's `DyeDatabase` class, not this interface directly
|
|
14
15
|
*/
|
|
15
16
|
export interface DyeDatabase {
|
|
16
17
|
/** Array of all loaded dyes */
|
|
@@ -1 +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
|
|
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;;;;;;GAMG;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"}
|
package/dist/dye/dye.d.ts
CHANGED
|
@@ -72,6 +72,7 @@ export interface Dye {
|
|
|
72
72
|
* Localized dye with optional translated name
|
|
73
73
|
*
|
|
74
74
|
* Extends Dye with a localized name for display in non-English locales.
|
|
75
|
+
* @internal Used by core's DyeService — apps use `getLocalizedDyeName()` instead
|
|
75
76
|
*/
|
|
76
77
|
export interface LocalizedDye extends Dye {
|
|
77
78
|
/** Translated dye name (if available) */
|
package/dist/dye/dye.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dye.d.ts","sourceRoot":"","sources":["../../src/dye/dye.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAe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ACvC,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;;;;;GAKG;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"}
|
package/dist/error/app-error.js
CHANGED
|
@@ -1 +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;
|
|
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;IASxB;IAEA;IAVT;;;;;;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"}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,20 +12,19 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @packageDocumentation
|
|
14
14
|
*/
|
|
15
|
-
export type { RGB, HSV, LAB } from './color/index.js';
|
|
15
|
+
export type { RGB, HSV, LAB, OKLAB, OKLCH, LCH, HSL } from './color/index.js';
|
|
16
16
|
export type { HexColor, DyeId, Hue, Saturation } from './color/index.js';
|
|
17
17
|
export { createHexColor, createDyeId, createHue, createSaturation } from './color/index.js';
|
|
18
|
-
export type { VisionType,
|
|
19
|
-
export type { Dye, LocalizedDye, DyeWithDistance
|
|
20
|
-
export type { CharacterColor, CharacterColorMatch, SharedColorCategory, RaceSpecificColorCategory,
|
|
18
|
+
export type { VisionType, ColorblindMatrices } from './color/index.js';
|
|
19
|
+
export type { Dye, LocalizedDye, DyeWithDistance } from './dye/index.js';
|
|
20
|
+
export type { CharacterColor, CharacterColorMatch, SharedColorCategory, RaceSpecificColorCategory, SubRace, Gender, } from './character/index.js';
|
|
21
21
|
export { RACE_SUBRACES, SUBRACE_TO_RACE, COLOR_GRID_DIMENSIONS, } from './character/index.js';
|
|
22
|
-
export type { PresetCategory, PresetStatus, PresetSortOption, CategoryMeta, PresetPalette,
|
|
22
|
+
export type { PresetCategory, PresetStatus, PresetSortOption, CategoryMeta, PresetPalette, PresetData, PresetPreviousValues, CommunityPreset, PresetSubmission, PresetFilters, PresetEditRequest, PresetListResponse, PresetSubmitResponse, PresetEditResponse, VoteResponse, ModerationResponse, CategoryListResponse, } from './preset/index.js';
|
|
23
23
|
export type { AuthProvider, AuthSource, AuthContext, PrimaryCharacter, JWTPayload, OAuthState, DiscordTokenResponse, DiscordUser, XIVAuthTokenResponse, XIVAuthCharacter, XIVAuthCharacterRegistration, XIVAuthSocialIdentity, XIVAuthUser, AuthUser, AuthResponse, RefreshResponse, UserInfoResponse, } from './auth/index.js';
|
|
24
|
-
export
|
|
24
|
+
export { isValidSnowflake } from './auth/index.js';
|
|
25
|
+
export type { CachedData, ModerationResult, ModerationLogEntry, ModerationStats, PriceData, RateLimitResult, } from './api/index.js';
|
|
25
26
|
export type { LocaleCode, TranslationKey, HarmonyTypeKey, JobKey, GrandCompanyKey, RaceKey, ClanKey, LocaleData, LocalePreference, } from './localization/index.js';
|
|
26
27
|
export { ErrorCode } from './error/index.js';
|
|
27
28
|
export { AppError } from './error/index.js';
|
|
28
29
|
export type { ErrorSeverity } from './error/index.js';
|
|
29
|
-
export type { Result, AsyncResult, Nullable, Optional } from './utility/index.js';
|
|
30
|
-
export { isOk, isErr } from './utility/index.js';
|
|
31
30
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,YAAY,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,YAAY,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC9E,YAAY,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