forked from home-assistant/frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpolymer-types.ts
More file actions
38 lines (35 loc) · 728 Bytes
/
Copy pathpolymer-types.ts
File metadata and controls
38 lines (35 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
export const applyPolymerEvent = <T>(
ev: PolymerChangedEvent<T>,
curValue: T
): T => {
const { path, value } = ev.detail;
if (!path) {
return value;
}
const propName = path.split(".")[1];
return { ...curValue, [propName]: value };
};
export interface PolymerChangedEvent<T> extends Event {
detail: {
value: T;
path?: string;
queueProperty: boolean;
};
}
export interface PolymerIronSelectEvent<T> extends Event {
detail: {
item: T;
};
}
declare global {
// for fire event
interface HASSDomEvents {
"hass-logout": undefined;
"iron-resize": undefined;
"config-refresh": undefined;
"hass-api-called": {
success: boolean;
response: unknown;
};
}
}