Skip to content

Commit

Permalink
Merge pull request #27 from DestinyItemManager/translateManually
Browse files Browse the repository at this point in the history
Directly generate TranslateManually type
  • Loading branch information
delphiactual authored Aug 1, 2024
2 parents d25eb8f + 5926407 commit 01d0fab
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
18 changes: 14 additions & 4 deletions output/symbol-name-sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2559,10 +2559,20 @@ export const symbolData: {
},
},
];
const translateManually = [
57495, 57654, 983359, 61239, 57665, 983382, 61244, 61245, 57671, 57426, 983376, 983269,
] as const;
export type TranslateManually = (typeof translateManually)[number];

export type TranslateManually =
| 57495
| 57654
| 983359
| 61239
| 57665
| 983382
| 61244
| 61245
| 57671
| 57426
| 983376
| 983269;

/*
* Could not find a source for (did the definitions disappear?):
Expand Down
8 changes: 4 additions & 4 deletions src/generate-symbols.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,10 +507,10 @@ if (hasDupes) {
const outString =
"export const symbolData: {codepoint: number; glyph: string, source?: {tableName: 'Trait' | 'InventoryItem' | 'SandboxPerk' | 'ActivityMode' | 'Objective'| 'ItemCategory' | 'InventoryBucket' | 'Faction' | 'Stat' | 'DamageType', hash: number, fromRichText: boolean }}[] =" +
JSON.stringify(output, null, 2) +
';\nconst translateManually = ' +
JSON.stringify(translateManually, null, 2) +
'as const;\n' +
'export type TranslateManually = typeof translateManually[number];\n\n' +
';\n\n' +
'export type TranslateManually = ' +
translateManually.join(' | ') +
';\n\n' +
'/*\n * Could not find a source for (did the definitions disappear?): \n' +
failedToFindSource.map((name) => ` * ${name}`).join('\n') +
'\n\n' +
Expand Down

0 comments on commit 01d0fab

Please sign in to comment.