Compare commits

...

3 Commits

Author SHA1 Message Date
Darius
e3fbe3b178 1.9.8 2026-02-09 19:44:12 +01:00
Darius
4c46c5ae6d component names as const 2026-02-09 19:44:08 +01:00
Darius
d416e8db07 convenience function 2026-02-09 19:34:44 +01:00
6 changed files with 51 additions and 9 deletions

15
dist/homepage.d.ts vendored
View File

@@ -1,14 +1,25 @@
import type { GristRecord_PersonalGoals } from "./grist"; import type { GristRecord_PersonalGoals } from "./grist";
import type { API_HA_DeskPosition } from "./homeassistant"; import type { API_HA_DeskPosition } from "./homeassistant";
import type { TidalGetCurrent } from "./tidal"; import type { TidalGetCurrent } from "./tidal";
export type FullInformation = { export declare const HomepageComponent: {
readonly HA_DESK_POSITION: "ha_desk_position";
readonly HA_TEMP: "ha_temp";
readonly TIDAL_CURRENT: "tidal_current";
readonly GRIST_PERSONAL_GOALS: "grist_personal_goals";
};
export type HomepageComponentName = (typeof HomepageComponent)[keyof typeof HomepageComponent];
export type FullInformation = Record<HomepageComponentName, unknown> & {
ha_desk_position: API_HA_DeskPosition | null; ha_desk_position: API_HA_DeskPosition | null;
ha_temp: string | null; ha_temp: string | null;
tidal_current: TidalGetCurrent | null; tidal_current: TidalGetCurrent | null;
grist_personal_goals: GristRecord_PersonalGoals | null; grist_personal_goals: GristRecord_PersonalGoals | null;
}; };
export type ComponentUpdate = { export type ComponentUpdate = {
component: string; component: HomepageComponentName;
data: unknown;
};
export declare function createComponentUpdate(component: HomepageComponentName, data: unknown): {
component: HomepageComponentName;
data: unknown; data: unknown;
}; };
//# sourceMappingURL=homepage.d.ts.map //# sourceMappingURL=homepage.d.ts.map

View File

@@ -1 +1 @@
{"version":3,"file":"homepage.d.ts","sourceRoot":"","sources":["../src/homepage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,MAAM,eAAe,GAAG;IAC7B,gBAAgB,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAC7C,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,aAAa,EAAE,eAAe,GAAG,IAAI,CAAC;IACtC,oBAAoB,EAAE,yBAAyB,GAAG,IAAI,CAAC;CACvD,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;CACd,CAAC"} {"version":3,"file":"homepage.d.ts","sourceRoot":"","sources":["../src/homepage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,eAAO,MAAM,iBAAiB;;;;;CAKpB,CAAC;AAEX,MAAM,MAAM,qBAAqB,GAChC,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAE5D,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,qBAAqB,EAAE,OAAO,CAAC,GAAG;IACtE,gBAAgB,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAC7C,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,aAAa,EAAE,eAAe,GAAG,IAAI,CAAC;IACtC,oBAAoB,EAAE,yBAAyB,GAAG,IAAI,CAAC;CACvD,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC7B,SAAS,EAAE,qBAAqB,CAAC;IACjC,IAAI,EAAE,OAAO,CAAC;CACd,CAAC;AAEF,wBAAgB,qBAAqB,CACpC,SAAS,EAAE,qBAAqB,EAChC,IAAI,EAAE,OAAO;;;EAMb"}

13
dist/homepage.js vendored
View File

@@ -1 +1,12 @@
export {}; export const HomepageComponent = {
HA_DESK_POSITION: "ha_desk_position",
HA_TEMP: "ha_temp",
TIDAL_CURRENT: "tidal_current",
GRIST_PERSONAL_GOALS: "grist_personal_goals",
};
export function createComponentUpdate(component, data) {
return {
component: component,
data: data,
};
}

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "@dpu/shared", "name": "@dpu/shared",
"version": "1.9.7", "version": "1.9.8",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@dpu/shared", "name": "@dpu/shared",
"version": "1.9.7", "version": "1.9.8",
"dependencies": { "dependencies": {
"@types/ws": "^8.18.1", "@types/ws": "^8.18.1",
"axios": "^1.7.9", "axios": "^1.7.9",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@dpu/shared", "name": "@dpu/shared",
"version": "1.9.7", "version": "1.9.8",
"description": "", "description": "",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",

View File

@@ -2,7 +2,17 @@ import type { GristRecord_PersonalGoals } from "./grist";
import type { API_HA_DeskPosition } from "./homeassistant"; import type { API_HA_DeskPosition } from "./homeassistant";
import type { TidalGetCurrent } from "./tidal"; import type { TidalGetCurrent } from "./tidal";
export type FullInformation = { export const HomepageComponent = {
HA_DESK_POSITION: "ha_desk_position",
HA_TEMP: "ha_temp",
TIDAL_CURRENT: "tidal_current",
GRIST_PERSONAL_GOALS: "grist_personal_goals",
} as const;
export type HomepageComponentName =
(typeof HomepageComponent)[keyof typeof HomepageComponent];
export type FullInformation = Record<HomepageComponentName, unknown> & {
ha_desk_position: API_HA_DeskPosition | null; ha_desk_position: API_HA_DeskPosition | null;
ha_temp: string | null; ha_temp: string | null;
tidal_current: TidalGetCurrent | null; tidal_current: TidalGetCurrent | null;
@@ -10,6 +20,16 @@ export type FullInformation = {
}; };
export type ComponentUpdate = { export type ComponentUpdate = {
component: string; component: HomepageComponentName;
data: unknown; data: unknown;
}; };
export function createComponentUpdate(
component: HomepageComponentName,
data: unknown,
) {
return {
component: component,
data: data,
};
}