docs: fix CfgSettings/DataSourceItem to satisfy JsonObject in plan
This commit is contained in:
@@ -254,12 +254,14 @@ Expected: FAIL — module `../src/lib/util` not found.
|
|||||||
- [ ] **Step 3: Implement `src/lib/util.ts`**
|
- [ ] **Step 3: Implement `src/lib/util.ts`**
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
|
import type { JsonObject } from "@elgato/utils";
|
||||||
|
|
||||||
export const DEFAULT_BASE_URL = "http://localhost:9292";
|
export const DEFAULT_BASE_URL = "http://localhost:9292";
|
||||||
|
|
||||||
export interface CfgSettings {
|
export type CfgSettings = {
|
||||||
baseUrl?: string;
|
baseUrl?: string;
|
||||||
apiKey?: string;
|
apiKey?: string;
|
||||||
}
|
} & JsonObject;
|
||||||
|
|
||||||
export interface LlamaSwapConfig {
|
export interface LlamaSwapConfig {
|
||||||
baseUrl: string;
|
baseUrl: string;
|
||||||
@@ -1572,6 +1574,9 @@ interface DataSourceItem {
|
|||||||
label: string;
|
label: string;
|
||||||
value: string;
|
value: string;
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Note: `DataSourceItem` must be a `type` alias, not an interface — interfaces without an index signature aren't assignable to `JsonObject`/`JsonValue`, which produces non-fatal TS diagnostics in `sendToPropertyInspector(payload: JsonValue)`. Define it as `type DataSourceItem = { label: string; value: string };` instead (type literals get implicit index signatures).
|
||||||
|
|
||||||
export function registerDataSources(): void {
|
export function registerDataSources(): void {
|
||||||
streamDeck.ui.onSendToPlugin(async (ev) => {
|
streamDeck.ui.onSendToPlugin(async (ev) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user