Skip to content

Commit 7b9d97f

Browse files
committed
you know, it'd be great if typescript didn't suck as often as it does
1 parent 5bab9f0 commit 7b9d97f

3 files changed

Lines changed: 37 additions & 2 deletions

File tree

packages/types/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ For prereleases:
1919
- Pre-release versions (x.x.x-pre.x) are unstable releases for the designated API version. These contain work-in-progress types and annotations. Pre-release versions are not meant to be used except for trying out new API interfaces and giving feedback, and may change without prior programmatic or verbal notice. Pre-release versions are meant to be used with new builds from the `dev` branch of the base extension repo.
2020
- Release candidates (x.x.x-rc.x) are stable previews for the designated API version. These contain types that are more or less finalized for the designated release. Breaking changes should not be expected, both in type signature and functionality, but will always be highlighted in the changelog if necessary. This is also meant for feedback, but only for more subtle feedback before releasing that version such that it simply just contains bug fixes and very minor changes.
2121

22+
## 1.0.0-pre.16
23+
24+
### Changed
25+
26+
- `ActionForcePriorityEnum`, which was previously a re-export of `neuro-game-sdk`'s enum, is now a wrapper object const that remains compatible with existing uses. This was done so we can add our own JSDoc annotations and so we can get proper type documentation generated for our docs.
27+
2228
## 1.0.0-pre.15
2329

2430
### Breaking changes

packages/types/src/index.ts

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,37 @@ import type { ActionHandlerResult, ActionValidationResult, Diff, DiffPlus, DiffR
22
import type { CompanionAPI, CompanionAPIConstructor } from './companions/register';
33
import type * as vscode from 'vscode';
44

5+
import { ActionForcePriorityEnum as _ActionForcePriorityEnum } from 'neuro-game-sdk';
6+
7+
// don't worry I hate this too
8+
interface ActionForcePriorityEnumInterface {
9+
/** Sets the priority to low. Is the default for action forces is the `priority` parameter is unspecified. */
10+
readonly LOW: _ActionForcePriorityEnum.LOW,
11+
/** Sets the priority to medium. Speeds Neuro's speaking up. */
12+
readonly MEDIUM: _ActionForcePriorityEnum.MEDIUM,
13+
/** Sets the priority to high. Processes the action force as soon as possible, which may cause Neuro to speed up or cut herself off. */
14+
readonly HIGH: _ActionForcePriorityEnum.HIGH,
15+
/** Sets the priority to critical. Use with caution; will force Neuro to respond at once, immediately. */
16+
readonly CRITICAL: _ActionForcePriorityEnum.CRITICAL,
17+
}
18+
19+
/**
20+
* This is a wrapper re-export around {@link _ActionForcePriorityEnum `neuro-game-sdk`'s ActionForcePriorityEnum}, so we can have proper a proper page for this on docs,
21+
* and add our own member-level JSDoc annotations.
22+
* Members are the same as the upstream enum's members.
23+
*
24+
* @example
25+
* ActionForcePriorityEnum.LOW // equivalent to low priority action force
26+
*
27+
* @see https://github.com/VedalAI/neuro-sdk/blob/main/API/SPECIFICATION.md#parameters-5
28+
*/
29+
export const ActionForcePriorityEnum: ActionForcePriorityEnumInterface = {
30+
LOW: _ActionForcePriorityEnum.LOW,
31+
MEDIUM: _ActionForcePriorityEnum.MEDIUM,
32+
HIGH: _ActionForcePriorityEnum.HIGH,
33+
CRITICAL: _ActionForcePriorityEnum.CRITICAL,
34+
} as const;
35+
536
interface ActionValidationUtils {
637
/**
738
* Function to return an object that indicates handler success.
@@ -255,4 +286,3 @@ type ItselfOrArray<T> = T | T[];
255286

256287
export * from './actions';
257288
export * from './companions';
258-
export { ActionForcePriorityEnum } from 'neuro-game-sdk';

packages/types/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
// Recommended Options
3838
"strict": true,
3939
"jsx": "react-jsx",
40-
"isolatedModules": true,
4140
"isolatedDeclarations": true,
4241
"noUncheckedSideEffectImports": true,
4342
"moduleDetection": "force",

0 commit comments

Comments
 (0)