@inradius/solid-wc-hass-mixin 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";const a=n=>{const{defaultConfig:i={},customCard:c,cardSize:u=3}=n;return o=>{const r=o.prototype,t=window;return t.customCards=t.customCards||[],r.setConfig=function(s){if(!s)throw new Error("Invalid configuration");this.config={...i,...s}},r.getCardSize=function(){return u},t.customCards.push({...c}),o}};module.exports=a;
@@ -0,0 +1,19 @@
1
+ import { ComponentType } from 'component-register';
2
+ export interface LovelaceCardConfig {
3
+ type: string;
4
+ [key: string]: unknown;
5
+ }
6
+ export interface CustomCardEntry {
7
+ type: string;
8
+ name: string;
9
+ description: string;
10
+ preview?: boolean;
11
+ }
12
+ export interface HomeAssistantOptions {
13
+ defaultConfig?: Record<string, unknown>;
14
+ customCard: CustomCardEntry;
15
+ cardSize?: number;
16
+ }
17
+ declare const withHomeAssistant: (options: HomeAssistantOptions) => <T>(ElementType: ComponentType<T>) => ComponentType<T>;
18
+ export default withHomeAssistant;
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,UAAU,EAAE,eAAe,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAQD,QAAA,MAAM,iBAAiB,GAAI,SAAS,oBAAoB,MAG9C,CAAC,EAAE,aAAa,aAAa,CAAC,CAAC,CAAC,KAAG,aAAa,CAAC,CAAC,CAqB3D,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,16 @@
1
+ const c = (s) => {
2
+ const { defaultConfig: i = {}, customCard: u, cardSize: a = 3 } = s;
3
+ return (o) => {
4
+ const r = o.prototype, t = window;
5
+ return t.customCards = t.customCards || [], r.setConfig = function(n) {
6
+ if (!n)
7
+ throw new Error("Invalid configuration");
8
+ this.config = { ...i, ...n };
9
+ }, r.getCardSize = function() {
10
+ return a;
11
+ }, t.customCards.push({ ...u }), o;
12
+ };
13
+ };
14
+ export {
15
+ c as default
16
+ };
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@inradius/solid-wc-hass-mixin",
3
+ "author": "Travis Stroud <travis.unfasten577@travisstroud.me>",
4
+ "version": "0.0.1",
5
+ "description": "A Solid.js Home Assistant web component mixin.",
6
+ "type": "module",
7
+ "main": "./dist/index.cjs",
8
+ "module": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.js",
14
+ "require": "./dist/index.cjs"
15
+ }
16
+ },
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "devDependencies": {
21
+ "rimraf": "^6.0.0",
22
+ "vite": "^5.4.0",
23
+ "vite-plugin-dts": "^4.0.0"
24
+ },
25
+ "peerDependencies": {
26
+ "component-register": "^0.8.0"
27
+ },
28
+ "license": "MIT",
29
+ "scripts": {
30
+ "build": "vite build",
31
+ "dev": "vite build --watch",
32
+ "clean": "rimraf dist"
33
+ }
34
+ }