@htmlplus/element 3.3.0 → 3.3.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.
@@ -2,18 +2,18 @@ import { TransformerPlugin } from './transformer.js';
2
2
  import '@babel/types';
3
3
  import '@babel/parser';
4
4
 
5
- declare const rollup: (...plugins: Array<TransformerPlugin>) => {
5
+ declare const rollup: (...plugins: TransformerPlugin[]) => {
6
6
  name: string;
7
7
  buildStart(): Promise<void>;
8
- load(id: any): Promise<string | undefined>;
8
+ load(id: string): Promise<string | undefined>;
9
9
  buildEnd(error?: Error): Promise<void>;
10
10
  };
11
11
 
12
- declare const vite: (...plugins: Array<TransformerPlugin>) => {
12
+ declare const vite: (...plugins: TransformerPlugin[]) => {
13
13
  name: string;
14
14
  buildStart(): Promise<void>;
15
- load(id: any): Promise<string | undefined>;
16
- writeBundle(options: any, bundles: any): Promise<void>;
15
+ load(id: string): Promise<string | undefined>;
16
+ writeBundle(_options: any, bundles: any): Promise<void>;
17
17
  };
18
18
 
19
19
  export { rollup, vite };
package/dist/bundlers.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import { KEY } from './constants.js';
2
- import { transformer } from './transformer.js';
3
2
  import 'fs-extra';
4
3
  import 'glob';
5
4
  import '@babel/template';
6
5
  import '@babel/types';
7
6
  import 'change-case';
8
- import '@babel/traverse';
7
+ import { transformer } from './transformer.js';
9
8
  import '@babel/parser';
10
- import '@babel/generator';
11
9
  import path from 'node:path';
10
+ import '@babel/traverse';
11
+ import '@babel/generator';
12
12
  import 'ora';
13
13
 
14
14
  const rollup = (...plugins) => {
@@ -52,7 +52,7 @@ const vite = (...plugins) => {
52
52
  }
53
53
  return context.script;
54
54
  },
55
- async writeBundle(options, bundles) {
55
+ async writeBundle(_options, bundles) {
56
56
  // TODO
57
57
  global.contexts.forEach((context) => {
58
58
  Object.keys(bundles).forEach((key) => {
package/dist/client.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Used to bind a method of a class to the current context,
3
3
  * making it easier to reference `this` within the method.
4
4
  */
5
- declare function Bind(): (target: Object, key: PropertyKey, descriptor: PropertyDescriptor) => {
5
+ declare function Bind(): (_target: object, key: PropertyKey, descriptor: PropertyDescriptor) => {
6
6
  configurable: boolean;
7
7
  get(): any;
8
8
  };
@@ -20,7 +20,7 @@ declare function Consumer(namespace: string): (target: HTMLPlusElement, key: Pro
20
20
  *
21
21
  * @param {number} delay - The debounce delay in milliseconds.
22
22
  */
23
- declare function Debounce(delay?: number): (target: Object, key: PropertyKey, descriptor: PropertyDescriptor) => {
23
+ declare function Debounce(delay?: number): (target: object, key: PropertyKey, descriptor: PropertyDescriptor) => {
24
24
  configurable: boolean;
25
25
  get(): any;
26
26
  };
@@ -29,7 +29,7 @@ declare function Debounce(delay?: number): (target: Object, key: PropertyKey, de
29
29
  * Indicates whether the [Direction](https://mdn.io/css-direction)
30
30
  * of the element is `Right-To-Left` or `Left-To-Right`.
31
31
  */
32
- declare function Direction(): (target: HTMLPlusElement, key: PropertyKey) => void;
32
+ declare function Direction$1(): (target: HTMLPlusElement, key: PropertyKey) => void;
33
33
 
34
34
  /**
35
35
  * The class marked with this decorator is considered a
@@ -41,7 +41,7 @@ declare function Element$1(): (constructor: HTMLPlusElement) => void;
41
41
  /**
42
42
  * A function type that generates a `CustomEvent`.
43
43
  */
44
- type EventEmitter<T = any> = (data?: T) => CustomEvent<T>;
44
+ type EventEmitter<T = unknown> = (data?: T) => CustomEvent<T>;
45
45
  /**
46
46
  * An object that configures
47
47
  * [options](https://developer.mozilla.org/docs/Web/API/Event/EventEvent#options)
@@ -71,7 +71,7 @@ interface EventOptions {
71
71
  *
72
72
  * @param options An object that configures options for the event dispatcher.
73
73
  */
74
- declare function Event<T = any>(options?: EventOptions): (target: HTMLPlusElement, key: PropertyKey) => void;
74
+ declare function Event<T = unknown>(options?: EventOptions): (target: HTMLPlusElement, key: PropertyKey) => void;
75
75
 
76
76
  /**
77
77
  * Indicates the host of the element.
@@ -139,15 +139,15 @@ declare function Listen(type: string, options?: ListenOptions): (target: HTMLPlu
139
139
  * Provides a way to encapsulate functionality within an element
140
140
  * and invoke it as needed, both internally and externally.
141
141
  */
142
- declare function Method(): (target: HTMLPlusElement, key: PropertyKey, descriptor: PropertyDescriptor) => void;
142
+ declare function Method(): (target: HTMLPlusElement, key: PropertyKey, _descriptor: PropertyDescriptor) => void;
143
143
 
144
144
  type DistributiveOmit<T, K extends keyof any> = T extends any ? Omit<T, K> : never;
145
145
  type Overwrite<T, U> = DistributiveOmit<T, keyof U> & U;
146
146
  type GenerateStringUnion<T> = Extract<{
147
147
  [Key in keyof T]: true extends T[Key] ? Key : never;
148
148
  }[keyof T], string>;
149
- type OverridesConfigBreakpointCreator<T extends string, U = {}> = GenerateStringUnion<Overwrite<Record<T, true>, U>>;
150
- type OverridesConfig<Breakpoint extends string, Properties = {}> = {
149
+ type OverridesConfigBreakpointCreator<T extends string, U> = GenerateStringUnion<Overwrite<Record<T, true>, U>>;
150
+ type OverridesConfig<Breakpoint extends string, Properties> = {
151
151
  [Key in Breakpoint]?: Partial<Properties>;
152
152
  };
153
153
  interface ElementPropertiesAutoGenerated {
@@ -171,7 +171,7 @@ interface PropertyOptions {
171
171
  * [data types](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures).
172
172
  * If this value is not set, it will be set automatically during transforming.
173
173
  */
174
- type?: any;
174
+ type?: unknown;
175
175
  }
176
176
  /**
177
177
  * Creates a reactive property, reflecting a corresponding attribute value,
@@ -229,7 +229,7 @@ declare function Watch(keys?: string | string[], immediate?: boolean): (target:
229
229
  /**
230
230
  * TODO
231
231
  */
232
- declare const classes: (input: any, smart?: boolean) => string;
232
+ declare const classes: (input: unknown, smart?: boolean) => string;
233
233
 
234
234
  /**
235
235
  * TODO
@@ -243,10 +243,10 @@ interface Config {
243
243
  };
244
244
  };
245
245
  event?: {
246
- resolver?: (parameters: any) => CustomEvent | undefined;
246
+ resolver?: (parameters: unknown) => CustomEvent | undefined;
247
247
  };
248
248
  assets?: {
249
- [key: string]: any;
249
+ [key: string]: unknown;
250
250
  };
251
251
  elements?: {
252
252
  [key: string]: {
@@ -288,16 +288,17 @@ declare const setConfig: (namespace: string, config: Config, options?: ConfigOpt
288
288
  */
289
289
  declare const setConfigCreator: (namespace: string) => (config: Config, options?: ConfigOptions) => void;
290
290
 
291
+ type Direction = 'ltr' | 'rtl';
291
292
  /**
292
293
  * Indicates whether the [Direction](https://mdn.io/css-direction)
293
294
  * of the element is `Right-To-Left` or `Left-To-Right`.
294
295
  */
295
- declare const direction: (target: HTMLElement | HTMLPlusElement) => "ltr" | "rtl";
296
+ declare const direction: (target: HTMLElement | HTMLPlusElement) => Direction;
296
297
 
297
298
  /**
298
299
  * TODO
299
300
  */
300
- declare const dispatch: <T = any>(target: HTMLElement | HTMLPlusElement, type: string, eventInitDict?: CustomEventInit<T>) => CustomEvent<T>;
301
+ declare const dispatch: <T = unknown>(target: HTMLElement | HTMLPlusElement, type: string, eventInitDict?: CustomEventInit<T>) => CustomEvent<T>;
301
302
  /**
302
303
  * TODO
303
304
  */
@@ -350,9 +351,26 @@ declare const toCSSUnit: (input?: number | string | null) => string | undefined;
350
351
  */
351
352
  declare const toUnit: (input: string | number, unit?: string) => string;
352
353
 
353
- declare const attributes: any;
354
- declare const html: any;
355
- declare const styles: any;
354
+ /**
355
+ * Holds all details wrappers needed to render the content further on.
356
+ * @constructor
357
+ * @param {string} type The hole type, either `html` or `svg`.
358
+ * @param {string[]} template The template literals used to the define the content.
359
+ * @param {Array} values Zero, one, or more interpolated values to render.
360
+ */
361
+ declare class Hole {
362
+ constructor(type: any, template: any, values: any);
363
+ type: any;
364
+ template: any;
365
+ values: any;
366
+ }
367
+
368
+ declare const attributes: (target: HTMLElement | HTMLPlusElement, attributes: unknown[]) => void;
369
+ declare const html: ((template: any, ...values: any[]) => Hole) & {
370
+ for(ref: any, id: any): any;
371
+ node: (template: any, ...values: any[]) => any;
372
+ };
373
+ declare const styles: (input: object) => string;
356
374
 
357
- export { Bind, Consumer, Debounce, Direction, Element$1 as Element, Event, Host, IsRTL, Listen, Method, Overrides, Property, Provider, Query, QueryAll, Slots$1 as Slots, State, Style, Watch, attributes as a, classes, direction, dispatch, getConfig, getConfigCreator, html as h, host, isCSSColor, isRTL, off, on, query, queryAll, styles as s, setConfig, setConfigCreator, slots, toCSSColor, toCSSUnit, toUnit };
375
+ export { Bind, Consumer, Debounce, Direction$1 as Direction, Element$1 as Element, Event, Host, IsRTL, Listen, Method, Overrides, Property, Provider, Query, QueryAll, Slots$1 as Slots, State, Style, Watch, attributes as a, classes, direction, dispatch, getConfig, getConfigCreator, html as h, host, isCSSColor, isRTL, off, on, query, queryAll, styles as s, setConfig, setConfigCreator, slots, toCSSColor, toCSSUnit, toUnit };
358
376
  export type { Config, ConfigOptions, ElementPropertiesAutoGenerated, EventEmitter, EventOptions, ListenOptions, OverridesConfig, OverridesConfigBreakpointCreator, PropertyOptions };