@zeus-js/component-dts 0.1.0-beta.4 → 0.1.0-beta.6

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * component-dts v0.1.0-beta.4
2
+ * component-dts v0.1.0-beta.6
3
3
  * (c) 2026 baicie
4
4
  * Released under the MIT License.
5
5
  **/
@@ -150,11 +150,9 @@ function generateWCIndexDts(manifest, options) {
150
150
  }
151
151
  function generateEventMap(component) {
152
152
  const eventMapName = getEventMapTypeName(component);
153
- const entries = Object.entries(component.events);
154
153
  const lines = [];
155
154
  lines.push(`export interface ${eventMapName} {`);
156
- if (!entries.length) lines.push(" [key: string]: CustomEvent<unknown>");
157
- else for (const [key, event] of Object.entries(component.events)) {
155
+ for (const [key, event] of Object.entries(component.events)) {
158
156
  var _event$name, _event$key;
159
157
  lines.push(` ${safePropertyName((_event$name = event.name) !== null && _event$name !== void 0 ? _event$name : toKebabCase$1((_event$key = event.key) !== null && _event$key !== void 0 ? _event$key : key))}: ${formatEventType(event)}`);
160
158
  }
@@ -179,11 +177,23 @@ function generateElementInterface$1(component) {
179
177
  lines.push(" options?: boolean | AddEventListenerOptions,");
180
178
  lines.push(" ): void");
181
179
  lines.push("");
180
+ lines.push(" addEventListener(");
181
+ lines.push(" type: string,");
182
+ lines.push(" listener: EventListenerOrEventListenerObject | null,");
183
+ lines.push(" options?: boolean | AddEventListenerOptions,");
184
+ lines.push(" ): void");
185
+ lines.push("");
182
186
  lines.push(` removeEventListener<K extends keyof ${eventMapName}>(`);
183
187
  lines.push(" type: K,");
184
188
  lines.push(` listener: (this: ${elementTypeName}, ev: ${eventMapName}[K]) => unknown,`);
185
189
  lines.push(" options?: boolean | EventListenerOptions,");
186
190
  lines.push(" ): void");
191
+ lines.push("");
192
+ lines.push(" removeEventListener(");
193
+ lines.push(" type: string,");
194
+ lines.push(" listener: EventListenerOrEventListenerObject | null,");
195
+ lines.push(" options?: boolean | EventListenerOptions,");
196
+ lines.push(" ): void");
187
197
  lines.push("}");
188
198
  return lines.join("\n");
189
199
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * component-dts v0.1.0-beta.4
2
+ * component-dts v0.1.0-beta.6
3
3
  * (c) 2026 baicie
4
4
  * Released under the MIT License.
5
5
  **/
@@ -150,11 +150,9 @@ function generateWCIndexDts(manifest, options) {
150
150
  }
151
151
  function generateEventMap(component) {
152
152
  const eventMapName = getEventMapTypeName(component);
153
- const entries = Object.entries(component.events);
154
153
  const lines = [];
155
154
  lines.push(`export interface ${eventMapName} {`);
156
- if (!entries.length) lines.push(" [key: string]: CustomEvent<unknown>");
157
- else for (const [key, event] of Object.entries(component.events)) {
155
+ for (const [key, event] of Object.entries(component.events)) {
158
156
  var _event$name, _event$key;
159
157
  lines.push(` ${safePropertyName((_event$name = event.name) !== null && _event$name !== void 0 ? _event$name : toKebabCase$1((_event$key = event.key) !== null && _event$key !== void 0 ? _event$key : key))}: ${formatEventType(event)}`);
160
158
  }
@@ -179,11 +177,23 @@ function generateElementInterface$1(component) {
179
177
  lines.push(" options?: boolean | AddEventListenerOptions,");
180
178
  lines.push(" ): void");
181
179
  lines.push("");
180
+ lines.push(" addEventListener(");
181
+ lines.push(" type: string,");
182
+ lines.push(" listener: EventListenerOrEventListenerObject | null,");
183
+ lines.push(" options?: boolean | AddEventListenerOptions,");
184
+ lines.push(" ): void");
185
+ lines.push("");
182
186
  lines.push(` removeEventListener<K extends keyof ${eventMapName}>(`);
183
187
  lines.push(" type: K,");
184
188
  lines.push(` listener: (this: ${elementTypeName}, ev: ${eventMapName}[K]) => unknown,`);
185
189
  lines.push(" options?: boolean | EventListenerOptions,");
186
190
  lines.push(" ): void");
191
+ lines.push("");
192
+ lines.push(" removeEventListener(");
193
+ lines.push(" type: string,");
194
+ lines.push(" listener: EventListenerOrEventListenerObject | null,");
195
+ lines.push(" options?: boolean | EventListenerOptions,");
196
+ lines.push(" ): void");
187
197
  lines.push("}");
188
198
  return lines.join("\n");
189
199
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * component-dts v0.1.0-beta.4
2
+ * component-dts v0.1.0-beta.6
3
3
  * (c) 2026 baicie
4
4
  * Released under the MIT License.
5
5
  **/
@@ -123,11 +123,9 @@ function generateWCIndexDts(manifest, options) {
123
123
  }
124
124
  function generateEventMap(component) {
125
125
  const eventMapName = getEventMapTypeName(component);
126
- const entries = Object.entries(component.events);
127
126
  const lines = [];
128
127
  lines.push(`export interface ${eventMapName} {`);
129
- if (!entries.length) lines.push(" [key: string]: CustomEvent<unknown>");
130
- else for (const [key, event] of Object.entries(component.events)) {
128
+ for (const [key, event] of Object.entries(component.events)) {
131
129
  var _event$name, _event$key;
132
130
  lines.push(` ${safePropertyName((_event$name = event.name) !== null && _event$name !== void 0 ? _event$name : toKebabCase$1((_event$key = event.key) !== null && _event$key !== void 0 ? _event$key : key))}: ${formatEventType(event)}`);
133
131
  }
@@ -152,11 +150,23 @@ function generateElementInterface$1(component) {
152
150
  lines.push(" options?: boolean | AddEventListenerOptions,");
153
151
  lines.push(" ): void");
154
152
  lines.push("");
153
+ lines.push(" addEventListener(");
154
+ lines.push(" type: string,");
155
+ lines.push(" listener: EventListenerOrEventListenerObject | null,");
156
+ lines.push(" options?: boolean | AddEventListenerOptions,");
157
+ lines.push(" ): void");
158
+ lines.push("");
155
159
  lines.push(` removeEventListener<K extends keyof ${eventMapName}>(`);
156
160
  lines.push(" type: K,");
157
161
  lines.push(` listener: (this: ${elementTypeName}, ev: ${eventMapName}[K]) => unknown,`);
158
162
  lines.push(" options?: boolean | EventListenerOptions,");
159
163
  lines.push(" ): void");
164
+ lines.push("");
165
+ lines.push(" removeEventListener(");
166
+ lines.push(" type: string,");
167
+ lines.push(" listener: EventListenerOrEventListenerObject | null,");
168
+ lines.push(" options?: boolean | EventListenerOptions,");
169
+ lines.push(" ): void");
160
170
  lines.push("}");
161
171
  return lines.join("\n");
162
172
  }
package/package.json CHANGED
@@ -1,15 +1,19 @@
1
1
  {
2
2
  "name": "@zeus-js/component-dts",
3
- "version": "0.1.0-beta.4",
4
- "description": "DTS generators for Zeus component manifest",
5
3
  "type": "module",
6
- "main": "index.js",
7
- "module": "dist/component-dts.esm-bundler.js",
8
- "types": "dist/component-dts.d.ts",
9
- "files": [
10
- "index.js",
11
- "dist"
12
- ],
4
+ "version": "0.1.0-beta.6",
5
+ "description": "DTS generators for Zeus component manifest",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/baicie/zeus.git",
10
+ "directory": "packages/web-c/component-dts"
11
+ },
12
+ "publishConfig": {
13
+ "access": "public",
14
+ "provenance": true
15
+ },
16
+ "sideEffects": false,
13
17
  "exports": {
14
18
  ".": {
15
19
  "types": "./dist/component-dts.d.ts",
@@ -23,11 +27,14 @@
23
27
  }
24
28
  }
25
29
  },
26
- "sideEffects": false,
27
- "repository": {
28
- "type": "git",
29
- "url": "https://github.com/baicie/zeus"
30
+ "files": [
31
+ "index.js",
32
+ "dist"
33
+ ],
34
+ "dependencies": {
35
+ "@zeus-js/component-analyzer": "0.1.0-beta.6"
30
36
  },
37
+ "author": "Baicie",
31
38
  "buildOptions": {
32
39
  "name": "ZeusComponentDts",
33
40
  "formats": [
@@ -35,15 +42,13 @@
35
42
  "cjs"
36
43
  ]
37
44
  },
38
- "dependencies": {
39
- "@zeus-js/component-analyzer": "0.1.0-beta.4"
40
- },
41
45
  "keywords": [
42
46
  "zeus",
43
47
  "web-components",
44
48
  "dts",
45
49
  "types"
46
50
  ],
47
- "author": "Baicie",
48
- "license": "MIT"
51
+ "main": "index.js",
52
+ "module": "dist/component-dts.esm-bundler.js",
53
+ "types": "dist/component-dts.d.ts"
49
54
  }